Eli Zaretskii [Sun, 17 Feb 2013 18:17:34 +0000 (20:17 +0200)]
Fix bug #13735 with network streams on MS-Windows.
Revert changes to w32proc.c done since 2012-11-30T09:23:15Z!eliz@gnu.org.
Do NOT merge to trunk!
src/w32proc.c (new_child): Remove the loop that attempted to salvage
slots of dead processes.
(new_child, delete_child, find_child_pid): Don't insist on
procinfo.hProcess be NULL for a process slot to be considered
inactive, or be non-NULL to be considered active.
(reader_thread): Don't set the FILE_AT_EOF flag of a file
descriptor if the corresponding child was deleted and its
char_avail handle is NULL.
(reap_subprocess): Don't reset the FILE_AT_EOF flag.
(sys_select): Don't pass a NULL process handle to
WaitForMultipleObjects.
Stefan Monnier [Sun, 17 Feb 2013 16:58:12 +0000 (11:58 -0500)]
Don't use font-lock-syntax-table in lisp modes.
* lisp/font-lock.el (lisp-font-lock-keywords-1, lisp-font-lock-keywords-2):
Don't assume all identifier chars have syntax word.
* lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables):
Remove bar-not-symbol. Adjust callers.
(lisp-mode-variables): Don't set a font-lock-syntax-table.
Eli Zaretskii [Sun, 17 Feb 2013 16:22:11 +0000 (18:22 +0200)]
Fix bug #13723 with redrawing vertical border in GUI sessions.
src/xdisp.c (x_draw_vertical_border): For a window that is neither
the leftmost nor the rightmost, redraw both the left and the right
vertical borders.
Glenn Morris [Sat, 16 Feb 2013 19:56:50 +0000 (11:56 -0800)]
Generalize "animated" images to "multi-frame" images
* lisp/image.el (image-animated-types): Remove.
(image-multi-frame-p): Rename from image-animated-p, and generalize.
(image-animated-p): Make obsolete alias.
(image-animate, image-nth-frame, image-animate-timeout):
Use image-multi-frame-p.
(image-animate-timeout): If no delay, use image-default-frame-delay.
* lisp/image-mode.el (image-mode, image-toggle-animation):
Use image-multi-frame-p.
(image-mode): Adjust startup message for a multi-frame image.
* lisp/gnus/shr.el (shr-put-image): Only animate images that specify a delay.
This is consistent with the old image-animated-p behavior.
Eli Zaretskii [Sat, 16 Feb 2013 11:08:49 +0000 (13:08 +0200)]
Don't set h_errno on MS-Windows except in gethostbyname.
See http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00293.html
and the following discussion for the details.
src/w32.c (set_errno): Reset h_errno and don't set it to any other
value. Set errno instead.
(check_errno): Reset h_errno.
(sys_socket, socket_to_fd, sys_bind, sys_connect)
(sys_gethostname, sys_getservbyname, sys_getpeername)
(sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
(sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
h_errno.
(sys_gethostbyname): Set h_errno only errors detected.
Jambunathan K [Sat, 16 Feb 2013 09:26:42 +0000 (14:56 +0530)]
(read-regexp): Add regexp for symbol at point to the defaults (Bug#13687).
* lisp/replace.el (read-regexp): Tighten the regexp that matches tag.
When tag is retrieved with `find-tag-default', use regexp that
matches tag at point. Also update docstring.
Eli Zaretskii [Sat, 16 Feb 2013 09:13:40 +0000 (11:13 +0200)]
Fix bug #13725 with file notifications on MS-Windows.
lisp/autorevert.el (auto-revert-notify-add-watch): With 'w32notify',
add watch for the file, not its parent directory, since w32notify
sets up the watch for the directory internally.
Glenn Morris [Sat, 16 Feb 2013 03:39:12 +0000 (19:39 -0800)]
Add variables for default/minimum animated image frame delay
* lisp/image.el (image-default-frame-delay): New variable.
(image-animated-p): Use image-default-frame-delay.
(image-minimum-frame-delay): New constant.
(image-animate-timeout): Use image-minimum-frame-delay.
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.