commit 112460da705c2a6716d7b6bc72501de0a3757259 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Tue Dec 27 15:27:40 2016 -0800 ; fix indenting Problem reported by Chris Gregory in: http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00968.html * src/keyboard.c (read_event_from_main_queue): Fix indenting. diff --git a/src/keyboard.c b/src/keyboard.c index f2ee313b8c..15c7f5ff8c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2162,9 +2162,9 @@ read_event_from_main_queue (struct timespec *end_time, if (CONSP (last)) { while (CONSP (XCDR (last))) - last = XCDR (last); + last = XCDR (last); if (!NILP (XCDR (last))) - emacs_abort (); + emacs_abort (); } if (!CONSP (last)) kset_kbd_queue (kb, list1 (c)); commit aebe6592db7da893fcedb56a3fb4b66ce3de2057 Author: Michael Albinus Date: Tue Dec 27 20:06:27 2016 +0100 Release Tramp 2.3.1 * doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.3.1". * lisp/net/tramp.el (tramp-eshell-directory-change): Add it to `eshell-mode-hook' but `eshell-first-time-mode-hook'. * lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p) (tramp-compat-file-name-quote) (tramp-compat-file-name-unquote): Embed them in `eval-and-compile'. diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi index 3101dc0de8..2677672444 100644 --- a/doc/misc/trampver.texi +++ b/doc/misc/trampver.texi @@ -8,7 +8,7 @@ @c In the Tramp GIT, the version number is auto-frobbed from @c configure.ac, so you should edit that file and run @c "autoconf && ./configure" to change the version number. -@set trampver 2.3.1-pre +@set trampver 2.3.1 @c Other flags from configuration @set instprefix /usr/local diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 9f1c64dd10..9b779a0566 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -349,34 +349,35 @@ This is a string of ten letters or dashes as in ls -l." ;; `file-name-quoted-p', `file-name-quote' and `file-name-unquote' are ;; introduced in Emacs 26. -(if (fboundp 'file-name-quoted-p) - (defalias 'tramp-compat-file-name-quoted-p 'file-name-quoted-p) - (defsubst tramp-compat-file-name-quoted-p (name) - "Whether NAME is quoted with prefix \"/:\". +(eval-and-compile + (if (fboundp 'file-name-quoted-p) + (defalias 'tramp-compat-file-name-quoted-p 'file-name-quoted-p) + (defsubst tramp-compat-file-name-quoted-p (name) + "Whether NAME is quoted with prefix \"/:\". If NAME is a remote file name, check the local part of NAME." - (string-match "^/:" (or (file-remote-p name 'localname) name)))) + (string-match "^/:" (or (file-remote-p name 'localname) name)))) -(if (fboundp 'file-name-quote) - (defalias 'tramp-compat-file-name-quote 'file-name-quote) - (defsubst tramp-compat-file-name-quote (name) - "Add the quotation prefix \"/:\" to file NAME. + (if (fboundp 'file-name-quote) + (defalias 'tramp-compat-file-name-quote 'file-name-quote) + (defsubst tramp-compat-file-name-quote (name) + "Add the quotation prefix \"/:\" to file NAME. If NAME is a remote file name, the local part of NAME is quoted." - (concat - (file-remote-p name) "/:" (or (file-remote-p name 'localname) name)))) + (concat + (file-remote-p name) "/:" (or (file-remote-p name 'localname) name)))) -(if (fboundp 'file-name-unquote) - (defalias 'tramp-compat-file-name-unquote 'file-name-unquote) - (defsubst tramp-compat-file-name-unquote (name) - "Remove quotation prefix \"/:\" from file NAME. + (if (fboundp 'file-name-unquote) + (defalias 'tramp-compat-file-name-unquote 'file-name-unquote) + (defsubst tramp-compat-file-name-unquote (name) + "Remove quotation prefix \"/:\" from file NAME. If NAME is a remote file name, the local part of NAME is unquoted." - (save-match-data - (let ((localname (or (file-remote-p name 'localname) name))) - (when (tramp-compat-file-name-quoted-p localname) - (setq - localname - (replace-match - (if (= (length localname) 2) "/" "") nil t localname))) - (concat (file-remote-p name) localname))))) + (save-match-data + (let ((localname (or (file-remote-p name 'localname) name))) + (when (tramp-compat-file-name-quoted-p localname) + (setq + localname + (replace-match + (if (= (length localname) 2) "/" "") nil t localname))) + (concat (file-remote-p name) localname)))))) (provide 'tramp-compat) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 4103a6e76a..7b5f71a754 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4345,13 +4345,13 @@ Only works for Bourne-like shells." (eval-after-load "esh-util" '(progn - (add-hook 'eshell-first-time-mode-hook + (add-hook 'eshell-mode-hook 'tramp-eshell-directory-change) (add-hook 'eshell-directory-change-hook 'tramp-eshell-directory-change) (add-hook 'tramp-unload-hook (lambda () - (remove-hook 'eshell-first-time-mode-hook + (remove-hook 'eshell-mode-hook 'tramp-eshell-directory-change) (remove-hook 'eshell-directory-change-hook 'tramp-eshell-directory-change))))) diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index fad7e7f77c..1cdbe161d5 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -6,7 +6,7 @@ ;; Author: Kai Großjohann ;; Keywords: comm, processes ;; Package: tramp -;; Version: 2.3.1-pre +;; Version: 2.3.1 ;; This file is part of GNU Emacs. @@ -32,7 +32,7 @@ ;; should be changed only there. ;;;###tramp-autoload -(defconst tramp-version "2.3.1-pre" +(defconst tramp-version "2.3.1" "This version of Tramp.") ;;;###tramp-autoload @@ -54,7 +54,7 @@ ;; Check for Emacs version. (let ((x (if (>= emacs-major-version 23) "ok" - (format "Tramp 2.3.1-pre is not fit for %s" + (format "Tramp 2.3.1 is not fit for %s" (when (string-match "^.*$" (emacs-version)) (match-string 0 (emacs-version))))))) (unless (string-match "\\`ok\\'" x) (error "%s" x))) commit a02ca7a231c3856efd57a502c6a73e6c251091e8 Author: Paul Eggert Date: Tue Dec 27 10:32:44 2016 -0800 Simplify prog1 implementation Inspired by a suggestion from Chris Gregory in: http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00965.html On my platform, this generates exactly the same machine insns. * src/eval.c (prog_ignore): Rename from unwind_body, since it’s more general than that. All callers changed. (Fprog1): Simplify by using prog_ignore. (Fwhile): Clarify by using prog_ignore. diff --git a/src/bytecode.c b/src/bytecode.c index d484dbb25c..3bb96c2ed2 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -809,7 +809,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, { Lisp_Object handler = POP; /* Support for a function here is new in 24.4. */ - record_unwind_protect (FUNCTIONP (handler) ? bcall0 : unwind_body, + record_unwind_protect (FUNCTIONP (handler) ? bcall0 : prog_ignore, handler); NEXT; } diff --git a/src/eval.c b/src/eval.c index ddcccc285d..e50e26a11d 100644 --- a/src/eval.c +++ b/src/eval.c @@ -453,11 +453,10 @@ usage: (progn BODY...) */) return val; } -/* Evaluate BODY sequentially, discarding its value. Suitable for - record_unwind_protect. */ +/* Evaluate BODY sequentially, discarding its value. */ void -unwind_body (Lisp_Object body) +prog_ignore (Lisp_Object body) { Fprogn (body); } @@ -469,16 +468,8 @@ whose values are discarded. usage: (prog1 FIRST BODY...) */) (Lisp_Object args) { - Lisp_Object val; - Lisp_Object args_left; - - args_left = args; - val = args; - - val = eval_sub (XCAR (args_left)); - while (CONSP (args_left = XCDR (args_left))) - eval_sub (XCAR (args_left)); - + Lisp_Object val = eval_sub (XCAR (args)); + prog_ignore (XCDR (args)); return val; } @@ -988,7 +979,7 @@ usage: (while TEST BODY...) */) while (!NILP (eval_sub (test))) { QUIT; - Fprogn (body); + prog_ignore (body); } return Qnil; @@ -1191,7 +1182,7 @@ usage: (unwind-protect BODYFORM UNWINDFORMS...) */) Lisp_Object val; ptrdiff_t count = SPECPDL_INDEX (); - record_unwind_protect (unwind_body, XCDR (args)); + record_unwind_protect (prog_ignore, XCDR (args)); val = eval_sub (XCAR (args)); return unbind_to (count, val); } diff --git a/src/lisp.h b/src/lisp.h index dc2c7a6008..1a586cab0d 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3867,7 +3867,7 @@ extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object); extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object); extern void init_eval (void); extern void syms_of_eval (void); -extern void unwind_body (Lisp_Object); +extern void prog_ignore (Lisp_Object); extern ptrdiff_t record_in_backtrace (Lisp_Object, Lisp_Object *, ptrdiff_t); extern void mark_specpdl (union specbinding *first, union specbinding *ptr); extern void get_backtrace (Lisp_Object array); commit e6161f648903d821865b9610b3b6aa0f82a5dcb7 Author: Stefan Monnier Date: Tue Dec 27 12:44:32 2016 -0500 * lisp/emacs-lisp/inline.el: Fix apply-conversion (bug#25280) (inline--dont-quote): Quote the function with #' when passing it to `apply'. diff --git a/lisp/emacs-lisp/inline.el b/lisp/emacs-lisp/inline.el index 058c56c3b4..5ceb0d9ed2 100644 --- a/lisp/emacs-lisp/inline.el +++ b/lisp/emacs-lisp/inline.el @@ -191,9 +191,9 @@ After VARS is handled, BODY is evaluated in the new environment." (while (and (consp exp) (not (eq '\, (car exp)))) (push (inline--dont-quote (pop exp)) args)) (setq args (nreverse args)) - (if exp - `(apply ,@args ,(inline--dont-quote exp)) - args))) + (if (null exp) + args + `(apply #',(car args) ,@(cdr args) ,(inline--dont-quote exp))))) (_ exp))) (defun inline--do-leteval (var-exp &rest body) commit ee264827f3684e211951b493fffb2193e4cba776 Author: Mark Oteiza Date: Tue Dec 27 11:09:39 2016 -0500 Remove a use of lexical-let * lisp/gnus/message.el (message-completion-function): Just use let, since the file now uses lexical-binding. diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 5446aa2b8c..33c5339e54 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -7946,7 +7946,7 @@ regular text mode tabbing command." (not (mail-abbrev-in-expansion-header-p)))) (setq alist (cdr alist))) (when (cdar alist) - (lexical-let ((fun (cdar alist))) + (let ((fun (cdar alist))) ;; Even if completion fails, return a non-nil value, so as to avoid ;; falling back to message-tab-body-function. (lambda () (funcall fun) 'completion-attempted))))) commit eff237503c321dd96e6bd509a5e34a9f1f6c75d9 Author: Ken Brown Date: Mon Dec 26 13:24:43 2016 -0500 Improve filenotify-tests.el on Cygwin (Bug #21804) * test/lisp/filenotify-tests.el [CYGWIN] (file-notify--test-read-event-timeout): Increase. (file-notify--test-with-events): Add delay before executing body. (file-notify-test02-events, file-notify-test04-file-validity): Adjust expected results. diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index 0e6e58e7b8..1ed764fb97 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -64,7 +64,11 @@ (defvar file-notify--test-event nil) (defvar file-notify--test-events nil) -(defconst file-notify--test-read-event-timeout 0.01 +(defconst file-notify--test-read-event-timeout + (cond + ;; Some events take several seconds to arrive on cygwin. + ((eq system-type 'cygwin) 7) + (t 0.01)) "Timeout for `read-event' calls. It is different for local and remote file notification libraries.") @@ -388,6 +392,10 @@ delivered." (not (input-pending-p))) (setq file-notify--test-events nil file-notify--test-results nil) + ;; cygwin needs a delay between setting a watch and beginning + ;; file activity, or else the first event is not sent. + (if (eq system-type 'cygwin) + (sleep-for 1)) ,@body (file-notify--wait-for-events ;; More events need more time. Use some fudge factor. @@ -409,10 +417,9 @@ delivered." (unwind-protect (progn ;; Check file creation, change and deletion. It doesn't work - ;; for cygwin and kqueue, because we don't use an implicit - ;; directory monitor (kqueue), or the timings are too bad (cygwin). - (unless (or (eq system-type 'cygwin) - (string-equal (file-notify--test-library) "kqueue")) + ;; for kqueue, because we don't use an implicit directory + ;; monitor. + (unless (string-equal (file-notify--test-library) "kqueue") (setq file-notify--test-tmpfile (file-notify--test-make-temp-name)) (should (setq file-notify--test-desc @@ -421,9 +428,9 @@ delivered." '(change) #'file-notify--test-event-handler))) (file-notify--test-with-events (cond - ;; cygwin recognizes only `deleted' and `stopped' events. + ;; cygwin does not raise a `changed' event. ((eq system-type 'cygwin) - '(deleted stopped)) + '(created deleted stopped)) (t '(created changed deleted stopped))) (write-region "another text" nil file-notify--test-tmpfile nil 'no-message) @@ -440,13 +447,9 @@ delivered." file-notify--test-tmpfile '(change) #'file-notify--test-event-handler))) (file-notify--test-with-events - (cond - ;; cygwin recognizes only `deleted' and `stopped' events. - ((eq system-type 'cygwin) - '(deleted stopped)) - ;; There could be one or two `changed' events. - (t '((changed deleted stopped) - (changed changed deleted stopped)))) + ;; There could be one or two `changed' events. + '((changed deleted stopped) + (changed changed deleted stopped)) (write-region "another text" nil file-notify--test-tmpfile nil 'no-message) (read-event nil nil file-notify--test-read-event-timeout) @@ -470,11 +473,11 @@ delivered." ;; events for the watched directory. ((string-equal (file-notify--test-library) "w32notify") '(created changed deleted)) - ;; cygwin recognizes only `deleted' and `stopped' events. - ((eq system-type 'cygwin) - '(deleted stopped)) ;; There are two `deleted' events, for the file and for - ;; the directory. Except for kqueue. + ;; the directory. Except for cygwin and kqueue. And + ;; cygwin does not raise a `changed' event. + ((eq system-type 'cygwin) + '(created deleted stopped)) ((string-equal (file-notify--test-library) "kqueue") '(created changed deleted stopped)) (t '(created changed deleted deleted stopped))) @@ -503,11 +506,10 @@ delivered." '(created changed created changed changed changed changed deleted deleted)) - ;; cygwin recognizes only `deleted' and `stopped' events. - ((eq system-type 'cygwin) - '(deleted stopped)) ;; There are three `deleted' events, for two files and - ;; for the directory. Except for kqueue. + ;; for the directory. Except for cygwin and kqueue. + ((eq system-type 'cygwin) + '(created created changed changed deleted stopped)) ((string-equal (file-notify--test-library) "kqueue") '(created changed created changed deleted stopped)) (t '(created changed created changed @@ -541,11 +543,12 @@ delivered." ;; events for the watched directory. ((string-equal (file-notify--test-library) "w32notify") '(created changed renamed deleted)) - ;; cygwin recognizes only `deleted' and `stopped' events. - ((eq system-type 'cygwin) - '(deleted stopped)) ;; There are two `deleted' events, for the file and for - ;; the directory. Except for kqueue. + ;; the directory. Except for cygwin and kqueue. And + ;; cygwin raises `created' and `deleted' events instead + ;; of a `renamed' event. + ((eq system-type 'cygwin) + '(created created deleted deleted stopped)) ((string-equal (file-notify--test-library) "kqueue") '(created changed renamed deleted stopped)) (t '(created changed renamed deleted deleted stopped))) @@ -728,13 +731,9 @@ delivered." '(change) #'file-notify--test-event-handler))) (should (file-notify-valid-p file-notify--test-desc)) (file-notify--test-with-events - (cond - ;; cygwin recognizes only `deleted' and `stopped' events. - ((eq system-type 'cygwin) - '(deleted stopped)) ;; There could be one or two `changed' events. - (t '((changed deleted stopped) - (changed changed deleted stopped)))) + '((changed deleted stopped) + (changed changed deleted stopped)) (write-region "another text" nil file-notify--test-tmpfile nil 'no-message) (read-event nil nil file-notify--test-read-event-timeout) @@ -765,11 +764,11 @@ delivered." ;; for the watched directory. ((string-equal (file-notify--test-library) "w32notify") '(created changed deleted)) - ;; cygwin recognizes only `deleted' and `stopped' events. - ((eq system-type 'cygwin) - '(deleted stopped)) ;; There are two `deleted' events, for the file and for the - ;; directory. Except for kqueue. + ;; directory. Except for cygwin and kqueue. And cygwin + ;; does not raise a `changed' event. + ((eq system-type 'cygwin) + '(created deleted stopped)) ((string-equal (file-notify--test-library) "kqueue") '(created changed deleted stopped)) (t '(created changed deleted deleted stopped))) @@ -1172,9 +1171,10 @@ the file watch." ;; the missing directory monitor. ;; * For w32notify, no `deleted' and `stopped' events arrive when a ;; directory is removed. -;; * For w32notify, no `attribute-changed' events arrive. Its sends -;; `changed' events instead. -;; * Check, why cygwin recognizes only `deleted' and `stopped' events. +;; * For cygwin and w32notify, no `attribute-changed' events arrive. +;; They send `changed' events instead. +;; * cygwin does not send all expected `changed' and `deleted' events. +;; Probably due to timing issues. (provide 'file-notify-tests) ;;; filenotify-tests.el ends here