commit 369c67a6bba8ec36d9b2f29413848f5898a9e1ea (HEAD, refs/remotes/origin/master) Author: Johan Bockgård Date: Sun Nov 19 16:29:14 2017 +0100 copyright.el: Avoid inadvertent point motion * lisp/emacs-lisp/copyright.el (copyright-update-year): Enlarge the scope of save-excursion. Reported in: https://lists.gnu.org/archive/html/emacs-devel/2017-04/msg00271.html diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index 11569e4056..25dc77c725 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -186,9 +186,10 @@ skips to the end of all the years." (substring copyright-current-year -2)) (if (or noquery (save-window-excursion - (switch-to-buffer (current-buffer)) - ;; Fixes some point-moving oddness (bug#2209). + ;; switch-to-buffer might move point when + ;; switch-to-buffer-preserve-window-point is non-nil. (save-excursion + (switch-to-buffer (current-buffer)) (y-or-n-p (if replace (concat "Replace copyright year(s) by " copyright-current-year "? ") commit f41bcae3e55c4510e9f0f303962f04186f7ebdef Author: Michael Albinus Date: Sun Nov 19 12:18:37 2017 +0100 ; * test/lisp/net/tramp-tests.el (tramp-test24-file-acl): Remove test instrumentation. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 1ad286bf60..80735529c1 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2968,47 +2968,28 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (should (file-acl tmp-name1)) (copy-file tmp-name1 tmp-name3 nil nil nil 'preserve-permissions) (should (file-acl tmp-name3)) - (tramp--test-message - "tmp-name1:\n%stmp-name3:\n%s" - (file-acl tmp-name1) (file-acl tmp-name3)) (should (string-equal (file-acl tmp-name1) (file-acl tmp-name3))) ;; Different permissions mean different ACLs. (set-file-modes tmp-name1 #o777) (set-file-modes tmp-name3 #o444) - (tramp--test-message - "tmp-name1:\n%stmp-name3:\n%s" - (file-acl tmp-name1) (file-acl tmp-name3)) (should-not (string-equal (file-acl tmp-name1) (file-acl tmp-name3))) - ;; Copy ACL. Since we don't know whether Emacs is built - ;; with local ACL support, we must check it. - (when (set-file-acl tmp-name3 (file-acl tmp-name1)) - (tramp--test-message - "tmp-name1:\n%stmp-name3:\n%s" - (file-acl tmp-name1) (file-acl tmp-name3)) - (should (string-equal (file-acl tmp-name1) (file-acl tmp-name3)))) + ;; Copy ACL. + (file-acl tmp-name1) (file-acl tmp-name3) + (should (string-equal (file-acl tmp-name1) (file-acl tmp-name3)))) ;; Two files with same ACLs. (delete-file tmp-name1) (copy-file tmp-name3 tmp-name1 nil nil nil 'preserve-permissions) (should (file-acl tmp-name1)) - (tramp--test-message - "tmp-name1:\n%stmp-name3:\n%s" - (file-acl tmp-name1) (file-acl tmp-name3)) (should (string-equal (file-acl tmp-name1) (file-acl tmp-name3))) ;; Different permissions mean different ACLs. (set-file-modes tmp-name1 #o777) (set-file-modes tmp-name3 #o444) - (tramp--test-message - "tmp-name1:\n%stmp-name3:\n%s" - (file-acl tmp-name1) (file-acl tmp-name3)) (should-not (string-equal (file-acl tmp-name1) (file-acl tmp-name3))) ;; Copy ACL. (set-file-acl tmp-name1 (file-acl tmp-name3)) - (tramp--test-message - "tmp-name1:\n%stmp-name3:\n%s" - (file-acl tmp-name1) (file-acl tmp-name3)) (should (string-equal (file-acl tmp-name1) (file-acl tmp-name3)))) ;; Cleanup. commit ecda09c22dd546af70cc02bd6211640f5b38558d Author: Michael Albinus Date: Sun Nov 19 11:06:19 2017 +0100 ; * test/lisp/net/tramp-tests.el (tramp-test24-file-acl): More instrumentation diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 6d5cc5df8f..1ad286bf60 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2942,23 +2942,14 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (should (file-acl tmp-name1)) (copy-file tmp-name1 tmp-name2 nil nil nil 'preserve-permissions) (should (file-acl tmp-name2)) - (tramp--test-message - "tmp-name1:\n%stmp-name2:\n%s" - (file-acl tmp-name1) (file-acl tmp-name2)) (should (string-equal (file-acl tmp-name1) (file-acl tmp-name2))) ;; Different permissions mean different ACLs. (set-file-modes tmp-name1 #o777) (set-file-modes tmp-name2 #o444) - (tramp--test-message - "tmp-name1:\n%stmp-name2:\n%s" - (file-acl tmp-name1) (file-acl tmp-name2)) (should-not (string-equal (file-acl tmp-name1) (file-acl tmp-name2))) ;; Copy ACL. (should (set-file-acl tmp-name2 (file-acl tmp-name1))) - (tramp--test-message - "tmp-name1:\n%stmp-name2:\n%s" - (file-acl tmp-name1) (file-acl tmp-name2)) (should (string-equal (file-acl tmp-name1) (file-acl tmp-name2))) ;; An invalid ACL does not harm. (should-not (set-file-acl tmp-name2 "foo"))) @@ -2989,12 +2980,13 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (file-acl tmp-name1) (file-acl tmp-name3)) (should-not (string-equal (file-acl tmp-name1) (file-acl tmp-name3))) - ;; Copy ACL. - (set-file-acl tmp-name3 (file-acl tmp-name1)) - (tramp--test-message - "tmp-name1:\n%stmp-name3:\n%s" - (file-acl tmp-name1) (file-acl tmp-name3)) - (should (string-equal (file-acl tmp-name1) (file-acl tmp-name3))) + ;; Copy ACL. Since we don't know whether Emacs is built + ;; with local ACL support, we must check it. + (when (set-file-acl tmp-name3 (file-acl tmp-name1)) + (tramp--test-message + "tmp-name1:\n%stmp-name3:\n%s" + (file-acl tmp-name1) (file-acl tmp-name3)) + (should (string-equal (file-acl tmp-name1) (file-acl tmp-name3)))) ;; Two files with same ACLs. (delete-file tmp-name1)