Alan Mackenzie [Fri, 15 Feb 2013 20:01:51 +0000 (20:01 +0000)]
emacs-lisp/easy-mmode.el (define-globalized-minor-mode): When a global
minor mode has been enabled, call the minor mode function for a new
buffer once only, after the major mode hook, whilst allowing that hook
explicitly to disable the minor mode.
(MODE-disable-in-buffer): new (generated) function.
(disable-MODE): new (generated) buffer local variable.
Jambunathan K [Fri, 15 Feb 2013 19:39:50 +0000 (01:09 +0530)]
ido, iswitchb, icomplete: Use `C-.' and `C-,' for cycling (Bug#13708)
* lisp/icomplete.el (icomplete-minibuffer-map): Unbind `C-s' and `C-r'.
Bind `C-.' and `C-,' to `icomplete-forward-completions' and
`icomplete-backward-completions'.
* lisp/ido.el (ido-init-completion-maps): Bind `C-.' and `C-,' to
`ido-next-match' and `ido-prev-match' resply.
* lisp/iswitchb.el (iswitchb-read-buffer): Bind `C-.' and `C-,' to
`iswitchb-next-match' and `iswitchb-prev-match' resply.
Jambunathan K [Fri, 15 Feb 2013 19:19:29 +0000 (00:49 +0530)]
Fix bug#13708
* lisp/icomplete.el (icomplete-minibuffer-map): Unbind `C-s' and `C-r'.
Bind `C-.' and `C-,' to `icomplete-forward-completions' and
`icomplete-backward-completions'.
* lisp/ido.el (ido-init-completion-maps): Bind `C-.' and `C-,' to
`ido-next-match' and `ido-prev-match' resply.
* lisp/iswitchb.el (iswitchb-read-buffer): Bind `C-.' and `C-,' to
`iswitchb-next-match' and `iswitchb-prev-match' resply.
Eli Zaretskii [Fri, 15 Feb 2013 09:41:31 +0000 (11:41 +0200)]
Allow deleted processes to be reaped by SIGCHLD handler on MS-Windows.
src/w32proc.c (new_child): Free up to 2 slots of dead processes at a
time. Improve diagnostics in DebPrint.
(reader_thread): If cp->char_avail is NULL, set the FILE_AT_EOF
flag, so that sys_select could have a chance of noticing that this
process is dead, and call a SIGCHLD handler for it. Improve
diagnostics in DebPrint.
(reap_subprocess): Reset the FILE_AT_EOF flag set by
reader_thread.
(sys_select): Watch a process whose procinfo.hProcess is non-NULL
even if its char_avail is NULL. Allows to reap subprocesses that
were forcibly deleted by delete-process. (Bug#13546)
Eli Zaretskii [Fri, 15 Feb 2013 09:01:13 +0000 (11:01 +0200)]
Improve error reporting as part of solving bug #13546 on MS-Windows.
src/w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
(sys_gethostbyname, sys_getservbyname, sys_getpeername)
(sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
(sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
make sure errno is set to an appropriate value. (Bug#13546)
(socket_to_fd): Add assertion against indexing fd_info[] with a
value that is out of bounds.
(sys_accept): If fd is negative, do not set up the child_process
structure for reading.
Glenn Morris [Fri, 15 Feb 2013 01:30:11 +0000 (20:30 -0500)]
* lisp/play/fortune.el (fortune-compile): Simplify and fix previous change.
Since file-newer-than-p returns non-nil if FILE2 does not exist,
the actual fix for bug#5338 is just a one-liner. But there is no test
case or explanation of what the issue actually is in bug#5338, so one
has to wonder if the initial (file-exists-p fortune-dat) test was
there for a reason...
Paul Eggert [Thu, 14 Feb 2013 22:08:38 +0000 (14:08 -0800)]
Backport GCPRO fix from trunk.
The bug was reported for AIX before today's changes.
I reproduced the problem on Fedora 17 x86-64 when setting
GC_MARK_STACK by hand, and I presume it occurs with default
configurations on HP-UX and Unixware.
Trunk fix on 2013-01-14 by Dmitry Antipov <dmantipov@yandex.ru>:
Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
* eval.c (eval_sub): Protect `form' from being GCed before its
car and cdr becomes protected with the backtrace entry.
Paul Eggert [Thu, 14 Feb 2013 20:05:10 +0000 (12:05 -0800)]
Fix AIX port.
* configure.ac (DATA_START, DATA_SEG_BITS): Set to 0x20000000 on AIX.
(GC_MARK_STACK): Do not set to GC_USE_GCPROS_AS_BEFORE, as that
runs afoul of some other bug in Emacs, and the default value
GC_MAKE_GCPROS_NOOPS has been tested and works.
* src/lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
was #undeffed earlier, so it cannot be used as a macro here.
Use the constant and not the macro. Tested on AIX.
* src/unexaix.c: Revert 2013-02-11 and 2013-02-12 changes to this
file. They're almost surely OK but we're just before a release so
we should avoid changes unless they're clearly needed. Instead,
make the following minor change:
(ADDR_CORRECT): New macro.
Stefan Monnier [Thu, 14 Feb 2013 15:53:46 +0000 (10:53 -0500)]
* lisp/net/goto-addr.el (goto-address-fontify): Add start and end args.
(goto-address-fontify-region): Use them instead of narrowing, so
syntax-ppss has access to the whole buffer.
Michael Albinus [Thu, 14 Feb 2013 13:32:04 +0000 (14:32 +0100)]
* net/tramp.el (tramp-debug-message): Add
`tramp-condition-case-unless-debug'.
(tramp-debug-on-error): New defvar.
(tramp-condition-case-unless-debug): New defun.
(tramp-file-name-handler): Use it.
Juri Linkov [Thu, 14 Feb 2013 09:15:55 +0000 (11:15 +0200)]
* lisp/info.el (Info-isearch-filter): Treat non-nil values of
`search-invisible' including its default value `open'
like the value `t' to match hidden text.
Dmitry Gutov [Thu, 14 Feb 2013 05:45:33 +0000 (09:45 +0400)]
(ruby-add-log-current-method): Improve performance at the expense
of accuracy. `ruby-block-contains-point' is relatively slow, so
only use it for method and singleton class blocks.
* test/automated/ruby-mode-tests.el
(ruby-add-log-current-method-after-inner-class): Lower
expectations: move point inside a method, initially.
Dmitry Gutov [Thu, 14 Feb 2013 03:33:55 +0000 (07:33 +0400)]
* lisp/progmodes/ruby-mode.el (ruby-parse-partial): Don't increase
depth for unfinished percent literal. Not using it in the caller.
(ruby-move-to-block): Jump over multiline literals of all types,
ignoring code-looking contents inside them.
* test/automated/ruby-mode-tests.el
(ruby-move-to-block-skips-percent-literal): Add depth-affecting
bits inside the examples.
(ruby-move-to-block-skips-heredoc): New test.
* progmodes/python.el: Explain how to restore "cc-mode"-like
forward-sexp movement in header documentation.
(python-nav--forward-sexp): Behave like emacs-lisp-mode in
comments and strings (GH bug 114).
Eli Zaretskii [Wed, 13 Feb 2013 17:00:26 +0000 (19:00 +0200)]
Cleanup related to bug #13546 with subprocesses on MS-Windows.
src/w32.c (sys_pipe): When failing due to file descriptors above
MAXDESC, set errno to EMFILE.
(_sys_read_ahead): Update cp->status when failing to read serial
communications input, so that the status doesn't stay at
STATUS_READ_IN_PROGRESS.
Jambunathan K [Wed, 13 Feb 2013 15:13:22 +0000 (10:13 -0500)]
* lisp/icomplete.el (icomplete-hide-common-prefix): New user option.
(icomplete-first-match): New face.
(icomplete-completions): Correct handling of "complete but not unique".
Stefan Monnier [Wed, 13 Feb 2013 13:40:00 +0000 (08:40 -0500)]
* lisp/tmm.el: Use lexical-binding and current-active-maps.
(tmm-menubar): Use map-keymap and pcase.
(tmm--completion-table): New function.
(tmm-prompt): Use it to fix the menu order.
(tmm-get-keybind): Use current-active-maps.
* locate.el (locate-mode): Set parent mode property to dired-mode.
* find-dired.el (find-dired): Call dired-insert-set-properties on
initial information line. Set process mark on end of buffer.
(find-dired-sentinel):
Call dired-insert-set-properties on summary.
* dired.el (dired-hide-details-hide-symlink-targets)
(dired-hide-details-hide-information-lines): New options.
(dired-insert-directory):
Set properties after final treatment of output.
(dired-insert-set-properties):
Set dired-hide-details-* properties.
(dired-mode-map): Bind dired-hide-details-mode.
(dired-mode): Set buffer-invisibility-spec to a list.
(dired-next-line): Skip hidden lines.
(dired-previous-line): Use dired-next-line.
(dired-hide-details-mode): New minor mode.
(dired-hide-details-update-invisibility-spec): New function.
Juri Linkov [Wed, 13 Feb 2013 08:28:47 +0000 (10:28 +0200)]
Add more keymaps where S-SPC scrolls in the opposite direction to SPC.
* lisp/image-mode.el (image-mode-map):
* lisp/doc-view.el (doc-view-mode-map):
* lisp/vc/ediff-util.el (ediff-setup-keymap):
Make S-SPC scroll in the opposite sense to SPC.
* lisp/gnus/gnus-art.el (gnus-article-mode-map):
* lisp/gnus/gnus-sum.el (gnus-summary-mode-map, gnus-summary-article-map):
Make S-SPC scroll in the opposite sense to SPC. (Bug#2145)
Dmitry Gutov [Wed, 13 Feb 2013 08:15:05 +0000 (12:15 +0400)]
* lisp/progmodes/ruby-mode.el (ruby-move-to-block): Improve
performance. Instead of recalculating indentation fully for each
line, sum up indentation depth based only on visited lines.
(ruby-parse-partial): Increase the depth after "do" even when END
is right after it.
(ruby-parse-partial): When END is in the middle of a percent
literal, increase the depth if the delimiter chars belong to the
paren syntax class.
* test/automated/ruby-mode-tests.el
(ruby-move-to-block-skips-percent-literal): New test.
Dmitry Antipov [Wed, 13 Feb 2013 07:14:38 +0000 (11:14 +0400)]
* font.c (font_range): Add pos_byte argument. Adjust comment
and break long line.
* font.h (font_range): Adjust prototype.
* composite.c (autocmp_chars): Pass byte position to font_range.
Break long line. Remove useless prototype and format comment.
Paul Eggert [Tue, 12 Feb 2013 18:43:11 +0000 (10:43 -0800)]
Improve AIX port some more.
With this, it should be as good as it was in 23.3, though it's
still pretty bad: the dumped emacs does not run. See Mark Fleishman in
http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
* unexaix.c (start_of_text): Remove.
(_data, _text): Declare as char[], not int, as AIX manual suggests.
(bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
(orig_load_scnptr, orig_data_scnptr):
Now off_t, not long, since they are file offsets.
(make_hdr): Use _data, not start_of_data ().
This is the key part of the fix.
(make_hdr, unrelocate_symbols): Use off_t for file offsets.
(unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
Eli Zaretskii [Tue, 12 Feb 2013 16:43:09 +0000 (18:43 +0200)]
Fix cursor positioning near scroll margin at top of window.
src/xdisp.c (try_scrolling): Scroll text up more if point is too close
to ZV and inside the scroll margin. This makes sure point is moved
outside the scroll margin in these cases.
Eli Zaretskii [Tue, 12 Feb 2013 16:36:55 +0000 (18:36 +0200)]
Minor additional fix in the wake of bugs #13623 and 13626.
src/xdisp.c (redisplay_internal): Don't set w->region_showing to the
marker's position.
(display_line): Set w->region_showing to the value of
it->region_beg_charpos, not to -1. This fixes redisplay
optimization when cursor is moved up after M->.
src/window.h (struct window): region_showing can no longer be negative.
Paul Eggert [Mon, 11 Feb 2013 20:32:54 +0000 (12:32 -0800)]
Improve AIX port.
This doesn't fix the bug, but it makes progress: Emacs builds now.
* unexaix.c: Include inttypes.h, stdarg.h.
(report_error, report_error_1): Mark as _Noreturn.
(report_error): Don't report the wrong errno.
(report_error_1): Now varargs. All callers changed.
(make_hdr): Use uintptr_t, not unsigned, when converting pointers
to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
(write_ptr): Use %p to print address rather than %lx and a cast
to unsigned long. Grow buffer a bit, to be safer.
Stefan Monnier [Mon, 11 Feb 2013 19:21:23 +0000 (14:21 -0500)]
Clean up read_key_sequence a bit; reread active keymaps after first event.
* src/keyboard.c (read_char, read_char_x_menu_prompt)
(read_char_minibuf_menu_prompt):
Replace nmaps+maps with a single `map' arg.
(follow_key): Operate on a single map.
(active_maps): New function.
(test_undefined): Also return true for nil bindings.
(read_key_sequence): Use active_maps to replace the arrays of keymaps with
a single (composed) keymap. Remember `first_event' to choose the right
set of active keymaps. Recompute the set of keymaps after receiving
the first event. Remove GOBBLE_FIRST_EVENT.
(syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
* src/keyboard.h (read_char): Update declaration.
* src/lread.c (read_filtered_event): Adjust call to read_char.
* lisp/cus-start.el (all): Remove inhibit-local-menu-bar-menus.
Eli Zaretskii [Mon, 11 Feb 2013 17:27:48 +0000 (19:27 +0200)]
Fix rare aborts in bidi.c.
src/bidi.c (bidi_resolve_neutral): After finding the next
non-neutral character, accept NEUTRAL_ON type as well, because
directional control characters, such as LRE and RLE, have their
type converted to that by bidi_resolve_weak. This avoids aborts
when LRE/RLE follows a run of neutrals.
(bidi_move_to_visually_next): Assert that return value of
bidi_peek_at_next_level is non-negative. Negative values will
cause an infloop.
Dmitry Antipov [Mon, 11 Feb 2013 10:21:52 +0000 (14:21 +0400)]
* marker.c (set_marker_internal): If desired position is passed
as a marker, avoid call to buf_charpos_to_bytepos.
* window.c (Fset_window_point): Omit redundant type checking.
(Fset_window_start): Likewise. Format comment.
(window_scroll_pixel_based): Use set_marker_restricted_both
with character and byte positions obtained from an iterator.
(Fset_window_configuration): Use set_marker_restricted_both.
* xdisp.c (message_dolog): Likewise.