commit 879e09bbbce79f78db14eb32c714452efd53b268 (HEAD, refs/remotes/origin/master) Author: Vasilij Schneidermann Date: Tue Feb 23 20:28:37 2016 +1100 Place apples randomly in Snake * lisp/play/snake.el (snake-score): New variable (bug#21359). (snake-set-dot): Place the apples randomly. diff --git a/lisp/play/snake.el b/lisp/play/snake.el index 243f019..371c713 100644 --- a/lisp/play/snake.el +++ b/lisp/play/snake.el @@ -144,7 +144,6 @@ (defvar snake-velocity-x 1) (defvar snake-velocity-y 0) (defvar snake-positions nil) -(defvar snake-cycle 0) (defvar snake-score 0) (defvar snake-paused nil) (defvar snake-moved-p nil) @@ -164,7 +163,6 @@ and then start moving it leftwards.") (make-variable-buffer-local 'snake-velocity-x) (make-variable-buffer-local 'snake-velocity-y) (make-variable-buffer-local 'snake-positions) -(make-variable-buffer-local 'snake-cycle) (make-variable-buffer-local 'snake-score) (make-variable-buffer-local 'snake-paused) (make-variable-buffer-local 'snake-moved-p) @@ -237,7 +235,6 @@ and then start moving it leftwards.") snake-velocity-x snake-initial-velocity-x snake-velocity-y snake-initial-velocity-y snake-positions nil - snake-cycle 1 snake-score 0 snake-paused nil snake-moved-p nil @@ -251,6 +248,14 @@ and then start moving it leftwards.") (cl-incf y snake-velocity-y))) (snake-update-score)) +(defun snake-set-dot () + (let ((x (random snake-width)) + (y (random snake-height))) + (while (not (= (gamegrid-get-cell x y) snake-blank)) + (setq x (random snake-width)) + (setq y (random snake-height))) + (gamegrid-set-cell x y snake-dot))) + (defun snake-update-game (snake-buffer) "Called on each clock tick. Advances the snake one square, testing for collision. @@ -268,23 +273,20 @@ Argument SNAKE-BUFFER is the name of the buffer." (cond ((= c snake-dot) (cl-incf snake-length) (cl-incf snake-score) - (snake-update-score)) + (snake-update-score) + (snake-set-dot)) (t (let* ((last-cons (nthcdr (- snake-length 2) snake-positions)) (tail-pos (cadr last-cons)) (x0 (aref tail-pos 0)) (y0 (aref tail-pos 1))) - (gamegrid-set-cell x0 y0 - (if (= (% snake-cycle 5) 0) - snake-dot - snake-blank)) - (cl-incf snake-cycle) + (gamegrid-set-cell x0 y0 snake-blank) (setcdr last-cons nil)))) (gamegrid-set-cell x y snake-snake) (setq snake-positions (cons (vector x y) snake-positions)) - (setq snake-moved-p nil))))) + (setq snake-moved-p nil))))) (defun snake-update-velocity () (unless snake-moved-p @@ -339,6 +341,7 @@ Argument SNAKE-BUFFER is the name of the buffer." "Start a new game of Snake." (interactive) (snake-reset-game) + (snake-set-dot) (use-local-map snake-mode-map) (gamegrid-start-timer snake-tick-period 'snake-update-game)) commit cc27b1b04113677bf9f7bf60f41ac3f07c6c2530 Author: Tino Calancha Date: Tue Feb 23 20:17:21 2016 +1100 Allow optional parameter to be nil * lisp/ibuf-ext.el (ibuffer-copy-filename-as-kill): Allow the optional parameter to be nil (bug#21576). diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index aa3ccbd..6052bf3 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -1403,7 +1403,7 @@ You can then feed the file name(s) to other commands with \\[yank]." (if (zerop (ibuffer-count-marked-lines)) (message "No buffers marked; use 'm' to mark a buffer") (let ((ibuffer-copy-filename-as-kill-result "") - (type (cond ((zerop arg) + (type (cond ((or (null arg) (zerop arg)) 'full) ((= arg 4) 'relative) commit b8dfc7beeb49d3fe673966f630126a38397e8d78 Author: Tino Calancha Date: Tue Feb 23 20:12:59 2016 +1100 Completely ignore buffers with no name when copying file names * lisp/ibuf-ext.el (ibuffer-copy-filename-as-kill): Completely ignore buffers with no file name. (bug#21577). diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index 1d61825..aa3ccbd 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -1412,20 +1412,23 @@ You can then feed the file name(s) to other commands with \\[yank]." (ibuffer-map-marked-lines #'(lambda (buf _mark) (setq ibuffer-copy-filename-as-kill-result - (concat ibuffer-copy-filename-as-kill-result - (let ((name (buffer-file-name buf))) - (if name - (pcase type - (`full - name) - (`relative - (file-relative-name - name (or ibuffer-default-directory - default-directory))) - (_ - (file-name-nondirectory name))) - "")) - " ")))) + (concat ibuffer-copy-filename-as-kill-result + (let ((name (buffer-file-name buf))) + (cond (name + (concat + (pcase type + (`full + name) + (`relative + (file-relative-name + name (or ibuffer-default-directory + default-directory))) + (_ + (file-name-nondirectory name))) " ")) + (t ""))))))) + (when (not (zerop (length ibuffer-copy-filename-as-kill-result))) + (setq ibuffer-copy-filename-as-kill-result + (substring ibuffer-copy-filename-as-kill-result 0 -1))) (kill-new ibuffer-copy-filename-as-kill-result)))) (defun ibuffer-mark-on-buffer (func &optional ibuffer-mark-on-buffer-mark group) commit ed91405a07f694b0061ff5ebf9972a726cb1cb6e Author: Lars Ingebrigtsen Date: Tue Feb 23 20:01:06 2016 +1100 Make spelling of "Eshell" consistent * lisp/eshell/esh-mode.el (eshell-mode): Spell it "Eshell". * lisp/eshell/eshell.el (eshell-command): Spell it "Eshell" (bug#21678). diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 388bc74..074b94c 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -296,7 +296,7 @@ and the hook `eshell-exit-hook'." (run-hooks 'eshell-exit-hook)) ;;;###autoload -(define-derived-mode eshell-mode fundamental-mode "EShell" +(define-derived-mode eshell-mode fundamental-mode "Eshell" "Emacs shell interactive mode." (setq-local eshell-mode t) diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el index 8b21730..54281a7 100644 --- a/lisp/eshell/eshell.el +++ b/lisp/eshell/eshell.el @@ -308,9 +308,9 @@ With prefix ARG, insert output into the current buffer at point." (eshell-parse-command command)))) intr (bufname (if (and proc (listp proc)) - "*EShell Async Command Output*" + "*Eshell Async Command Output*" (setq intr t) - "*EShell Command Output*"))) + "*Eshell Command Output*"))) (if (buffer-live-p (get-buffer bufname)) (kill-buffer bufname)) (rename-buffer bufname) commit ad99299f400d348026d0a6cca7551ad6371014b9 Author: Simen Heggestøyl Date: Tue Feb 23 19:56:52 2016 +1100 Allow pretty lambdas in Scheme mode * lisp/progmodes/scheme.el (scheme-mode-variables): Borrow `prettify-symbols-alist' from Lisp mode (bug#21679). diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el index 27ce60b..1fbc87e 100644 --- a/lisp/progmodes/scheme.el +++ b/lisp/progmodes/scheme.el @@ -156,6 +156,7 @@ nil t (("+-*/.<>=!?$%_&~^:" . "w") (?#. "w 14")) beginning-of-defun (font-lock-mark-block-function . mark-defun))) + (setq-local prettify-symbols-alist lisp-prettify-symbols-alist) (setq-local lisp-doc-string-elt-property 'scheme-doc-string-elt)) (defvar scheme-mode-line-process "") commit aeac60371585c4bd9a809b04591448597491fece Author: Lars Ingebrigtsen Date: Tue Feb 23 19:46:02 2016 +1100 Rename lisp--prettify-symbols-alist * lisp/emacs-lisp/lisp-mode.el (lisp-prettify-symbols-alist): Rename from `lisp--prettify-symbols-alist' since we're going to use it in Scheme mode, too. (lisp-mode-variables): Use it. diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index cb8abde..8d57c19 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -168,6 +168,8 @@ (defvar lisp-doc-string-elt-property 'doc-string-elt "The symbol property that holds the docstring position info.") +(defconst lisp-prettify-symbols-alist '(("lambda" . ?λ)) + "Alist of symbol/\"pretty\" characters to be displayed.") ;;;; Font-lock support. @@ -594,7 +596,7 @@ font-lock keywords will not be case sensitive." (font-lock-extra-managed-props help-echo) (font-lock-syntactic-face-function . lisp-font-lock-syntactic-face-function))) - (setq-local prettify-symbols-alist lisp--prettify-symbols-alist) + (setq-local prettify-symbols-alist lisp-prettify-symbols-alist) (setq-local electric-pair-skip-whitespace 'chomp) (setq-local electric-pair-open-newline-between-pairs nil)) @@ -655,9 +657,6 @@ font-lock keywords will not be case sensitive." :type 'hook :group 'lisp) -(defconst lisp--prettify-symbols-alist - '(("lambda" . ?λ))) - ;;; Generic Lisp mode. (defvar lisp-mode-map commit d6925623770117f0e5e6eab0076b8760af289b43 Author: Chunyang Xu Date: Tue Feb 23 19:36:23 2016 +1100 Remove spurious newline in package list * lisp/emacs-lisp/package.el (describe-package-1): Remove spurious newline (bug#21706). Copyright-paperwork-exempt: yes diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index dc05044..6bfc96c 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2289,7 +2289,7 @@ Otherwise no newline is inserted." (insert "\n") (unless (and pkg-dir (not archive)) ; Installed pkgs don't have archive. (package--print-help-section "Archive" - (or archive "n/a") "\n")) + (or archive "n/a"))) (and version (package--print-help-section "Version" (package-version-join version))) commit b85bfe2c3b1ce53caae33dd696dfd6b6bf5d45eb Author: Lars Ingebrigtsen Date: Tue Feb 23 19:35:47 2016 +1100 Revert "Remove spurious newline in package list" This reverts commit fad14c289d36a2c61e0fd34105ebb1f62c80d71d. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 6bfc96c..dc05044 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2289,7 +2289,7 @@ Otherwise no newline is inserted." (insert "\n") (unless (and pkg-dir (not archive)) ; Installed pkgs don't have archive. (package--print-help-section "Archive" - (or archive "n/a"))) + (or archive "n/a") "\n")) (and version (package--print-help-section "Version" (package-version-join version))) commit fad14c289d36a2c61e0fd34105ebb1f62c80d71d Author: Chunyang Xu Date: Tue Feb 23 19:35:03 2016 +1100 Remove spurious newline in package list * lisp/emacs-lisp/package.el (describe-package-1): Remove spurious newline (bug#21706). diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index dc05044..6bfc96c 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2289,7 +2289,7 @@ Otherwise no newline is inserted." (insert "\n") (unless (and pkg-dir (not archive)) ; Installed pkgs don't have archive. (package--print-help-section "Archive" - (or archive "n/a") "\n")) + (or archive "n/a"))) (and version (package--print-help-section "Version" (package-version-join version))) commit 1b0bf990b53a2626e2b825101615d72d78f98ef7 Author: Tino Calancha Date: Tue Feb 23 16:24:52 2016 +1100 Keep the position in the process buffer when deleting processes * lisp/simple.el (process-menu-delete-process): Keep the position in the buffer after killing a process (bug#21759). Copyright-paperwork-exempt: yes diff --git a/lisp/simple.el b/lisp/simple.el index 4efad8c..8c9d546 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3746,8 +3746,13 @@ support pty association, if PROGRAM is nil." (defun process-menu-delete-process () "Kill process at point in a `list-processes' buffer." (interactive) - (delete-process (tabulated-list-get-id)) - (revert-buffer)) + (let ((pos (point))) + (delete-process (tabulated-list-get-id)) + (revert-buffer) + (goto-char (min pos (point-max))) + (if (eobp) + (forward-line -1) + (beginning-of-line)))) (defun list-processes--refresh () "Recompute the list of processes for the Process List buffer. commit 92da003692b894e6dc514e3a56a1861849dcad8c Author: Lars Ingebrigtsen Date: Tue Feb 23 16:09:06 2016 +1100 Require that the buffer that we're trying to patch exist * lisp/vc/ediff.el (ediff-patch-buffer): Require that the buffer that we're trying to patch exist (bug#21852). diff --git a/lisp/vc/ediff.el b/lisp/vc/ediff.el index e5e16a1..be4ced9 100644 --- a/lisp/vc/ediff.el +++ b/lisp/vc/ediff.el @@ -1367,7 +1367,8 @@ buffer. If odd -- assume it is in a file." (require 'ediff-ptch) (setq patch-buf (ediff-get-patch-buffer - (if arg (prefix-numeric-value arg)) patch-buf)) + (if arg (prefix-numeric-value arg)) + (get-buffer patch-buf))) (setq source-dir (cond (ediff-use-last-dir ediff-last-dir-patch) ((and (not ediff-patch-default-directory) (buffer-file-name patch-buf)) commit 0d21540646b7272b069aa6909d41978171c9e06c Author: Tino Calancha Date: Tue Feb 23 16:04:06 2016 +1100 Require that the buffer that we're trying to patch exist * lisp/vc/ediff.el (ediff-patch-buffer): Require that the buffer that we're trying to patch exist (bug#21852). Copyright-paperwork-exempt: yes diff --git a/lisp/vc/ediff.el b/lisp/vc/ediff.el index 71099ab..e5e16a1 100644 --- a/lisp/vc/ediff.el +++ b/lisp/vc/ediff.el @@ -1401,9 +1401,8 @@ patch. If not given, the user is prompted according to the prefix argument." (if arg (prefix-numeric-value arg)) patch-buf)) (ediff-patch-buffer-internal patch-buf - (read-buffer - "Which buffer to patch? " - (ediff-other-buffer patch-buf)))) + (read-buffer "Which buffer to patch? " (ediff-other-buffer patch-buf) + 'require-match))) ;;;###autoload commit c5214e7969a7be964465152c8698958e429cfeea Author: Tino Calancha Date: Tue Feb 23 15:55:08 2016 +1100 Be more verbose when changing frame mode in ediff * lisp/vc/ediff-util.el (ediff-toggle-multiframe): Say what mode we toggled to (bug#21853). Copyright-paperwork-exempt: yes diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index 5419d47..eb5c249 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -1293,7 +1293,8 @@ which see." (cond ((eq ediff-window-setup-function 'ediff-setup-windows-multiframe) (setq ediff-multiframe nil) - (setq window-setup-func 'ediff-setup-windows-plain)) + (setq window-setup-func 'ediff-setup-windows-plain) + (message "ediff is now in 'plain' mode")) ((eq ediff-window-setup-function 'ediff-setup-windows-plain) (if (ediff-in-control-buffer-p) (ediff-kill-bottom-toolbar)) @@ -1301,14 +1302,15 @@ which see." (window-live-p ediff-control-window)) (set-window-dedicated-p ediff-control-window nil)) (setq ediff-multiframe t) - (setq window-setup-func 'ediff-setup-windows-multiframe)) + (setq window-setup-func 'ediff-setup-windows-multiframe) + (message "ediff is now in 'multiframe' mode")) (t (if (and (ediff-buffer-live-p ediff-control-buffer) (window-live-p ediff-control-window)) (set-window-dedicated-p ediff-control-window nil)) (setq ediff-multiframe t) (setq window-setup-func 'ediff-setup-windows-multiframe)) - ) + (message "ediff is now in 'multiframe' mode")) ;; change default (setq-default ediff-window-setup-function window-setup-func) commit 3cedbdcc71ebefc12bd20ec84f74251fe99ee7d0 Author: Łukasz Stelmach Date: Tue Feb 23 14:54:30 2016 +1100 Encode header strings before printing * lisp/ps-print.el (ps-generate-header-line): Encode the header strings to avoid problems with non-ASCII headers (bug#22611). diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 7333709..2ea0919 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -4761,7 +4761,11 @@ page-height == ((floor print-height ((th + ls) * zh)) * ((th + ls) * zh)) - th ;; Literal strings should be output as is -- the string must contain its own ;; PS string delimiters, '(' and ')', if necessary. ((stringp content) - (ps-output content)) + (if (functionp ps-encode-header-string-function) + (dolist (elem (funcall ps-encode-header-string-function + content fonttag)) + (ps-output elem)) + (ps-output content))) ;; Functions are called -- they should return strings; they will be inserted ;; as strings and the PS string delimiters added. @@ -4777,7 +4781,7 @@ page-height == ((floor print-height ((th + ls) * zh)) * ((th + ls) * zh)) - th ((and (symbolp content) (boundp content)) (if (fboundp ps-encode-header-string-function) (dolist (l (funcall ps-encode-header-string-function - (symbol-value content) fonttag)) + (symbol-value content) fonttag)) (ps-output-string l)) (ps-output-string (symbol-value content)))) commit dea946d1bc9ae14d9d9e5c409c9e0d1492ed4f10 Author: Michal Nazarewicz Date: Tue Feb 23 14:48:05 2016 +1100 Test message-strip-subject-trailing-was * test/lisp/gnus/message-test.el (message-strip-subject-trailing-was): New test (bug#22632). diff --git a/test/lisp/gnus/message-tests.el b/test/lisp/gnus/message-tests.el index 3afa156..ae34f24 100644 --- a/test/lisp/gnus/message-tests.el +++ b/test/lisp/gnus/message-tests.el @@ -55,6 +55,49 @@ (point))))) (set-buffer-modified-p nil)))) + +(ert-deftest message-strip-subject-trailing-was () + (ert-with-function-mocked message-talkative-question nil + (with-temp-buffer + (let ((no-was "Re: Foo ") + (with-was "Re: Foo \t (was: Bar ) ") + (stripped-was "Re: Foo") + reply) + + ;; Test unconditional stripping + (setq-local message-subject-trailing-was-query t) + (should (string= no-was (message-strip-subject-trailing-was no-was))) + (should (string= stripped-was + (message-strip-subject-trailing-was with-was))) + + ;; Test asking + (setq-local message-subject-trailing-was-query 'ask) + (fset 'message-talkative-question + (lambda (_ question show text) + (should (string= "Strip `(was: )' in subject? " + question)) + (should show) + (should (string-match + (concat + "Strip `(was: )' in subject " + "and use the new one instead\\?\n\n" + "Current subject is: \"\\(.*\\)\"\n\n" + "New subject would be: \"\\(.*\\)\"\n\n" + "See the variable " + "`message-subject-trailing-was-query' " + "to get rid of this query.") + text)) + (should (string= (match-string 1 text) with-was)) + (should (string= (match-string 2 text) stripped-was)) + reply)) + (message-strip-subject-trailing-was with-was) + (should (string= with-was + (message-strip-subject-trailing-was with-was))) + (setq reply t) + (should (string= stripped-was + (message-strip-subject-trailing-was with-was))))))) + + (provide 'message-mode-tests) ;;; message-mode-tests.el ends here commit d57ca9f8519ac1b0054857ad57653b2bdb1196ea Author: Michal Nazarewicz Date: Tue Feb 23 14:46:56 2016 +1100 Make use of the `ert-with-function-mocked' macro * test/lisp/calendar/icalendar-tests.el (icalendar--create-uid): * test/lisp/vc/vc-bzr-tests.el (vc-bzr-test-bug9781): Use `ert-with-function-mocked' instead of implementing the fragile `unwind-protect' logic openly. diff --git a/test/lisp/calendar/icalendar-tests.el b/test/lisp/calendar/icalendar-tests.el index 2c13a36..20d8834 100644 --- a/test/lisp/calendar/icalendar-tests.el +++ b/test/lisp/calendar/icalendar-tests.el @@ -32,6 +32,7 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'icalendar) ;; ====================================================================== @@ -58,23 +59,16 @@ (ert-deftest icalendar--create-uid () "Test for `icalendar--create-uid'." (let* ((icalendar-uid-format "xxx-%t-%c-%h-%u-%s") - t-ct (icalendar--uid-count 77) (entry-full "30.06.1964 07:01 blahblah") (hash (format "%d" (abs (sxhash entry-full)))) (contents "DTSTART:19640630T070100\nblahblah") - (username (or user-login-name "UNKNOWN_USER")) - ) - (fset 't-ct (symbol-function 'current-time)) - (unwind-protect - (progn - (fset 'current-time (lambda () '(1 2 3))) - (should (= 77 icalendar--uid-count)) - (should (string= (concat "xxx-123-77-" hash "-" username "-19640630") - (icalendar--create-uid entry-full contents))) - (should (= 78 icalendar--uid-count))) - ;; restore 'current-time - (fset 'current-time (symbol-function 't-ct))) + (username (or user-login-name "UNKNOWN_USER"))) + (ert-with-function-mocked current-time (lambda () '(1 2 3)) + (should (= 77 icalendar--uid-count)) + (should (string= (concat "xxx-123-77-" hash "-" username "-19640630") + (icalendar--create-uid entry-full contents))) + (should (= 78 icalendar--uid-count))) (setq contents "blahblah") (setq icalendar-uid-format "yyy%syyy") (should (string= (concat "yyyDTSTARTyyy") diff --git a/test/lisp/vc/vc-bzr-tests.el b/test/lisp/vc/vc-bzr-tests.el index 82721ee..98d176c 100644 --- a/test/lisp/vc/vc-bzr-tests.el +++ b/test/lisp/vc/vc-bzr-tests.el @@ -25,6 +25,7 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'vc-bzr) (require 'vc-dir) @@ -101,12 +102,8 @@ (while (vc-dir-busy) (sit-for 0.1)) (vc-dir-mark-all-files t) - (let ((f (symbol-function 'y-or-n-p))) - (unwind-protect - (progn - (fset 'y-or-n-p (lambda (prompt) t)) - (vc-next-action nil)) - (fset 'y-or-n-p f))) + (ert-with-function-mocked y-or-n-p (lambda (_) t) + (vc-next-action nil)) (should (get-buffer "*vc-log*"))) (delete-directory homedir t)))) commit a77c6799c1f3ae30c8bbf26aa376f52c33cd554f Author: Michal Nazarewicz Date: Tue Feb 23 14:45:59 2016 +1100 message-strip-subject-trailing-was: Refactor * lisp/gnus/message.el (message-strip-subject-trailing-was): Refactor the function replacing sequence of `if' calls with a mixture of `or' and `and' calls instead. This makes it shorter and containing less internal state thus easier to follow. diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index cc147b3..a23e3ba 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -2197,33 +2197,26 @@ charset: " "Remove trailing \"(was: )\" from SUBJECT lines. Leading \"Re: \" is not stripped by this function. Use the function `message-strip-subject-re' for this." - (let* ((query message-subject-trailing-was-query) - (new) (found)) - (setq found - (string-match - (if (eq query 'ask) - message-subject-trailing-was-ask-regexp - message-subject-trailing-was-regexp) - subject)) - (if found - (setq new (substring subject 0 (match-beginning 0)))) - (if (or (not found) (eq query nil)) - subject - (if (eq query 'ask) - (if (message-y-or-n-p - "Strip `(was: )' in subject? " t - (concat - "Strip `(was: )' in subject " - "and use the new one instead?\n\n" - "Current subject is: \"" - subject "\"\n\n" - "New subject would be: \"" - new "\"\n\n" - "See the variable `message-subject-trailing-was-query' " - "to get rid of this query." - )) - new subject) - new)))) + (or + (let ((query message-subject-trailing-was-query) new) + (and query + (string-match (if (eq query 'ask) + message-subject-trailing-was-ask-regexp + message-subject-trailing-was-regexp) + subject) + (setq new (substring subject 0 (match-beginning 0))) + (or (not (eq query 'ask)) + (message-y-or-n-p + "Strip `(was: )' in subject? " t + (concat + "Strip `(was: )' in subject " + "and use the new one instead?\n\n" + "Current subject is: \"" subject "\"\n\n" + "New subject would be: \"" new "\"\n\n" + "See the variable `message-subject-trailing-was-query' " + "to get rid of this query."))) + new)) + subject)) ;;; Suggested by Jonas Steverud @ www.dtek.chalmers.se/~d4jonas/ commit 6f0498bf290cbe066036f8bfe0d09ad99ddaab03 Author: Michal Nazarewicz Date: Tue Feb 23 14:44:56 2016 +1100 ert-with-function-mocked: New macro * lisp/emacs-lisp/ert-x.el (ert-with-function-mocked): New macro which allows evaluating code while particular function is replaced with a mock. The original definition of said function is restored once the macro finishes. diff --git a/etc/NEWS b/etc/NEWS index 9e000be..04c1ee8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -104,6 +104,9 @@ different group ID. ** Autoload files can be generated without timestamps, by setting `autoload-timestamps' to nil. +** `ert-with-function-mocked' of 'ert-x package allows mocking of functions +in unit tests. + * Changes in Emacs 25.2 on Non-Free Operating Systems diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el index 2a2418f..eb10c84 100644 --- a/lisp/emacs-lisp/ert-x.el +++ b/lisp/emacs-lisp/ert-x.el @@ -285,6 +285,46 @@ BUFFER defaults to current buffer. Does not modify BUFFER." (kill-buffer clone))))))) +(defmacro ert-with-function-mocked (name mock &rest body) + "Mocks function NAME with MOCK and run BODY. + +Once BODY finishes (be it normally by returning a value or +abnormally by throwing or signalling), the old definition of +function NAME is restored. + +BODY may further change the mock with `fset'. + +If MOCK is nil, the function NAME is mocked with a function +`ert-fail'ing when called. + +For example: + + ;; Regular use, function is mocked inside the BODY: + (should (eq 2 (+ 1 1))) + (ert-with-function-mocked ((+ (lambda (a b) (- a b)))) + (should (eq 0 (+ 1 1)))) + (should (eq 2 (+ 1 1))) + + ;; Macro correctly recovers from a throw or signal: + (should + (catch 'done + (ert-with-function-mocked ((+ (lambda (a b) (- a b)))) + (should (eq 0 (+ 1 1)))) + (throw 'done t))) + (should (eq 2 (+ 1 1))) +" + (declare (indent 2)) + (let ((old-var (make-symbol "old-var")) + (mock-var (make-symbol "mock-var"))) + `(let ((,old-var (symbol-function (quote ,name))) (,mock-var ,mock)) + (fset (quote ,name) + (or ,mock-var (lambda (&rest _) + (ert-fail (concat "`" ,(symbol-name name) + "' unexpectedly called."))))) + (unwind-protect + (progn ,@body) + (fset (quote ,name) ,old-var))))) + (provide 'ert-x) ;;; ert-x.el ends here diff --git a/test/lisp/emacs-lisp/ert-x-tests.el b/test/lisp/emacs-lisp/ert-x-tests.el index ef8642a..a2665e7 100644 --- a/test/lisp/emacs-lisp/ert-x-tests.el +++ b/test/lisp/emacs-lisp/ert-x-tests.el @@ -275,6 +275,49 @@ desired effect." (should (equal (c x) (lisp x)))))) +(defun ert--dummy-id (a) + "Identity function. Used for tests only." + a) + +(ert-deftest ert-with-function-mocked () + (let ((mock-id (lambda (_) 21))) + (should (eq 42 (ert--dummy-id 42))) + + (ert-with-function-mocked ert--dummy-id nil + (fset 'ert--dummy-id mock-id) + (should (eq 21 (ert--dummy-id 42)))) + (should (eq 42 (ert--dummy-id 42))) + + (ert-with-function-mocked ert--dummy-id mock-id + (should (eq 21 (ert--dummy-id 42)))) + (should (eq 42 (ert--dummy-id 42))) + + (should + (catch 'exit + (ert-with-function-mocked ert--dummy-id mock-id + (should (eq 21 (ert--dummy-id 42)))) + (throw 'exit t))) + (should (eq 42 (ert--dummy-id 42))) + + (should + (string= "Foo" + (condition-case err + (progn + (ert-with-function-mocked ert--dummy-id mock-id + (should (eq 21 (ert--dummy-id 42)))) + (user-error "Foo")) + (user-error (cadr err))))) + (should (eq 42 (ert--dummy-id 42))) + + (should + (string= "`ert--dummy-id' unexpectedly called." + (condition-case err + (ert-with-function-mocked ert--dummy-id nil + (ert--dummy-id 42)) + (ert-test-failed (cadr err))))) + (should (eq 42 (ert--dummy-id 42))))) + + (provide 'ert-x-tests) ;;; ert-x-tests.el ends here commit 96e32bbb736ec6e0a7278ae864098c7c812b05a4 Author: Lars Ingebrigtsen Date: Tue Feb 23 14:15:26 2016 +1100 Move Gnus functions frm rfc1843 to new file gnus-rfc1843 * lisp/gnus/gnus-rfc1843.el: New file for Gnus/rfc1843 interface functions. * lisp/gnus/rfc1843.el: Move all Gnus-specifig functions to gnus-rfc1843. diff --git a/lisp/gnus/gnus-rfc1843.el b/lisp/gnus/gnus-rfc1843.el new file mode 100644 index 0000000..4e6fdc6 --- /dev/null +++ b/lisp/gnus/gnus-rfc1843.el @@ -0,0 +1,77 @@ +;;; gnus-rfc1843.el --- HZ (rfc1843) decoding interface functions for Gnus + +;; Copyright (C) 1998-2016 Free Software Foundation, Inc. + +;; Author: Shenghuo Zhu +;; Keywords: news HZ HZ+ mail i18n + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;; Usage: +;; (require 'gnus-rfc1843) +;; (rfc1843-gnus-setup) + +;;; Code: + +(require 'rfc1843) +(require 'gnus-sum) +(require 'gnus-art) +(require 'message) + +(defun rfc1843-decode-article-body () + "Decode HZ encoded text in the article body." + (if (string-match (concat "\\<\\(" rfc1843-newsgroups-regexp "\\)\\>") + (or gnus-newsgroup-name "")) + (save-excursion + (save-restriction + (message-narrow-to-head) + (let* ((inhibit-point-motion-hooks t) + (case-fold-search t) + (ct (message-fetch-field "Content-Type" t)) + (ctl (and ct (mail-header-parse-content-type ct)))) + (if (and ctl (not (string-match "/" (car ctl)))) + (setq ctl nil)) + (goto-char (point-max)) + (widen) + (forward-line 1) + (narrow-to-region (point) (point-max)) + (when (or (not ctl) + (equal (car ctl) "text/plain")) + (rfc1843-decode-region (point) (point-max)))))))) + +(defun rfc1843-gnus-setup () + "Setup HZ decoding for Gnus." + (add-hook 'gnus-article-decode-hook 'rfc1843-decode-article-body t) + (setq gnus-decode-encoded-word-function + 'gnus-multi-decode-encoded-word-string + gnus-decode-header-function + 'gnus-multi-decode-header + gnus-decode-encoded-word-methods + (nconc gnus-decode-encoded-word-methods + (list + (cons (concat "\\<\\(" rfc1843-newsgroups-regexp "\\)\\>") + 'rfc1843-decode-string))) + gnus-decode-header-methods + (nconc gnus-decode-header-methods + (list + (cons (concat "\\<\\(" rfc1843-newsgroups-regexp "\\)\\>") + 'rfc1843-decode-region))))) + +(provide 'gnus-rfc1843) + +;;; gnus-rfc1843.el ends here diff --git a/lisp/gnus/rfc1843.el b/lisp/gnus/rfc1843.el index ee2af48..508629f 100644 --- a/lisp/gnus/rfc1843.el +++ b/lisp/gnus/rfc1843.el @@ -22,21 +22,12 @@ ;;; Commentary: -;; Usage: -;; (require 'rfc1843) -;; (rfc1843-gnus-setup) -;; ;; Test: ;; (rfc1843-decode-string "~{<:Ky2;S{#,NpJ)l6HK!#~}") ;;; Code: (eval-when-compile (require 'cl)) -(require 'mm-util) - -(defvar gnus-decode-encoded-word-function) -(defvar gnus-decode-header-function) -(defvar gnus-newsgroup-name) (defvar rfc1843-word-regexp "~\\({\\([\041-\167][\041-\176]\\| \\)+\\)\\(~}\\|$\\)") @@ -111,10 +102,10 @@ ftp://ftp.math.psu.edu/pub/simpson/chinese/hzp/hzp.doc" (defun rfc1843-decode-string (string) "Decode HZ STRING and return the results." - (let ((m (mm-multibyte-p))) + (let ((m enable-multibyte-characters)) (with-temp-buffer (when m - (mm-enable-multibyte)) + (set-buffer-multibyte 'to)) (insert string) (inline (rfc1843-decode-region (point-min) (point-max))) @@ -135,54 +126,6 @@ ftp://ftp.math.psu.edu/pub/simpson/chinese/hzp/hzp.doc" (aset s (incf i) (+ v (if (< v 63) 64 98)))))) s)) -(autoload 'mail-header-parse-content-type "mail-parse") -(autoload 'message-narrow-to-head "message") -(declare-function message-fetch-field "message" (header &optional not-all)) - -(defun rfc1843-decode-article-body () - "Decode HZ encoded text in the article body." - (if (string-match (concat "\\<\\(" rfc1843-newsgroups-regexp "\\)\\>") - (or gnus-newsgroup-name "")) - (save-excursion - (save-restriction - (message-narrow-to-head) - (let* ((inhibit-point-motion-hooks t) - (case-fold-search t) - (ct (message-fetch-field "Content-Type" t)) - (ctl (and ct (mail-header-parse-content-type ct)))) - (if (and ctl (not (string-match "/" (car ctl)))) - (setq ctl nil)) - (goto-char (point-max)) - (widen) - (forward-line 1) - (narrow-to-region (point) (point-max)) - (when (or (not ctl) - (equal (car ctl) "text/plain")) - (rfc1843-decode-region (point) (point-max)))))))) - -(defvar gnus-decode-header-methods) -(defvar gnus-decode-encoded-word-methods) - -(defun rfc1843-gnus-setup () - "Setup HZ decoding for Gnus." - (require 'gnus-art) - (require 'gnus-sum) - (add-hook 'gnus-article-decode-hook 'rfc1843-decode-article-body t) - (setq gnus-decode-encoded-word-function - 'gnus-multi-decode-encoded-word-string - gnus-decode-header-function - 'gnus-multi-decode-header - gnus-decode-encoded-word-methods - (nconc gnus-decode-encoded-word-methods - (list - (cons (concat "\\<\\(" rfc1843-newsgroups-regexp "\\)\\>") - 'rfc1843-decode-string))) - gnus-decode-header-methods - (nconc gnus-decode-header-methods - (list - (cons (concat "\\<\\(" rfc1843-newsgroups-regexp "\\)\\>") - 'rfc1843-decode-region))))) - (provide 'rfc1843) ;;; rfc1843.el ends here commit 6b1a86ff624ba69ec404312f145c63d2d59fd38c Author: Lars Ingebrigtsen Date: Tue Feb 23 14:05:18 2016 +1100 Don't use mm-util functions in qp.el * lisp/gnus/qp.el (quoted-printable-decode-region): Don't use mm-util functions. (quoted-printable-encode-string): Ditto. (quoted-printable-encode-region): Ditto. diff --git a/lisp/gnus/qp.el b/lisp/gnus/qp.el index 71e838a..a295e0c 100644 --- a/lisp/gnus/qp.el +++ b/lisp/gnus/qp.el @@ -27,9 +27,6 @@ ;;; Code: -(require 'mm-util) -(defvar mm-use-ultra-safe-encoding) - ;;;###autoload (defun quoted-printable-decode-region (from to &optional coding-system) "Decode quoted-printable in the region between FROM and TO, per RFC 2045. @@ -45,7 +42,8 @@ them into characters should be done separately." (interactive ;; Let the user determine the coding system with "C-x RET c". (list (region-beginning) (region-end) coding-system-for-read)) - (unless (mm-coding-system-p coding-system) ; e.g. `ascii' from Gnus + (when (and coding-system + (not (coding-system-p coding-system))) ; e.g. `ascii' from Gnus (setq coding-system nil)) (save-excursion (save-restriction @@ -94,7 +92,8 @@ them into characters should be done separately." If CODING-SYSTEM is non-nil, decode the string with coding-system. Use of CODING-SYSTEM is deprecated; this function should deal with raw bytes, and coding conversion should be done separately." - (mm-with-unibyte-buffer + (with-temp-buffer + (set-buffer-multibyte nil) (insert string) (quoted-printable-decode-region (point-min) (point-max) coding-system) (buffer-string))) @@ -138,17 +137,17 @@ encode lines starting with \"From\"." (prog1 (format "=%02X" (char-after)) (delete-char 1))))) - (let ((mm-use-ultra-safe-encoding + (let ((ultra (and (boundp 'mm-use-ultra-safe-encoding) mm-use-ultra-safe-encoding))) - (when (or fold mm-use-ultra-safe-encoding) + (when (or fold ultra) (let ((tab-width 1) ; HTAB is one character. (case-fold-search nil)) (goto-char (point-min)) (while (not (eobp)) ;; In ultra-safe mode, encode "From " at the beginning ;; of a line. - (when mm-use-ultra-safe-encoding + (when ultra (if (looking-at "From ") (replace-match "From=20" nil t) (if (looking-at "-") @@ -167,8 +166,8 @@ encode lines starting with \"From\"." "Encode the STRING as quoted-printable and return the result." (with-temp-buffer (if (multibyte-string-p string) - (mm-enable-multibyte) - (mm-disable-multibyte)) + (set-buffer-multibyte 'to) + (set-buffer-multibyte nil)) (insert string) (quoted-printable-encode-region (point-min) (point-max)) (buffer-string))) commit f956efb946220f274ec90ea89307dcd9653c9115 Author: Lars Ingebrigtsen Date: Tue Feb 23 13:59:54 2016 +1100 Don't require mm-util * lisp/gnus/ietf-drums.el (mm-util): Don't require. diff --git a/lisp/gnus/ietf-drums.el b/lisp/gnus/ietf-drums.el index d833366..03349d1 100644 --- a/lisp/gnus/ietf-drums.el +++ b/lisp/gnus/ietf-drums.el @@ -38,7 +38,6 @@ ;;; Code: (eval-when-compile (require 'cl)) -(require 'mm-util) (defvar ietf-drums-no-ws-ctl-token "\001-\010\013\014\016-\037\177" "US-ASCII control characters excluding CR, LF and white space.") commit 335c098a66f507ac6a6296e9daaa8ba6e7c1b0c0 Author: Lars Ingebrigtsen Date: Tue Feb 23 13:56:05 2016 +1100 Remove Gnus functions from auth-source.el * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): Remove usage of Gnus utility function. (mm-util, gnus-util): Don't require. diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index b9341f5..cfd21a5 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el @@ -40,8 +40,6 @@ ;;; Code: (require 'password-cache) -(require 'mm-util) -(require 'gnus-util) (eval-when-compile (require 'cl)) (require 'eieio) @@ -1088,12 +1086,10 @@ Note that the MAX parameter is used so we can exit the parse early." (when (setq item2 (auth-source-netrc-parse-one)) ;; Did we get a "machine" value? (if (equal item2 "machine") - (progn - (gnus-error 1 - "%s: Unexpected `machine' token at line %d" - "auth-source-netrc-parse-entries" - (auth-source-current-line)) - (forward-line 1)) + (error + "%s: Unexpected `machine' token at line %d" + "auth-source-netrc-parse-entries" + (auth-source-current-line)) (push (cons item item2) alist))))) ;; Clean up: if there's an entry left over, use it. commit dfcdc1cbed773041e907a389b8901ca845af49bb Author: Lars Ingebrigtsen Date: Tue Feb 23 12:51:24 2016 +1100 Allow deleting all non-matching cookies * lisp/url/url-cookie.el (url-cookie-delete-cookies): Allow keeping matching cookies (bug#22720). diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el index a4b7a58..6848230 100644 --- a/lisp/url/url-cookie.el +++ b/lisp/url/url-cookie.el @@ -353,14 +353,19 @@ to run the `url-cookie-setup-save-timer' function manually." url-cookie-save-interval #'url-cookie-write-file)))) -(defun url-cookie-delete-cookies (&optional regexp) +(defun url-cookie-delete-cookies (&optional regexp keep) "Delete all cookies from the cookie store where the domain matches REGEXP. -If REGEXP is nil, all cookies are deleted." +If REGEXP is nil, all cookies are deleted. If KEEP is non-nil, +instead delete all cookies that do not match REGEXP." (dolist (variable '(url-cookie-secure-storage url-cookie-storage)) (let ((cookies (symbol-value variable))) (dolist (elem cookies) - (when (or (null regexp) - (string-match regexp (car elem))) + (when (or (and (null keep) + (or (null regexp) + (string-match regexp (car elem)))) + (and keep + regexp + (not (string-match regexp (car elem))))) (setq cookies (delq elem cookies)))) (set variable cookies))) (setq url-cookies-changed-since-last-save t) commit ad1879b7be9f641250e7616d4630eb29a3fa6a52 Author: Lars Ingebrigtsen Date: Tue Feb 23 12:26:30 2016 +1100 Make (setf (image-property ...)) return VALUE * lisp/image.el (image--set-property): Return VALUE, not IMAGE. diff --git a/lisp/image.el b/lisp/image.el index 96afa98..2ae642a 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -448,7 +448,7 @@ Internal use only." (setq image (cddr image)))) ;; Just enter the new value. (plist-put (cdr image) property value)) - image) + value) (defun image-property (image property) "Return the value of PROPERTY in IMAGE. commit 81ef756e6aea369ec78f19b3609f01ceddc5851f Merge: 23d463d a9c48d5 Author: John Wiegley Date: Mon Feb 22 11:33:54 2016 -0800 Merge from origin/emacs-25 a9c48d5 Additional fixes for file notification 6bd9d69 Fix documentation of 'global-disable-point-adjustment' 8c22ac9 ; Spelling fix 2975784 Set file modes of pinentry socket for extra safety 2667b3e Clarify GnuPG version compatibility chapter 5e34c36 Revert "Change the default socket location for pinentry" e19c1c3 Kill off xref--display-history 5698947 Keep the xref buffer visible until the user quits it explicitly e34fbde Change the default socket location for pinentry 5f89658 Mention how to enable pinentry feature db51224 Sync with gnulib aa5a794 Remove `semanticdb-save-all-db-idle' from `auto-save-hook' 2d8b2fd Restore point when writing semantic table to disk 27d3430 Mention pinentry.el in epa manual 5baa001 Fix Bug#22736 7261355 Grammar fix in doc string d0f3b18 Naming fix for consistency 74ec92d Prefer customized value for GnuPG executable ea0b604 Fix memory reservation on MS-Windows c5f72aa Update NextStep readme and add wish list. 6de26a7 Report also result in `file-notify--test-event-handler' 5d17ae7 Improve file-notify-test08-watched-file-in-watched-dir 1cb1268 Fix todo-mode item date editing bugs 1e996cf Fix "[:upper:]" for non-ASCII characters 896f993 Allow customising the article mode cursor behavior 24c1c1d Use pop-to-buffer-same-window in woman.el 2a75f64 New filenotify test for bug#22736 c9bccf7 Report critical battery errors d675db9 Make eww message toggling message clearer 5e0bb40 * lisp/calc/calc-units.el (math-standard-units): Update to 2014 CODATA adjustment. fa8fd65 ; Improve character-folding entries in NEWS 3722a69 Fix bugs in window resizing code 289d5c6 Fix decoding DOS EOL in a unibyte buffer 2abcb06 Correct c-parse-state cache manipulation error. 14aec91 Take advantage of new GnuPG version check function e80c2a7 Make GnuPG version check robuster 15a9464 Fix x-load-color-file pointer signedness 132dbf0 * lisp/time-stamp.el (time-stamp-time-zone): Fix doc string punct. 78ab6f1 Follow convention for greek letter constants. 106b5bb Add Stefan-Boltzmann constant to calc units table. b96baa8 * lisp/calc/calc-units.el (math-build-units-table-buffer): Use special-mode. 5f91cf9 Avoid loading cl-lib for term/xterm.elc, eg in -Q -nw. (Bug#22669) 2d40f7d Fix soffice UserInstallation-URL for Windows b1a3ebe Fix display of
 elements
    57d0e3d ; * lisp/help-fns.el: Remove outdated comment.
    7a0628d ; * admin/make-tarball.txt: Mention cleaning.

commit a9c48d5c9e3cb5952aab1c6e8821677d49068a74
Author: Michael Albinus 
Date:   Mon Feb 22 18:52:37 2016 +0100

    Additional fixes for file notification
    
    * lisp/filenotify.el (top): Require 'cl when compiling.
    (file-notify--event-watched-file): New defun.
    (file-notify--rm-descriptor, file-notify-callback):
    Handle case of several monitors running in parallel.
    
    * test/automated/file-notify-tests.el
    (file-notify--test-event-test): Simplify test.
    (file-notify--test-with-events): Get rid of outer definition.
    Check also results of tests performed in callbacks.
    (file-notify-test02-events): No wrapping when calling
    `file-notify-rm-watch'.  No special checking for callback tests.
    (file-notify-test07-backup): Adapt expected events for gfilenotify.
    (file-notify-test08-watched-file-in-watched-dir): Improve.

diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index ba76bac..21046a8 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -27,6 +27,9 @@
 
 ;;; Code:
 
+(eval-when-compile
+  (require 'cl))
+
 (defconst file-notify--library
   (cond
    ((featurep 'inotify) 'inotify)
@@ -54,18 +57,15 @@ different files from the same directory are watched.")
 DESCRIPTOR should be an object returned by `file-notify-add-watch'.
 If it is registered in `file-notify-descriptors', a stopped event is sent."
   (let* ((desc (if (consp descriptor) (car descriptor) descriptor))
-	 (file (if (consp descriptor) (cdr descriptor)))
          (registered (gethash desc file-notify-descriptors))
+	 (file (if (consp descriptor) (cdr descriptor) (caadr registered)))
 	 (dir (car registered)))
 
     (when (consp registered)
       ;; Send `stopped' event.
-      (dolist (entry (cdr registered))
-	(funcall (cdr entry)
-		 `(,descriptor stopped
-		   ,(or (and (stringp (car entry))
-			     (expand-file-name (car entry) dir))
-			dir))))
+      (funcall
+       (cdr (assoc file (cdr registered)))
+       `(,descriptor stopped ,(if file (expand-file-name file dir) dir)))
 
       ;; Modify `file-notify-descriptors'.
       (if (not file)
@@ -99,6 +99,15 @@ Otherwise, signal a `file-notify-error'."
   "A pending file notification events for a future `renamed' action.
 It is a form ((DESCRIPTOR ACTION FILE [FILE1-OR-COOKIE]) CALLBACK).")
 
+(defun file-notify--event-watched-file (event)
+  "Return file or directory being watched.
+Could be different from the directory watched by the backend library."
+  (let* ((desc (if (consp (car event)) (caar event) (car event)))
+         (registered (gethash desc file-notify-descriptors))
+	 (file (if (consp (car event)) (cdar event) (caadr registered)))
+	 (dir (car registered)))
+    (if file (expand-file-name file dir) dir)))
+
 (defun file-notify--event-file-name (event)
   "Return file name of file notification event, or nil."
   (directory-file-name
@@ -234,26 +243,6 @@ EVENT is the cadr of the event in `file-notify-handle-event'
           (funcall (cadr pending-event) (car pending-event))
           (setq pending-event nil))
 
-        ;; Check for stopped.
-        (setq
-         stopped
-         (or
-          stopped
-          (and
-           (memq action '(deleted renamed))
-           (= (length (cdr registered)) 1)
-           ;; Not, when a file is backed up.
-           (not (and (stringp file1) (backup-file-name-p file1)))
-           (or
-            ;; Watched file or directory is concerned.
-            (string-equal
-             (file-name-nondirectory file)
-	     (file-name-nondirectory (car registered)))
-            ;; File inside a watched directory is concerned.
-            (string-equal
-             (file-name-nondirectory file)
-             (car (cadr registered)))))))
-
 	;; Apply callback.
 	(when (and action
 		   (or
@@ -282,11 +271,15 @@ EVENT is the cadr of the event in `file-notify-handle-event'
                  ,action ,file ,file1))
 	    (funcall
 	     callback
-	     `(,(file-notify--descriptor desc (car entry)) ,action ,file)))))
-
-      ;; Modify `file-notify-descriptors'.
-      (when stopped
-        (file-notify-rm-watch (file-notify--descriptor desc file))))))
+	     `(,(file-notify--descriptor desc (car entry)) ,action ,file))))
+
+        ;; Send `stopped' event.
+        (when (and (memq action '(deleted renamed))
+                   ;; Not, when a file is backed up.
+                   (not (and (stringp file1) (backup-file-name-p file1)))
+                   ;; Watched file or directory is concerned.
+                   (string-equal file (file-notify--event-watched-file event)))
+          (file-notify-rm-watch (file-notify--descriptor desc (car entry))))))))
 
 ;; `kqueue', `gfilenotify' and `w32notify' return a unique descriptor
 ;; for every `file-notify-add-watch', while `inotify' returns a unique
diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el
index ac33d68..a16de7f 100644
--- a/test/automated/file-notify-tests.el
+++ b/test/automated/file-notify-tests.el
@@ -256,19 +256,15 @@ is bound somewhere."
   (should (equal (car file-notify--test-event) file-notify--test-desc))
   ;; Check the file name.
   (should
-   (or (string-equal (file-notify--event-file-name file-notify--test-event)
-		     file-notify--test-tmpfile)
-       (string-equal (file-notify--event-file-name file-notify--test-event)
-		     file-notify--test-tmpfile1)
-       (string-equal (file-notify--event-file-name file-notify--test-event)
-		     temporary-file-directory)))
+   (string-prefix-p
+    (file-notify--event-watched-file file-notify--test-event)
+    (file-notify--event-file-name file-notify--test-event)))
   ;; Check the second file name if exists.
   (when (eq (nth 1 file-notify--test-event) 'renamed)
     (should
-     (or (string-equal (file-notify--event-file1-name file-notify--test-event)
-		       file-notify--test-tmpfile1)
-	 (string-equal (file-notify--event-file1-name file-notify--test-event)
-		       temporary-file-directory)))))
+     (string-prefix-p
+      (file-notify--event-watched-file file-notify--test-event)
+      (file-notify--event-file1-name file-notify--test-event)))))
 
 (defun file-notify--test-event-handler (event)
   "Run a test over FILE-NOTIFY--TEST-EVENT.
@@ -326,25 +322,28 @@ EVENTS is either a simple list of events, or a list of lists of
 events, which represent different possible results.  Don't wait
 longer than timeout seconds for the events to be delivered."
   (declare (indent 1))
-  (let ((outer (make-symbol "outer")))
-    `(let* ((,outer file-notify--test-events)
-            (events (if (consp (car ,events)) ,events (list ,events)))
-            (max-length (apply 'max (mapcar 'length events)))
-            create-lockfiles)
-       ;; Flush pending events.
-       (file-notify--wait-for-events
-        (file-notify--test-timeout)
-        (input-pending-p))
-       (let (file-notify--test-events)
-         ,@body
-         (file-notify--wait-for-events
-          ;; More events need more time.  Use some fudge factor.
-          (* (ceiling max-length 100) (file-notify--test-timeout))
-          (= max-length (length file-notify--test-events)))
-         ;; One of the possible results shall match.
-         (should (file-notify--test-with-events-check events))
-         (setq ,outer (append ,outer file-notify--test-events)))
-       (setq file-notify--test-events ,outer))))
+  `(let* ((events (if (consp (car ,events)) ,events (list ,events)))
+          (max-length (apply 'max (mapcar 'length events)))
+          create-lockfiles)
+     ;; Flush pending events.
+     (file-notify--wait-for-events
+      (file-notify--test-timeout)
+      (input-pending-p))
+     (setq file-notify--test-events nil
+           file-notify--test-results nil)
+     ,@body
+     (file-notify--wait-for-events
+      ;; More events need more time.  Use some fudge factor.
+      (* (ceiling max-length 100) (file-notify--test-timeout))
+      (= max-length (length file-notify--test-events)))
+     ;; Check the result sequence just to make sure that all events
+     ;; are as expected.
+     (dolist (result file-notify--test-results)
+       (when (ert-test-failed-p result)
+         (ert-fail
+          (cadr (ert-test-result-with-condition-condition result)))))
+     ;; One of the possible event sequences shall match.
+     (should (file-notify--test-with-events-check events))))
 
 (ert-deftest file-notify-test02-events ()
   "Check file creation/change/removal notifications."
@@ -373,9 +372,7 @@ longer than timeout seconds for the events to be delivered."
              "another text" nil file-notify--test-tmpfile nil 'no-message)
             (read-event nil nil file-notify--test-read-event-timeout)
             (delete-file file-notify--test-tmpfile))
