Leo Liu [Thu, 9 May 2013 00:52:49 +0000 (08:52 +0800)]
* progmodes/octave.el (inferior-octave-completion-at-point):
Restore the broken file completion.
(inferior-octave-startup): Fix incorrect highlighting for the
first prompt.
Stefan Monnier [Wed, 8 May 2013 20:25:57 +0000 (16:25 -0400)]
* lisp/progmodes/ruby-mode.el: First cut at SMIE support.
(ruby-use-smie): New var.
(ruby-smie-grammar): New constant.
(ruby-smie--bosp, ruby-smie--implicit-semi-p)
(ruby-smie--forward-token, ruby-smie--backward-token)
(ruby-smie-rules): New functions.
(ruby-mode-variables): Setup SMIE if applicable.
* test/indent/ruby.rb: Fix indentation after =; add more cases.
Eli Zaretskii [Wed, 8 May 2013 18:05:40 +0000 (21:05 +0300)]
Avoid beginning/end of buffer errors when moving across display strings.
lisp/simple.el (line-move-visual): Signal beginning/end of buffer
only if vertical-motion moved less than it was requested. Avoids
silly incorrect error messages when there are display strings with
multiple newlines at EOL.
Eli Zaretskii [Wed, 8 May 2013 17:59:38 +0000 (20:59 +0300)]
Fix vertical cursor motion when there's a display string with newline at EOL.
src/xdisp.c (row_for_charpos_p): New function, with code of
cursor_row_p, but accepts an additional argument CHARPOS instead
of using a hardcoded PT.
(cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
(row_containing_pos): Call row_for_charpos_p instead of partially
doing the same. Fixes cursor positioning under longlines-mode
when longlines-show-effect includes more than one newline, when
moving the cursor vertically up.
Stefan Monnier [Wed, 8 May 2013 16:27:53 +0000 (12:27 -0400)]
* lisp/progmodes/f90.el (f90-mode-syntax-table): Use symbol syntax for "_".
Change all regexps to use things like \_< and \_>.
* lisp/progmodes/ada-mode.el (ada-mode-abbrev-table): Consolidate declaration.
(ada-mode-syntax-table, ada-mode-symbol-syntax-table): Initialize in
the declaration.
(ada-create-syntax-table): Remove.
(ada-capitalize-word): Don't mess with the syntax of "_" since it
already has the right syntax nowadays.
(ada-goto-next-word): Don't change the syntax of "_".
* lisp/progmodes/autoconf.el (autoconf-definition-regexp)
(autoconf-font-lock-keywords, autoconf-current-defun-function):
Handle a _ with symbol syntax.
(autoconf-mode): Don't change the syntax-table for imenu and font-lock.
* lisp/progmodes/vera-mode.el (vera-underscore-is-part-of-word):
* lisp/progmodes/prolog.el (prolog-underscore-wordchar-flag)
(prolog-char-quote-workaround):
* lisp/progmodes/cperl-mode.el (cperl-under-as-char):
* lisp/progmodes/vhdl-mode.el (vhdl-underscore-is-part-of-word):
Mark as obsolete.
(vhdl-mode-syntax-table, vhdl-mode-ext-syntax-table): Initialize in
their declaration.
(vhdl-mode-syntax-table-init): Remove.
* lisp/progmodes/ld-script.el (ld-script-mode-syntax-table): Use symbol
syntax for "_".
(ld-script-font-lock-keywords):
Change regexps to use things like \_< and \_>.
* lisp/progmodes/m4-mode.el (m4-mode-syntax-table): Add comment on last change.
Sam Steingold [Wed, 8 May 2013 15:13:25 +0000 (11:13 -0400)]
* lisp/thingatpt.el (thing-at-point): Accept optional second argument
NO-PROPERTIES to strip the text properties from the return value.
* lisp/net/browse-url.el (browse-url-url-at-point): Pass NO-PROPERTIES
to `thing-at-point' instead of stripping the properties ourselves.
Also, when `thing-at-point' fails to find a url, prepend "http://"
to the filename at point on the assumption that the user is
pointing at something like gnu.org/gnu.
Leo Liu [Wed, 8 May 2013 14:22:24 +0000 (22:22 +0800)]
Re-work a fix for bug#10994 based on Le Wang's patch.
* ido.el (ido-remove-consecutive-dups): New helper.
(ido-completing-read): Use it.
(ido-chop): Revert fix for bug#10994.
Glenn Morris [Wed, 8 May 2013 06:56:37 +0000 (23:56 -0700)]
m4-mode misc small cleanup
* lisp/progmodes/m4-mode.el (m4-program): Assume it is in PATH.
(m4-mode-syntax-table): Init in the defvar.
(m4-mode-abbrev-table): Let define-derived-mode define it.
Paul Eggert [Tue, 7 May 2013 21:34:03 +0000 (14:34 -0700)]
Use Gnulib ACL implementation, for benefit of Solaris etc.
* configure.ac: Remove -with-acl option, since Gnulib does that for
us now.
(LIBACL_LIBS): Remove; no longer needed.
* lib/Makefile.am (CLEANFILES, SUFFIXES): New (empty) macros,
for the benefit of the new ACL implementation.
* lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/acl-errno-valid.$(O).
($(BLD)/acl-errno-valid.$(O)): New rule.
* lib/acl-errno-valid.c, lib/acl-internal.h, lib/acl.h:
* lib/acl_entries.c, lib/errno.in.h, lib/file-has-acl.c:
* lib/qcopy-acl.c, lib/qset-acl.c, m4/acl.m4, m4/errno_h.m4:
New files, taken from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* admin/merge-gnulib (GNULIB_MODULES): Add qacl.
(GNULIB_TOOL_FLAGS): Do not avoid errno.
* etc/NEWS: Emacs is no longer limited to POSIX ACLs. --disable-acl,
not --without-acl, since we're now using Gnulib's implementation.
* nt/config.nt (HAVE_ACL_SET_FILE): Rename from HAVE_POSIX_ACL.
* nt/inc/ms-w32.h (EOPNOTSUPP): New macro.
* src/Makefile.in (LIB_ACL): New macro.
(LIBACL_LIBS): Remove.
(LIBES): Use LIB_ACL, not LIBACL_LIBS.
* src/fileio.c: Include <acl.h>.
Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
(ACL_NOT_WELL_SUPPORTED): Remove. All uses replaced by
!acl_errno_valid.
(Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
it ourselves.
Paul Eggert [Tue, 7 May 2013 20:55:47 +0000 (13:55 -0700)]
* unexelf.c: Don't assume ElfW (Half) fits in int.
(entry_address, find_section, unexec): Use ptrdiff_t, not int,
when dealing with ElfW (Half) values, since they can exceed 2**31
on 64-bit OpenBSD hosts. Problem reported privately by Han Boetes.
(entry_address): Omit unused NUM arg. All uses changed.
Paul Eggert [Tue, 7 May 2013 05:34:01 +0000 (22:34 -0700)]
Static checking by GCC 4.8.0.
* xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
(x_get_monitor_for_frame, x_make_monitor_attribute_list)
(x_get_monitor_attributes_fallback)
(x_get_monitor_attributes_xinerama)
(x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
Define only if USE_GTK.
(free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
(x_get_monitor_attributes_fallback): Omit unused locals.
(x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
Use double, not float, to avoid mixed-mode floating point arithmetic.
Leo Liu [Mon, 6 May 2013 23:46:07 +0000 (07:46 +0800)]
* progmodes/octave.el (octave-syntax-propertize-function): Change
\'s syntax to escape when inside double-quoted strings.
(octave-font-lock-keywords): Use octave-operator-regexp.
(octave-completion-at-point): Renamed from
octave-completion-at-point-function.
(inferior-octave-directory-tracker): Robustify.
(octave-text-functions): Remove and fix its uses. No such things
any more.
Stefan Monnier [Mon, 6 May 2013 19:33:56 +0000 (15:33 -0400)]
* lisp/progmodes/perl-mode.el: Add support for here documents.
(perl-syntax-propertize-function): Match here-doc markers.
(perl-syntax-propertize-special-constructs): Find their end.
(perl-imenu-generic-expression): Use [:alnum:].
Eli Zaretskii [Mon, 6 May 2013 17:11:07 +0000 (20:11 +0300)]
Fix bug #14241 with posn-at-point at the beginning of an image display prop.
src/xdisp.c (pos_visible_p): Use the special code for finding the
beginning of a display property or overlay for any "replacing"
display property, not just for display strings. This solves
incorrect reporting of position by posn-at-point.
Glenn Morris [Mon, 6 May 2013 07:20:35 +0000 (00:20 -0700)]
* lisp/eshell/em-cmpl.el: Simply require pcomplete;
eg we use a bunch of its defcustom properties.
(eshell-cmpl-initialize): No need to load pcomplete.
Glenn Morris [Mon, 6 May 2013 07:14:03 +0000 (00:14 -0700)]
* net/eudc-export.el: Make it loadable without bbdb.
(top-level): Use require rather than load-library.
(eudc-create-bbdb-record, eudc-bbdbify-phone)
(eudc-batch-export-records-to-bbdb)
(eudc-insert-record-at-point-into-bbdb, eudc-try-bbdb-insert):
Require bbdb.
Paul Eggert [Mon, 6 May 2013 04:52:00 +0000 (21:52 -0700)]
* unexelf.c: Fix some 32-bit integer problems, notably when debugging.
Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
Verify that ElfW (Half) fits in int.
(fatal): Use same signature as lisp.h.
(UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
configure and build with -DUNEXELF_DEBUG without worrying about
other modules that use DEBUG.
(DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
possibly-wide integers now uses it instead of plain fprintf.
(entry_address): New function, which avoids problems with 32-bit
overflow on 64-bit hosts.
(OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
(round_up): Don't assume the remainder fits in int.
(find_section): Use bool for boolean. Simplify debug code.
(unexec): Don't assume file sizes fit in int or size_t.
Omit unnecessary trailing newline in 'fatal' format.
Use strerror rather than outputting decimal error number.
Remove unused code when emacs is not defined;
this file relies on Emacs now.
Don't assume e_phnum and e_shnum are positive.
Paul Eggert [Mon, 6 May 2013 04:31:16 +0000 (21:31 -0700)]
* regex.c: Fix problems when DEBUG is defined.
(extract_number, extract_number_and_incr): Define regardless of
whether DEBUG is defined; that's simpler and makes the code less
likely to go stale in the normal case when DEBUG is not defined.
Return int rather than taking an int * arg. All callers changed.
(DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
Remove, replacing with ...
(DEBUG_PRINT): New macro. All callers changed.
(DEBUG_COMPILES_ARGUMENTS): New macro.
(print_fastmap, print_partial_compiled_pattern) [DEBUG]:
(print_compiled_pattern, print_double_string) [DEBUG]:
Use prototype rather than old-style definition.
(print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
(ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
(POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
(POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
Don't assume ptrdiff_t, size_t, and long are the same width as int.
(POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
This matters only when DEBUG is defined.
Stefan Monnier [Mon, 6 May 2013 02:29:42 +0000 (22:29 -0400)]
* lisp/progmodes/octave.el (octave-texinfo-font-lock-keywords): Remove.
(octave-font-lock-texinfo-comment): Use texinfo-font-lock-keywords with
some tweaks, instead.
Eli Zaretskii [Sun, 5 May 2013 17:41:09 +0000 (20:41 +0300)]
Fix bug #14306 with whitespace mode together with linum-mode.
src/xdisp.c (set_iterator_to_next): Set the
ignore_overlay_strings_at_pos_p flag only if we are _really_
iterating over an overlay string, as indicated by the
current.overlay_string_index member.
Leo Liu [Sun, 5 May 2013 15:29:51 +0000 (23:29 +0800)]
* progmodes/octave.el (octave-font-lock-keywords)
(octave-font-lock-texinfo-comment): Adjust for the byte-compiler.
(inferior-octave-send-list-and-digest): Improve error message.
(octave-mode, inferior-octave-mode): Use setq-local.
(octave-help): Set info-lookup-mode.
Leo Liu [Sun, 5 May 2013 04:49:27 +0000 (12:49 +0800)]
* progmodes/octave.el (inferior-octave-strip-ctrl-g)
(inferior-octave-output-filter): Remove.
(octave-send-region, inferior-octave-startup): Fix callers.
(inferior-octave-mode-map): Don't use comint-dynamic-complete.
(octave-binary-file-extensions): New user variable.
(octave-find-definition): Confirm if opening binary files.
(octave-help-file): Use octave-find-definition to get the binary
confirmation.
(octave-help): Adjust for octave-help-file change.
Stefan Monnier [Sun, 5 May 2013 02:26:38 +0000 (22:26 -0400)]
* lisp/progmodes/pascal.el (pascal--syntax-propertize): New const.
(pascal-mode): Use it. Use setq-local.
(pascal-font-lock-keywords): Use backquotes.
Merge the two entries that handle function definitions.
* test/indent/pascal.pas: Add test for mis-identified comments.
Paul Eggert [Sun, 5 May 2013 00:51:49 +0000 (17:51 -0700)]
`write-region-inhibit-fsync' defaults to noninteractive.
* cmdargs.texi (Initial Options):
* files.texi (Customize Save): Document this.
* etc/NEWS: Document this.
* src/fileio.c (syms_of_fileio): Implement this.
* src/filelock.c (create_lock_file): If symbolic links don't work, so
we use a regular file as a lock file, do not fsync the lock file;
it's not needed.
Eli Zaretskii [Sat, 4 May 2013 10:19:13 +0000 (13:19 +0300)]
Fix bug #14062 with assertion violations on MS-Windows.
src/dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
w->contents is a buffer before computing everything else. Use
parentheses to disambiguate last part of the condition.
src/w32fns.c (w32_wnd_proc): Remove temporary code used to trap
assertion violations.
Leo Liu [Fri, 3 May 2013 07:22:26 +0000 (15:22 +0800)]
* progmodes/octave.el (octave-completing-read)
(octave-goto-function-definition): New helpers.
(octave-help-buffer): New user variable.
(octave-help-file, octave-help-function): New button types.
(octave-help): New command and bind it to C-h ;.
(octave-find-definition): New command and bind it to M-.
Juri Linkov [Wed, 1 May 2013 08:05:05 +0000 (11:05 +0300)]
* lisp/comint.el (comint-previous-matching-input): Don't print message
"History item: %d" when `isearch-mode' is active.
(comint-history-isearch-message): Print message "History item: %d"
when `comint-input-ring-index' is not empty and this function is
called from `isearch-update' with a nil `ellipsis'.
Alan Mackenzie [Tue, 30 Apr 2013 16:19:14 +0000 (16:19 +0000)]
Handle arbitrarily long C++ member initialisation lists.
* progmodes/cc-engine.el (c-back-over-member-initializers): new
function.
(c-guess-basic-syntax): New CASE 5R (extracted from 5B) to handle
(most) member init lists.
Leo Liu [Tue, 30 Apr 2013 14:23:03 +0000 (22:23 +0800)]
* progmodes/octave.el (octave-variables): Remove. No builtin
variables any more. All converted to functions.
(octave-font-lock-keywords, octave-completion-at-point-function):
Fix uses.
(octave-font-lock-texinfo-comment): New user variable.
(octave-texinfo-font-lock-keywords): New variable for texinfo
comment block.
(octave-function-comment-block): New face.
(octave-font-lock-texinfo-comment): New function.
(octave-mode): Font lock texinfo comment block.