-          ;; `file-notify-rm-watch' fires the `stopped' event.  Suppress it.
-          (let (file-notify--test-events)
-            (file-notify-rm-watch file-notify--test-desc)))
+          (file-notify-rm-watch file-notify--test-desc))
 
         ;; Check file change and deletion.
 	(setq file-notify--test-tmpfile (file-notify--test-make-temp-name))
@@ -405,9 +402,7 @@ longer than timeout seconds for the events to be delivered."
            "another text" nil file-notify--test-tmpfile nil 'no-message)
           (read-event nil nil file-notify--test-read-event-timeout)
           (delete-file file-notify--test-tmpfile))
-	;; `file-notify-rm-watch' fires the `stopped' event.  Suppress it.
-	(let (file-notify--test-events)
-	  (file-notify-rm-watch file-notify--test-desc))
+        (file-notify-rm-watch file-notify--test-desc)
 
         ;; Check file creation, change and deletion when watching a
         ;; directory.  There must be a `stopped' event when deleting
@@ -439,9 +434,7 @@ longer than timeout seconds for the events to be delivered."
 	     "any text" nil file-notify--test-tmpfile nil 'no-message)
 	    (read-event nil nil file-notify--test-read-event-timeout)
 	    (delete-directory temporary-file-directory 'recursive))
-	  ;; `file-notify-rm-watch' fires the `stopped' event.  Suppress it.
-	  (let (file-notify--test-events)
-	    (file-notify-rm-watch file-notify--test-desc)))
+          (file-notify-rm-watch file-notify--test-desc))
 
         ;; Check copy of files inside a directory.
 	(let ((temporary-file-directory
@@ -481,9 +474,7 @@ longer than timeout seconds for the events to be delivered."
 	    (set-file-times file-notify--test-tmpfile '(0 0))
 	    (read-event nil nil file-notify--test-read-event-timeout)
 	    (delete-directory temporary-file-directory 'recursive))
-	  ;; `file-notify-rm-watch' fires the `stopped' event.  Suppress it.
-	  (let (file-notify--test-events)
-	    (file-notify-rm-watch file-notify--test-desc)))
+          (file-notify-rm-watch file-notify--test-desc))
 
         ;; Check rename of files inside a directory.
 	(let ((temporary-file-directory
@@ -517,9 +508,7 @@ longer than timeout seconds for the events to be delivered."
 	    ;; After the rename, we won't get events anymore.
 	    (read-event nil nil file-notify--test-read-event-timeout)
 	    (delete-directory temporary-file-directory 'recursive))
-	  ;; `file-notify-rm-watch' fires the `stopped' event.  Suppress it.
-	  (let (file-notify--test-events)
-	    (file-notify-rm-watch file-notify--test-desc)))
+          (file-notify-rm-watch file-notify--test-desc))
 
         ;; Check attribute change.  Does not work for cygwin.
 	(unless (eq system-type 'cygwin)
@@ -552,17 +541,7 @@ longer than timeout seconds for the events to be delivered."
 	    (set-file-times file-notify--test-tmpfile '(0 0))
 	    (read-event nil nil file-notify--test-read-event-timeout)
 	    (delete-file file-notify--test-tmpfile))
-	  ;; `file-notify-rm-watch' fires the `stopped' event.  Suppress it.
-	  (let (file-notify--test-events)
-	    (file-notify-rm-watch file-notify--test-desc)))
-
-        ;; Check the global sequence just to make sure that all
-        ;; results are as expected.
-        (should file-notify--test-results)
-        (dolist (result file-notify--test-results)
-          (when (ert-test-failed-p result)
-            (ert-fail
-             (cadr (ert-test-result-with-condition-condition result))))))
+          (file-notify-rm-watch file-notify--test-desc)))
 
     ;; Cleanup.
     (file-notify--test-cleanup)))
@@ -832,7 +811,7 @@ longer than timeout seconds for the events to be delivered."
         (dotimes (i n)
 	  ;; It matters which direction we rename, at least for
 	  ;; kqueue.  This backend parses directories in alphabetic
-	  ;; order (x%d before y%d).  So we rename both directions.
+	  ;; order (x%d before y%d).  So we rename into both directions.
 	  (if (zerop (mod i 2))
 	      (progn
 		(push (expand-file-name (format "x%d" i)) source-file-list)
@@ -892,6 +871,11 @@ longer than timeout seconds for the events to be delivered."
              ((or (string-equal (file-notify--test-library) "w32notify")
                   (file-remote-p temporary-file-directory))
               '(changed changed))
+             ;; gfilenotify raises one or two `changed' events
+             ;; randomly, no chance to test.  So we accept both cases.
+             ((string-equal "gfilenotify" (file-notify--test-library))
+              '((changed)
+                (changed changed)))
              (t '(changed)))
           ;; There shouldn't be any problem, because the file is kept.
           (with-temp-buffer
@@ -955,52 +939,116 @@ the file watch."
   :tags '(:expensive-test)
   (skip-unless (file-notify--test-local-enabled))
 
+  ;; A directory to be watched.
+  (should
+   (setq file-notify--test-tmpfile
+         (make-temp-file "file-notify-test-parent" t)))
+  ;; A file to be watched.
+  (should
+   (setq file-notify--test-tmpfile1
+         (let ((temporary-file-directory file-notify--test-tmpfile))
+           (file-notify--test-make-temp-name))))
+  (write-region "any text" nil file-notify--test-tmpfile1 nil 'no-message)
   (unwind-protect
-      (progn
-        (setq file-notify--test-tmpfile
-              (make-temp-file "dir" t))
-        (setq file-notify--test-tmpfile1
-              (let ((temporary-file-directory file-notify--test-tmpfile))
-                (make-temp-file "file")))
-	(cl-flet ((dir-callback (event)
-                   (let ((file-notify--test-desc file-notify--test-desc1)
-                         (file-notify--test-tmpfile
-                          (file-notify--event-file-name event)))
-                     (file-notify--test-event-handler event)))
-                  (file-callback (event)
-                   (let ((file-notify--test-desc file-notify--test-desc2))
-                     (file-notify--test-event-handler event))))
-          (should
-           (setq file-notify--test-desc1
-                 (file-notify-add-watch
-                  file-notify--test-tmpfile
-                  '(change attribute-change) #'dir-callback)))
-          (should
-           (setq file-notify--test-desc2
-                 (file-notify-add-watch
-                  file-notify--test-tmpfile1
-                  '(change attribute-change) #'file-callback)))
-          (should (file-notify-valid-p file-notify--test-desc1))
-          (should (file-notify-valid-p file-notify--test-desc2))
-          (dotimes (i 100)
-            (read-event nil nil file-notify--test-read-event-timeout)
-            (if (< 0 (random))
-                (write-region
-                 "any text" nil file-notify--test-tmpfile1 t 'no-message)
-              (let ((temporary-file-directory file-notify--test-tmpfile))
-                (make-temp-file "fileX"))))
-          (should (file-notify-valid-p file-notify--test-desc1))
-          (should (file-notify-valid-p file-notify--test-desc2))
-          (delete-file file-notify--test-tmpfile1)
-          (delete-directory file-notify--test-tmpfile 'recursive))
+      (cl-flet (;; Directory monitor.
+                (dir-callback (event)
+                 (let ((file-notify--test-desc file-notify--test-desc1))
+                   (file-notify--test-event-handler event)))
+                ;; File monitor.
+                (file-callback (event)
+                 (let ((file-notify--test-desc file-notify--test-desc2))
+                   (file-notify--test-event-handler event))))
+        (should
+         (setq file-notify--test-desc1
+               (file-notify-add-watch
+                file-notify--test-tmpfile
+                '(change) #'dir-callback)))
+        (should
+         (setq file-notify--test-desc2
+               (file-notify-add-watch
+                file-notify--test-tmpfile1
+                '(change) #'file-callback)))
+        (should (file-notify-valid-p file-notify--test-desc1))
+        (should (file-notify-valid-p file-notify--test-desc2))
+        (should-not (equal file-notify--test-desc1 file-notify--test-desc2))
+        ;; gfilenotify raises one or two `changed' events randomly in
+        ;; the file monitor, no chance to test.
+        (unless (string-equal "gfilenotify" (file-notify--test-library))
+          (let ((n 100) events)
+            ;; Compute the expected events.
+            (dotimes (_i (/ n 2))
+              (setq events
+                    (append
+                     (append
+                      ;; Directory monitor and file monitor.
+                      (cond
+                       ;; In the remote case, there are two `changed'
+                       ;; events.
+		       ((file-remote-p temporary-file-directory)
+                        '(changed changed changed changed))
+                       ;; The directory monitor in kqueue does not
+                       ;; raise any `changed' event.  Just the file
+                       ;; monitor event is received.
+                       ((string-equal (file-notify--test-library) "kqueue")
+                        '(changed))
+                       ;; Otherwise, both monitors report the
+                       ;; `changed' event.
+                       (t '(changed changed)))
+                      ;; Just the directory monitor.
+                      (cond
+                       ;; In kqueue, there is an additional `changed'
+                       ;; event.  Why?
+                       ((string-equal (file-notify--test-library) "kqueue")
+                        '(changed created changed))
+                       (t '(created changed))))
+                     events)))
+
+            ;; Run the test.
+            (file-notify--test-with-events events
+              (dotimes (i n)
+                (read-event nil nil file-notify--test-read-event-timeout)
+                (if (zerop (mod i 2))
+                    (write-region
+                     "any text" nil file-notify--test-tmpfile1 t 'no-message)
+                  (let ((temporary-file-directory file-notify--test-tmpfile))
+                    (write-region
+                     "any text" nil
+                     (file-notify--test-make-temp-name) nil 'no-message)))))))
+
+        ;; If we delete the file, the directory monitor shall still be
+        ;; active.  We receive the `deleted' event from both the
+        ;; directory and the file monitor.  The `stopped' event is
+        ;; from the file monitor.  It's undecided in which order the
+        ;; the directory and the file monitor are triggered.
+        (file-notify--test-with-events
+            '((deleted deleted stopped)
+              (deleted stopped deleted))
+          (delete-file file-notify--test-tmpfile1))
+        (should (file-notify-valid-p file-notify--test-desc1))
+        (should-not (file-notify-valid-p file-notify--test-desc2))
 
-        ;; Check the global sequence just to make sure that all
-        ;; results are as expected.
-        (should file-notify--test-results)
-        (dolist (result file-notify--test-results)
-          (when (ert-test-failed-p result)
-            (ert-fail
-             (cadr (ert-test-result-with-condition-condition result))))))
+        ;; Now we delete the directory.
+        (file-notify--test-with-events
+            (cond
+             ;; In kqueue, just one `deleted' event for the directory
+             ;; is received.
+             ((string-equal (file-notify--test-library) "kqueue")
+              '(deleted stopped))
+             (t (append
+                 ;; The directory monitor raises a `deleted' event for
+                 ;; every file contained in the directory, we must
+                 ;; count them.
+                 (make-list
+                  (length
+                   (directory-files
+                    file-notify--test-tmpfile nil
+                    directory-files-no-dot-files-regexp 'nosort))
+                  'deleted)
+                 ;; The events of the directory itself.
+                 '(deleted stopped))))
+          (delete-directory file-notify--test-tmpfile 'recursive))
+        (should-not (file-notify-valid-p file-notify--test-desc1))
+        (should-not (file-notify-valid-p file-notify--test-desc2)))
 
     ;; Cleanup.
     (file-notify--test-cleanup)))

commit 6bd9d697fd6d81726fa684fa86ef7369a1ef93de
Author: Eli Zaretskii 
Date:   Mon Feb 22 19:30:01 2016 +0200

    Fix documentation of 'global-disable-point-adjustment'
    
    * src/keyboard.c (syms_of_keyboard) 
    : Doc fixes.  (Bug#22771)

diff --git a/src/keyboard.c b/src/keyboard.c
index 4edb5aa..3120869 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -11620,10 +11620,10 @@ It's called with one argument, the help string to display.  */);
   DEFVAR_LISP ("disable-point-adjustment", Vdisable_point_adjustment,
 	       doc: /* If non-nil, suppress point adjustment after executing a command.
 
-After a command is executed, if point is moved into a region that has
-special properties (e.g. composition, display), we adjust point to
-the boundary of the region.  But, when a command sets this variable to
-non-nil, we suppress the point adjustment.
+After a command is executed, if point moved into a region that has
+special properties (e.g. composition, display), Emacs adjusts point to
+the boundary of the region.  But when a command binds this variable to
+non-nil, this point adjustment is suppressed.
 
 This variable is set to nil before reading a command, and is checked
 just after executing the command.  */);
@@ -11631,9 +11631,9 @@ just after executing the command.  */);
 
   DEFVAR_LISP ("global-disable-point-adjustment",
 	       Vglobal_disable_point_adjustment,
-	       doc: /* If non-nil, always suppress point adjustment.
+	       doc: /* If non-nil, always suppress point adjustments.
 
-The default value is nil, in which case, point adjustment are
+The default value is nil, in which case point adjustments are
 suppressed only after special commands that set
 `disable-point-adjustment' (which see) to non-nil.  */);
   Vglobal_disable_point_adjustment = Qnil;

commit 8c22ac9115a20e84f38a0b6e262756f43ea72f05
Author: Paul Eggert 
Date:   Mon Feb 22 07:44:01 2016 -0800

    ; Spelling fix

diff --git a/nextstep/WISHLIST b/nextstep/WISHLIST
index 673f091..1c4b9e2 100644
--- a/nextstep/WISHLIST
+++ b/nextstep/WISHLIST
@@ -227,7 +227,7 @@ errors.
 
 *** Anders frame test
 
-Anders Lindgren  has implmented some (very basic)
+Anders Lindgren  has implemented some (very basic)
 tests for full screen, toolbar, and auto-hiding the menu bar.
 
 ** Make sure all build variants work

commit 23d463d40cca1b68ef4f74a303b748e0649c506c
Author: Oleh Krehel 
Date:   Mon Feb 22 14:43:23 2016 +0100

    lisp/calendar/appt.el (appt-delete-window): Check if buffer is live
    
    * lisp/calendar/appt.el (appt-delete-window): Avoid trying to delete a
      non-existing buffer.

diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el
index fff63d3..36ebd2d 100644
--- a/lisp/calendar/appt.el
+++ b/lisp/calendar/appt.el
@@ -482,7 +482,9 @@ Usually just deletes the appointment buffer."
     (and window
          (or (eq window (frame-root-window (window-frame window)))
              (delete-window window))))
-  (kill-buffer appt-buffer-name)
+  (let ((buffer (get-buffer appt-buffer-name)))
+    (when buffer
+      (kill-buffer buffer)))
   (if appt-audible
       (beep 1)))
 

commit 29757844e578706b23baaf361336629a8f10ed15
Author: Daiki Ueno 
Date:   Mon Feb 22 11:28:11 2016 +0900

    Set file modes of pinentry socket for extra safety
    
    * lisp/net/pinentry.el: Require 'cl-lib for `cl-letf'.
    (pinentry-start): Change the file modes of the socket file to 0700.
    This is just for extra safety since the parent directory is already
    protected with `server-ensure-safe-dir'.

diff --git a/lisp/net/pinentry.el b/lisp/net/pinentry.el
index 285f864..082a9c8 100644
--- a/lisp/net/pinentry.el
+++ b/lisp/net/pinentry.el
@@ -49,6 +49,8 @@
 
 ;;; Code:
 
+(eval-when-compile (require 'cl-lib))
+
 (defgroup pinentry nil
   "The Pinentry server"
   :version "25.1"
@@ -172,17 +174,18 @@ will not be shown."
       (ignore-errors
         (let (delete-by-moving-to-trash)
           (delete-file server-file)))
-      (setq pinentry--server-process
-            (make-network-process
-             :name "pinentry"
-             :server t
-             :noquery t
-             :sentinel #'pinentry--process-sentinel
-             :filter #'pinentry--process-filter
-             :coding 'no-conversion
-             :family 'local
-             :service server-file))
-      (process-put pinentry--server-process :server-file server-file))))
+      (cl-letf (((default-file-modes) ?\700))
+        (setq pinentry--server-process
+              (make-network-process
+               :name "pinentry"
+               :server t
+               :noquery t
+               :sentinel #'pinentry--process-sentinel
+               :filter #'pinentry--process-filter
+               :coding 'no-conversion
+               :family 'local
+               :service server-file))
+        (process-put pinentry--server-process :server-file server-file)))))
 
 (defun pinentry-stop ()
   "Stop a Pinentry service."

commit 2667b3ebaee4c7d136e8320d859c7385c7ff88e5
Author: Daiki Ueno 
Date:   Mon Feb 22 10:40:42 2016 +0900

    Clarify GnuPG version compatibility chapter
    
    * doc/misc/epa.texi (GnuPG version compatibility): Make the gpg-agent
    description a bit clearer.

diff --git a/doc/misc/epa.texi b/doc/misc/epa.texi
index 4b7b118..cb177c4 100644
--- a/doc/misc/epa.texi
+++ b/doc/misc/epa.texi
@@ -441,26 +441,30 @@ The default value is @code{t}.
 @chapter GnuPG version compatibility
 
 As of February 2016, there are three active branches of GnuPG: 2.1,
-2.0, and 1.4.  All those branches should work flawlessly with Emacs,
+2.0, and 1.4.  All those branches should work flawlessly with Emacs
 with basic use-cases.  They have, however, some incompatible
 characteristics, which might be visible when used from Emacs.
 
 @itemize
 @item
-The key store format used by 2.1 is incompatible with 1.4.  That
-means, a key created with 2.1 might not be visible with 1.4.
+The key store format used by GnuPG 2.1 is incompatible with 1.4.  That
+means, a key created with GnuPG 2.1 is not visible with 1.4.
 
 @item
-2.1 uses a fixed Unix domain socket for gpg-agent, and ignores the
-@code{GPG_AGENT_INFO} environment variable, used by 2.0 and 1.4.
+GnuPG 2.1 uses a fixed address for the Unix domain socket used to
+communicate with gpg-agent.  The @code{GPG_AGENT_INFO} environment
+variable, which is used by GnuPG 2.0 and 1.4, is ignored.  That means,
+if your system has both GnuPG 2.1 and 1.4, the gpg command from GnuPG
+1.4 is not able to use gpg-agent provided by 2.1 (at least out of box).q
 
 @item
-2.1 (2.1.5 or later) has a mechanism to direct the Pinentry password
-prompt to the Emacs minibuffer@footnote{To enable this feature, add
-@samp{allow-emacs-pinentry} to @file{~/.gnupg/gpg-agent.conf} and let
-gpg-agent reload the configuration, with: @samp{gpgconf --reload gpg-agent}},
-which would be useful when you use Emacs remotely or from a text-only
-terminal.  That feature is not available in other versions, and more
+GnuPG 2.1 (2.1.5 or later) has a mechanism to direct the Pinentry
+password prompt to the Emacs minibuffer@footnote{To enable this
+feature, add @samp{allow-emacs-pinentry} to
+@file{~/.gnupg/gpg-agent.conf} and let gpg-agent reload the
+configuration, with: @samp{gpgconf --reload gpg-agent}}, which would
+be useful when you use Emacs remotely or from a text-only terminal.
+That feature is not available in other versions, and more
 specifically, with 2.0 (as of 2.0.29), there is no way to avoid the
 graphical prompt.
 @end itemize

commit 5e34c3671a657ee4b0355d062e1412f1f009dbd0
Author: Daiki Ueno 
Date:   Mon Feb 22 10:45:53 2016 +0900

    Revert "Change the default socket location for pinentry"
    
    This reverts commit e34fbdee8aca84b98393b06b2450837d175999ca.
    It turned out that the address is fixed in Pinentry itself.

diff --git a/lisp/net/pinentry.el b/lisp/net/pinentry.el
index f83b073..285f864 100644
--- a/lisp/net/pinentry.el
+++ b/lisp/net/pinentry.el
@@ -26,9 +26,6 @@
 ;; This package allows GnuPG passphrase to be prompted through the
 ;; minibuffer instead of graphical dialog.
 ;;
-;; This feature requires GnuPG 2.1.5 or later and Pinentry 0.9.5 or
-;; later, with the Emacs support compiled in.
-;;
 ;; To use, add "allow-emacs-pinentry" to "~/.gnupg/gpg-agent.conf",
 ;; reload the configuration with "gpgconf --reload gpg-agent", and
 ;; start the server with M-x pinentry-start.
@@ -41,15 +38,17 @@
 ;; where pinentry and Emacs communicate through a Unix domain socket
 ;; created at:
 ;;
-;;   ~/.emacs.d/pinentry/pinentry
+;;   ${TMPDIR-/tmp}/emacs$(id -u)/pinentry
+;;
+;; under the same directory which server.el uses.  The protocol is a
+;; subset of the Pinentry Assuan protocol described in (info
+;; "(pinentry) Protocol").
 ;;
-;; The protocol is a subset of the Pinentry Assuan protocol described
-;; in (info "(pinentry) Protocol").
+;; NOTE: As of August 2015, this feature requires newer versions of
+;; GnuPG (2.1.5+) and Pinentry (0.9.5+).
 
 ;;; Code:
 
-(eval-when-compile (require 'cl-lib))
-
 (defgroup pinentry nil
   "The Pinentry server"
   :version "25.1"
@@ -77,7 +76,10 @@
 
 (defvar pinentry--prompt-buffer nil)
 
-(defvar pinentry--socket-dir (locate-user-emacs-file "pinentry")
+;; We use the same location as `server-socket-dir', when local sockets
+;; are supported.
+(defvar pinentry--socket-dir
+  (format "%s/emacs%d" (or (getenv "TMPDIR") "/tmp") (user-uid))
   "The directory in which to place the server socket.
 If local sockets are not supported, this is nil.")
 
@@ -170,17 +172,16 @@ will not be shown."
       (ignore-errors
         (let (delete-by-moving-to-trash)
           (delete-file server-file)))
-      (cl-letf (((default-file-modes) ?\700))
-        (setq pinentry--server-process
-              (make-network-process
-               :name "pinentry"
-               :server t
-               :noquery t
-               :sentinel #'pinentry--process-sentinel
-               :filter #'pinentry--process-filter
-               :coding 'no-conversion
-               :family 'local
-               :service server-file)))
+      (setq pinentry--server-process
+            (make-network-process
+             :name "pinentry"
+             :server t
+             :noquery t
+             :sentinel #'pinentry--process-sentinel
+             :filter #'pinentry--process-filter
+             :coding 'no-conversion
+             :family 'local
+             :service server-file))
       (process-put pinentry--server-process :server-file server-file))))
 
 (defun pinentry-stop ()

commit e19c1c301700430ae428f40c2a364671f5d50dcf
Author: Dmitry Gutov 
Date:   Mon Feb 22 00:40:53 2016 +0200

    Kill off xref--display-history
    
    Now that the core workflow keeps the xref window visible, there's
    less value in storing this history.  And it never was
    comprehensive enough to undo scrolling changes.
    * lisp/progmodes/xref.el (xref--display-history)
    (xref--save-to-history, xref-quit): Remove.
    (xref--show-pos-in-buf): Update accordingly.
    (xref--xref-buffer-mode-map): Remove xref-quit binding.

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 31a03d9..f983525 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -437,16 +437,6 @@ If SELECT is non-nil, select the target window."
 
 ;; The xref buffer is used to display a set of xrefs.
 
-(defvar-local xref--display-history nil
-  "List of pairs (BUFFER . WINDOW), for temporarily displayed buffers.")
-
-(defun xref--save-to-history (buf win)
-  (let ((restore (window-parameter win 'quit-restore)))
-    ;; Save the new entry if the window displayed another buffer
-    ;; previously.
-    (when (and restore (not (eq (car restore) 'same)))
-      (push (cons buf win) xref--display-history))))
-
 (defmacro xref--with-dedicated-window (&rest body)
   `(let* ((xref-w (get-buffer-window xref-buffer-name))
           (xref-w-dedicated (window-dedicated-p xref-w)))
@@ -469,8 +459,7 @@ If SELECT is non-nil, select the target window."
       (let ((buf (current-buffer)))
         (setq win (selected-window))
         (with-current-buffer xref-buf
-          (setq-local other-window-scroll-buffer buf)
-          (xref--save-to-history buf win))))
+          (setq-local other-window-scroll-buffer buf))))
     (when select
       (select-window win))))
 
@@ -606,7 +595,6 @@ references displayed in the current *xref* buffer."
 
 (defvar xref--xref-buffer-mode-map
   (let ((map (make-sparse-keymap)))
-    (define-key map [remap quit-window] #'xref-quit)
     (define-key map (kbd "n") #'xref-next-line)
     (define-key map (kbd "p") #'xref-prev-line)
     (define-key map (kbd "r") #'xref-query-replace-in-results)
@@ -638,23 +626,6 @@ references displayed in the current *xref* buffer."
           (t
            (error "No %s xref" (if backward "previous" "next"))))))
 
-(defun xref-quit (&optional kill)
-  "Bury temporarily displayed buffers, then quit the current window.
-
-If KILL is non-nil, also kill the current buffer.
-
-The buffers that the user has otherwise interacted with in the
-meantime are preserved."
-  (interactive "P")
-  (let ((window (selected-window))
-        (history xref--display-history))
-    (setq xref--display-history nil)
-    (pcase-dolist (`(,buf . ,win) history)
-      (when (and (window-live-p win)
-                 (eq buf (window-buffer win)))
-        (quit-window nil win)))
-    (quit-window kill window)))
-
 (defconst xref-buffer-name "*xref*"
   "The name of the buffer to show xrefs.")
 

commit 5698947ff9335cf150c73cca257a5e7e5951b045
Author: Dmitry Gutov 
Date:   Mon Feb 22 00:26:24 2016 +0200

    Keep the xref buffer visible until the user quits it explicitly
    
    * lisp/progmodes/xref.el (xref--pop-to-location):
    Rename WINDOW argument to ACTION.
    (xref--with-dedicated-window): New macro.
    (xref--show-pos-in-buf): Rename from `xref--display-position'.
    Add and handle new argument, SELECTED.  Use the above macro.
    (xref--show-location): Add SELECTED argument.
    (xref-show-location-at-point): Make an effort to avoid the
    original window when showing the location.
    (xref-goto-xref): Don't quit the xref window (bug#20487 and
    http://lists.gnu.org/archive/html/emacs-devel/2016-01/msg01133.html).
    (xref--query-replace-1): Use xref--with-dedicated-window as well.
    (xref--next-error-function): Call xref--show-location instead of
    xref--pop-to-location.
    (xref--show-xrefs): Rename WINDOW argument to DISPLAY-ACTION.
    Only pass that value to xref--pop-to-location.  Pass the current
    selected window to xref-show-xrefs-function as the `window'
    property.
    (xref--find-xrefs, xref--find-definitions): Rename WINDOW argument
    to DISPLAY-ACTION as well.

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 2fd7297..31a03d9 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -414,16 +414,17 @@ elements is negated."
     (set-buffer (marker-buffer marker))
     (xref--goto-char marker)))
 
-(defun xref--pop-to-location (item &optional window)
+(defun xref--pop-to-location (item &optional action)
   "Go to the location of ITEM and display the buffer.
-WINDOW controls how the buffer is displayed:
+ACTION controls how the buffer is displayed:
   nil      -- switch-to-buffer
   `window' -- pop-to-buffer (other window)
-  `frame'  -- pop-to-buffer (other frame)"
+  `frame'  -- pop-to-buffer (other frame)
+If SELECT is non-nil, select the target window."
   (let* ((marker (save-excursion
                    (xref-location-marker (xref-item-location item))))
          (buf (marker-buffer marker)))
-    (cl-ecase window
+    (cl-ecase action
       ((nil)  (switch-to-buffer buf))
       (window (pop-to-buffer buf t))
       (frame  (let ((pop-up-frames t)) (pop-to-buffer buf t))))
@@ -446,41 +447,61 @@ WINDOW controls how the buffer is displayed:
     (when (and restore (not (eq (car restore) 'same)))
       (push (cons buf win) xref--display-history))))
 
-(defun xref--display-position (pos other-window buf)
-  ;; Show the location, but don't hijack focus.
-  (let ((xref-buf (current-buffer)))
-    (with-selected-window (display-buffer buf other-window)
+(defmacro xref--with-dedicated-window (&rest body)
+  `(let* ((xref-w (get-buffer-window xref-buffer-name))
+          (xref-w-dedicated (window-dedicated-p xref-w)))
+     (unwind-protect
+         (progn
+           (when xref-w
+             (set-window-dedicated-p xref-w 'soft))
+           ,@body)
+       (when xref-w
+         (set-window-dedicated-p xref-w xref-w-dedicated)))))
+
+(defun xref--show-pos-in-buf (pos buf select)
+  (let ((xref-buf (current-buffer))
+        win)
+    (with-selected-window
+        (xref--with-dedicated-window
+         (display-buffer buf))
       (xref--goto-char pos)
       (run-hooks 'xref-after-jump-hook)
-      (let ((buf (current-buffer))
-            (win (selected-window)))
+      (let ((buf (current-buffer)))
+        (setq win (selected-window))
         (with-current-buffer xref-buf
           (setq-local other-window-scroll-buffer buf)
-          (xref--save-to-history buf win))))))
+          (xref--save-to-history buf win))))
+    (when select
+      (select-window win))))
 
-(defun xref--show-location (location)
+(defun xref--show-location (location &optional select)
   (condition-case err
       (let* ((marker (xref-location-marker location))
              (buf (marker-buffer marker)))
-        (xref--display-position marker t buf))
+        (xref--show-pos-in-buf marker buf select))
     (user-error (message (error-message-string err)))))
 
 (defun xref-show-location-at-point ()
-  "Display the source of xref at point in the other window, if any."
+  "Display the source of xref at point in the appropriate window, if any."
   (interactive)
   (let* ((xref (xref--item-at-point))
          (xref--current-item xref))
     (when xref
-      (xref--show-location (xref-item-location xref)))))
+      ;; Try to avoid the window the current xref buffer was
+      ;; originally created from.
+      (if (window-live-p xref--window)
+          (with-selected-window xref--window
+            (xref--show-location (xref-item-location xref)))
+        (xref--show-location (xref-item-location xref))))))
 
 (defun xref-next-line ()
-  "Move to the next xref and display its source in the other window."
+  "Move to the next xref and display its source in the appropriate window."
   (interactive)
   (xref--search-property 'xref-item)
   (xref-show-location-at-point))
 
 (defun xref-prev-line ()
-  "Move to the previous xref and display its source in the other window."
+  "Move to the previous xref and display its source in the appropriate window."
   (interactive)
   (xref--search-property 'xref-item t)
   (xref-show-location-at-point))
@@ -491,16 +512,14 @@ WINDOW controls how the buffer is displayed:
     (get-text-property (point) 'xref-item)))
 
 (defvar-local xref--window nil
-  "ACTION argument to call `display-buffer' with.")
+  "The original window this xref buffer was created from.")
 
 (defun xref-goto-xref ()
-  "Jump to the xref on the current line and bury the xref buffer."
+  "Jump to the xref on the current line and select its window."
   (interactive)
   (let ((xref (or (xref--item-at-point)
-                 (user-error "No reference at point")))
-        (window xref--window))
-    (xref-quit)
-    (xref--pop-to-location xref window)))
+                  (user-error "No reference at point"))))
+    (xref--show-location (xref-item-location xref) t)))
 
 (defun xref-query-replace-in-results (from to)
   "Perform interactive replacement of FROM with TO in all displayed xrefs.
@@ -573,7 +592,8 @@ references displayed in the current *xref* buffer."
                       current-beg (car pair)
                       current-end (cdr pair)
                       current-buf (marker-buffer current-beg))
-                (pop-to-buffer current-buf)
+                (xref--with-dedicated-window
+                 (pop-to-buffer current-buf))
                 (goto-char current-beg)
                 (when (re-search-forward from current-end noerror)
                   (setq found t)))
@@ -614,7 +634,7 @@ references displayed in the current *xref* buffer."
     (dotimes (_ n)
       (setq xref (xref--search-property 'xref-item backward)))
     (cond (xref
-           (xref--pop-to-location xref))
+           (xref--show-location (xref-item-location xref) t))
           (t
            (error "No %s xref" (if backward "previous" "next"))))))
 
@@ -724,15 +744,15 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
 
 (defvar xref--read-pattern-history nil)
 
-(defun xref--show-xrefs (xrefs window &optional always-show-list)
+(defun xref--show-xrefs (xrefs display-action &optional always-show-list)
   (cond
    ((and (not (cdr xrefs)) (not always-show-list))
     (xref-push-marker-stack)
-    (xref--pop-to-location (car xrefs) window))
+    (xref--pop-to-location (car xrefs) display-action))
    (t
     (xref-push-marker-stack)
     (funcall xref-show-xrefs-function xrefs
-             `((window . ,window))))))
+             `((window . ,(selected-window)))))))
 
 (defun xref--prompt-p (command)
   (or (eq xref-prompt-for-identifier t)
@@ -761,16 +781,16 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
 
 ;;; Commands
 
-(defun xref--find-xrefs (input kind arg window)
+(defun xref--find-xrefs (input kind arg display-action)
   (let ((xrefs (funcall (intern (format "xref-backend-%s" kind))
                         (xref-find-backend)
                         arg)))
     (unless xrefs
       (user-error "No %s found for: %s" (symbol-name kind) input))
-    (xref--show-xrefs xrefs window)))
+    (xref--show-xrefs xrefs display-action)))
 
-(defun xref--find-definitions (id window)
-  (xref--find-xrefs id 'definitions id window))
+(defun xref--find-definitions (id display-action)
+  (xref--find-xrefs id 'definitions id display-action))
 
 ;;;###autoload
 (defun xref-find-definitions (identifier)

commit e34fbdee8aca84b98393b06b2450837d175999ca
Author: Daiki Ueno 
Date:   Mon Feb 22 06:06:50 2016 +0900

    Change the default socket location for pinentry
    
    * lisp/net/pinentry.el: Require 'cl-lib for `cl-letf'.
    (pinentry--socket-dir): Change the default from /tmp/emacsXXX to
    ~/.emacs.d/pinentry.
    (pinentry-start): Change the file modes of the socket file to 0700.
    This is just for extra safety since the parent directory is already
    protected with `server-ensure-safe-dir'.

diff --git a/lisp/net/pinentry.el b/lisp/net/pinentry.el
index 285f864..f83b073 100644
--- a/lisp/net/pinentry.el
+++ b/lisp/net/pinentry.el
@@ -26,6 +26,9 @@
 ;; This package allows GnuPG passphrase to be prompted through the
 ;; minibuffer instead of graphical dialog.
 ;;
+;; This feature requires GnuPG 2.1.5 or later and Pinentry 0.9.5 or
+;; later, with the Emacs support compiled in.
+;;
 ;; To use, add "allow-emacs-pinentry" to "~/.gnupg/gpg-agent.conf",
 ;; reload the configuration with "gpgconf --reload gpg-agent", and
 ;; start the server with M-x pinentry-start.
@@ -38,17 +41,15 @@
 ;; where pinentry and Emacs communicate through a Unix domain socket
 ;; created at:
 ;;
-;;   ${TMPDIR-/tmp}/emacs$(id -u)/pinentry
-;;
-;; under the same directory which server.el uses.  The protocol is a
-;; subset of the Pinentry Assuan protocol described in (info
-;; "(pinentry) Protocol").
+;;   ~/.emacs.d/pinentry/pinentry
 ;;
-;; NOTE: As of August 2015, this feature requires newer versions of
-;; GnuPG (2.1.5+) and Pinentry (0.9.5+).
+;; The protocol is a subset of the Pinentry Assuan protocol described
+;; in (info "(pinentry) Protocol").
 
 ;;; Code:
 
+(eval-when-compile (require 'cl-lib))
+
 (defgroup pinentry nil
   "The Pinentry server"
   :version "25.1"
@@ -76,10 +77,7 @@
 
 (defvar pinentry--prompt-buffer nil)
 
-;; We use the same location as `server-socket-dir', when local sockets
-;; are supported.
-(defvar pinentry--socket-dir
-  (format "%s/emacs%d" (or (getenv "TMPDIR") "/tmp") (user-uid))
+(defvar pinentry--socket-dir (locate-user-emacs-file "pinentry")
   "The directory in which to place the server socket.
 If local sockets are not supported, this is nil.")
 
@@ -172,16 +170,17 @@ will not be shown."
       (ignore-errors
         (let (delete-by-moving-to-trash)
           (delete-file server-file)))
-      (setq pinentry--server-process
-            (make-network-process
-             :name "pinentry"
-             :server t
-             :noquery t
-             :sentinel #'pinentry--process-sentinel
-             :filter #'pinentry--process-filter
-             :coding 'no-conversion
-             :family 'local
-             :service server-file))
+      (cl-letf (((default-file-modes) ?\700))
+        (setq pinentry--server-process
+              (make-network-process
+               :name "pinentry"
+               :server t
+               :noquery t
+               :sentinel #'pinentry--process-sentinel
+               :filter #'pinentry--process-filter
+               :coding 'no-conversion
+               :family 'local
+               :service server-file)))
       (process-put pinentry--server-process :server-file server-file))))
 
 (defun pinentry-stop ()

commit 5f8965839d573032fc02be1298f37899cf61862d
Author: Daiki Ueno 
Date:   Mon Feb 22 06:05:14 2016 +0900

    Mention how to enable pinentry feature
    
    * etc/NEWS: Mention "gpgconf --reload gpg-agent".
    * lisp/net/pinentry.el: Likewise.

diff --git a/etc/NEWS b/etc/NEWS
index 6d57091..660af78 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1275,7 +1275,9 @@ few or no entries have changed.
 minibuffer instead of a graphical dialog, depending on whether the gpg
 command is called from Emacs (i.e., INSIDE_EMACS environment variable
 is set).  This feature requires newer versions of GnuPG (2.1.5 or
-later) and Pinentry (0.9.5 or later).
+later) and Pinentry (0.9.5 or later).  To use this feature, add
+"allow-emacs-pinentry" to "~/.gnupg/gpg-agent.conf" and reload the
+configuration with "gpgconf --reload gpg-agent".
 
 +++
 ** cl-generic.el provides CLOS-style multiple-dispatch generic functions.
diff --git a/lisp/net/pinentry.el b/lisp/net/pinentry.el
index 27374af..285f864 100644
--- a/lisp/net/pinentry.el
+++ b/lisp/net/pinentry.el
@@ -26,7 +26,8 @@
 ;; This package allows GnuPG passphrase to be prompted through the
 ;; minibuffer instead of graphical dialog.
 ;;
-;; To use, add allow-emacs-pinentry to ~/.gnupg/gpg-agent.conf, and
+;; To use, add "allow-emacs-pinentry" to "~/.gnupg/gpg-agent.conf",
+;; reload the configuration with "gpgconf --reload gpg-agent", and
 ;; start the server with M-x pinentry-start.
 ;;
 ;; The actual communication path between the relevant components is

commit db512249ddb02221716fd01f13b5ac6c045ed773
Author: Paul Eggert 
Date:   Sun Feb 21 12:34:00 2016 -0800

    Sync with gnulib
    
    This incorporates:
    2016-02-10 stdalign: port to older HP and IBM cc
    * doc/misc/texinfo.tex, lib/stdalign.in.h: Copy from gnulib.

diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex
index 71b97c0..08baf5d 100644
--- a/doc/misc/texinfo.tex
+++ b/doc/misc/texinfo.tex
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2016-02-09.12}
+\def\texinfoversion{2016-02-16.15}
 %
 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -310,7 +310,7 @@
 % Margin to add to right of even pages, to left of odd pages.
 \newdimen\bindingoffset
 \newdimen\normaloffset
-\newdimen\pagewidth \newdimen\pageheight
+\newdimen\txipagewidth \newdimen\txipageheight
 
 % Main output routine.
 %
@@ -334,7 +334,7 @@
   % Common context changes for both heading and footing.
   % Do this outside of the \shipout so @code etc. will be expanded in
   % the headline as they should be, not taken literally (outputting ''code).
-  \def\commmonheadfootline{\let\hsize=\pagewidth \texinfochars}
+  \def\commmonheadfootline{\let\hsize=\txipagewidth \texinfochars}
   %
   % Retrieve the information for the headings from the marks in the page,
   % and call Plain TeX's \makeheadline and \makefootline, which use the
@@ -433,7 +433,7 @@
 \newinsert\margin \dimen\margin=\maxdimen
 
 % Main part of page, including any footnotes
-\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
+\def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=\maxdepth #1}}
 {\catcode`\@ =11
 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
 % marginal hacks, juha@viisa.uucp (Juha Takala)
@@ -724,11 +724,11 @@
   % \dimen0 is the vertical size of the group's box.
   \dimen0 = \ht\groupbox  \advance\dimen0 by \dp\groupbox
   % \dimen2 is how much space is left on the page (more or less).
-  \dimen2 = \pageheight   \advance\dimen2 by -\pagetotal
+  \dimen2 = \txipageheight   \advance\dimen2 by -\pagetotal
   % if the group doesn't fit on the current page, and it's a big big
   % group, force a page break.
   \ifdim \dimen0 > \dimen2
-    \ifdim \pagetotal < \vfilllimit\pageheight
+    \ifdim \pagetotal < \vfilllimit\txipageheight
       \page
     \fi
   \fi
@@ -1100,6 +1100,64 @@ where each line of input produces a line of output.}
 \newif\ifpdf
 \newif\ifpdfmakepagedest
 
+%
+% For LuaTeX
+%
+
+\ifx\luatexversion\thisisundefined
+\else
+  % Escape PDF strings UTF-8 to UTF-16
+  \begingroup
+    \catcode`\%=12
+    \directlua{
+      function UTF16oct(str)
+        tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377')
+        for c in string.utfvalues(str) do
+          if c < 0x10000 then
+            tex.sprint(
+              string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
+                            string.char(0x5c) .. string.char(0x25) .. '03o',
+                            (c / 256), (c % 256)))
+          else
+            c = c - 0x10000
+            local c_hi = c / 1024 + 0xd800
+            local c_lo = c % 1024 + 0xdc00
+            tex.sprint(
+              string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
+                            string.char(0x5c) .. string.char(0x25) .. '03o' ..
+                            string.char(0x5c) .. string.char(0x25) .. '03o' ..
+                            string.char(0x5c) .. string.char(0x25) .. '03o',
+                            (c_hi / 256), (c_hi % 256),
+                            (c_lo / 256), (c_lo % 256)))
+          end
+        end
+      end
+    }
+  \endgroup
+  \def\pdfescapestring#1{\directlua{UTF16oct('\luaescapestring{#1}')}}
+  \ifnum\luatexversion>84
+    % For LuaTeX >= 0.85
+    \def\pdfdest{\pdfextension dest}
+    \let\pdfoutput\outputmode
+    \def\pdfliteral{\pdfextension literal}
+    \def\pdfcatalog{\pdfextension catalog}
+    \def\pdftexversion{\numexpr\pdffeedback version\relax}
+    \let\pdfximage\saveimageresource
+    \let\pdfrefximage\useimageresource
+    \let\pdflastximage\lastsavedimageresourceindex
+    \def\pdfendlink{\pdfextension endlink\relax}
+    \def\pdfoutline{\pdfextension outline}
+    \def\pdfstartlink{\pdfextension startlink}
+    \def\pdffontattr{\pdfextension fontattr}
+    \def\pdfobj{\pdfextension obj}
+    \def\pdflastobj{\numexpr\pdffeedback lastobj\relax}
+    \let\pdfpagewidth\pagewidth
+    \let\pdfpageheight\pageheight
+    \edef\pdfhorigin{\pdfvariable horigin}
+    \edef\pdfvorigin{\pdfvariable vorigin}
+  \fi
+\fi
+
 % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
 % can be set).  So we test for \relax and 0 as well as being undefined.
 \ifx\pdfoutput\thisisundefined
@@ -1283,18 +1341,23 @@ output) for that.)}
     % page number.  We could generate a destination for the section
     % text in the case where a section has no node, but it doesn't
     % seem worth the trouble, since most documents are normally structured.
-    \edef\pdfoutlinedest{#3}%
-    \ifx\pdfoutlinedest\empty
-      \def\pdfoutlinedest{#4}%
-    \else
-      \txiescapepdf\pdfoutlinedest
-    \fi
-    %
-    % Also escape PDF chars in the display string.
-    \edef\pdfoutlinetext{#1}%
-    \txiescapepdf\pdfoutlinetext
-    %
-    \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
+    {
+      \ifx\luatexversion\thisisundefined \else
+        \turnoffactive % LuaTeX can use Unicode strings for PDF
+      \fi
+      \edef\pdfoutlinedest{#3}%
+      \ifx\pdfoutlinedest\empty
+        \def\pdfoutlinedest{#4}%
+      \else
+        \txiescapepdf\pdfoutlinedest
+      \fi
+      %
+      % Also escape PDF chars in the display string.
+      \edef\pdfoutlinetext{#1}%
+      \txiescapepdf\pdfoutlinetext
+      %
+      \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
+    }
   }
   %
   \def\pdfmakeoutlines{%
@@ -1528,7 +1591,16 @@ output) for that.)}
   ]
 
   \special{pdf:docview << /PageMode /UseOutlines >> }
-  \special{pdf:tounicode UTF8-UTF16 }
+  \openin 1 uptex.tex % upTeX has UTF8-UTF16 cmap
+  \ifeof 1
+    % upTeX does not exist. To use UTF8-UCS2 cmap.
+    % In this case, non-BMP characters (over U+FFFF) can not be used.
+    \special{pdf:tounicode UTF8-UCS2}
+  \else
+    % upTeX exists. To use UTF8-UTF16 cmap.
+    % Non-BMP characters (over U+FFFF) can be used.
+    \special{pdf:tounicode UTF8-UTF16}
+  \fi
 \fi
 
 %
@@ -3570,7 +3642,7 @@ end
   %
   % Leave some space for the footline.  Hopefully ok to assume
   % @evenfooting will not be used by itself.
-  \global\advance\pageheight by -12pt
+  \global\advance\txipageheight by -12pt
   \global\advance\vsize by -12pt
 }
 
@@ -3595,9 +3667,9 @@ end
 \def\oddheadingmarks{\headingmarks{odd}{heading}}
 \def\evenfootingmarks{\headingmarks{even}{footing}}
 \def\oddfootingmarks{\headingmarks{odd}{footing}}
-\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
+\parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1}
                           \headingmarks{odd}{heading}{#1} }
-\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
+\parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1}
                           \headingmarks{odd}{footing}{#1} }
 % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
 \def\headingmarks#1#2#3 {%
@@ -3618,7 +3690,7 @@ end
 % By default, they are off at the start of a document,
 % and turned `on' after @end titlepage.
 
-\def\headings #1 {\csname HEADINGS#1\endcsname}
+\parseargdef\headings{\csname HEADINGS#1\endcsname}
 
 \def\headingsoff{% non-global headings elimination
   \evenheadline={\hfil}\evenfootline={\hfil}%
@@ -5642,7 +5714,7 @@ end
   \wd0=\hsize \wd2=\hsize
   \vbox{%
     \vskip\doublecolumntopgap
-    \hbox to\pagewidth{\box0\hfil\box2}}%
+    \hbox to\txipagewidth{\box0\hfil\box2}}%
 }
 
 
@@ -5669,7 +5741,7 @@ end
   % goal.  When TeX sees \eject from below which follows the final
   % section, it invokes the new output routine that we've set after
   % \balancecolumns below; \onepageout will try to fit the two columns
-  % and the final section into the vbox of \pageheight (see
+  % and the final section into the vbox of \txipageheight (see
   % \pagebody), causing an overfull box.
   %
   % Note that glue won't work here, because glue does not exercise the
@@ -6153,7 +6225,7 @@ end
   \fi
 }
 
-\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
+\parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname}
 
 \def\CHAPPAGoff{%
 \global\let\contentsalignmacro = \chappager
@@ -6302,7 +6374,7 @@ end
 % I don't think this chapter style is supported any more, so I'm not
 % updating it with the new noderef stuff.  We'll see.  --karl, 11aug03.
 %
-\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
+\parseargdef\setchapterstyle{\csname CHAPF#1\endcsname}
 %
 \def\unnchfopen #1{%
   \chapoddpage
@@ -9043,7 +9115,7 @@ end
   % We want to typeset this text as a normal paragraph, even if the
   % footnote reference occurs in (for example) a display environment.
   % So reset some parameters.
-  \hsize=\pagewidth
+  \hsize=\txipagewidth
   \interlinepenalty\interfootnotelinepenalty
   \splittopskip\ht\strutbox % top baseline for broken footnotes
   \splitmaxdepth\dp\strutbox
@@ -11007,12 +11079,12 @@ directory should work if nowhere else does.}
   \advance\vsize by \topskip
   \outervsize = \vsize
   \advance\outervsize by 2\topandbottommargin
-  \pageheight = \vsize
+  \txipageheight = \vsize
   %
   \hsize = #2\relax
   \outerhsize = \hsize
   \advance\outerhsize by 0.5in
-  \pagewidth = \hsize
+  \txipagewidth = \hsize
   %
   \normaloffset = #4\relax
   \bindingoffset = #5\relax
@@ -11336,9 +11408,10 @@ directory should work if nowhere else does.}
   @global@let\ = @eatinput%
   @catcode`@^^M=13%
   @def@c{@fixbackslash@c}%
+  % Definition for the newline at the end of this file.
   @def ^^M{@let^^M@secondlinenl}%
-  @gdef @secondlinenl{@let^^M@thirdlinenl}%
-  @gdef @thirdlinenl{@fixbackslash}%
+  % Definition for a newline in the main Texinfo file.
+  @gdef @secondlinenl{@fixbackslash}%
 }}
 
 {@catcode`@^=7 @catcode`@^^M=13%
diff --git a/lib/stdalign.in.h b/lib/stdalign.in.h
index cd83956..12f8a15 100644
--- a/lib/stdalign.in.h
+++ b/lib/stdalign.in.h
@@ -103,8 +103,8 @@
 # elif ((defined __APPLE__ && defined __MACH__                  \
          ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__)                 \
          : __GNUC__)                                            \
-        || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__        \
-        || __ICC || 0x590 <= __SUNPRO_C)
+        || 061200 <= __HP_cc || 061200 <= __HP_aCC                \
+        || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__)
 #  define _Alignas(a) __attribute__ ((__aligned__ (a)))
 # elif 1300 <= _MSC_VER
 #  define _Alignas(a) __declspec (align (a))

commit aa5a7948431437fc09931ac21eb05f365e1f8876
Author: David Engster 
Date:   Sun Feb 21 17:16:45 2016 +0100

    Remove `semanticdb-save-all-db-idle' from `auto-save-hook'
    
    * lisp/cedet/semantic/db-mode.el (semanticdb-hooks): Do not put
      `semanticdb-save-all-db-idle' into `auto-save-hook'. The latter is
      not an idle hook, so it's not appropriate to call it there. It will
      already be called in the `semantic-idle-work-core-handler', which
      runs when Emacs is actually idle.

diff --git a/lisp/cedet/semantic/db-mode.el b/lisp/cedet/semantic/db-mode.el
index e8be185..73cc7b5 100644
--- a/lisp/cedet/semantic/db-mode.el
+++ b/lisp/cedet/semantic/db-mode.el
@@ -39,7 +39,6 @@
     (semanticdb-kill-hook kill-buffer-hook)
     (semanticdb-kill-hook change-major-mode-hook) ;; Not really a kill, but we need the same effect.
     (semanticdb-kill-emacs-hook kill-emacs-hook)
-    (semanticdb-save-all-db-idle auto-save-hook)
     )
   "List of hooks and values to add/remove when configuring semanticdb.")
 

commit 2d8b2fd034ccc61f949b408373342b5f9f8ba592
Author: David Engster 
Date:   Sun Feb 21 17:11:01 2016 +0100

    Restore point when writing semantic table to disk
    
    * lisp/cedet/semantic/db-file.el (object-write): Wrap call to
      `semantic-fetch-tags' in `save-excursion', since it might move point
      in current buffer. (Bug #22287)

diff --git a/lisp/cedet/semantic/db-file.el b/lisp/cedet/semantic/db-file.el
index d9dd1f9..0ae433f 100644
--- a/lisp/cedet/semantic/db-file.el
+++ b/lisp/cedet/semantic/db-file.el
@@ -287,22 +287,22 @@ Argument OBJ is the object to write."
   (when (semanticdb-live-p obj)
     (when (semanticdb-in-buffer-p obj)
       (with-current-buffer (semanticdb-in-buffer-p obj)
-
-	;; Make sure all our tag lists are up to date.
-	(semantic-fetch-tags)
-
-	;; Try to get an accurate unmatched syntax table.
-	(when (and (boundp semantic-show-unmatched-syntax-mode)
-		   semantic-show-unmatched-syntax-mode)
-	  ;; Only do this if the user runs unmatched syntax
-	  ;; mode display entries.
-	  (oset obj unmatched-syntax
-		(semantic-show-unmatched-lex-tokens-fetch))
-	  )
-
-	;; Make sure pointmax is up to date
-	(oset obj pointmax (point-max))
-	))
+        (save-excursion
+          ;; Make sure all our tag lists are up to date.
+          (semantic-fetch-tags)
+
+          ;; Try to get an accurate unmatched syntax table.
+          (when (and (boundp semantic-show-unmatched-syntax-mode)
+                     semantic-show-unmatched-syntax-mode)
+            ;; Only do this if the user runs unmatched syntax
+            ;; mode display entries.
+            (oset obj unmatched-syntax
+                  (semantic-show-unmatched-lex-tokens-fetch))
+            )
+
+          ;; Make sure pointmax is up to date
+          (oset obj pointmax (point-max))
+          )))
 
     ;; Make sure that the file size and other attributes are
     ;; up to date.

commit 27d343070d02210316e69e4f7da1faeea2d87608
Author: Daiki Ueno 
Date:   Sun Feb 21 18:20:40 2016 +0900

    Mention pinentry.el in epa manual
    
    * doc/misc/epa.texi (GnuPG version compatibility): New chapter,
    describing the differences between three GnuPG branches, and how
    to enable pinentry.el.
    (Caching Passphrases): Add xref to the compatibility chapter.

diff --git a/doc/misc/epa.texi b/doc/misc/epa.texi
index 527b44f..4b7b118 100644
--- a/doc/misc/epa.texi
+++ b/doc/misc/epa.texi
@@ -42,7 +42,7 @@ modify this GNU manual.''
 
 @contents
 
-@node Top
+@node Top, Overview, (dir), (dir)
 @top EasyPG Assistant user's manual
 
 EasyPG Assistant is an Emacs user interface to GNU Privacy Guard
@@ -61,6 +61,7 @@ called EasyPG Library.
 * Quick start::
 * Commands::
 * Caching Passphrases::
+* GnuPG version compatibility::
 * Bug Reports::
 * GNU Free Documentation License::  The license for this documentation.
 * Key Index::
@@ -68,7 +69,7 @@ called EasyPG Library.
 * Variable Index::
 @end menu
 
-@node  Overview
+@node  Overview, Quick start, Top, Top
 @chapter Overview
 
 EasyPG Assistant provides the following features.
@@ -82,7 +83,7 @@ EasyPG Assistant provides the following features.
 @item Automatic encryption/decryption of *.gpg files.
 @end itemize
 
-@node  Quick start
+@node  Quick start, Commands, Overview, Top
 @chapter Quick start
 
 EasyPG Assistant commands are prefixed by @samp{epa-}.  For example,
@@ -99,7 +100,7 @@ EasyPG Assistant provides several cryptographic features which can be
 integrated into other Emacs functionalities.  For example, automatic
 encryption/decryption of @file{*.gpg} files.
 
-@node Commands
+@node Commands, GnuPG version compatibility, Quick start, Top
 @chapter Commands
 
 This chapter introduces various commands for typical use cases.
@@ -113,7 +114,7 @@ This chapter introduces various commands for typical use cases.
 * Encrypting/decrypting gpg files::
 @end menu
 
-@node Key management
+@node Key management, Cryptographic operations on regions, Commands, Commands
 @section Key management
 Probably the first step of using EasyPG Assistant is to browse your
 keyring.  @kbd{M-x epa-list-keys} is corresponding to @samp{gpg
@@ -196,7 +197,7 @@ Delete selected keys.  If @var{allow-secret} is non-@code{nil}, it
 also delete the secret keys.
 @end deffn
 
-@node Cryptographic operations on regions
+@node Cryptographic operations on regions, Cryptographic operations on files, Key management, Commands
 @section Cryptographic operations on regions
 
 @deffn Command epa-decrypt-region start end
@@ -241,7 +242,7 @@ also ask you whether or not to sign the text before encryption and if
 you answered yes, it will let you select the signing keys.
 @end deffn
 
-@node Cryptographic operations on files
+@node Cryptographic operations on files, Dired integration, Cryptographic operations on regions, Commands
 @section Cryptographic operations on files
 
 @deffn Command epa-decrypt-file file &optional output
@@ -262,7 +263,7 @@ select signing keys, and then a signature type.
 Encrypt @var{file}.  It will let you select recipients.
 @end deffn
 
-@node Dired integration
+@node Dired integration, Mail-mode integration, Cryptographic operations on files, Commands
 @section Dired integration
 
 EasyPG Assistant extends Dired Mode for GNU Emacs to allow users to
@@ -301,7 +302,7 @@ Encrypt marked files.
 
 @end table
 
-@node Mail-mode integration
+@node Mail-mode integration, Encrypting/decrypting gpg files, Dired integration, Commands
 @section Mail-mode integration
 
 EasyPG Assistant provides a minor mode @code{epa-mail-mode} to help
@@ -353,7 +354,7 @@ use that option to ignore specific recipients for encryption purposes.
 
 @end table
 
-@node Encrypting/decrypting gpg files
+@node Encrypting/decrypting gpg files,  , Mail-mode integration, Commands
 @section Encrypting/decrypting gpg files
 By default, every file whose name ends with @file{.gpg} will be
 treated as encrypted.  That is, when you open such a file, the
@@ -436,18 +437,47 @@ If non-@code{nil}, disable auto-saving when opening an encrypted file.
 The default value is @code{t}.
 @end defvar
 
-@node Caching Passphrases
+@node GnuPG version compatibility, Caching Passphrases, Commands, Top
+@chapter GnuPG version compatibility
+
+As of February 2016, there are three active branches of GnuPG: 2.1,
+2.0, and 1.4.  All those branches should work flawlessly with Emacs,
+with basic use-cases.  They have, however, some incompatible
+characteristics, which might be visible when used from Emacs.
+
+@itemize
+@item
+The key store format used by 2.1 is incompatible with 1.4.  That
+means, a key created with 2.1 might not be visible with 1.4.
+
+@item
+2.1 uses a fixed Unix domain socket for gpg-agent, and ignores the
+@code{GPG_AGENT_INFO} environment variable, used by 2.0 and 1.4.
+
+@item
+2.1 (2.1.5 or later) has a mechanism to direct the Pinentry password
+prompt to the Emacs minibuffer@footnote{To enable this feature, add
+@samp{allow-emacs-pinentry} to @file{~/.gnupg/gpg-agent.conf} and let
+gpg-agent reload the configuration, with: @samp{gpgconf --reload gpg-agent}},
+which would be useful when you use Emacs remotely or from a text-only
+terminal.  That feature is not available in other versions, and more
+specifically, with 2.0 (as of 2.0.29), there is no way to avoid the
+graphical prompt.
+@end itemize
+
+@node Caching Passphrases, Bug Reports, GnuPG version compatibility, Top
 @chapter Caching Passphrases
 
-Typing passphrases is an irritating task if you frequently open and
+Typing passphrases is a troublesome task if you frequently open and
 close the same file.  GnuPG and EasyPG Assistant provide mechanisms to
 remember your passphrases.  However, the configuration is a bit
-confusing since it depends on your GnuPG installation (GnuPG version 1 or
-GnuPG version 2), encryption method (symmetric or public key), and whether or
-not you want to use gpg-agent.  Here are some questions:
+confusing since it depends on your GnuPG installation@xref{GnuPG
+version compatibility}, encryption method (symmetric or public key),
+and whether or not you want to use gpg-agent.  Here are some
+questions:
 
 @enumerate
-@item Do you use GnuPG version 2 instead of GnuPG version 1?
+@item Do you use GnuPG version 2.1 or 2.0 instead of GnuPG version 1.4?
 @item Do you use symmetric encryption rather than public key encryption?
 @item Do you want to use gpg-agent?
 @end enumerate
@@ -473,7 +503,7 @@ To set up elisp passphrase cache, set
 @code{epa-file-cache-passphrase-for-symmetric-encryption}.
 @xref{Encrypting/decrypting gpg files}.
 
-@node Bug Reports
+@node Bug Reports, GNU Free Documentation License, Caching Passphrases, Top
 @chapter Bug Reports
 
 Bugs and problems with EasyPG Assistant are actively worked on by the
@@ -495,19 +525,19 @@ Before reporting the bug, you should set @code{epg-debug} in the
 of the @file{ *epg-debug*} buffer.  Note that the first letter of the
 buffer name is a whitespace.
 
-@node GNU Free Documentation License
+@node GNU Free Documentation License, Key Index, Bug Reports, Top
 @appendix GNU Free Documentation License
 @include doclicense.texi
 
-@node Key Index
+@node Key Index, Function Index, GNU Free Documentation License, Top
 @unnumbered Key Index
 @printindex ky
 
-@node Function Index
+@node Function Index, Variable Index, Key Index, Top
 @unnumbered Function Index
 @printindex fn
 
-@node Variable Index
+@node Variable Index,  , Function Index, Top
 @unnumbered Variable Index
 @printindex vr
 

commit 5baa001cecbeb3081fb8a9293d45cfe9f19ef844
Author: Michael Albinus 
Date:   Sun Feb 21 09:58:55 2016 +0100

    Fix Bug#22736
    
    * lisp/filenotify.el (file-notify-callback): Use the proper
    descriptor when calling the callback.  (Bug#22736)
    
    * test/automated/file-notify-tests.el
    (file-notify--test-event-handler): Deactivate trace.
    (file-notify-test08-watched-file-in-watched-dir): Bind
    `file-notify--test-tmpfile' temporarily in `dir-callback'.

diff --git a/lisp/filenotify.el b/lisp/filenotify.el
index 66e7fd7..ba76bac 100644
--- a/lisp/filenotify.el
+++ b/lisp/filenotify.el
@@ -273,14 +273,16 @@ EVENT is the cadr of the event in `file-notify-handle-event'
 			  (nth 0 entry) (file-name-nondirectory file1)))))
           ;;(message
            ;;"file-notify-callback %S %S %S %S %S"
-           ;;(file-notify--descriptor desc file) action file file1 registered)
+           ;;(file-notify--descriptor desc (car entry))
+           ;;action file file1 registered)
 	  (if file1
 	      (funcall
 	       callback
-	       `(,(file-notify--descriptor desc file) ,action ,file ,file1))
+	       `(,(file-notify--descriptor desc (car entry))
+                 ,action ,file ,file1))
 	    (funcall
 	     callback
-	     `(,(file-notify--descriptor desc file) ,action ,file)))))
+	     `(,(file-notify--descriptor desc (car entry)) ,action ,file)))))
 
       ;; Modify `file-notify-descriptors'.
       (when stopped
diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el
index 346120e..ac33d68 100644
--- a/test/automated/file-notify-tests.el
+++ b/test/automated/file-notify-tests.el
@@ -281,8 +281,8 @@ and the event to `file-notify--test-events'."
     (unless (string-match
 	     (regexp-quote ".#")
 	     (file-notify--event-file-name file-notify--test-event))
-      (message "file-notify--test-event-handler result: %s event: %S"
-               (null (ert-test-failed-p result)) file-notify--test-event)
+      ;;(message "file-notify--test-event-handler result: %s event: %S"
+               ;;(null (ert-test-failed-p result)) file-notify--test-event)
       (setq file-notify--test-events
 	    (append file-notify--test-events `(,file-notify--test-event))
 	    file-notify--test-results
@@ -963,11 +963,11 @@ the file watch."
               (let ((temporary-file-directory file-notify--test-tmpfile))
                 (make-temp-file "file")))
 	(cl-flet ((dir-callback (event)
-                   (message "dir-callback %s" event)
-                   (let ((file-notify--test-desc file-notify--test-desc1))
+                   (let ((file-notify--test-desc file-notify--test-desc1)
+                         (file-notify--test-tmpfile
+                          (file-notify--event-file-name event)))
                      (file-notify--test-event-handler event)))
                   (file-callback (event)
-                   (message "file-callback %s" event)
                    (let ((file-notify--test-desc file-notify--test-desc2))
                      (file-notify--test-event-handler event))))
           (should
@@ -989,7 +989,6 @@ the file watch."
                  "any text" nil file-notify--test-tmpfile1 t 'no-message)
               (let ((temporary-file-directory file-notify--test-tmpfile))
                 (make-temp-file "fileX"))))
-          ;; After saving the buffer, the descriptor is still valid.
           (should (file-notify-valid-p file-notify--test-desc1))
           (should (file-notify-valid-p file-notify--test-desc2))
           (delete-file file-notify--test-tmpfile1)

commit 72613557e02d493f195a1c0894ec736b19069f4c
Author: Wieland Hoffmann 
Date:   Sun Feb 21 13:32:22 2016 +1100

    Grammar fix in doc string
    
    * lisp/custom.el (defgroup): Grammar fix in doc string.
    
    Copyright-paperwork-exempt: yes

diff --git a/lisp/custom.el b/lisp/custom.el
index f404500..056ca34 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -464,7 +464,7 @@ are not usually written so.
 MEMBERS should be an alist of the form ((NAME WIDGET)...) where
 NAME is a symbol and WIDGET is a widget for editing that symbol.
 Useful widgets are `custom-variable' for editing variables,
-`custom-face' for edit faces, and `custom-group' for editing groups.
+`custom-face' for editing faces, and `custom-group' for editing groups.
 
 The remaining arguments should have the form
 

commit d0f3b18fa91c3926034a859c3a7c11c0dab924e6
Author: Daiki Ueno 
Date:   Sun Feb 21 07:26:40 2016 +0900

    Naming fix for consistency
    
    * lisp/epg-config.el (epg-find-configuration): Rename from
    `epg-configuration-find' to be consistent with other epg-* functions.
    Change all callers.

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 6156f65..b65e45b 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1452,7 +1452,7 @@ loading packages twice."
 (defvar package--downloads-in-progress nil
   "List of in-progress asynchronous downloads.")
 
-(declare-function epg-configuration-find "epg-config"
+(declare-function epg-find-configuration "epg-config"
                   (protocol &optional force))
 (declare-function epg-import-keys-from-file "epg" (context keys))
 
@@ -1555,9 +1555,9 @@ downloads in the background."
         (inhibit-message async))
     (if (get 'package-check-signature 'saved-value)
         (when package-check-signature
-          (epg-configuration-find 'OpenPGP))
+          (epg-find-configuration 'OpenPGP))
       (setq package-check-signature
-            (if (epg-configuration-find 'OpenPGP)
+            (if (epg-find-configuration 'OpenPGP)
                 'allow-unsigned)))
     (when (and package-check-signature (file-exists-p default-keyring))
       (condition-case-unless-debug error
diff --git a/lisp/epg-config.el b/lisp/epg-config.el
index 1d77066..8a20804 100644
--- a/lisp/epg-config.el
+++ b/lisp/epg-config.el
@@ -99,7 +99,7 @@ Emacs.")
 (defvar epg--configurations nil)
 
 ;;;###autoload
-(defun epg-configuration-find (protocol &optional force)
+(defun epg-find-configuration (protocol &optional force)
   "Find or create a usable configuration to handle PROTOCOL.
 This function first looks at the existing configuration found by
 the previous invocation of this function, unless FORCE is non-nil.
@@ -190,7 +190,7 @@ entry until the version requirement is met."
 ;;;###autoload
 (defun epg-configuration ()
   "Return a list of internal configuration parameters of `epg-gpg-program'."
-  (declare (obsolete epg-configuration-find "25.1"))
+  (declare (obsolete epg-find-configuration "25.1"))
   (epg-config--make-gpg-configuration epg-gpg-program))
 
 (defun epg-config--parse-version (string)
diff --git a/lisp/epg.el b/lisp/epg.el
index 1a18ab2..f4058ed 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -186,7 +186,7 @@
                           compress-algorithm
                  &aux
                  (program
-                  (let ((configuration (epg-configuration-find protocol)))
+                  (let ((configuration (epg-find-configuration protocol)))
                     (unless configuration
                       (signal 'epg-error
                               (list "no usable configuration" protocol)))

commit 74ec92da9e0430728ac9496d3b1e50f0bb5dae3a
Author: Daiki Ueno 
Date:   Sun Feb 21 07:11:04 2016 +0900

    Prefer customized value for GnuPG executable
    
    * lisp/epg-config.el (epg-configuration-find): Don't check GPG
    configuration if it is already set with custom.  (Bug#22747)

diff --git a/lisp/epg-config.el b/lisp/epg-config.el
index 1736456..1d77066 100644
--- a/lisp/epg-config.el
+++ b/lisp/epg-config.el
@@ -114,16 +114,15 @@ entry until the version requirement is met."
     (cl-destructuring-bind (symbol constructor . alist)
         (cdr entry)
       (or (and (not force) (alist-get protocol epg--configurations))
-          (let ((executable (get symbol 'saved-value)))
-            (if executable
-                (ignore-errors
-                  (let ((configuration (funcall constructor executable)))
-                    (epg-check-configuration configuration)
-                    (push (cons protocol configuration) epg--configurations)
-                    configuration))
-              (catch 'found
-                (dolist (program-version alist)
-                  (setq executable (executable-find (car program-version)))
+          ;; If the executable value is already set with M-x
+          ;; customize, use it without checking.
+          (if (get symbol 'saved-value)
+              (let ((configuration (funcall constructor (symbol-value symbol))))
+                (push (cons protocol configuration) epg--configurations)
+                configuration)
+            (catch 'found
+              (dolist (program-version alist)
+                (let ((executable (executable-find (car program-version))))
                   (when executable
                     (let ((configuration
                            (funcall constructor executable)))

commit ea0b604412d6b33353839640f7d5e5e0b62a45ad
Author: Eli Zaretskii 
Date:   Sat Feb 20 18:59:14 2016 +0200

    Fix memory reservation on MS-Windows
    
    * src/w32heap.c (mmap_alloc): Reserve memory in 64KB granular
    units.  This avoids leaving gaps in reserved memory regions that
    no one can use, since memory reservation must produce 64KB-aligned
    addresses.  (Bug#22526)

diff --git a/src/w32heap.c b/src/w32heap.c
index 69706a3..b908169 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -641,12 +641,14 @@ mmap_alloc (void **var, size_t nbytes)
      advance, and the buffer is enlarged several times as the data is
      decompressed on the fly.  */
   if (nbytes < MAX_BUFFER_SIZE)
-    p = VirtualAlloc (NULL, (nbytes * 2), MEM_RESERVE, PAGE_READWRITE);
+    p = VirtualAlloc (NULL, ROUND_UP (nbytes * 2, get_allocation_unit ()),
+		      MEM_RESERVE, PAGE_READWRITE);
 
   /* If it fails, or if the request is above 512MB, try with the
      requested size.  */
   if (p == NULL)
-    p = VirtualAlloc (NULL, nbytes, MEM_RESERVE, PAGE_READWRITE);
+    p = VirtualAlloc (NULL, ROUND_UP (nbytes, get_allocation_unit ()),
+		      MEM_RESERVE, PAGE_READWRITE);
 
   if (p != NULL)
     {

commit c5f72aa573bc45b82ad6479ae0eba5ffc7916fb9
Author: Anders Lindgren 
Date:   Sat Feb 20 16:24:40 2016 +0100

    Update NextStep readme and add wish list.
    
    * nextstep/README: Rewritten from scratch. New sections on
    "History", "Overview of Cocoa and Objective-C", "Guidelines",
    "Tracing Support", and "GNUStep". Expanded the "See Also" section.
    * nextstep/WISHLIST: New file containing list of issues and ideas
    associated with the NS port of Emacs.

diff --git a/nextstep/README b/nextstep/README
index 45b9b23..c16d55b 100644
--- a/nextstep/README
+++ b/nextstep/README
@@ -1,4 +1,100 @@
-This directory contains files needed to build Emacs on Nextstep-based
-platforms, including GNUstep and Mac OS X (using the Cocoa libraries).
 
-See the INSTALL file in this directory for compilation instructions.
+  NS -- the Cocoa interface for OS X and compatible systems
+  ---------------------------------------------------------
+
+This directory contains files needed to build Emacs on system based on
+NextStep (NS), including OS X (Mac) and GNUstep, using the Cocoa API.
+
+
+  HISTORY
+
+Up to Emacs 22, the OS X interface was implemented using the C-based
+Carbon API.  Starting with Emacs 23, the interface was rewritten in
+Objective-C using the Cocoa API.  Meanwhile, the Carbon interface has
+been maintained independently under the name "mac".
+
+
+  OVERVIEW OF COCOA AND OBJECTIVE-C
+
+Cocoa is an API for the Objective-C language, an objective oriented
+superset of C.  Anybody with experience with iOS or modern OS X
+application development should feel at home.
+
+A method call in Objective-C differs from most other languages in the
+fact that it doesn't have a normal name.  Instead, the method name is
+made up of the name of each parameter.  An exception to this rule are
+methods without parameters.
+
+The following calls a method in the object `anObject'.
+
+    [anObject alpha:1 beta:2 gamma:3];
+
+Classes are declared like the following:
+
+    @interface AClassName
+    {
+      // A class method.
+      + (TYPE)name1:(TYPE)param1
+
+      // An object method.
+      - (TYPE)name1:(TYPE)param1 name2:(TYPE)param2;
+    }
+    @end
+
+
+  GUIDELINES
+
+* Adhere the to the FSF philosophy that a feature in GNU software
+  should not only be available on non-free systems.
+
+* People with varying Cocoa and Objective-C skills will read and
+  modify the NS code over a long period of time.  Keep the code simple
+  and avoid language constructs that makes the code hard to maintain.
+
+* Don't use macros and types intended for the XCode Interface Builder,
+  like `IBAction'.
+
+* The NS interface should work on all version of OS X from 10.6.8
+  (Snow Leopard) to the latest official release.
+
+* Under OS X, it is possible to build Emacs using NS, X11, or console
+  only.  A new OS X feature should work in all appropriate builds.
+
+
+  TRACING SUPPORT
+
+The NS interface features a printf-based trace package that prints the
+call tree of selected functions in the Cocoa interface, plus various
+extra information.  It can be enabled by uncommenting the line
+defining `NSTRACE_ENABLED' in "nsterm.h".  To enable more output,
+uncomment the lines defining symbols starting with `NSTRACE_GROUP'.
+
+
+  GNUSTEP AND OTHER COMPATIBLE SYSTEMS
+
+The NS interface works on system compatible with OS X, for example
+GNUstep.  Even though they are less frequently used, this is important
+for a number of reasons:
+
+* It supports the GNUstep project and provides an Emacs with the same
+  look-and-feel as the rest of the system.
+
+* This allows other Emacs developers to test their changes on the NS
+  interface without having access to an OS X machine.
+
+* If a feature in the NS interface work on free systems like GNUstep,
+  this meets the FSF requirement that features in GNU software should
+  not only be available on non-free systems.
+
+
+  SEE ALSO
+
+The src/ns... files contains the C and Objective-C parts.
+
+The lisp/term/ns-win.el file contains the lisp part of the NS
+interface.
+
+The INSTALL file in this directory for compilation instructions.
+
+The WISHLIST file in this directory for a list of ideas for future
+development of the NS interface.
diff --git a/nextstep/WISHLIST b/nextstep/WISHLIST
new file mode 100644
index 0000000..673f091
--- /dev/null
+++ b/nextstep/WISHLIST
@@ -0,0 +1,247 @@
+			     -*- org -*-
+
+  Wish list for the "NS" OS X Emacs port
+  --------------------------------------
+
+    Note: This document is written using "org-mode", a plain-text
+    format supporting outlines.  To expand a heading, press TAB.  To
+    expand all headings and subheadings, press S-TAB until Emacs
+    responds "SHOW ALL".
+
+* Introduction
+
+This is a wishlist for future development of the "NS" Emacs user
+interface whose primary use is the official Emacs version on OS X.
+
+This list should be seen as a complement to the bug- and wishlist on
+[[http://debbugs.gnu.org/cgi/pkgreport.cgi?package%3Demacs][debbugs]], the Emacs bug tracker.
+
+* Missing features
+
+This sections contains features found in other official Emacs ports.
+
+** Support for "xwidget"
+
+Emacs 25 has support for "xwidgets", a system to include operating
+system components into an Emacs buffer.  The components range from
+simple buttons to "webkit" (effectively, a web browser).
+
+Currently, "xwidget" only works for the "gtk+" framework but it is
+designed to be compatible with multiple Emacs ports.
+
+** Respect `frame-inhibit-implied-resize'
+
+When the variable `frame-inhibit-implied-resize' is non-nil, frames
+should not be resized when operations like changing font or toggling
+the tool bar is performed.
+
+Unfortunately, the tool bar (and possible other operations) always
+resize the frame.
+
+** Support `proced' (implement `process-attributes')
+
+Unfortunately, a user-level process like Emacs does not have the
+privileges to get information about other processes under OS X.
+
+There are other ways to do this:
+
+ 1) Spawn "ps" and parse the output ("ps" has superuser privileges).
+
+ 2) Sign Emacs as part of the distribution process.
+
+ 3) Ask the user to self-sign Emacs, if this feature is of interest.
+
+Anders Lindgren  has implemented
+`process-attributes' for OS X -- which currently only work when
+running Emacs as root.
+
+[[http://emacsredux.com/blog/2013/05/02/manage-processes-with-proced/][See this article by Bozhidar Batsov for an overview of Proced.]]
+
+** Tooltip properties
+
+Tooltip properties like the background color and font are hard wired,
+even though Emacs allow a user to customize such features.
+
+* New features
+
+This section contains features unique to the NS and/or OS X.
+
+** PressAndHold for writing accented character
+
+On OS X, many application supports the press and hold pattern to
+invoke a menu of accented characters. (See example at [[https://support.apple.com/en-us/HT201586][Apple]].)
+
+Currently, this doesn't work in Emacs.
+
+Note that "ns-win.el" explicitly disables this.
+
+Note: This feature might not be allowed to be implemented until also
+implemented in Emacs for a free system.
+
+** Floating scroll bars
+
+In modern OS X applications, the scroll bar often float over the
+content, and is invisible unless actually used.  This makes user
+interface less cluttered and more area could be used to contain text.
+
+With floating scroll bars, the user interface would look like it does
+when they are disabled today.  However, they will be made visible when
+a scroll action is initiated, e.g. by putting two fingers on a
+trackpad.
+
+Note: This feature might not be allowed to be implemented until also
+implemented in Emacs for a free system.
+
+* Features from the "mac" port
+
+This section contains features available in the "mac" Emacs port.
+
+As the "mac" port (as of this writing) isn't an official Emacs port,
+it might contain features not following the FSF rule "must exist on
+free systems".
+
+The "mac" port is based on the Emacs 22 C-based Carbon interface. It
+has been maintained in parallel to the official Cocoa-based NS
+interface. The Carbon interface has been enhanced, and a number of the
+features of that interface could be implemented NS.
+
+** Smooth scrolling -- maybe not a good idea
+
+Today, by default, scrolling with a trackpad makes the text move in
+steps of five lines. (Scrolling with SHIFT scrolls one line at a
+time.)
+
+The "mac" port provides smooth, pixel-based, scrolling.  This is a very
+popular features.  However, there are drawbacks to this method: what
+happens if only a fraction of a line is visible at the top of a
+window, is the partially visible text considered part of the window or
+not? (Technically, what should `window-start' return.)
+
+An alternative would be to make one-line scrolling the default on NS
+(or in Emacs in general).
+
+Note: This feature might not be allowed to be implemented until also
+implemented in Emacs for a free system.
+
+** Mouse gestures
+
+The "mac" port defines the gestures `swipe-left/right/up/down',
+`magnify-up/down', and `rotate-left/right'.
+
+It also binds the magnification commands to change the font
+size. (This should be not be done in a specific interface, instead
+Emacs should do this binding globally.)
+
+Note: This feature might not be allowed to be implemented until also
+implemented in Emacs for a free system.
+
+** Synthesize bold fonts
+
+* Open issues
+
+This section contains issues where there is an ongoing debate.
+
+** Key bindings of CMD and ALT
+
+Currently in the "ns" port, ALT is bound to Meta and CMD is bound to
+Super -- allowing the user to use typical OS X commands like CMD-A to
+mark everything.
+
+Unfortunately, when using an international keyboard, you can't type
+normal characters like "(" etc.
+
+There are many alternative key bindings. One solution is to bind CMD
+to Meta and pass ALT to the system.  In fact, this is what Emacs did up
+to, and including, version 22.  Also, this is how the "mac" port binds
+the keys.
+
+One could envision asymmetrical variants as well, however, this is
+inappropriate for the default setting.
+
+See the discussion on emacs-devel [[https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg01575.html][part 1]] and [[https://lists.gnu.org/archive/html/emacs-devel/2016-01/msg00008.html][part 2]].
+
+* Bugs
+
+This sections contains a small selection of bugs which are hard to
+fix.  For other bugs, see the official bug tracker debbugs.gnu.org.
+
+** Incorrect translation of Super modifier with Ctrl or Meta on OS X
+
+When pressing `M-s-a', Emacs replies "M-s-å is undefined".  What
+happened is a mix of Emacs view that Meta and Super has been pressed,
+and OS X view that ALT-a should yield "å".
+
+The bug reports suggests two different patched, unfortunately, none
+work properly.  For example:
+
+   Use a Swedish keyboard layout
+
+   (setq ns-alternate-modifier nil)
+
+   "CMD-ALT-9"
+
+Today, this correctly yields that s-] is undefined.  With the either
+of the two patches, Emacs responds that s-9 was pressed.
+
+More investigation is needed to fix this problem.
+
+Links:
+- [[http://debbugs.gnu.org/cgi/bugreport.cgi?bug%3D19977][bug#19977]]
+- [[http://debbugs.gnu.org/cgi/bugreport.cgi?bug%3D21330][bug#21330]]
+- [[http://debbugs.gnu.org/cgi/bugreport.cgi?bug%3D21551][bug#21551]]
+
+** Toggline the toolbar in fullheight or maximized modes
+
+The toolbar, in the NS interface, is not considered part of the text
+area.  When it is toggled, the Emacs frame change height accordingly.
+
+Unfortunately, this also occurs when the frame is in fullheight or
+maximized modes (N.B. this is not the same as "fullscreen").  The
+effect is that the full frame size either increases (stretching down
+below the lower edge of the screen) or decreases (leaving space
+between the lower edge of the frame and the lower edge of the screen).
+
+A better solution would be for the frame to retain its size,
+i.e. change the text area.
+
+This is related to the `frame-inhibit-implied-resize' issue.
+
+* Internal development features
+
+** Regression test system (or at least a checklist)
+
+Today, after each change to the user interface, Emacs must be manually
+tested.  Often, small details are overlooked ("Oh, I didn't test
+toggling the tool-bar in one of the full screen modes, when multiple
+frame were open -- silly me.")
+
+It would be an enormous help if this could be tested automatically.
+Many features are generic, however, the NS interface provides a number
+of unique features.
+
+*** Existing packages
+
+Note that there is a generic UI test named "[[http://debbugs.gnu.org/cgi/bugreport.cgi?bug%3D21415#284][frame-test.el]]".  The NS
+interface pass this, with the exception of two toolbar related
+errors.
+
+*** Anders frame test
+
+Anders Lindgren  has implmented some (very basic)
+tests for full screen, toolbar, and auto-hiding the menu bar.
+
+** Make sure all build variants work
+
+Emacs can be build in a number of different ways.  For each feature,
+consider if is really is "NS" specific, or if it should be applied to
+all build versions.
+
+- With the "NS" interface.  This is the normal way to build Emacs on
+  OS X.
+
+- With the "X11" interface.  On OS X, this is mainly of interest to
+  developers of Emacs to get a "reference" interface implementations.
+  However, it might be of interest for people working remotely, as X11
+  applications can be used over a network connection.
+
+- Console only.

commit 6de26a78de83ca9a8f096056e91c14fdb2aedc84
Author: Michael Albinus 
Date:   Sat Feb 20 14:20:54 2016 +0100

    Report also result in `file-notify--test-event-handler'

diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el
index 1817484..346120e 100644
--- a/test/automated/file-notify-tests.el
+++ b/test/automated/file-notify-tests.el
@@ -281,7 +281,8 @@ and the event to `file-notify--test-events'."
     (unless (string-match
 	     (regexp-quote ".#")
 	     (file-notify--event-file-name file-notify--test-event))
-      (message "file-notify--test-event-handler %S" file-notify--test-event)
+      (message "file-notify--test-event-handler result: %s event: %S"
+               (null (ert-test-failed-p result)) file-notify--test-event)
       (setq file-notify--test-events
 	    (append file-notify--test-events `(,file-notify--test-event))
 	    file-notify--test-results

commit 5d17ae7d467c2d6146a5792d676621aa3d69b21a
Author: Michael Albinus 
Date:   Sat Feb 20 14:04:36 2016 +0100

    Improve file-notify-test08-watched-file-in-watched-dir
    
    * test/automated/file-notify-tests.el (file-notify--test-desc2):
    New variable.
    (file-notify--test-cleanup): Use it.
    (file-notify--test-event-handler): Enable trace.
    (file-notify-test08-watched-file-in-watched-dir): Tag it as
    :expensive-test.  Rewrite callbacks to use
    `file-notify--test-event-handler'.  Read events in loop.  Check
    `file-notify--test-results'.
    (file-notify-test08-watched-file-in-watched-dir): Fix docstring.

diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el
index affe34a..1817484 100644
--- a/test/automated/file-notify-tests.el
+++ b/test/automated/file-notify-tests.el
@@ -59,6 +59,7 @@
 (defvar file-notify--test-tmpfile1 nil)
 (defvar file-notify--test-desc nil)
 (defvar file-notify--test-desc1 nil)
+(defvar file-notify--test-desc2 nil)
 (defvar file-notify--test-results nil)
 (defvar file-notify--test-event nil)
 (defvar file-notify--test-events nil)
@@ -79,6 +80,7 @@ It is different for local and remote file notification libraries.")
   "Cleanup after a test."
   (file-notify-rm-watch file-notify--test-desc)
   (file-notify-rm-watch file-notify--test-desc1)
+  (file-notify-rm-watch file-notify--test-desc2)
 
   (ignore-errors
     (delete-file (file-newest-backup file-notify--test-tmpfile)))
@@ -99,6 +101,7 @@ It is different for local and remote file notification libraries.")
         file-notify--test-tmpfile1 nil
         file-notify--test-desc nil
         file-notify--test-desc1 nil
+        file-notify--test-desc2 nil
         file-notify--test-results nil
         file-notify--test-events nil)
   (when file-notify--test-event
@@ -278,7 +281,7 @@ and the event to `file-notify--test-events'."
     (unless (string-match
 	     (regexp-quote ".#")
 	     (file-notify--event-file-name file-notify--test-event))
-      ;;(message "file-notify--test-event-handler %S" file-notify--test-event)
+      (message "file-notify--test-event-handler %S" file-notify--test-event)
       (setq file-notify--test-events
 	    (append file-notify--test-events `(,file-notify--test-event))
 	    file-notify--test-results
@@ -552,8 +555,8 @@ longer than timeout seconds for the events to be delivered."
 	  (let (file-notify--test-events)
 	    (file-notify-rm-watch file-notify--test-desc)))
 
-        ;; Check the global sequence again just to make sure that
-        ;; `file-notify--test-events' has been set correctly.
+        ;; Check the global sequence just to make sure that all
+        ;; results are as expected.
         (should file-notify--test-results)
         (dolist (result file-notify--test-results)
           (when (ert-test-failed-p result)
@@ -948,6 +951,7 @@ descriptors that were issued when registering the watches.  This
 test caters for the situation in bug#22736 where the callback for
 the directory received events for the file with the descriptor of
 the file watch."
+  :tags '(:expensive-test)
   (skip-unless (file-notify--test-local-enabled))
 
   (unwind-protect
@@ -957,42 +961,52 @@ the file watch."
         (setq file-notify--test-tmpfile1
               (let ((temporary-file-directory file-notify--test-tmpfile))
                 (make-temp-file "file")))
-	(cl-flet ((dir-callback
-                   (ev)
-                   (should (equal file-notify--test-desc (car ev))))
-                  (file-callback
-                   (ev)
-                   (should (equal file-notify--test-desc1 (car ev)))))
+	(cl-flet ((dir-callback (event)
+                   (message "dir-callback %s" event)
+                   (let ((file-notify--test-desc file-notify--test-desc1))
+                     (file-notify--test-event-handler event)))
+                  (file-callback (event)
+                   (message "file-callback %s" event)
+                   (let ((file-notify--test-desc file-notify--test-desc2))
+                     (file-notify--test-event-handler event))))
           (should
-           (setq file-notify--test-desc
+           (setq file-notify--test-desc1
                  (file-notify-add-watch
                   file-notify--test-tmpfile
                   '(change attribute-change) #'dir-callback)))
           (should
-           (setq file-notify--test-desc1
+           (setq file-notify--test-desc2
                  (file-notify-add-watch
                   file-notify--test-tmpfile1
                   '(change attribute-change) #'file-callback)))
-          (should (file-notify-valid-p file-notify--test-desc))
           (should (file-notify-valid-p file-notify--test-desc1))
+          (should (file-notify-valid-p file-notify--test-desc2))
           (dotimes (i 100)
+            (read-event nil nil file-notify--test-read-event-timeout)
             (if (< 0 (random))
                 (write-region
                  "any text" nil file-notify--test-tmpfile1 t 'no-message)
               (let ((temporary-file-directory file-notify--test-tmpfile))
-                (make-temp-file "fileX")))))
-        ;; After saving the buffer, the descriptor is still valid.
-        (should (file-notify-valid-p file-notify--test-desc))
-        (should (file-notify-valid-p file-notify--test-desc1))
-	(delete-file file-notify--test-tmpfile1)
-        (delete-directory file-notify--test-tmpfile))
+                (make-temp-file "fileX"))))
+          ;; After saving the buffer, the descriptor is still valid.
+          (should (file-notify-valid-p file-notify--test-desc1))
+          (should (file-notify-valid-p file-notify--test-desc2))
+          (delete-file file-notify--test-tmpfile1)
+          (delete-directory file-notify--test-tmpfile 'recursive))
+
+        ;; Check the global sequence just to make sure that all
+        ;; results are as expected.
+        (should file-notify--test-results)
+        (dolist (result file-notify--test-results)
+          (when (ert-test-failed-p result)
+            (ert-fail
+             (cadr (ert-test-result-with-condition-condition result))))))
 
     ;; Cleanup.
     (file-notify--test-cleanup)))
 
 (file-notify--deftest-remote file-notify-test08-watched-file-in-watched-dir
-  "Checks what `file-notify-test08-watched-file-in-watched-dir'
-checks, just for a remote directory and file.")
+  "Check `file-notify-test08-watched-file-in-watched-dir' for remote files.")
 
 (defun file-notify-test-all (&optional interactive)
   "Run all tests for \\[file-notify]."

commit 1cb126866df0b01aa2eaa51eeba696997d6d37ae
Author: Stephen Berman 
Date:   Sat Feb 20 13:44:47 2016 +0100

    Fix todo-mode item date editing bugs
    
    * lisp/calendar/todo-mode.el (todo-edit-item--header): Prevent out of
    range error by making sure the value of the numerical month date
    component cannot be nil.  Prevent wrong type error on trying to edit
    day number in February by making sure numerical instead of string
    value of the year component is passed to todo-read-date.
    (todo-read-date): When using the numerical month date component make
    sure to use `*' for an arbitrary month instead of its numerical value.

diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 29d8dfc..94cd08e 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -2262,9 +2262,8 @@ made in the number or names of categories."
 		 (mlist (append tmn-array nil))
 		 (tma-array todo-month-abbrev-array)
 		 (mablist (append tma-array nil))
-		 (yy (and oyear (unless (string= oyear "*")
-				  (string-to-number oyear))))
-		 (mm (or (and omonth (unless (string= omonth "*")
+		 (yy (and oyear (string-to-number oyear))) ; 0 if year is "*".
+		 (mm (or (and omonth (if (string= omonth "*") 13
 				       (string-to-number omonth)))
 			 (1+ (- (length mlist)
 				(length (or (member omonthname mlist)
@@ -2330,12 +2329,11 @@ made in the number or names of categories."
 			     (if omonth
 				 (number-to-string mm)
 			       (aref tma-array (1- mm))))))
-		(let ((yy (string-to-number year)) ; 0 if year is "*".
-		      ;; When mm is 13 (corresponding to "*" as value
-		      ;; of month), this raises an args-out-of-range
-		      ;; error in calendar-last-day-of-month, so use 1
-		      ;; (corresponding to January) to get 31 days.
-		      (mm (if (= mm 13) 1 mm)))
+                ;; Since the number corresponding to the arbitrary
+                ;; month name "*" is out of the range of
+                ;; calendar-last-day-of-month, set it to 1
+                ;; (corresponding to January) to allow 31 days.
+                (let ((mm (if (= mm 13) 1 mm)))
 		  (if (> (string-to-number day)
 			 (calendar-last-day-of-month mm yy))
 		      (user-error "%s %s does not have %s days"
@@ -2347,7 +2345,7 @@ made in the number or names of categories."
 		      monthname omonthname
 		      day (cond
 			   ((not current-prefix-arg)
-			    (todo-read-date 'day mm oyear))
+			    (todo-read-date 'day mm yy))
 			   ((string= oday "*")
 			    (user-error "Cannot increment *"))
 			   ((or (string= omonth "*") (string= omonthname "*"))
@@ -5933,7 +5931,7 @@ number of the last the day of the month."
     (and day (setq day (if (eq day '*)
 			   (symbol-name '*)
 			 (number-to-string day))))
-    (and month (setq month (if (eq month '*)
+    (and month (setq month (if (= month 13)
 			       (symbol-name '*)
 			     (number-to-string month))))
     (if arg

commit 1e996cfbd0ab64e4d74d92a80ef3aefc39249462
Author: Eli Zaretskii 
Date:   Sat Feb 20 13:03:20 2016 +0200

    Fix "[:upper:]" for non-ASCII characters
    
    * src/regex.c (re_match_2_internal): Support [:upper:] and
    [:lower:] for non-ASCII characters.  (Bug#18150)

diff --git a/src/regex.c b/src/regex.c
index dd3f2b3..164eb46 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -5444,7 +5444,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1,
 	case charset:
 	case charset_not:
 	  {
-	    register unsigned int c;
+	    register unsigned int c, corig;
 	    boolean not = (re_opcode_t) *(p - 1) == charset_not;
 	    int len;
 
@@ -5473,7 +5473,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1,
 	      }
 
 	    PREFETCH ();
-	    c = RE_STRING_CHAR_AND_LENGTH (d, len, target_multibyte);
+	    corig = c = RE_STRING_CHAR_AND_LENGTH (d, len, target_multibyte);
 	    if (target_multibyte)
 	      {
 		int c1;
@@ -5517,11 +5517,17 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1,
 	      {
 		int class_bits = CHARSET_RANGE_TABLE_BITS (&p[-1]);
 
-		if (  (class_bits & BIT_LOWER && ISLOWER (c))
+		if (  (class_bits & BIT_LOWER
+		       && (ISLOWER (c)
+			   || (corig != c
+			       && c == upcase (corig) && ISUPPER(c))))
 		    | (class_bits & BIT_MULTIBYTE)
 		    | (class_bits & BIT_PUNCT && ISPUNCT (c))
 		    | (class_bits & BIT_SPACE && ISSPACE (c))
-		    | (class_bits & BIT_UPPER && ISUPPER (c))
+		    | (class_bits & BIT_UPPER
+		       && (ISUPPER (c)
+			   || (corig != c
+			       && c == downcase (corig) && ISLOWER (c))))
 		    | (class_bits & BIT_WORD  && ISWORD  (c))
 		    | (class_bits & BIT_ALPHA && ISALPHA (c))
 		    | (class_bits & BIT_ALNUM && ISALNUM (c))

commit 896f993dec0e7b18ed701a5dee6c224083d6e1dd
Author: Lars Ingebrigtsen 
Date:   Sat Feb 20 19:05:45 2016 +1100

    Allow customising the article mode cursor behavior
    
    * doc/misc/gnus.texi (HTML): Mention gnus-article-show-cursor.
    
    * lisp/gnus/gnus-art.el (gnus-article-show-cursor): New variable.
    (gnus-article-mode): Use it.

diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 7bcf1cd..2ae2e18 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -11828,6 +11828,10 @@ A value of 0.7 (the default) means that they are allowed to take up
 this, and Emacs supports it, then the images will be rescaled down to
 fit these criteria.
 
+@item gnus-article-show-cursor
+@vindex gnus-article-show-cursor
+If non-@code{nil}, display the cursor in the article buffer even when
+the article buffer isn't the current buffer.
 @end table
 
 To use this, make sure that you have @code{w3m} and @code{curl}
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 079d16b..4ea8bae 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -527,6 +527,12 @@ each invocation of the saving commands."
 		 (item :tag "never" nil)
 		 (sexp :tag "once" :format "%t\n" :value t)))
 
+(defcustom gnus-article-show-cursor nil
+  "If non-nil, show the cursor in the Article buffer even when not selected."
+  :version "25.1"
+  :group 'gnus-article
+  :type 'bool)
+
 (defcustom gnus-saved-headers gnus-visible-headers
   "Headers to keep if `gnus-save-all-headers' is nil.
 If `gnus-save-all-headers' is non-nil, this variable will be ignored.
@@ -4521,7 +4527,8 @@ commands:
   (set (make-local-variable 'nobreak-char-display) nil)
   ;; Enable `gnus-article-remove-images' to delete images shr.el renders.
   (set (make-local-variable 'shr-put-image-function) 'gnus-shr-put-image)
-  (setq cursor-in-non-selected-windows nil)
+  (unless gnus-article-show-cursor
+    (setq cursor-in-non-selected-windows nil))
   (gnus-set-default-directory)
   (buffer-disable-undo)
   (setq buffer-read-only t

commit 24c1c1d5c3bc14cccdeb41f5de39a8d11993c566
Author: Ari Roponen 
Date:   Sat Feb 20 18:57:44 2016 +1100

    Use pop-to-buffer-same-window in woman.el
    
    * lisp/woman.el (woman-really-find-file): Work around going to
    the wrong buffer by using `pop-to-buffer-same-window' (bug#22332).
    (WoMan-find-buffer): Ditto.

diff --git a/lisp/woman.el b/lisp/woman.el
index 28a4798..a4a0da2 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -1654,7 +1654,7 @@ Do not call directly!"
 	     (setq woman-frame (make-frame)))))
     (set-buffer (get-buffer-create bufname))
     (condition-case nil
-        (display-buffer (current-buffer))
+        (pop-to-buffer-same-window (current-buffer))
       (error (pop-to-buffer (current-buffer))))
     (buffer-disable-undo)
     (setq buffer-read-only nil)
@@ -2064,14 +2064,14 @@ alist in `woman-buffer-alist' and return nil."
   (if (zerop woman-buffer-number)
       (let ((buffer (get-buffer (cdr (car woman-buffer-alist)))))
 	(if buffer
-	    (display-buffer buffer)
+	    (pop-to-buffer-same-window buffer)
 	  ;; Delete alist element:
 	  (setq woman-buffer-alist (cdr woman-buffer-alist))
 	  nil))
     (let* ((prev-ptr (nthcdr (1- woman-buffer-number) woman-buffer-alist))
 	   (buffer (get-buffer (cdr (car (cdr prev-ptr))))))
       (if buffer
-	  (display-buffer buffer)
+	  (pop-to-buffer-same-window buffer)
 	;; Delete alist element:
 	(setcdr prev-ptr (cdr (cdr prev-ptr)))
 	(if (>= woman-buffer-number (length woman-buffer-alist))

commit 2a75f64dd2cdc714da70321e61ca38e79af8b100
Author: Tassilo Horn 
Date:   Sat Feb 20 08:33:11 2016 +0100

    New filenotify test for bug#22736
    
    * test/automated/file-notify-tests.el
    (file-notify-test08-watched-file-in-watched-dir):
    (file-notify--test-desc1): New filenotify test for bug#22736

diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el
index a852182..affe34a 100644
--- a/test/automated/file-notify-tests.el
+++ b/test/automated/file-notify-tests.el
@@ -58,6 +58,7 @@
 (defvar file-notify--test-tmpfile nil)
 (defvar file-notify--test-tmpfile1 nil)
 (defvar file-notify--test-desc nil)
+(defvar file-notify--test-desc1 nil)
 (defvar file-notify--test-results nil)
 (defvar file-notify--test-event nil)
 (defvar file-notify--test-events nil)
@@ -77,6 +78,7 @@ It is different for local and remote file notification libraries.")
 (defun file-notify--test-cleanup ()
   "Cleanup after a test."
   (file-notify-rm-watch file-notify--test-desc)
+  (file-notify-rm-watch file-notify--test-desc1)
 
   (ignore-errors
     (delete-file (file-newest-backup file-notify--test-tmpfile)))
@@ -96,6 +98,7 @@ It is different for local and remote file notification libraries.")
   (setq file-notify--test-tmpfile nil
         file-notify--test-tmpfile1 nil
         file-notify--test-desc nil
+        file-notify--test-desc1 nil
         file-notify--test-results nil
         file-notify--test-events nil)
   (when file-notify--test-event
@@ -938,6 +941,59 @@ longer than timeout seconds for the events to be delivered."
 (file-notify--deftest-remote file-notify-test07-backup
   "Check that backup keeps file notification for remote files.")
 
+(ert-deftest file-notify-test08-watched-file-in-watched-dir ()
+  "Watches a directory and a file in that directory separately.
+Checks that the callbacks are only called with events with
+descriptors that were issued when registering the watches.  This
+test caters for the situation in bug#22736 where the callback for
+the directory received events for the file with the descriptor of
+the file watch."
+  (skip-unless (file-notify--test-local-enabled))
+
+  (unwind-protect
+      (progn
+        (setq file-notify--test-tmpfile
+              (make-temp-file "dir" t))
+        (setq file-notify--test-tmpfile1
+              (let ((temporary-file-directory file-notify--test-tmpfile))
+                (make-temp-file "file")))
+	(cl-flet ((dir-callback
+                   (ev)
+                   (should (equal file-notify--test-desc (car ev))))
+                  (file-callback
+                   (ev)
+                   (should (equal file-notify--test-desc1 (car ev)))))
+          (should
+           (setq file-notify--test-desc
+                 (file-notify-add-watch
+                  file-notify--test-tmpfile
+                  '(change attribute-change) #'dir-callback)))
+          (should
+           (setq file-notify--test-desc1
+                 (file-notify-add-watch
+                  file-notify--test-tmpfile1
+                  '(change attribute-change) #'file-callback)))
+          (should (file-notify-valid-p file-notify--test-desc))
+          (should (file-notify-valid-p file-notify--test-desc1))
+          (dotimes (i 100)
+            (if (< 0 (random))
+                (write-region
+                 "any text" nil file-notify--test-tmpfile1 t 'no-message)
+              (let ((temporary-file-directory file-notify--test-tmpfile))
+                (make-temp-file "fileX")))))
+        ;; After saving the buffer, the descriptor is still valid.
+        (should (file-notify-valid-p file-notify--test-desc))
+        (should (file-notify-valid-p file-notify--test-desc1))
+	(delete-file file-notify--test-tmpfile1)
+        (delete-directory file-notify--test-tmpfile))
+
+    ;; Cleanup.
+    (file-notify--test-cleanup)))
+
+(file-notify--deftest-remote file-notify-test08-watched-file-in-watched-dir
+  "Checks what `file-notify-test08-watched-file-in-watched-dir'
+checks, just for a remote directory and file.")
+
 (defun file-notify-test-all (&optional interactive)
   "Run all tests for \\[file-notify]."
   (interactive "p")

commit c9bccf72cbaed5ca2fb5b829687886db92fa6d6b
Author: Marcin Borkowski 
Date:   Sat Feb 20 18:33:48 2016 +1100

    Report critical battery errors
    
    * lisp/battery.el (battery-pmset): Report critical battery
    errors (bug#18157).

diff --git a/lisp/battery.el b/lisp/battery.el
index d029369..b5e312f 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -628,12 +628,12 @@ The following %-sequences are provided:
 	    (cond ((looking-at "; charging")
 		   (setq battery-status "charging"
 			 battery-status-symbol "+"))
-		  ((< (string-to-number load-percentage) battery-load-low)
-		   (setq battery-status "low"
-			 battery-status-symbol "-"))
 		  ((< (string-to-number load-percentage) battery-load-critical)
 		   (setq battery-status "critical"
 			 battery-status-symbol "!"))
+		  ((< (string-to-number load-percentage) battery-load-low)
+		   (setq battery-status "low"
+			 battery-status-symbol "-"))
 		  (t
 		   (setq battery-status "high"
 			 battery-status-symbol "")))

commit d675db943e8e55321a58353600d3574a8433c52d
Author: Kaushal Modi 
Date:   Fri Feb 19 16:55:54 2016 +1100

    Make eww message toggling message clearer
    
    * lisp/net/eww.el (eww-toggle-fonts): Make the message
    clearer.
    
    Copyright-paperwork-exempt: Yes

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 551517b..796eacf 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1502,11 +1502,10 @@ If CHARSET is nil then use UTF-8."
 (defun eww-toggle-fonts ()
   "Toggle whether to use monospaced or font-enabled layouts."
   (interactive)
-  (message "Fonts are now %s"
-	   (if (setq shr-use-fonts (not shr-use-fonts))
-	       "on"
-	     "off"))
-  (eww-reload))
+  (setq shr-use-fonts (not shr-use-fonts))
+  (eww-reload)
+  (message "Proportional fonts are now %s"
+           (if shr-use-fonts "on" "off")))
 
 ;;; Bookmarks code
 

commit 5e0bb40f8ad2e4c0f202c6e35f437596b2dcb885
Author: Mark Oteiza 
Date:   Thu Feb 18 21:38:44 2016 -0500

    * lisp/calc/calc-units.el (math-standard-units): Update to 2014 CODATA adjustment.

diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index b23670f..07d9ac9 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -43,6 +43,9 @@
 ;;;             Measures, by François Cardarelli)
 ;;; All conversions are exact unless otherwise noted.
 
+;; CODATA values updated February 2016, using 2014 adjustment
+;; http://arxiv.org/pdf/1507.07956.pdf
+
 (defvar math-standard-units
   '( ;; Length
     ( m       nil                    "*Meter" )
@@ -136,8 +139,8 @@
               "31.10347680 g") ;; ESUWM, 1/12 exact value for lbt
     ( ct      "(2/10) g"             "Carat" nil
               "0.2 g") ;; ESUWM
-    ( u       "1.660538782*10^(-27) kg"    "Unified atomic mass" nil
-              "1.660538782 10^-27 kg (*)");;(approx) CODATA
+    ( u       "1.660539040*10^(-27) kg"    "Unified atomic mass" nil
+              "1.660539040 10^-27 kg (*)");;(approx) CODATA
 
     ;; Force
     ( N       "m kg/s^2"             "*Newton" )
@@ -204,8 +207,8 @@
     ( C       "A s"                   "Coulomb" )
     ( Fdy     "ech Nav"               "Faraday" )
     ( e       "ech"                   "Elementary charge" )
-    ( ech     "1.602176487*10^(-19) C"     "Elementary charge" nil
-              "1.602176487 10^-19 C (*)") ;;(approx) CODATA
+    ( ech     "1.6021766208*10^(-19) C"     "Elementary charge" nil
+              "1.6021766208 10^-19 C (*)") ;;(approx) CODATA
     ( V       "W/A"                   "Volt" )
     ( ohm     "V/A"                   "Ohm" )
     ( Ω       "ohm"                   "Ohm" )
@@ -254,51 +257,51 @@
 
     ;; Other physical quantities
     ;; The values are from CODATA, and are approximate.
-    ( h       "6.62606896*10^(-34) J s"     "*Planck's constant" nil
-              "6.62606896 10^-34 J s (*)")
+    ( h       "6.626070040*10^(-34) J s"     "*Planck's constant" nil
+              "6.626070040 10^-34 J s (*)")
     ( hbar    "h / (2 pi)"                  "Planck's constant" ) ;; Exact
     ( mu0     "4 pi 10^(-7) H/m"            "Permeability of vacuum") ;; Exact
     ( μ0      "mu0"                         "Permeability of vacuum") ;; Exact
     ( eps0    "1 / (mu0 c^2)"               "Permittivity of vacuum" )
     ( ε0      "eps0"                        "Permittivity of vacuum" )
-    ( G       "6.67428*10^(-11) m^3/(kg s^2)"    "Gravitational constant" nil
-              "6.67428 10^-11 m^3/(kg s^2) (*)")
-    ( Nav     "6.02214179*10^(23) / mol"    "Avogadro's constant" nil
-              "6.02214179 10^23 / mol (*)")
-    ( me      "9.10938215*10^(-31) kg"      "Electron rest mass" nil
-              "9.10938215 10^-31 kg (*)")
-    ( mp      "1.672621637*10^(-27) kg"     "Proton rest mass" nil
-              "1.672621637 10^-27 kg (*)")
-    ( mn      "1.674927211*10^(-27) kg"     "Neutron rest mass" nil
-              "1.674927211 10^-27 kg (*)")
-    ( mmu     "1.88353130*10^(-28) kg"      "Muon rest mass" nil
-              "1.88353130 10^-28 kg (*)")
+    ( G       "6.67408*10^(-11) m^3/(kg s^2)"    "Gravitational constant" nil
+              "6.67408 10^-11 m^3/(kg s^2) (*)")
+    ( Nav     "6.022140857*10^(23) / mol"    "Avogadro's constant" nil
+              "6.022140857 10^23 / mol (*)")
+    ( me      "9.10938356*10^(-31) kg"      "Electron rest mass" nil
+              "9.10938356 10^-31 kg (*)")
+    ( mp      "1.672621898*10^(-27) kg"     "Proton rest mass" nil
+              "1.672621898 10^-27 kg (*)")
+    ( mn      "1.674927471*10^(-27) kg"     "Neutron rest mass" nil
+              "1.674927471 10^-27 kg (*)")
+    ( mmu     "1.883531594*10^(-28) kg"      "Muon rest mass" nil
+              "1.883531594 10^-28 kg (*)")
     ( mμ      "mmu"                         "Muon rest mass" nil
-              "1.88353130 10^-28 kg (*)")
-    ( Ryd     "10973731.568527 /m"          "Rydberg's constant" nil
-              "10973731.568527 /m (*)")
-    ( k       "1.3806504*10^(-23) J/K"      "Boltzmann's constant" nil
-              "1.3806504 10^-23 J/K (*)")
+              "1.883531594 10^-28 kg (*)")
+    ( Ryd     "10973731.568508 /m"          "Rydberg's constant" nil
+              "10973731.568508 /m (*)")
+    ( k       "1.38064852*10^(-23) J/K"      "Boltzmann's constant" nil
+              "1.38064852 10^-23 J/K (*)")
     ( sigma   "5.670367*10^(-8) W/(m^2 K^4)" "Stefan-Boltzmann constant" nil
               "5.670367 10^-8 W/(m^2 K^4) (*)")
     ( σ       "sigma" "Stefan-Boltzmann constant" nil
               "5.670367 10^-8 W/(m^2 K^4) (*)")
-    ( alpha   "7.2973525376*10^(-3)"        "Fine structure constant" nil
-              "7.2973525376 10^-3 (*)")
+    ( alpha   "7.2973525664*10^(-3)"        "Fine structure constant" nil
+              "7.2973525664 10^-3 (*)")
     ( α       "alpha"                        "Fine structure constant" nil
-              "7.2973525376 10^-3 (*)")
-    ( muB     "927.400915*10^(-26) J/T"     "Bohr magneton" nil
-              "927.400915 10^-26 J/T (*)")
-    ( muN     "5.05078324*10^(-27) J/T"     "Nuclear magneton" nil
-              "5.05078324 10^-27 J/T (*)")
-    ( mue     "-928.476377*10^(-26) J/T"    "Electron magnetic moment" nil
-              "-928.476377 10^-26 J/T (*)")
-    ( mup     "1.410606662*10^(-26) J/T"    "Proton magnetic moment" nil
-              "1.410606662 10^-26 J/T (*)")
-    ( R0      "8.314472 J/(mol K)"          "Molar gas constant" nil
-              "8.314472 J/(mol K) (*)")
-    ( V0      "22.710981*10^(-3) m^3/mol"   "Standard volume of ideal gas" nil
-              "22.710981 10^-3 m^3/mol (*)")
+              "7.2973525664 10^-3 (*)")
+    ( muB     "927.4009994*10^(-26) J/T"     "Bohr magneton" nil
+              "927.4009994 10^-26 J/T (*)")
+    ( muN     "5.050783699*10^(-27) J/T"     "Nuclear magneton" nil
+              "5.050783699 10^-27 J/T (*)")
+    ( mue     "-928.4764620*10^(-26) J/T"    "Electron magnetic moment" nil
+              "-928.4764620 10^-26 J/T (*)")
+    ( mup     "1.4106067873*10^(-26) J/T"    "Proton magnetic moment" nil
+              "1.4106067873 10^-26 J/T (*)")
+    ( R0      "8.3144598 J/(mol K)"          "Molar gas constant" nil
+              "8.3144598 J/(mol K) (*)")
+    ( V0      "22.710947*10^(-3) m^3/mol"   "Standard volume of ideal gas" nil
+              "22.710947 10^-3 m^3/mol (*)")
     ;; Logarithmic units
     ( Np      nil    "*Neper")
     ( dB      "(ln(10)/20) Np" "decibel")))

commit fa8fd65ef40eacb808583a968c3621c228bf021c
Author: Eli Zaretskii 
Date:   Thu Feb 18 19:42:17 2016 +0200

    ; Improve character-folding entries in NEWS
    
    * etc/NEWS: Expand description of character-folding support.
    Suggested by Mark Oteiza .

diff --git a/etc/NEWS b/etc/NEWS
index f4ea3a0..6d57091 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -610,10 +610,6 @@ item as before.
 ** Search and Replace
 
 +++
-*** New user option `search-default-mode'
-specifies the default mode for I-search.
-
-+++
 *** `isearch' and `query-replace' can now perform character folding in matches.
 Isearch does that by default, while `query-replace' will do that if
 the new variable `replace-character-fold' is customized to a non-nil
@@ -628,6 +624,18 @@ and ”), and the letter a will match all of its accented cousins, even
 those composed of multiple characters, as well as many other symbols
 like ℀, ℁, ⒜, and ⓐ.
 
+Character folding is enabled by customizing `search-default-mode' to
+the value `character-fold-to-regexp'.  If you want to turn character
+folding off, customize the value of `search-default-mode' to the `nil'
+value.  You can also toggle character folding in the middle of a
+search by typing `M-s ''.
+
++++
+*** New user option `search-default-mode'.
+This option specifies the default mode for Isearch.  The default
+value, `character-fold-to-regexp' specifies that Isearch should fold
+characters when searching.
+
 +++
 *** New function `character-fold-to-regexp' can be used
 by searching commands to produce a regexp matching anything that

commit 3722a694fa094f88f7dfe54ccce7ea7cbaab214a
Author: Martin Rudalics 
Date:   Thu Feb 18 11:25:07 2016 +0100

    Fix bugs in window resizing code
    
    * lisp/window.el (adjust-window-trailing-edge): Fix mismatched
    parenthesis.
    (shrink-window, enlarge-window): Fix bug#22723 where windows
    with preserved size would not get resized.  Also now signal an
    error when the window cannot be shrunk or enlarged as requested.

diff --git a/lisp/window.el b/lisp/window.el
index e4669c1..c45e60e 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -3241,9 +3241,9 @@ move it as far as possible in the desired direction."
 	(setq ignore 'preserved)
 	(setq right first-right)
 	(while (and right
-		    (or (window-size-fixed-p right horizontal 'preserved))
-		    (<= (window-size right horizontal t)
-			(window-min-size right horizontal 'preserved t)))
+		    (or (window-size-fixed-p right horizontal 'preserved)
+                        (<= (window-size right horizontal t)
+                            (window-min-size right horizontal 'preserved t))))
 	  (setq right
 		(or (window-right right)
 		    (progn
@@ -3352,12 +3352,12 @@ negative, shrink selected window by -DELTA lines or columns."
       (window--resize-mini-window minibuffer-window (- delta)))
      ((window--resizable-p nil delta horizontal)
       (window-resize nil delta horizontal))
+     ((window--resizable-p nil delta horizontal 'preserved)
+      (window-resize nil delta horizontal 'preserved))
+     ((eq this-command 'enlarge-window)
+      (user-error "Cannot enlarge selected window"))
      (t
-      (window-resize
-       nil (if (> delta 0)
-	       (window-max-delta nil horizontal)
-	     (- (window-min-delta nil horizontal)))
-       horizontal)))))
+      (error "Cannot enlarge selected window")))))
 
 (defun shrink-window (delta &optional horizontal)
   "Make the selected window DELTA lines smaller.
@@ -3387,12 +3387,12 @@ Also see the `window-min-height' variable."
       (window--resize-mini-window minibuffer-window delta))
      ((window--resizable-p nil (- delta) horizontal)
       (window-resize nil (- delta) horizontal))
+     ((window--resizable-p nil (- delta) horizontal 'preserved)
+      (window-resize nil (- delta) horizontal 'preserved))
+     ((eq this-command 'shrink-window)
+      (user-error "Cannot shrink selected window"))
      (t
-      (window-resize
-       nil (if (> delta 0)
-	       (- (window-min-delta nil horizontal))
-	     (window-max-delta nil horizontal))
-       horizontal)))))
+      (error "Cannot shrink selected window")))))
 
 (defun maximize-window (&optional window)
   "Maximize WINDOW.

commit 289d5c6e976d4ea557b0f71008468d42ee0258ad
Author: Eli Zaretskii 
Date:   Wed Feb 17 17:48:30 2016 +0200

    Fix decoding DOS EOL in a unibyte buffer
    
    * src/coding.c (decode_eol): Loop over bytes, not characters.
    (Bug#5251)

diff --git a/src/coding.c b/src/coding.c
index 3bee16c..e591bed 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -6828,11 +6828,11 @@ decode_eol (struct coding_system *coding)
 	}
       else
 	{
-	  ptrdiff_t pos_byte = coding->dst_pos_byte;
 	  ptrdiff_t pos = coding->dst_pos;
-	  ptrdiff_t pos_end = pos + coding->produced_char - 1;
+	  ptrdiff_t pos_byte = coding->dst_pos_byte;
+	  ptrdiff_t pos_end = pos_byte + coding->produced - 1;
 
-	  while (pos < pos_end)
+	  while (pos_byte < pos_end)
 	    {
 	      p = BYTE_POS_ADDR (pos_byte);
 	      if (*p == '\r' && p[1] == '\n')

commit 2abcb06cab03cf9040348146fcc0e3e93ae24a58
Author: Alan Mackenzie 
Date:   Wed Feb 17 11:53:01 2016 +0000

    Correct c-parse-state cache manipulation error.
    
    * lisp/progmodes/cc-engine.el (c-invalidate-state-cache-1): Correct a
    comparison bound.  Amend comments.

diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index d4dcb1c..69a2a53 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -3241,7 +3241,7 @@ comment at the start of cc-engine.el for more info."
   ;; pair element into an open paren element.  Doing that would mean that the
   ;; new open paren wouldn't have the required preceding paren pair element.
   ;;
-  ;; This function is called from c-after-change.
+  ;; This function is called from c-before-change.
 
   ;; The caches of non-literals:
   ;; Note that we use "<=" for the possibility of the second char of a two-char
@@ -3265,7 +3265,7 @@ comment at the start of cc-engine.el for more info."
     ;; below `here'.  To maintain its consistency, we may need to insert a new
     ;; brace pair.
     (let ((here-bol (c-point 'bol here))
-	  too-high-pa		  ; recorded {/(/[ next above here, or nil.
+	  too-high-pa  ; recorded {/(/[ next above or just below here, or nil.
 	  dropped-cons		  ; was the last removed element a brace pair?
 	  pa)
       ;; The easy bit - knock over-the-top bits off `c-state-cache'.
@@ -3277,7 +3277,7 @@ comment at the start of cc-engine.el for more info."
 
       ;; Do we need to add in an earlier brace pair, having lopped one off?
       (if (and dropped-cons
-	       (< too-high-pa (+ here c-state-cache-too-far)))
+	       (<= too-high-pa here))
 	  (c-append-lower-brace-pair-to-state-cache too-high-pa here here-bol))
       (setq c-state-cache-good-pos (or (c-state-cache-after-top-paren)
 				       (c-state-get-min-scan-pos)))))

commit 14aec913ac3f0dd408487c0e8327403e0f239964
Author: Daiki Ueno 
Date:   Wed Feb 17 16:44:16 2016 +0900

    Take advantage of new GnuPG version check function
    
    * lisp/emacs-lisp/package.el (epg-configuration-find): Declare.
    (package-refresh-contents): Use `epg-configuration-find' to check if EPG
    is usable.

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 34772a0..6156f65 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1452,9 +1452,8 @@ loading packages twice."
 (defvar package--downloads-in-progress nil
   "List of in-progress asynchronous downloads.")
 
-(declare-function epg-check-configuration "epg-config"
-                  (config &optional minimum-version))
-(declare-function epg-configuration "epg-config" ())
+(declare-function epg-configuration-find "epg-config"
+                  (protocol &optional force))
 (declare-function epg-import-keys-from-file "epg" (context keys))
 
 ;;;###autoload
@@ -1554,11 +1553,15 @@ downloads in the background."
   (let ((default-keyring (expand-file-name "package-keyring.gpg"
                                            data-directory))
         (inhibit-message async))
+    (if (get 'package-check-signature 'saved-value)
+        (when package-check-signature
+          (epg-configuration-find 'OpenPGP))
+      (setq package-check-signature
+            (if (epg-configuration-find 'OpenPGP)
+                'allow-unsigned)))
     (when (and package-check-signature (file-exists-p default-keyring))
       (condition-case-unless-debug error
-          (progn
-            (epg-check-configuration (epg-configuration))
-            (package-import-keyring default-keyring))
+          (package-import-keyring default-keyring)
         (error (message "Cannot import default keyring: %S" (cdr error))))))
   (package--download-and-read-archives async))
 

commit e80c2a7b47d161f00aac096b9d58a18879a122e8
Author: Daiki Ueno 
Date:   Wed Feb 17 16:32:25 2016 +0900

    Make GnuPG version check robuster
    
    We changed the default gpg program to "gpg2" from "gpg" in the commit
    f93d669a16bd3cb3f43f0c8cfd22fe18b627a6a1.  However, there are two
    maintained branches (2.0 and 2.1) and Emacs doesn't work well with 2.0
    series.  Check the actual version of "gpg2" at run time, and properly
    divert to "gpg" if necessary.
    * lisp/epg-config.el: Require 'cl-lib for `cl-destructuring-bind'.
    (epg-config--program-alist): New variable.
    (epg--configurations): New variable.
    (epg-configuration-find): New function.
    (epg-config--make-gpg-configuration): New function.
    (epg-config--make-gpgsm-configuration): New function.
    (epg-configuration): Mark as obsolete.
    * lisp/epg.el (epg-context): Use `epg-configuration-find'.

diff --git a/lisp/epg-config.el b/lisp/epg-config.el
index c41d97d..1736456 100644
--- a/lisp/epg-config.el
+++ b/lisp/epg-config.el
@@ -23,6 +23,8 @@
 
 ;;; Code:
 
+(eval-when-compile (require 'cl-lib))
+
 (defconst epg-package-name "epg"
   "Name of this package.")
 
@@ -76,12 +78,67 @@ Note that the buffer name starts with a space."
 
 (defconst epg-gpg-minimum-version "1.4.3")
 
+(defconst epg-config--program-alist
+  '((OpenPGP
+     epg-gpg-program
+     epg-config--make-gpg-configuration
+     ("gpg2" . "2.1.6") ("gpg" . "1.4.3"))
+    (CMS
+     epg-gpgsm-program
+     epg-config--make-gpgsm-configuration
+     ("gpgsm" . "2.0.4")))
+  "Alist used to obtain the usable configuration of executables.
+The first element of each entry is protocol symbol, which is
+either `OpenPGP' or `CMS'.  The second element is a symbol where
+the executable name is remembered.  The third element is a
+function which constructs a configuration object (actually a
+plist).  The rest of the entry is an alist mapping executable
+names to the minimum required version suitable for the use with
+Emacs.")
+
+(defvar epg--configurations nil)
+
 ;;;###autoload
-(defun epg-configuration ()
-  "Return a list of internal configuration parameters of `epg-gpg-program'."
+(defun epg-configuration-find (protocol &optional force)
+  "Find or create a usable configuration to handle PROTOCOL.
+This function first looks at the existing configuration found by
+the previous invocation of this function, unless FORCE is non-nil.
+
+Then it walks through `epg-config--program-alist'.  If
+`epg-gpg-program' or `epg-gpgsm-program' is already set with
+custom, use it.  Otherwise, it tries the programs listed in the
+entry until the version requirement is met."
+  (let ((entry (assq protocol epg-config--program-alist)))
+    (unless entry
+      (error "Unknown protocol %S" protocol))
+    (cl-destructuring-bind (symbol constructor . alist)
+        (cdr entry)
+      (or (and (not force) (alist-get protocol epg--configurations))
+          (let ((executable (get symbol 'saved-value)))
+            (if executable
+                (ignore-errors
+                  (let ((configuration (funcall constructor executable)))
+                    (epg-check-configuration configuration)
+                    (push (cons protocol configuration) epg--configurations)
+                    configuration))
+              (catch 'found
+                (dolist (program-version alist)
+                  (setq executable (executable-find (car program-version)))
+                  (when executable
+                    (let ((configuration
+                           (funcall constructor executable)))
+                      (when (ignore-errors
+                              (epg-check-configuration configuration
+                                                       (cdr program-version))
+                              t)
+                        (push (cons protocol configuration) epg--configurations)
+                        (throw 'found configuration))))))))))))
+
+;; Create an `epg-configuration' object for `gpg', using PROGRAM.
+(defun epg-config--make-gpg-configuration (program)
   (let (config groups type args)
     (with-temp-buffer
-      (apply #'call-process epg-gpg-program nil (list t nil) nil
+      (apply #'call-process program nil (list t nil) nil
 	     (append (if epg-gpg-home-directory
 			 (list "--homedir" epg-gpg-home-directory))
 		     '("--with-colons" "--list-config")))
@@ -113,10 +170,30 @@ Note that the buffer name starts with a space."
 			 type args))))
 	 (t
 	  (setq config (cons (cons type args) config))))))
+    (push (cons 'program program) config)
     (if groups
 	(cons (cons 'groups groups) config)
       config)))
 
+;; Create an `epg-configuration' object for `gpgsm', using PROGRAM.
+(defun epg-config--make-gpgsm-configuration (program)
+  (with-temp-buffer
+    (call-process program nil (list t nil) nil "--version")
+    (goto-char (point-min))
+    (when (looking-at "\\S-+ (")
+      (goto-char (match-end 0))
+      (backward-char)
+      (forward-sexp)
+      (skip-syntax-forward "-" (point-at-eol))
+      (list (cons 'program program)
+            (cons 'version (buffer-substring (point) (point-at-eol)))))))
+
+;;;###autoload
+(defun epg-configuration ()
+  "Return a list of internal configuration parameters of `epg-gpg-program'."
+  (declare (obsolete epg-configuration-find "25.1"))
+  (epg-config--make-gpg-configuration epg-gpg-program))
+
 (defun epg-config--parse-version (string)
   (let ((index 0)
 	version)
diff --git a/lisp/epg.el b/lisp/epg.el
index 1f9db23..1a18ab2 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -186,11 +186,11 @@
                           compress-algorithm
                  &aux
                  (program
-                  (pcase protocol
-                    (`OpenPGP epg-gpg-program)
-                    (`CMS epg-gpgsm-program)
-                    (_ (signal 'epg-error
-                               (list "unknown protocol" protocol)))))))
+                  (let ((configuration (epg-configuration-find protocol)))
+                    (unless configuration
+                      (signal 'epg-error
+                              (list "no usable configuration" protocol)))
+                    (alist-get 'program configuration)))))
                (:copier nil)
                (:predicate nil))
   protocol

commit 15a946479c96fdce693c13acfe41a66266ffcadb
Author: Paul Eggert 
Date:   Tue Feb 16 23:25:21 2016 -0800

    Fix x-load-color-file pointer signedness
    
    * src/xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
    For sscanf and int *, use %d, not %u.
    Problem found on Ubuntu 15.10 x32, which lacks X support.

diff --git a/src/xfaces.c b/src/xfaces.c
index 2880eed..7762e0f 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -6207,7 +6207,7 @@ where R,G,B are numbers between 0 and 255 and name is an arbitrary string.  */)
       int num;
 
       while (fgets (buf, sizeof (buf), fp) != NULL) {
-	if (sscanf (buf, "%u %u %u %n", &red, &green, &blue, &num) == 3)
+	if (sscanf (buf, "%d %d %d %n", &red, &green, &blue, &num) == 3)
 	  {
 #ifdef HAVE_NTGUI
 	    int color = RGB (red, green, blue);

commit 132dbf089ffdc6c77c9383f225f2458d21c869a5
Author: Paul Eggert 
Date:   Tue Feb 16 15:01:50 2016 -0800

    * lisp/time-stamp.el (time-stamp-time-zone): Fix doc string punct.

diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el
index d58942c..d4cddc9 100644
--- a/lisp/time-stamp.el
+++ b/lisp/time-stamp.el
@@ -120,7 +120,7 @@ If nil, no notification is given."
 
 (defcustom time-stamp-time-zone nil
   "The time zone to be used by \\[time-stamp].
-Its format is that of the ZONE argument of the `format-time-string' function,"
+Its format is that of the ZONE argument of the `format-time-string' function."
   :type '(choice (const :tag "Emacs local time" nil)
                  (const :tag "Universal Time" t)
                  (const :tag "system wall clock time" wall)

commit 78ab6f120d043fd3fdef29cc6604cc3366791d4d
Author: Mark Oteiza 
Date:   Tue Feb 16 17:16:16 2016 -0500

    Follow convention for greek letter constants.
    
    * list/calc/calc-units.el (math-standard-units):
    Add "sigma" and alias σ to it.

diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index ea711ce..b23670f 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -279,7 +279,9 @@
               "10973731.568527 /m (*)")
     ( k       "1.3806504*10^(-23) J/K"      "Boltzmann's constant" nil
               "1.3806504 10^-23 J/K (*)")
-    ( σ       "5.670367*10^(-8) W/(m^2 K^4)" "Stefan-Boltzmann constant" nil
+    ( sigma   "5.670367*10^(-8) W/(m^2 K^4)" "Stefan-Boltzmann constant" nil
+              "5.670367 10^-8 W/(m^2 K^4) (*)")
+    ( σ       "sigma" "Stefan-Boltzmann constant" nil
               "5.670367 10^-8 W/(m^2 K^4) (*)")
     ( alpha   "7.2973525376*10^(-3)"        "Fine structure constant" nil
               "7.2973525376 10^-3 (*)")

commit 106b5bb68dc2ff0776b920a7f31ffc3b17ef8013
Author: Mark Oteiza 
Date:   Tue Feb 16 12:04:39 2016 -0500

    Add Stefan-Boltzmann constant to calc units table.
    
    * lisp/calc/calc-units.el (math-standard-units):
    Add Stefan-Boltzmann constant.

diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index 5959960..ea711ce 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -279,6 +279,8 @@
               "10973731.568527 /m (*)")
     ( k       "1.3806504*10^(-23) J/K"      "Boltzmann's constant" nil
               "1.3806504 10^-23 J/K (*)")
+    ( σ       "5.670367*10^(-8) W/(m^2 K^4)" "Stefan-Boltzmann constant" nil
+              "5.670367 10^-8 W/(m^2 K^4) (*)")
     ( alpha   "7.2973525376*10^(-3)"        "Fine structure constant" nil
               "7.2973525376 10^-3 (*)")
     ( α       "alpha"                        "Fine structure constant" nil

commit b96baa8c92fcc10959ac9f76c8451820555e6a25
Author: Mark Oteiza 
Date:   Tue Feb 16 11:48:46 2016 -0500

    * lisp/calc/calc-units.el (math-build-units-table-buffer): Use special-mode.

diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index 0c89208..5959960 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -1628,7 +1628,7 @@ If COMP or STD is non-nil, put that in the units table instead."
                "TeX point will be `pt' instead of `texpt', for example.\n"
                "To avoid conflicts, the unit names for pint and parsec will\n"
                "be `pint' and `parsec' instead of `pt' and `pc'."))))
-	  (view-mode)
+	  (special-mode)
 	  (message "Formatting units table...done"))
 	(setq math-units-table-buffer-valid t)
 	(let ((oldbuf (current-buffer)))

commit 5f91cf95b0cc21b6950db0d8dac6320dc52eb8d4
Author: Glenn Morris 
Date:   Tue Feb 16 11:49:05 2016 -0500

    Avoid loading cl-lib for term/xterm.elc, eg in -Q -nw.  (Bug#22669)
    
    * lisp/emacs-lisp/cl-generic.el (cl--generic-dispatchers):
    Prefill with relevant elements for term/xterm.

diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index 5413bdb..7ad9f30 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -1019,6 +1019,10 @@ The value returned is a list of elements of the form
 
 (cl--generic-prefill-dispatchers 0 (eql nil))
 (cl--generic-prefill-dispatchers window-system (eql nil))
+(cl--generic-prefill-dispatchers (terminal-parameter nil 'xterm--get-selection)
+                                 (eql nil))
+(cl--generic-prefill-dispatchers (terminal-parameter nil 'xterm--set-selection)
+                                 (eql nil))
 
 ;;; Support for cl-defstructs specializers.
 

commit 2d40f7d6354fbd9b55fa5a987b7673dea5664254
Author: Tassilo Horn 
Date:   Tue Feb 16 17:38:44 2016 +0100

    Fix soffice UserInstallation-URL for Windows
    
    * lisp/doc-view.el (doc-view-odf->pdf-converter-soffice): Fix
    UserInstallation-URL when calling soffice on Windows.

diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index af7f199..9d912c3 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -987,6 +987,11 @@ is named like ODF with the extension turned to pdf."
     (doc-view-start-process "odf->pdf" doc-view-odf->pdf-converter-program
 			    (list
 			     (concat "-env:UserInstallation=file://"
+                                     ;; The URL must be
+                                     ;; file:///C:/tmp/dir on Windows.
+                                     ;; https://wiki.documentfoundation.org/UserProfile.
+                                     (when (eq system-type 'windows-nt)
+                                       "/")
 				     tmp-user-install-dir)
 			     "--headless" "--convert-to" "pdf"
 			     "--outdir" (doc-view--current-cache-dir) odf)

commit b1a3ebedba88689d26f44cf7db338104b849ae99
Author: Lars Ingebrigtsen 
Date:   Tue Feb 16 17:38:58 2016 +1100

    Fix display of 
 elements
    
    * lisp/net/eww.el (eww-display-html): Remove CRLF before
    parsing so that 
 elements don't render with ^M at the end
    of the lines.

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index da920c1..551517b 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -402,6 +402,10 @@ Currently this means either text/html or application/xhtml+xml."
 		(condition-case nil
 		    (decode-coding-region (point) (point-max) encode)
 		  (coding-system-error nil))
+                (save-excursion
+                  ;; Remove CRLF before parsing.
+                  (while (re-search-forward "\r$" nil t)
+                    (replace-match "" t t)))
 		(libxml-parse-html-region (point) (point-max))))))
 	(source (and (null document)
 		     (buffer-substring (point) (point-max)))))

commit 57d0e3d5ae33184aa66b477d151ec32a4374c836
Author: Glenn Morris 
Date:   Mon Feb 15 22:25:01 2016 -0800

    ; * lisp/help-fns.el: Remove outdated comment.

diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 547bc7e..6e8a108 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -296,7 +296,6 @@ suitable file is found, return nil."
 		      (substring-no-properties lib-name 0 -1)
 		    lib-name)
 		file-name))
-	     ;; The next three forms are from `find-source-lisp-file'.
 	     (src-file (locate-library file-name t nil 'readable)))
 	(and src-file (file-readable-p src-file) src-file))))))
 

commit 7a0628d82eceb37ce3800a265cfc310945985fbd
Author: Glenn Morris 
Date:   Mon Feb 15 21:38:21 2016 -0800

    ; * admin/make-tarball.txt: Mention cleaning.

diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt
index 0730b94..030ad4c 100644
--- a/admin/make-tarball.txt
+++ b/admin/make-tarball.txt
@@ -5,7 +5,7 @@ Instructions to create pretest or release tarballs. -*- coding: utf-8 -*-
 
 Steps to take before starting on the first pretest in any release sequence:
 
-0.  The release branch (e.g. emacs-24) should already have been made
+0.  The release branch (e.g. emacs-25) should already have been made
     and you should use it for all that follows.  Diffs from this
     branch should be going to the emacs-diffs mailing list.
 
@@ -26,6 +26,13 @@ General steps (for each step, check for possible errors):
 1.   git pull     # fetch from the repository
      git status   # check for locally modified files
 
+    Ensure that you have a clean, unmodified state.
+    If you switched in-place from another branch to the release branch,
+    there could be inappropriate generated ignored files left over.
+    You might want to use "git status --ignored" to check for such files,
+    or some form of "git clean -x".  It's probably simpler and safer to
+    make a new working directory exclusively for the release branch.
+
 2.  Regenerate the etc/AUTHORS file:
       M-: (require 'authors) RET
       M-x authors RET