commit 313955110b242cd18fc19bd168032d3ddf39fe94 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Sat May 16 22:23:28 2020 -0700 Don’t attempt to modify constant strings * lisp/bookmark.el (bookmark-bmenu-set-header): Use copy-sequence instead of concat, for clarity. Also, the byte-compiler optimizes (concat "a" "b") into "ab". * lisp/button.el (make-text-button): * test/lisp/erc/erc-track-tests.el (erc-track--erc-faces-in): * test/lisp/password-cache-tests.el: (password-cache-tests-add-and-remove) (password-cache-tests-read-from-cache) (password-cache-tests-in-cache-p, password-cache-tests-read) (password-cache-tests-reset) (password-cache-tests-add/expires-key) (password-cache-tests-no-password-cache): Don’t attempt to modify constant strings. * lisp/progmodes/elisp-mode.el (elisp--xref-format) (elisp--xref-format-extra): Don’t attempt to modify constant strings via put-text-property. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-loop-across-ref): Don’t attempt to modify constant vectors or strings. diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 0fa77ed322..5bb1698171 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -1723,7 +1723,7 @@ deletion, or > if it is flagged for displaying." ;; according to `bookmark-bookmarks-timestamp'. (defun bookmark-bmenu-set-header () "Set the immutable header line." - (let ((header (concat "%% " "Bookmark"))) + (let ((header (copy-sequence "%% Bookmark"))) (when bookmark-bmenu-toggle-filenames (setq header (concat header (make-string (- bookmark-bmenu-file-column diff --git a/lisp/button.el b/lisp/button.el index 3a6a6de774..f969a03cb0 100644 --- a/lisp/button.el +++ b/lisp/button.el @@ -349,7 +349,7 @@ Also see `insert-text-button'." (or (plist-member properties 'type) (plist-member properties :type)))) (when (stringp beg) - (setq object beg beg 0 end (length object))) + (setq object (copy-sequence beg) beg 0 end (length object))) ;; Disallow setting the `category' property directly. (when (plist-get properties 'category) (error "Button `category' property may not be set directly")) diff --git a/lisp/password-cache.el b/lisp/password-cache.el index 5e5f3240bc..86d802f283 100644 --- a/lisp/password-cache.el +++ b/lisp/password-cache.el @@ -31,7 +31,7 @@ ;; ;; Minibuffer prompt for password. ;; => "foo" ;; -;; (password-cache-add "test" "foo") +;; (password-cache-add "test" (copy-sequence "foo")) ;; => nil ;; (password-read "Password? " "test") diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index b737134f90..d37eb8c152 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -655,18 +655,16 @@ functions are annotated with \"\" via the ;; WORKAROUND: This is nominally a constant, but the text properties ;; are not preserved thru dump if use defconst. See bug#21237. (defvar elisp--xref-format - (let ((str "(%s %s)")) - (put-text-property 1 3 'face 'font-lock-keyword-face str) - (put-text-property 4 6 'face 'font-lock-function-name-face str) - str)) + #("(%s %s)" + 1 3 (face font-lock-keyword-face) + 4 6 (face font-lock-function-name-face))) ;; WORKAROUND: This is nominally a constant, but the text properties ;; are not preserved thru dump if use defconst. See bug#21237. (defvar elisp--xref-format-extra - (let ((str "(%s %s %s)")) - (put-text-property 1 3 'face 'font-lock-keyword-face str) - (put-text-property 4 6 'face 'font-lock-function-name-face str) - str)) + #("(%s %s %s)" + 1 3 (face font-lock-keyword-face) + 4 6 (face font-lock-function-name-face))) (defvar find-feature-regexp);; in find-func.el diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el index 983e79ac57..24bbad0cc6 100644 --- a/test/lisp/emacs-lisp/cl-macs-tests.el +++ b/test/lisp/emacs-lisp/cl-macs-tests.el @@ -425,7 +425,9 @@ collection clause." '(2 3 4 5 6)))) (ert-deftest cl-macs-loop-across-ref () - (should (equal (cl-loop with my-vec = ["one" "two" "three"] + (should (equal (cl-loop with my-vec = (vector (cl-copy-seq "one") + (cl-copy-seq "two") + (cl-copy-seq "three")) for x across-ref my-vec do (setf (aref x 0) (upcase (aref x 0))) finally return my-vec) diff --git a/test/lisp/erc/erc-track-tests.el b/test/lisp/erc/erc-track-tests.el index 7e924c2234..457f08cb73 100644 --- a/test/lisp/erc/erc-track-tests.el +++ b/test/lisp/erc/erc-track-tests.el @@ -107,8 +107,8 @@ (ert-deftest erc-track--erc-faces-in () "`erc-faces-in' should pick up both 'face and 'font-lock-face properties." - (let ((str0 "is bold") - (str1 "is bold")) + (let ((str0 (copy-sequence "is bold")) + (str1 (copy-sequence "is bold"))) ;; Turn on Font Lock mode: this initialize `char-property-alias-alist' ;; to '((face font-lock-face)). Note that `font-lock-mode' don't ;; turn on the mode if the test is run on batch mode or if the diff --git a/test/lisp/password-cache-tests.el b/test/lisp/password-cache-tests.el index 01f4358fc5..55ebbfce7f 100644 --- a/test/lisp/password-cache-tests.el +++ b/test/lisp/password-cache-tests.el @@ -28,31 +28,31 @@ (ert-deftest password-cache-tests-add-and-remove () (let ((password-data (copy-hash-table password-data))) - (password-cache-add "foo" "bar") + (password-cache-add "foo" (copy-sequence "bar")) (should (eq (password-in-cache-p "foo") t)) (password-cache-remove "foo") (should (not (password-in-cache-p "foo"))))) (ert-deftest password-cache-tests-read-from-cache () (let ((password-data (copy-hash-table password-data))) - (password-cache-add "foo" "bar") + (password-cache-add "foo" (copy-sequence "bar")) (should (equal (password-read-from-cache "foo") "bar")) (should (not (password-read-from-cache nil))))) (ert-deftest password-cache-tests-in-cache-p () (let ((password-data (copy-hash-table password-data))) - (password-cache-add "foo" "bar") + (password-cache-add "foo" (copy-sequence "bar")) (should (password-in-cache-p "foo")) (should (not (password-read-from-cache nil))))) (ert-deftest password-cache-tests-read () (let ((password-data (copy-hash-table password-data))) - (password-cache-add "foo" "bar") + (password-cache-add "foo" (copy-sequence "bar")) (should (equal (password-read nil "foo") "bar")))) (ert-deftest password-cache-tests-reset () (let ((password-data (copy-hash-table password-data))) - (password-cache-add "foo" "bar") + (password-cache-add "foo" (copy-sequence "bar")) (password-reset) (should (not (password-in-cache-p "foo"))))) @@ -60,14 +60,14 @@ :tags '(:expensive-test) (let ((password-data (copy-hash-table password-data)) (password-cache-expiry 0.01)) - (password-cache-add "foo" "bar") + (password-cache-add "foo" (copy-sequence "bar")) (sit-for 0.1) (should (not (password-in-cache-p "foo"))))) (ert-deftest password-cache-tests-no-password-cache () (let ((password-data (copy-hash-table password-data)) (password-cache nil)) - (password-cache-add "foo" "bar") + (password-cache-add "foo" (copy-sequence "bar")) (should (not (password-in-cache-p "foo"))) (should (not (password-read-from-cache "foo"))))) commit 1fc4e3fb3f6caba6a4ca69060c7992ea5d24ff36 Author: Dmitry Gutov Date: Sun May 17 05:00:46 2020 +0300 ; Bump the project.el version to trigger a new release diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 2092d692b5..198f040fb2 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1,7 +1,7 @@ ;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- ;; Copyright (C) 2015-2020 Free Software Foundation, Inc. -;; Version: 0.1.2 +;; Version: 0.1.3 ;; Package-Requires: ((emacs "26.3")) ;; This is a GNU ELPA :core package. Avoid using functionality that commit c7bc28bf038e08fcc03e5dc96cd762af06b34e09 Author: Paul Eggert Date: Sat May 16 17:04:15 2020 -0700 Don’t attempt to modify constant conses From a patch privately suggested by Mattias Engdegård on 2020-05-11 in a followup to Bug#40671. * admin/charsets/cp51932.awk: * admin/charsets/eucjp-ms.awk: Generate code that does not modify constant conses. * doc/misc/emacs-mime.texi (Encoding Customization): * lisp/emacs-lisp/byte-opt.el (byte-compile-side-effect-free-ops): * lisp/frameset.el (frameset-persistent-filter-alist): * lisp/gnus/gnus-sum.el (gnus-article-mode-line-format-alist): Use append instead of nconc. * lisp/language/japanese.el (japanese-ucs-cp932-to-jis-map) (jisx0213-to-unicode): Use mapcar instead of mapc. * lisp/language/lao-util.el (lao-transcription-consonant-alist) (lao-transcription-vowel-alist): * lisp/language/tibetan.el (tibetan-subjoined-transcription-alist): Use copy-sequence. * test/src/fns-tests.el (fns-tests-nreverse): (fns-tests-sort, fns-tests-collate-sort) (fns-tests-string-version-lessp, fns-tests-mapcan): Use copy-sequence, vector, and list. diff --git a/admin/charsets/cp51932.awk b/admin/charsets/cp51932.awk index 6aac98815b..c355509524 100644 --- a/admin/charsets/cp51932.awk +++ b/admin/charsets/cp51932.awk @@ -43,13 +43,14 @@ BEGIN { END { print ")))"; - print " (mapc #'(lambda (x)"; - print " (setcar x (decode-char 'japanese-jisx0208 (car x))))"; - print " map)"; + print " (setq map (mapcar (lambda (x)"; + print " (cons (decode-char 'japanese-jisx0208 (car x))"; + print " (cdr x)))"; + print " map))"; print " (define-translation-table 'cp51932-decode map)"; - print " (mapc #'(lambda (x)"; - print " (let ((tmp (car x)))"; - print " (setcar x (cdr x)) (setcdr x tmp)))"; + print " (mapc (lambda (x)"; + print " (let ((tmp (car x)))"; + print " (setcar x (cdr x)) (setcdr x tmp)))"; print " map)"; print " (define-translation-table 'cp51932-encode map))"; print ""; diff --git a/admin/charsets/eucjp-ms.awk b/admin/charsets/eucjp-ms.awk index 0c9f94d0f4..f6a6748ce5 100644 --- a/admin/charsets/eucjp-ms.awk +++ b/admin/charsets/eucjp-ms.awk @@ -93,15 +93,17 @@ function write_entry (unicode) { END { print ")))"; - print " (mapc #'(lambda (x)"; + print " (setq map"; + print " (mapcar"; + print " (lambda (x)"; print " (let ((code (logand (car x) #x7F7F)))"; print " (if (integerp (cdr x))"; - print " (setcar x (decode-char 'japanese-jisx0208 code))"; - print " (setcar x (decode-char 'japanese-jisx0212 code))"; - print " (setcdr x (cadr x)))))"; - print " map)"; + print " (cons (decode-char 'japanese-jisx0208 code) (cdr x))"; + print " (cons (decode-char 'japanese-jisx0212 code)" + print " (cadr x)))))"; + print " map))"; print " (define-translation-table 'eucjp-ms-decode map)"; - print " (mapc #'(lambda (x)"; + print " (mapc (lambda (x)"; print " (let ((tmp (car x)))"; print " (setcar x (cdr x)) (setcdr x tmp)))"; print " map)"; diff --git a/doc/misc/emacs-mime.texi b/doc/misc/emacs-mime.texi index 42a7750b9a..2f38dcd495 100644 --- a/doc/misc/emacs-mime.texi +++ b/doc/misc/emacs-mime.texi @@ -917,7 +917,7 @@ Here's an example: @lisp (add-to-list 'gnus-newsgroup-variables 'mm-coding-system-priorities) (setq gnus-parameters - (nconc + (append ;; Some charsets are just examples! '(("^cn\\." ;; Chinese (mm-coding-system-priorities diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 4f72251aed..62b82e4f32 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1509,7 +1509,7 @@ byte-current-buffer byte-stack-ref)) (defconst byte-compile-side-effect-free-ops - (nconc + (append '(byte-varref byte-nth byte-memq byte-car byte-cdr byte-length byte-aref byte-symbol-value byte-get byte-concat2 byte-concat3 byte-sub1 byte-add1 byte-eqlsign byte-gtr byte-lss byte-leq byte-geq byte-diff byte-negate diff --git a/lisp/frameset.el b/lisp/frameset.el index 10c6914f52..0462d776c0 100644 --- a/lisp/frameset.el +++ b/lisp/frameset.el @@ -396,17 +396,17 @@ Properties can be set with ;; or, if you're only changing a few items, ;; ;; (defvar my-filter-alist -;; (nconc '((my-param1 . :never) -;; (my-param2 . my-filtering-function)) -;; frameset-filter-alist) +;; (append '((my-param1 . :never) +;; (my-param2 . my-filtering-function)) +;; frameset-filter-alist) ;; "My brief customized parameter filter alist.") ;; ;; and pass it to the FILTER arg of the save/restore functions, ;; ALWAYS taking care of not modifying the original lists; if you're ;; going to do any modifying of my-filter-alist, please use ;; -;; (nconc '((my-param1 . :never) ...) -;; (copy-sequence frameset-filter-alist)) +;; (append '((my-param1 . :never) ...) +;; (copy-sequence frameset-filter-alist)) ;; ;; One thing you shouldn't forget is that they are alists, so searching ;; in them is sequential. If you just want to change the default of @@ -445,7 +445,7 @@ DO NOT MODIFY. See `frameset-filter-alist' for a full description.") ;;;###autoload (defvar frameset-persistent-filter-alist - (nconc + (append '((background-color . frameset-filter-sanitize-color) (buffer-list . :never) (buffer-predicate . :never) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 6f367692dd..341f04ad77 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -1501,9 +1501,9 @@ the type of the variable (string, integer, character, etc).") ;; This is here rather than in gnus-art for compilation reasons. (defvar gnus-article-mode-line-format-alist - (nconc '((?w (gnus-article-wash-status) ?s) - (?m (gnus-article-mime-part-status) ?s)) - gnus-summary-mode-line-format-alist)) + (append '((?w (gnus-article-wash-status) ?s) + (?m (gnus-article-mime-part-status) ?s)) + gnus-summary-mode-line-format-alist)) (defvar gnus-last-search-regexp nil "Default regexp for article search command.") diff --git a/lisp/language/japanese.el b/lisp/language/japanese.el index d77efa48c9..9a99245dfd 100644 --- a/lisp/language/japanese.el +++ b/lisp/language/japanese.el @@ -82,9 +82,7 @@ (#x00A6 . #xFFE4) ; BROKEN LINE FULLWIDTH BROKEN LINE ))) (define-translation-table 'japanese-ucs-jis-to-cp932-map map) - (mapc #'(lambda (x) (let ((tmp (car x))) - (setcar x (cdr x)) (setcdr x tmp))) - map) + (setq map (mapcar (lambda (x) (cons (cdr x) (car x))) map)) (define-translation-table 'japanese-ucs-cp932-to-jis-map map)) ;; U+2014 (EM DASH) vs U+2015 (HORIZONTAL BAR) @@ -241,8 +239,10 @@ eucJP-ms is defined in ." (#x2b65 . [#x02E9 #x02E5]) (#x2b66 . [#x02E5 #x02E9]))) table) - (dolist (elt map) - (setcar elt (decode-char 'japanese-jisx0213-1 (car elt)))) + (setq map + (mapcar (lambda (x) (cons (decode-char 'japanese-jisx0213-1 (car x)) + (cdr x))) + map)) (setq table (make-translation-table-from-alist map)) (define-translation-table 'jisx0213-to-unicode table) (define-translation-table 'unicode-to-jisx0213 diff --git a/lisp/language/lao-util.el b/lisp/language/lao-util.el index a20aecee42..fa4c2f7f89 100644 --- a/lisp/language/lao-util.el +++ b/lisp/language/lao-util.el @@ -183,7 +183,9 @@ ;; Semi-vowel-sign-lo and lower vowels are put under the letter. (defconst lao-transcription-consonant-alist - (sort '(;; single consonants + (sort + (copy-sequence + '(;; single consonants ("k" . "ກ") ("kh" . "ຂ") ("qh" . "ຄ") @@ -223,14 +225,16 @@ ("hy" . ["ຫຍ"]) ("hn" . ["ຫນ"]) ("hm" . ["ຫມ"]) - ) - (function (lambda (x y) (> (length (car x)) (length (car y))))))) + )) + (lambda (x y) (> (length (car x)) (length (car y)))))) (defconst lao-transcription-semi-vowel-alist '(("r" . "ຼ"))) (defconst lao-transcription-vowel-alist - (sort '(("a" . "ະ") + (sort + (copy-sequence + '(("a" . "ະ") ("ar" . "າ") ("i" . "ິ") ("ii" . "ີ") @@ -257,8 +261,8 @@ ("ai" . "ໄ") ("ei" . "ໃ") ("ao" . ["ເົາ"]) - ("aM" . "ຳ")) - (function (lambda (x y) (> (length (car x)) (length (car y))))))) + ("aM" . "ຳ"))) + (lambda (x y) (> (length (car x)) (length (car y)))))) ;; Maa-sakod is put at the tail. (defconst lao-transcription-maa-sakod-alist diff --git a/lisp/language/tibetan.el b/lisp/language/tibetan.el index d31cd5cd52..bbd4729f6c 100644 --- a/lisp/language/tibetan.el +++ b/lisp/language/tibetan.el @@ -326,7 +326,9 @@ (defconst tibetan-subjoined-transcription-alist - (sort '(("+k" . "ྐ") + (sort + (copy-sequence + '(("+k" . "ྐ") ("+kh" . "ྑ") ("+g" . "ྒ") ("+gh" . "ྒྷ") @@ -371,8 +373,8 @@ ("+W" . "ྺ") ;; fixed form subscribed WA ("+Y" . "ྻ") ;; fixed form subscribed YA ("+R" . "ྼ") ;; fixed form subscribed RA - ) - (lambda (x y) (> (length (car x)) (length (car y)))))) + )) + (lambda (x y) (> (length (car x)) (length (car y)))))) ;;; ;;; alist for Tibetan base consonant <-> subjoined consonant conversion. diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index c6ceae4a00..b65543a64b 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el @@ -49,21 +49,21 @@ (should-error (nreverse)) (should-error (nreverse 1)) (should-error (nreverse (make-char-table 'foo))) - (should (equal (nreverse "xyzzy") "yzzyx")) - (let ((A [])) + (should (equal (nreverse (copy-sequence "xyzzy")) "yzzyx")) + (let ((A (vector))) (nreverse A) (should (equal A []))) - (let ((A [0])) + (let ((A (vector 0))) (nreverse A) (should (equal A [0]))) - (let ((A [1 2 3 4])) + (let ((A (vector 1 2 3 4))) (nreverse A) (should (equal A [4 3 2 1]))) - (let ((A [1 2 3 4])) + (let ((A (vector 1 2 3 4))) (nreverse A) (nreverse A) (should (equal A [1 2 3 4]))) - (let* ((A [1 2 3 4]) + (let* ((A (vector 1 2 3 4)) (B (nreverse (nreverse A)))) (should (equal A B)))) @@ -146,13 +146,13 @@ ;; Invalid UTF-8 sequences shall be indicated. How to create such strings? (ert-deftest fns-tests-sort () - (should (equal (sort '(9 5 2 -1 5 3 8 7 4) (lambda (x y) (< x y))) + (should (equal (sort (list 9 5 2 -1 5 3 8 7 4) (lambda (x y) (< x y))) '(-1 2 3 4 5 5 7 8 9))) - (should (equal (sort '(9 5 2 -1 5 3 8 7 4) (lambda (x y) (> x y))) + (should (equal (sort (list 9 5 2 -1 5 3 8 7 4) (lambda (x y) (> x y))) '(9 8 7 5 5 4 3 2 -1))) - (should (equal (sort '[9 5 2 -1 5 3 8 7 4] (lambda (x y) (< x y))) + (should (equal (sort (vector 9 5 2 -1 5 3 8 7 4) (lambda (x y) (< x y))) [-1 2 3 4 5 5 7 8 9])) - (should (equal (sort '[9 5 2 -1 5 3 8 7 4] (lambda (x y) (> x y))) + (should (equal (sort (vector 9 5 2 -1 5 3 8 7 4) (lambda (x y) (> x y))) [9 8 7 5 5 4 3 2 -1])) (should (equal (sort @@ -172,7 +172,7 @@ ;; Punctuation and whitespace characters are relevant for POSIX. (should (equal - (sort '("11" "12" "1 1" "1 2" "1.1" "1.2") + (sort (list "11" "12" "1 1" "1 2" "1.1" "1.2") (lambda (a b) (string-collate-lessp a b "POSIX"))) '("1 1" "1 2" "1.1" "1.2" "11" "12"))) ;; Punctuation and whitespace characters are not taken into account @@ -180,7 +180,7 @@ (when (eq system-type 'windows-nt) (should (equal - (sort '("11" "12" "1 1" "1 2" "1.1" "1.2") + (sort (list "11" "12" "1 1" "1 2" "1.1" "1.2") (lambda (a b) (let ((w32-collate-ignore-punctuation t)) (string-collate-lessp @@ -190,7 +190,7 @@ ;; Diacritics are different letters for POSIX, they sort lexicographical. (should (equal - (sort '("Ævar" "Agustín" "Adrian" "Eli") + (sort (list "Ævar" "Agustín" "Adrian" "Eli") (lambda (a b) (string-collate-lessp a b "POSIX"))) '("Adrian" "Agustín" "Eli" "Ævar"))) ;; Diacritics are sorted between similar letters for other locales, @@ -198,7 +198,7 @@ (when (eq system-type 'windows-nt) (should (equal - (sort '("Ævar" "Agustín" "Adrian" "Eli") + (sort (list "Ævar" "Agustín" "Adrian" "Eli") (lambda (a b) (let ((w32-collate-ignore-punctuation t)) (string-collate-lessp @@ -212,7 +212,7 @@ (should (not (string-version-lessp "foo20000.png" "foo12.png"))) (should (string-version-lessp "foo.png" "foo2.png")) (should (not (string-version-lessp "foo2.png" "foo.png"))) - (should (equal (sort '("foo12.png" "foo2.png" "foo1.png") + (should (equal (sort (list "foo12.png" "foo2.png" "foo1.png") 'string-version-lessp) '("foo1.png" "foo2.png" "foo12.png"))) (should (string-version-lessp "foo2" "foo1234")) @@ -432,9 +432,9 @@ (should-error (mapcan)) (should-error (mapcan #'identity)) (should-error (mapcan #'identity (make-char-table 'foo))) - (should (equal (mapcan #'list '(1 2 3)) '(1 2 3))) + (should (equal (mapcan #'list (list 1 2 3)) '(1 2 3))) ;; `mapcan' is destructive - (let ((data '((foo) (bar)))) + (let ((data (list (list 'foo) (list 'bar)))) (should (equal (mapcan #'identity data) '(foo bar))) (should (equal data '((foo bar) (bar)))))) commit a6ebca21b349ccfffdc0d4b84578d4c7a0f3ee22 Author: John Wiegley Date: Sat May 16 11:30:50 2020 -0700 Add a note to eshell.texi that I, too, was a contributor diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 57f713635f..c33ca0ea02 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -158,6 +158,9 @@ this package. The following persons have made contributions to Eshell. @itemize @bullet +@item +John Wiegley is the original author of Eshell. + @item Eli Zaretskii made it possible for Eshell to run without requiring asynchronous subprocess support. This is important for MS-DOS, which commit 788c2480f448e97773172f3e840976dbcdc3e6c8 Merge: a67415a71a b4937f64cd Author: Glenn Morris Date: Sat May 16 10:29:14 2020 -0700 Merge from origin/emacs-27 b4937f64cd (origin/emacs-27) Improve documentation of manually instal... efd4e973a4 Reflect the emacs-devel ELPA/MELPA dispute in FAQ 28541674cd Consider face inheritance when checking region face backgr... e75f6be6cc Fix dired default file operation (bug#41261) 406fb0746c Fix documentation related to 'command-switch-alist'. 747e0a2523 Improve ediff readability in misterioso theme (Bug#41221) 48830c73e7 Fix a crash in handle_display_spec a37290a6f9 In x_hide_tip reset tip_last_frame for GTK+ tooltips only ... 3d81995692 Fix docstring of flymake-make-diagnostic (bug#40351) 632aa9d57a Go back to “Bahá’í” e2406ff60f * lisp/dired.el (dired-toggle-marks): Doc fix. (Bug#41097) # Conflicts: # doc/emacs/building.texi commit a67415a71a1be5419547ac5e2abe51bc6bb37f1d Author: Stefan Kangas Date: Sat May 16 17:48:36 2020 +0200 Remove stale comments * lisp/printing.el (pr-create-interface): * lisp/progmodes/ebnf2ps.el (ebnf-eps-filename, ebnf-trim-right): Remove old comments about Emacs 21/22 compatibility. diff --git a/lisp/printing.el b/lisp/printing.el index 181092ee99..b8879befae 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -5622,8 +5622,6 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order." ;; header (let ((versions (concat "printing v" pr-version " ps-print v" ps-print-version))) - ;; to keep compatibility with Emacs 20 & 21: - ;; DO NOT REPLACE `?\ ' BY `?\s' (widget-insert (make-string (- 79 (length versions)) ?\ ) versions)) (pr-insert-italic "\nCurrent Directory : " 1) (pr-insert-italic default-directory) diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el index 28e7667cda..08cf802bcb 100644 --- a/lisp/progmodes/ebnf2ps.el +++ b/lisp/progmodes/ebnf2ps.el @@ -4975,8 +4975,6 @@ killed after process termination." (defun ebnf-eps-filename (str) (let* ((len (length str)) (stri 0) - ;; to keep compatibility with Emacs 20 & 21: - ;; DO NOT REPLACE `?\ ' BY `?\s' (new (make-string len ?\ ))) (while (< stri len) (aset new stri (aref ebnf-map-name (aref str stri))) @@ -5993,8 +5991,6 @@ killed after process termination." (defun ebnf-trim-right (str) (let* ((len (1- (length str))) (index len)) - ;; to keep compatibility with Emacs 20 & 21: - ;; DO NOT REPLACE `?\ ' BY `?\s' (while (and (> index 0) (= (aref str index) ?\ )) (setq index (1- index))) (if (= index len) commit 7f690a4bf1fff44db67916f8f374dc87ecdc52a6 Author: Stefan Kangas Date: Sat May 16 17:27:58 2020 +0200 Remove some compat code from CEDET * lisp/cedet/data-debug.el (data-debug-overlay-properties) (data-debug-overlay-p, dd-propertize): Redefine as obsolete function aliases. (data-debug-insert-overlay-props, data-debug-insert-hash-table) (data-debug-insert-hash-table-button) (data-debug-insert-widget-properties, data-debug-insert-widget) (data-debug-insert-symbol-from-point) (data-debug-insert-symbol-button, data-debug-insert-string) (data-debug-insert-number, data-debug-thing-alist): Don't use obsolete names. diff --git a/lisp/cedet/data-debug.el b/lisp/cedet/data-debug.el index 075e122e79..604fc40926 100644 --- a/lisp/cedet/data-debug.el +++ b/lisp/cedet/data-debug.el @@ -49,9 +49,9 @@ ;;; Compatibility ;; -(defalias 'data-debug-overlay-properties 'overlay-properties) -(defalias 'data-debug-overlay-p 'overlayp) -(defalias 'dd-propertize 'propertize) +(define-obsolete-function-alias 'data-debug-overlay-properties 'overlay-properties "28.1") +(define-obsolete-function-alias 'data-debug-overlay-p 'overlayp "28.1") +(define-obsolete-function-alias 'dd-propertize 'propertize "28.1") ;;; GENERIC STUFF ;; @@ -73,7 +73,7 @@ The attributes belong to the tag PARENT." "Insert all the parts of OVERLAY. PREFIX specifies what to insert at the start of each line." (let ((attrprefix (concat (make-string (length prefix) ? ) "# ")) - (proplist (data-debug-overlay-properties overlay))) + (proplist (overlay-properties overlay))) (data-debug-insert-property-list proplist attrprefix) ) @@ -393,10 +393,10 @@ PREBUTTONTEXT is some text between prefix and the stuff list button." (lambda (key value) (data-debug-insert-thing key prefix - (dd-propertize "key " 'face font-lock-comment-face)) + (propertize "key " 'face font-lock-comment-face)) (data-debug-insert-thing value prefix - (dd-propertize "val " 'face font-lock-comment-face))) + (propertize "val " 'face font-lock-comment-face))) hash-table)) (defun data-debug-insert-hash-table-from-point (point) @@ -415,9 +415,9 @@ PREBUTTONTEXT is some text between prefix and the stuff list button." (defun data-debug-insert-hash-table-button (hash-table prefix prebuttontext) "Insert HASH-TABLE as expandable button with recursive prefix PREFIX and PREBUTTONTEXT in front of the button text." - (let ((string (dd-propertize (format "%s" hash-table) + (let ((string (propertize (format "%s" hash-table) 'face 'font-lock-keyword-face))) - (insert (dd-propertize + (insert (propertize (concat prefix prebuttontext string) 'ddebug hash-table 'ddebug-indent (length prefix) @@ -444,7 +444,7 @@ PREBUTTONTEXT is some text between prefix and the stuff list button." (data-debug-insert-thing (car (cdr rest)) prefix (concat - (dd-propertize (format "%s" (car rest)) + (propertize (format "%s" (car rest)) 'face font-lock-comment-face) " : ")) (setq rest (cdr (cdr rest)))) @@ -468,9 +468,9 @@ PREBUTTONTEXT is some text between prefix and the stuff list button." A Symbol is a simple thing, but this provides some face and prefix rules. PREFIX is the text that precedes the button. PREBUTTONTEXT is some text between prefix and the thing." - (let ((string (dd-propertize (format "#" (car widget)) + (let ((string (propertize (format "#" (car widget)) 'face 'font-lock-keyword-face))) - (insert (dd-propertize + (insert (propertize (concat prefix prebuttontext string) 'ddebug widget 'ddebug-indent (length prefix) @@ -613,7 +613,7 @@ PREBUTTONTEXT is some text between prefix and the stuff vector button." (symbol-value symbol) (concat (make-string indent ? ) "> ") (concat - (dd-propertize "value" + (propertize "value" 'face 'font-lock-comment-face) " "))) (data-debug-insert-property-list @@ -628,13 +628,13 @@ PREFIX is the text that precedes the button. PREBUTTONTEXT is some text between prefix and the symbol button." (let ((string (cond ((fboundp symbol) - (dd-propertize (concat "#'" (symbol-name symbol)) + (propertize (concat "#'" (symbol-name symbol)) 'face 'font-lock-function-name-face)) ((boundp symbol) - (dd-propertize (concat "'" (symbol-name symbol)) + (propertize (concat "'" (symbol-name symbol)) 'face 'font-lock-variable-name-face)) (t (format "'%s" symbol))))) - (insert (dd-propertize + (insert (propertize (concat prefix prebuttontext string) 'ddebug symbol 'ddebug-indent (length prefix) @@ -657,7 +657,7 @@ PREBUTTONTEXT is some text between prefix and the thing." (while (string-match "\t" newstr) (setq newstr (replace-match "\\t" t t newstr))) (insert prefix prebuttontext - (dd-propertize (format "\"%s\"" newstr) + (propertize (format "\"%s\"" newstr) 'face font-lock-string-face) "\n" ))) @@ -668,7 +668,7 @@ A Symbol is a simple thing, but this provides some face and prefix rules. PREFIX is the text that precedes the button. PREBUTTONTEXT is some text between prefix and the thing." (insert prefix prebuttontext - (dd-propertize (format "%S" thing) + (propertize (format "%S" thing) 'face font-lock-string-face) "\n")) @@ -737,10 +737,10 @@ FACE is the face to use." (null . data-debug-insert-nil) ;; Overlay - (data-debug-overlay-p . data-debug-insert-overlay-button) + (overlayp . data-debug-insert-overlay-button) ;; Overlay list - ((lambda (thing) (and (consp thing) (data-debug-overlay-p (car thing)))) . + ((lambda (thing) (and (consp thing) (overlayp (car thing)))) . data-debug-insert-overlay-list-button) ;; Buffer commit d1545e2a038651e7a5203026202189351540b7f5 Author: Stefan Kangas Date: Sat May 16 17:02:18 2020 +0200 Remove Emacs 22 compat code from abbrev.el * lisp/abbrev.el (write-abbrev-file): Remove Emacs 22 compatibility code. diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 190b3504fa..2d61a96010 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -255,11 +255,7 @@ have been saved." (if (abbrev--table-symbols table) (insert-abbrev-table-description table nil))) (when (unencodable-char-position (point-min) (point-max) 'utf-8) - (setq coding-system-for-write - (if (> emacs-major-version 24) - 'utf-8-emacs - ;; For compatibility with Emacs 22 (See Bug#8308) - 'emacs-mule))) + (setq coding-system-for-write 'utf-8-emacs)) (goto-char (point-min)) (insert (format ";;-*-coding: %s;-*-\n" coding-system-for-write)) (write-region nil nil file nil (and (not verbose) 0))))) commit e07a751e08835ebae7fc23ae3fc4b81142d4ac9e Author: Stefan Kangas Date: Sat May 16 16:27:20 2020 +0200 ; * lisp/htmlfontify.el: Minor fix in file headers. diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index 7a5d88ce83..6265537e88 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -11,9 +11,6 @@ ;; Created: 2002-01-05 ;; Description: htmlize a buffer/source tree with optional hyperlinks ;; URL: http://rtfm.etla.org/emacs/htmlfontify/ -;; Compatibility: Emacs23, Emacs22 -;; Incompatibility: Emacs19, Emacs20, Emacs21 -;; Last Updated: Thu 2009-11-19 01:31:21 +0000 ;; This file is part of GNU Emacs. commit 21b7165473d68f47e16cb491ea410a10b2d65b71 Author: Stefan Kangas Date: Sat May 16 15:34:47 2020 +0200 Remove Emacs 22 compat code from ediff-vers.el * lisp/vc/ediff-vers.el (ediff-vc-revision-other-window) (ediff-vc-working-revision): Redefine Emacs 22 compatibility aliases as obsolete function aliases. (ediff-vc-internal, ediff-vc-merge-internal): Don't use the now obsolete aliases. diff --git a/lisp/vc/ediff-vers.el b/lisp/vc/ediff-vers.el index a95606fad5..4ee7ee5c1f 100644 --- a/lisp/vc/ediff-vers.el +++ b/lisp/vc/ediff-vers.el @@ -49,15 +49,10 @@ comparison or merge operations are being performed." :group 'ediff-vers ) -(defalias 'ediff-vc-revision-other-window - (if (fboundp 'vc-revision-other-window) - 'vc-revision-other-window - 'vc-version-other-window)) - -(defalias 'ediff-vc-working-revision - (if (fboundp 'vc-working-revision) - 'vc-working-revision - 'vc-workfile-version)) +(define-obsolete-function-alias 'ediff-vc-revision-other-window + #'vc-revision-other-window "28.1") +(define-obsolete-function-alias 'ediff-vc-working-revision + #'vc-working-revision "28.1") ;; VC.el support @@ -88,12 +83,12 @@ comparison or merge operations are being performed." (setq rev1 (ediff-vc-latest-version (buffer-file-name)))) (save-window-excursion (save-excursion - (ediff-vc-revision-other-window rev1) + (vc-revision-other-window rev1) (setq rev1buf (current-buffer) file1 (buffer-file-name))) (save-excursion (or (string= rev2 "") ; use current buffer - (ediff-vc-revision-other-window rev2)) + (vc-revision-other-window rev2)) (setq rev2buf (current-buffer) file2 (buffer-file-name))) (push (lambda () @@ -165,18 +160,18 @@ comparison or merge operations are being performed." (let (buf1 buf2 ancestor-buf) (save-window-excursion (save-excursion - (ediff-vc-revision-other-window rev1) + (vc-revision-other-window rev1) (setq buf1 (current-buffer))) (save-excursion (or (string= rev2 "") - (ediff-vc-revision-other-window rev2)) + (vc-revision-other-window rev2)) (setq buf2 (current-buffer))) (if ancestor-rev (save-excursion (if (string= ancestor-rev "") - (setq ancestor-rev (ediff-vc-working-revision + (setq ancestor-rev (vc-working-revision buffer-file-name))) - (ediff-vc-revision-other-window ancestor-rev) + (vc-revision-other-window ancestor-rev) (setq ancestor-buf (current-buffer)))) (push (let ((f1 (buffer-file-name buf1)) (f2 (unless (string= rev2 "") (buffer-file-name buf2))) commit 436809b705aaf10776af4615a9691406408735eb Author: Stefan Kangas Date: Sat May 16 15:22:54 2020 +0200 Remove some XEmacs compat code from semantic * lisp/cedet/semantic/wisent/comp.el (wisent-ISVALID-TOKEN) (wisent-parse-nonterminals): * lisp/cedet/semantic/wisent/wisent.el (wisent-item-to-string): Remove XEmacs compatibility code. (wisent-char-p): Redefine as obsolete function alias for 'characterp'. diff --git a/lisp/cedet/semantic/wisent/comp.el b/lisp/cedet/semantic/wisent/comp.el index 4e9927f23f..42c5756b98 100644 --- a/lisp/cedet/semantic/wisent/comp.el +++ b/lisp/cedet/semantic/wisent/comp.el @@ -3053,7 +3053,7 @@ one.") (defsubst wisent-ISVALID-TOKEN (x) "Return non-nil if X is a character or an allowed symbol." - (or (wisent-char-p x) + (or (characterp x) (wisent-ISVALID-VAR x))) (defun wisent-push-token (symbol &optional nocheck) @@ -3143,7 +3143,7 @@ the rule." (cond ((or (memq item token-list) (memq item var-list))) ;; Create new literal character token - ((wisent-char-p item) (wisent-push-token item t)) + ((characterp item) (wisent-push-token item t)) ((error "Symbol `%s' is used, but is not defined as a token and has no rules" item)))) (setq rhl (1+ rhl) diff --git a/lisp/cedet/semantic/wisent/wisent.el b/lisp/cedet/semantic/wisent/wisent.el index d8a35d3e7d..a0a8bed1ea 100644 --- a/lisp/cedet/semantic/wisent/wisent.el +++ b/lisp/cedet/semantic/wisent/wisent.el @@ -55,11 +55,8 @@ ;;;; Runtime stuff ;;;; ------------- -;;; Compatibility -(eval-and-compile - (if (fboundp 'char-valid-p) - (defalias 'wisent-char-p 'char-valid-p) - (defalias 'wisent-char-p 'char-or-char-int-p))) +(define-obsolete-function-alias 'wisent-char-p + #'characterp "28.1") ;;; Printed representation of terminals and nonterminals (defconst wisent-escape-sequence-strings @@ -80,7 +77,7 @@ (defsubst wisent-item-to-string (item) "Return a printed representation of ITEM. ITEM can be a nonterminal or terminal symbol, or a character literal." - (if (wisent-char-p item) + (if (characterp item) (or (cdr (assq item wisent-escape-sequence-strings)) (format "'%c'" item)) (symbol-name item))) commit 5ab12a4b1b8e4b745783797d0e5469096256b0d8 Author: Stefan Monnier Date: Sat May 16 09:08:14 2020 -0400 * lisp/textmodes/bibtex.el: Fix bug#41285 (paren typo) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index fa82227f36..4712f31408 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -3559,9 +3559,9 @@ LOCAL is t for interactive calls." (lambda () (:documentation (format "Insert a template for a @%s entry; see also `bibtex-entry'." - entry) - (interactive "*") - (bibtex-entry entry))))) + entry)) + (interactive "*") + (bibtex-entry entry)))) ;; Menu entries (define-key menu-map (vector fname) `(menu-item ,(or (nth 1 elt) (car elt)) ,fname)))) commit bbbab82a7117e08a77433f5ad39b34f5e03a014c Author: Michael Albinus Date: Sat May 16 14:04:07 2020 +0200 Introduce process-file-return-signal-string * doc/lispref/processes.texi (Synchronous Processes): Describe `process-file-return-signal-string'. * doc/misc/tramp.texi: Adapt Tramp and Emacs version numbers. (Remote processes): Describe `process-file-return-signal-string' and $INSIDE_EMACS. * etc/NEWS: Describe `process-file-return-signal-string'. Fix typos. * lisp/simple.el (process-file-return-signal-string): New user option. * lisp/net/tramp-adb.el (tramp-adb-handle-process-file): * lisp/net/tramp-sh.el (tramp-sh-handle-process-file): Use it. * lisp/net/tramp.el (tramp-get-signal-strings): New defun. * test/lisp/net/tramp-tests.el (tramp-test28-process-file): Adapt test. diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index c6e735a9b1..22c5093618 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi @@ -477,6 +477,22 @@ You should only ever change this variable with a let-binding; never with @code{setq}. @end defvar +@defopt process-file-return-signal-string +This user option indicates whether a call of @code{process-file} +returns a string describing the signal interrupting a remote process. + +When a process returns an exit code greater than 128, it is +interpreted as a signal. @code{process-file} requires to return a +string describing this signal. + +Since there are processes violating this rule, returning exit codes +greater than 128 which are not bound to a signal, @code{process-file} +returns always the exit code as natural number for remote processes. +Setting this user option to non-nil forces @code{process-file} to +interpret such exit codes as signals, and to return a corresponding +string. +@end defopt + @defun call-process-region start end program &optional delete destination display &rest args This function sends the text from @var{start} to @var{end} as standard input to a process running @var{program}. It deletes the text diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 0b13c17dbc..d1688deb1b 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -318,14 +318,14 @@ behind the scenes when you open a file with @value{tramp}. @uref{https://ftp.gnu.org/gnu/tramp/}. The version number of @value{tramp} can be obtained by the variable @code{tramp-version}. For released @value{tramp} versions, this is a three-number string -like ``2.4.2''. +like ``2.4.3''. A @value{tramp} release, which is packaged with Emacs, could differ slightly from the corresponding standalone release. This is because it isn't always possible to synchronize release dates between Emacs and @value{tramp}. Such version numbers have the Emacs version number -as suffix, like ``2.3.5.26.3''. This means @w{@value{tramp} 2.3.5} as -integrated in @w{Emacs 26.3}. A complete list of @value{tramp} +as suffix, like ``2.4.3.27.1''. This means @w{@value{tramp} 2.4.3} as +integrated in @w{Emacs 27.1}. A complete list of @value{tramp} versions packaged with Emacs can be retrieved by @vindex customize-package-emacs-version-alist @@ -337,12 +337,12 @@ versions packaged with Emacs can be retrieved by ELPA} package. Besides the standalone releases, further minor version of @value{tramp} will appear on GNU ELPA, until the next @value{tramp} release appears. These minor versions have a four-number string, like -``2.4.2.1''. +``2.4.3.1''. @value{tramp} development versions are available on Git servers. Development versions contain new and incomplete features. The development version of @value{tramp} is always the version number of -the next release, plus the suffix ``-pre'', like ``2.4.3-pre''. +the next release, plus the suffix ``-pre'', like ``2.4.4-pre''. One way to obtain @value{tramp} from Git server is to visit the Savannah project page at the following URL and then clicking on the @@ -2315,7 +2315,7 @@ string of that environment variable looks always like @example @group echo $INSIDE_EMACS -@result{} 26.2,tramp:2.3.4 +@result{} 27.1,tramp:2.4.3 @end group @end example @@ -3050,6 +3050,17 @@ host when the variable @code{default-directory} is remote: @end group @end lisp +@vindex process-file-return-signal-string +@code{process-file} shall return either the exit code of the process, +or a string describing the signal, when the process has been +interrupted. Since it cannot be determined reliably whether a remote +process has been interrupted, @code{process-file} returns always the +exit code. When the user option +@code{process-file-return-signal-string} is non-nil, +@code{process-file} regards all exit codes greater than 128 as an +indication that the process has been interrupted, and returns a +respective string. + Remote processes do not apply to @acronym{GVFS} (see @ref{GVFS-based methods}) because the remote file system is mounted on the local host and @value{tramp} just accesses by changing the @@ -3057,9 +3068,17 @@ and @value{tramp} just accesses by changing the @value{tramp} starts a remote process when a command is executed in a remote file or directory buffer. As of now, these packages have been -integrated to work with @value{tramp}: @file{compile.el} (commands -like @code{compile} and @code{grep}) and @file{gud.el} (@code{gdb} or -@code{perldb}). +integrated to work with @value{tramp}: @file{shell.el}, +@file{eshell.el}, @file{compile.el} (commands like @code{compile} and +@code{grep}) and @file{gud.el} (@code{gdb} or @code{perldb}). + +@vindex INSIDE_EMACS@r{, environment variable} +@value{tramp} always modifies the @env{INSIDE_EMACS} environment +variable for remote processes. Per default, this environment variable +shows the Emacs version. @value{tramp} adds its own version string, +so it looks like @samp{27.1,tramp:2.4.3.1}. However, other packages +might also add their name to this environment variable, like +@samp{27.1,comint,tramp:2.4.3.1}. For @value{tramp} to find the command on the remote, it must be accessible through the default search path as setup by @value{tramp} @@ -3254,7 +3273,7 @@ variables. @vindex async-shell-command-width @vindex COLUMNS@r{, environment variable} If Emacs supports the variable @code{async-shell-command-width} (since -@w{Emacs 27.1}), @value{tramp} cares about its value for asynchronous +@w{Emacs 27}), @value{tramp} cares about its value for asynchronous shell commands. It specifies the number of display columns for command output. For synchronous shell commands, a similar effect can be achieved by adding the environment variable @env{COLUMNS} to @@ -3741,7 +3760,7 @@ row are possible, like @file{/path/to/dir/file.tar.gz.uu/dir/file}. @vindex tramp-archive-all-gvfs-methods An archive file name could be a remote file name, as in -@file{/ftp:anonymous@@ftp.gnu.org:/gnu/tramp/tramp-2.3.2.tar.gz/INSTALL}. +@file{/ftp:anonymous@@ftp.gnu.org:/gnu/tramp/tramp-2.4.3.tar.gz/INSTALL}. Since all file operations are mapped internally to @acronym{GVFS} operations, remote file names supported by @code{tramp-gvfs} perform better, because no local copy of the file archive must be downloaded @@ -3752,7 +3771,7 @@ the similar @samp{/scp:user@@host:...}. See the constant If @code{url-handler-mode} is enabled, archives could be visited via URLs, like -@file{https://ftp.gnu.org/gnu/tramp/tramp-2.3.2.tar.gz/INSTALL}. This +@file{https://ftp.gnu.org/gnu/tramp/tramp-2.4.3.tar.gz/INSTALL}. This allows complex file operations like @lisp @@ -3760,8 +3779,8 @@ allows complex file operations like (progn (url-handler-mode 1) (ediff-directories - "https://ftp.gnu.org/gnu/tramp/tramp-2.3.1.tar.gz/tramp-2.3.1" - "https://ftp.gnu.org/gnu/tramp/tramp-2.3.2.tar.gz/tramp-2.3.2" "")) + "https://ftp.gnu.org/gnu/tramp/tramp-2.4.2.tar.gz/tramp-2.4.2" + "https://ftp.gnu.org/gnu/tramp/tramp-2.4.3.tar.gz/tramp-2.4.3" "")) @end group @end lisp diff --git a/etc/NEWS b/etc/NEWS index b93199f362..303036ece3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -101,19 +101,23 @@ horizontal movements now stop at the edge of the board. * Changes in Specialized Modes and Packages in Emacs 28.1 -** EIEIO: 'oset' and 'oset-default' are declared obsolete +** EIEIO: 'oset' and 'oset-default' are declared obsolete. -** New minor mode 'cl-font-lock-built-in-mode' for `lisp-mode' +** New minor mode 'cl-font-lock-built-in-mode' for `lisp-mode'. The mode provides refined highlighting of built-in functions, types, and variables. -** archive-mode +** Archive mode + *** Can now modify members of 'ar' archives. -*** Display of summaries unified between backends -*** New var 'archive-hidden-columns' and cmd 'archive-hideshow-column' -These let you control which columns are displayed and which are kept hidden -** Emacs-Lisp mode +*** Display of summaries unified between backends. + +*** New user option 'archive-hidden-columns' and command +'archive-hideshow-column'. These let you control which columns are +displayed and which are kept hidden. + +** Emacs Lisp mode *** The mode-line now indicates whether we're using lexical or dynamic scoping. @@ -158,7 +162,7 @@ this user option. This file was a compatibility kludge which is no longer needed. --- -** 'lisp-mode' now uses 'common-lisp-indent-function'. +** Lisp mode now uses 'common-lisp-indent-function'. To revert to the previous behaviour, '(setq lisp-indent-function 'lisp-indent-function)' from 'lisp-mode-hook'. @@ -184,7 +188,7 @@ their backends. ** Eshell --- -*** Environment variable INSIDE_EMACS is now copied to subprocesses. +*** Environment variable 'INSIDE_EMACS' is now copied to subprocesses. Its value equals the result of evaluating '(format "%s,eshell" emacs-version)'. ** Tramp @@ -240,7 +244,7 @@ it after GDB quits. A toggle button is also provided under 'Gud -- GDB-Windows'. +++ -*** gdb-mi now has a better logic for displaying source buffers +*** gdb-mi now has a better logic for displaying source buffers. Now GDB only uses one source window to display source file by default. Customize 'gdb-max-source-window-count' to use more than one window. Control source file display by 'gdb-display-source-buffer-action'. @@ -259,11 +263,11 @@ case-insensitive matching of messages when the old behaviour is required, but the recommended solution is to use a correctly matching regexp instead. -** Hi-Lock +** Hi Lock mode --- *** Matching in 'hi-lock-mode' is case-sensitive when regexp contains -upper case characters and `search-upper-case' is non-nil. +upper case characters and 'search-upper-case' is non-nil. 'highlight-phrase' also uses 'search-whitespace-regexp' to substitute spaces in regexp search. @@ -274,13 +278,13 @@ The new default value is 2000000 (2 megabytes). ** Texinfo --- -*** New customizable option 'texinfo-texi2dvi-options'. +*** New user option 'texinfo-texi2dvi-options'. This is used when invoking 'texi2dvi' from 'texinfo-tex-buffer'. ** Rmail --- -*** New customizable option 'rmail-re-abbrevs'. +*** New user option 'rmail-re-abbrevs'. Its default value matches localized abbreviations of the "reply" prefix on the Subject line in various languages. @@ -290,13 +294,13 @@ prefix on the Subject line in various languages. These new navigation commands are bound to 'n' and 'p' in 'apropos-mode'. -** cc-mode +** CC mode *** Added support for Doxygen documentation style. -‘doxygen’ is now valid ‘c-doc-comment-style’ which recognises all -comment styles supported by Doxygen (namely ‘///’, ‘//!’, ‘/** … */’ -and ‘/*! … */’. ‘gtkdoc’ remains the default for C and C++ modes; to -use ‘doxygen’ by default one might evaluate: +'doxygen' is now a valid 'c-doc-comment-style' which recognises all +comment styles supported by Doxygen (namely '///', '//!', '/** … */' +and '/*! … */'. 'gtkdoc' remains the default for C and C++ modes; to +use 'doxygen' by default one might evaluate: (setq-default c-doc-comment-style '((java-mode . javadoc) @@ -304,17 +308,17 @@ use ‘doxygen’ by default one might evaluate: (c-mode . doxygen) (c++-mode . doxygen))) -or use it in a custom ‘c-style’. +or use it in a custom 'c-style'. -*** Added support to line up ‘?’ and ‘:’ of a ternary operator. -The new ‘c-lineup-ternary-bodies’ function can be used as a lineup +*** Added support to line up '?' and ':' of a ternary operator. +The new 'c-lineup-ternary-bodies' function can be used as a lineup function to align question mark and colon which are part of a ternary -operator (‘?:’). For example: +operator ('?:'). For example: return arg % 2 == 0 ? arg / 2 : (3 * arg + 1); -To enable, add it to appropriate entries in ‘c-offsets-alist’, e.g.: +To enable, add it to appropriate entries in 'c-offsets-alist', e.g.: (c-set-offset 'arglist-cont '(c-lineup-ternary-bodies c-lineup-gcc-asm-reg)) @@ -325,20 +329,21 @@ To enable, add it to appropriate entries in ‘c-offsets-alist’, e.g.: ** browse-url -*** Added support for custom URL handlers +*** Added support for custom URL handlers. -There is a new defvar 'browse-url-default-handlers' and a defcustom -'browse-url-handlers' being alists with (REGEXP-OR-PREDICATE -. FUNCTION) entries allowing to define different browsing FUNCTIONs -depending on the URL to be browsed. The defvar is for default -handlers provided by Emacs itself or external packages, the defcustom -is for the user (and allows for overriding the default handlers). +There is a new variable 'browse-url-default-handlers' and a user +option 'browse-url-handlers' being alists with '(REGEXP-OR-PREDICATE +. FUNCTION)' entries allowing to define different browsing FUNCTIONs +depending on the URL to be browsed. The variable is for default +handlers provided by Emacs itself or external packages, the user +option is for the user (and allows for overriding the default +handlers). Formerly, one could do the same by setting 'browse-url-browser-function' to such an alist. This usage is still supported but deprecated. -*** Categorization of browsing functions in internal vs. external +*** Categorization of browsing functions in internal vs. external. All standard browsing functions such as 'browse-url-firefox', 'browse-url-mail', or 'eww' have been categorized into internal (URL @@ -351,10 +356,11 @@ either an internal or external browser. * New Modes and Packages in Emacs 28.1 -*** Lisp Data mode +** Lisp Data mode + The new command 'lisp-data-mode' enables a major mode for buffers composed of Lisp symbolic expressions that do not form a computer -program. The '.dir-locals.el' file is automatically set to use this +program. The ".dir-locals.el" file is automatically set to use this mode, as are other data files produced by Emacs. @@ -436,23 +442,28 @@ such as "2020-01-15T16:12:21-08:00". ** The new function 'dom-remove-attribute' has been added. --- -** 'make-network-process', 'make-serial-process' :coding behavior change. -Previously, passing ":coding nil" to either of these functions would +** 'make-network-process', 'make-serial-process' ':coding' behavior change. +Previously, passing ':coding nil' to either of these functions would override any non-nil binding for 'coding-system-for-read' and 'coding-system-for-write'. For consistency with 'make-process' and -'make-pipe-process', passing ":coding nil" is now ignored. No code in +'make-pipe-process', passing ':coding nil' is now ignored. No code in Emacs depended on the previous behavior; if you really want the process' coding-system to be nil, use 'set-process-coding-system' -after the process has been created, or pass in ":coding '(nil nil)". +after the process has been created, or pass in ':coding '(nil nil)'. +++ -** 'open-network-stream' now accepts a :coding argument. +** 'open-network-stream' now accepts a ':coding' argument. This allows specifying the coding systems used by a network process for encoding and decoding without having to bind -coding-system-for-{read,write} or call 'set-process-coding-system'. +'coding-system-for-{read,write}' or call 'set-process-coding-system'. + ++++ +** 'open-gnutls-stream' now also accepts a ':coding' argument. +++ -** 'open-gnutls-stream' now also accepts a :coding argument. +** New user option 'process-file-return-signal-string'. +It controls, whether 'process-file' returns a string when a remote +process is interrupted by a signal. * Changes in Emacs 28.1 on Non-Free Operating Systems @@ -473,12 +484,12 @@ current IME activation status. ** On MS-Windows, Emacs can now use the native image API to display images. Emacs can now use the MS-Windows GDI+ library to load and display images in JPEG, PNG, GIF and TIFF formats. This support is enabled -unless Emacs was configured --without-native-image-api. +unless Emacs was configured '--without-native-image-api'. This feature is experimental, and needs to be turned on to be used. To turn this on, set the variable 'w32-use-native-image-API' to a non-nil value. Please report any bugs you find while using the native -image API via "M-x report-emacs-bug". +image API via 'M-x report-emacs-bug'. ---------------------------------------------------------------------- diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 7ef07afb8e..b4a080ee0f 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -918,9 +918,11 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (kill-buffer (tramp-get-connection-buffer v)) (setq ret 1))) - ;; Handle signals. - (when (and (natnump ret) (> ret 128)) - (setq ret (format "Signal %d" (- ret 128)))) + ;; Handle signals. `process-file-return-signal-string' exists + ;; since Emacs 28.1. + (when (and (bound-and-true-p process-file-return-signal-string) + (natnump ret) (> ret 128)) + (setq ret (nth (- ret 128) (tramp-get-signal-strings)))) ;; Provide error file. (when tmpstderr (rename-file tmpstderr (cadr destination) t)) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index c609f58cdd..523663cafb 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3159,9 +3159,11 @@ STDERR can also be a file name." (kill-buffer (tramp-get-connection-buffer v)) (setq ret 1))) - ;; Handle signals. - (when (and (natnump ret) (> ret 128)) - (setq ret (format "Signal %d" (- ret 128)))) + ;; Handle signals. `process-file-return-signal-string' exists + ;; since Emacs 28.1. + (when (and (bound-and-true-p process-file-return-signal-string) + (natnump ret) (>= ret 128)) + (setq ret (nth (- ret 128) (tramp-get-signal-strings)))) ;; Provide error file. (when tmpstderr (rename-file tmpstderr (cadr destination) t)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 70fb46bb4c..ee263ebe93 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -5047,6 +5047,23 @@ name of a process or buffer, or nil to default to the current buffer." (lambda () (remove-hook 'interrupt-process-functions #'tramp-interrupt-process)))) +(defun tramp-get-signal-strings () + "Strings to return by `process-file' in case of signals." + ;; We use key nil for local connection properties. + (with-tramp-connection-property nil "signal-strings" + (let (result) + (if (and (stringp shell-file-name) (executable-find shell-file-name)) + (dotimes (i 128) + (push + (if (= i 19) 1 ;; SIGSTOP + (call-process + shell-file-name nil nil nil "-c" (format "kill -%d $$" i))) + result)) + (dotimes (i 128) + (push (format "Signal %d" i) result))) + ;; Due to Bug#41287, we cannot add this to the `dotimes' clause. + (reverse result)))) + ;; Checklist for `tramp-unload-hook' ;; - Unload all `tramp-*' packages ;; - Reset `file-name-handler-alist' diff --git a/lisp/simple.el b/lisp/simple.el index b5ba05426f..d151d6c9ae 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4141,6 +4141,20 @@ its behavior with respect to remote file attribute caching. You should only ever change this variable with a let-binding; never with `setq'.") +(defcustom process-file-return-signal-string nil + "Whether to return a string describing the signal interrupting a process. +When a process returns an exit code greater than 128, it is +interpreted as a signal. `process-file' requires to return a +string describing this signal. +Since there are processes violating this rule, returning exit +codes greater than 128 which are not bound to a signal, +`process-file' returns the exit code as natural number also in +this case. Setting this user option to non-nil forces +`process-file' to interpret such exit codes as signals, and to +return a corresponding string." + :version "28.1" + :type 'boolean) + (defun start-file-process (name buffer program &rest program-args) "Start a program in a subprocess. Return the process object for it. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index de85f83982..1f56baad7c 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -75,6 +75,7 @@ ;; Needed for Emacs 26. (defvar async-shell-command-width) ;; Needed for Emacs 27. +(defvar process-file-return-signal-string) (defvar shell-command-dont-erase-buffer) ;; Beautify batch mode. @@ -4208,18 +4209,27 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (should (zerop (process-file "true"))) (should-not (zerop (process-file "false"))) (should-not (zerop (process-file "binary-does-not-exist"))) - (should - (= 42 + ;; Return exit code. + (should (= 42 (process-file + (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh") + nil nil nil "-c" "exit 42"))) + ;; Return exit code in case the process is interrupted, + ;; and there's no indication for a signal describing string. + (let (process-file-return-signal-string) + (should + (= (+ 128 2) + (process-file + (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh") + nil nil nil "-c" "kill -2 $$")))) + ;; Return string in case the process is interrupted and + ;; there's an indication for a signal describing string. + (let ((process-file-return-signal-string t)) + (should + (string-equal + "Interrupt" (process-file (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh") - nil nil nil "-c" "exit 42"))) - ;; Return string in case the process is interrupted. - (should - (string-equal - "Signal 2" - (process-file - (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh") - nil nil nil "-c" "kill -2 $$"))) + nil nil nil "-c" "kill -2 $$")))) (with-temp-buffer (write-region "foo" nil tmp-name) commit b4937f64cd97ff6bf93538987c014f8ea8ff9d34 Author: Eli Zaretskii Date: Sat May 16 11:54:37 2020 +0300 Improve documentation of manually installing Lisp packages * doc/emacs/building.texi (Lisp Libraries): Describe how to manually load packages in the init file. Mention the 'site-lisp' subdirectory of the default 'load-path'. * doc/emacs/package.texi (Packages): Describe manual installation of ELisp packages. Suggested by Jean-Christophe Helary . diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index e866eea4a2..fa60ce2662 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -1509,6 +1509,11 @@ putting a line like this in your init file (@pxref{Init File}): (add-to-list 'load-path "/path/to/my/lisp/library") @end example +It is customary to put locally installed libraries in the +@file{site-lisp} directory that is already in the default value of +@code{load-path}, or in some subdirectory of @file{site-lisp}. This +way, you don't need to modify the default value of @code{load-path}. + @cindex autoload Some commands are @dfn{autoloaded}; when you run them, Emacs automatically loads the associated library first. For instance, the @@ -1538,6 +1543,33 @@ compiled with XEmacs, a modified version of Emacs---they can cause Emacs to crash. Set the variable @code{load-dangerous-libraries} to @code{t} if you want to try loading them. + Once you put your library in a directory where Emacs can find and +load it, you may wish to make it available at startup. This is useful +when the library defines features that should be available +automatically on demand, and manually loading the library is thus +inconvenient. In these cases, make sure the library will be loaded by +adding suitable forms to your init file: either @code{load} or +@code{require} (if you always need to load the library at startup), or +@code{autoload} if you need Emacs to load the library when some +command or function is invoked. For example: + +@smalllisp +@group + ;; Loads @file{my-shining-package.elc} unconditionally. + (require 'my-shining-package) +@end group +@group + ;; Will load @file{my-shining-package.elc} when @code{my-func} is invoked. + (autoload 'my-func "my-shining-package") +@end group +@end smalllisp + + Note that installing a package using @code{package-install} +(@pxref{Package Installation}) takes care of placing the package's +Lisp files in a directory where Emacs will find it, and also writes +the necessary initialization code into your init files, making the +above manual customizations unnecessary. + @node Lisp Eval @section Evaluating Emacs Lisp Expressions @cindex Emacs Lisp mode diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi index 6bf4fc7e10..517d2b75aa 100644 --- a/doc/emacs/package.texi +++ b/doc/emacs/package.texi @@ -5,23 +5,37 @@ @node Packages @chapter Emacs Lisp Packages @cindex Package -@cindex Emacs Lisp package archive @cindex Package archive -Emacs includes a facility that lets you easily download and install -@dfn{packages} that implement additional features. Each package is a -separate Emacs Lisp program, sometimes including other components such -as an Info manual. + Emacs is extended by implementing additional features in +@dfn{packages}, which are Emacs Lisp libraries. These could be +written by you or provided by someone else. If you want to install +such a package so it is available in your future Emacs session, you +need to compile it and put it in a directory where Emacs looks for +Lisp libraries. @xref{Lisp Libraries}, for more details about this +manual installation method. Many packages provide installation and +usage instructions in the large commentary near the beginning of the +Lisp file; you can use those instructions for installing and +fine-tuning your use of the package. - @kbd{M-x list-packages} brings up a buffer named @file{*Packages*} -with a list of all packages. You can install or uninstall packages -via this buffer. @xref{Package Menu}. +@cindex Emacs Lisp package archive + Packages can also be provided by @dfn{package archives}, which are +large collections of Emacs Lisp packages. Each package is a separate +Emacs Lisp program, sometimes including other components such as an +Info manual. Emacs includes a facility that lets you easily download +and install packages from such archives. The rest of this chapter +describes this facility. + + To list the packages available for installation from package +archives, type @w{@kbd{M-x list-packages @key{RET}}}. It brings up a +buffer named @file{*Packages*} with a list of all packages. You can +install or uninstall packages via this buffer. @xref{Package Menu}. The command @kbd{C-h P} (@code{describe-package}) prompts for the name of a package, and displays a help buffer describing the attributes of the package and the features that it implements. - By default, Emacs downloads packages from a @dfn{package archive} + By default, Emacs downloads packages from a package archive maintained by the Emacs developers and hosted by the GNU project. Optionally, you can also download packages from archives maintained by third parties. @xref{Package Installation}. commit efd4e973a4f0c7fe9442b677c6fdeebb347e2b9d Author: Eli Zaretskii Date: Sat May 16 10:30:43 2020 +0300 Reflect the emacs-devel ELPA/MELPA dispute in FAQ * doc/misc/efaq.texi (Packages that do not come with Emacs): Warn that some MELPA packages may require non-free software. diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index 962f76d179..132e8ffaa9 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -3479,7 +3479,10 @@ There are other, non-GNU, Emacs Lisp package servers, including: @uref{https://marmalade-repo.org, Marmalade}. To use additional package servers, customize the @code{package-archives} variable. Be aware that installing a package can run arbitrary code, so only add -sources that you trust. +sources that you trust. Also, packages hosted on non-GNU package +servers may encourage or require you to install and use non-free +software; for example, MELPA is known to host some packages that do +this. The @uref{https://lists.gnu.org/mailman/listinfo/gnu-emacs-sources, GNU Emacs sources mailing list}, which is gatewayed to the commit 28541674cdff8e4d1587391ac66818c56885f083 Author: Tassilo Horn Date: Fri May 15 22:24:29 2020 +0200 Consider face inheritance when checking region face background. Some themes (like dracula) make the region face inherit from some other face. If the background color of the region was inherited, `indicate-copied-region' did the switch-point-and-mark-twice dance which is not visible in case the region is highlighted. It just looked like Emacs would hang for a second after M-w. * lisp/simple.el (indicate-copied-region): Consider face inheritance when checking region face background. diff --git a/lisp/simple.el b/lisp/simple.el index ab277c4e11..e8bf77c7e6 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4852,7 +4852,7 @@ of this sample text; it defaults to 40." ;; Swap point-and-mark quickly so as to show the region that ;; was selected. Don't do it if the region is highlighted. (unless (and (region-active-p) - (face-background 'region)) + (face-background 'region nil t)) ;; Swap point and mark. (set-marker (mark-marker) (point) (current-buffer)) (goto-char mark) commit e75f6be6cc117b0a30158a47c3231035f8ccdc20 Author: Leo Vivier Date: Fri May 15 00:03:18 2020 +0200 Fix dired default file operation (bug#41261) * lisp/dired-aux.el (dired-dwim-target-directories): Restore pre-emacs-27 behavior of 'dired-dwim-target'. diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 0069c1744d..7f988540c2 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -2002,10 +2002,9 @@ Optional arg HOW-TO determines how to treat the target. (format prompt (dired-mark-prompt arg files)) dir default)) (defun dired-dwim-target-directories () - (cond ((functionp dired-dwim-target) - (funcall dired-dwim-target)) - (dired-dwim-target - (dired-dwim-target-next)))) + (if (functionp dired-dwim-target) + (funcall dired-dwim-target) + (dired-dwim-target-next))) (defun dired-dwim-target-next (&optional all-frames) ;; Return directories from all next windows with dired-mode buffers. commit 406fb0746c8b54869302d50b2327333769b7604b Author: Philipp Stephani Date: Thu May 14 19:26:43 2020 +0200 Fix documentation related to 'command-switch-alist'. While there, add a unit test to verify the behavior. * doc/lispref/os.texi (Command-Line Arguments): Fix documentation: the option string in 'command-switch-alist' does include leading hyphens. Also mention that 'command-switch-alist' parsing ignores equals signs in options. * test/lisp/startup-tests.el (startup-tests/command-switch-alist): New unit test. diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 92684c8993..97b8b532fe 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -613,7 +613,7 @@ The elements of the @code{command-switch-alist} look like this: @end example The @sc{car}, @var{option}, is a string, the name of a command-line -option (not including the initial hyphen). The @var{handler-function} +option (including the initial hyphen). The @var{handler-function} is called to handle @var{option}, and receives the option name as its sole argument. @@ -623,6 +623,14 @@ remaining command-line arguments in the variable @code{command-line-args-left} (see below). (The entire list of command-line arguments is in @code{command-line-args}.) +Note that the handling of @code{command-switch-alist} doesn't treat +equals signs in @var{option} specially. That is, if there's an option +like @code{--name=value} on the command line, then only a +@code{command-switch-alist} member whose @code{car} is literally +@code{--name=value} will match this option. If you want to parse such +options, you need to use @code{command-line-functions} instead (see +below). + The command-line arguments are parsed by the @code{command-line-1} function in the @file{startup.el} file. See also @ref{Emacs Invocation, , Command Line Arguments for Emacs Invocation, emacs, The diff --git a/test/lisp/startup-tests.el b/test/lisp/startup-tests.el new file mode 100644 index 0000000000..314ffc93e4 --- /dev/null +++ b/test/lisp/startup-tests.el @@ -0,0 +1,47 @@ +;;; startup-tests.el --- unit tests for startup.el -*- lexical-binding: t; -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; Author: Philipp Stephani + +;; 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: + +;; Unit tests for startup.el. + +;;; Code: + +(ert-deftest startup-tests/command-switch-alist () + (let* ((foo-args ()) (bar-args ()) + (command-switch-alist + (list (cons "--foo" + (lambda (arg) + (ert-info ("Processing argument --foo") + (push arg foo-args) + (should (equal command-line-args-left + '("value" "--bar=value"))) + (pop command-line-args-left)))) + (cons "--bar=value" + (lambda (arg) + (ert-info ("Processing argument --bar") + (push arg bar-args) + (should-not command-line-args-left))))))) + (command-line-1 '("--foo" "value" "--bar=value")) + (should (equal foo-args '("--foo"))) + (should (equal bar-args '("--bar=value"))))) + +;;; startup-tests.el ends here commit 747e0a2523e474c76410430c40cb9b04500218d4 Author: Simon Lang Date: Tue May 12 22:54:52 2020 +0100 Improve ediff readability in misterioso theme (Bug#41221) * etc/themes/misterioso-theme.el: Add ediff faces. Copyright-paperwork-exempt: yes diff --git a/etc/themes/misterioso-theme.el b/etc/themes/misterioso-theme.el index df8895385d..b51c9b8e58 100644 --- a/etc/themes/misterioso-theme.el +++ b/etc/themes/misterioso-theme.el @@ -63,6 +63,13 @@ `(button ((,class (:underline t)))) `(link ((,class (:foreground "#59e9ff" :underline t)))) `(link-visited ((,class (:foreground "#ed74cd" :underline t)))) + ;; Ediff + `(ediff-even-diff-A ((,class (:background "#1d2430")))) + `(ediff-even-diff-B ((,class (:background "#1d2430")))) + `(ediff-even-diff-C ((,class (:background "#1d2430")))) + `(ediff-odd-diff-A ((,class (:background "#415160")))) + `(ediff-odd-diff-B ((,class (:background "#415160")))) + `(ediff-odd-diff-C ((,class (:background "#415160")))) ;; Gnus faces `(gnus-group-news-1 ((,class (:foreground "#ff4242" :weight bold)))) `(gnus-group-news-1-low ((,class (:foreground "#ff4242")))) commit 48830c73e77255985685bd2df65f031cd115e069 Author: Clément Pit-Claudel Date: Wed May 13 10:37:05 2020 -0400 Fix a crash in handle_display_spec * src/xdisp.c (handle_display_spec): Check that the cdr of the disable-eval spec is a cons before taking its car. (Bug#41232) diff --git a/src/xdisp.c b/src/xdisp.c index b0fbc9936f..1e865898e3 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -5104,7 +5104,7 @@ handle_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, if (CONSP (spec) && EQ (XCAR (spec), Qdisable_eval)) { enable_eval = false; - spec = XCAR (XCDR (spec)); + spec = CONSP (XCDR (spec)) ? XCAR (XCDR (spec)) : Qnil; } if (CONSP (spec) commit a37290a6f965d0e0c13a734e6be973e1bd43bb7f Author: Martin Rudalics Date: Wed May 13 10:31:50 2020 +0200 In x_hide_tip reset tip_last_frame for GTK+ tooltips only (Bug#41200) * src/xfns.c (x_hide_tip): Reset tip_last_frame only when using GTK+ system tooltips (Bug#41200). diff --git a/src/xfns.c b/src/xfns.c index a5431aa890..b89fac1cda 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -6746,9 +6746,11 @@ x_hide_tip (bool delete) } } - /* Reset tip_last_frame, it will be reassigned when showing the - next GTK+ system tooltip. */ - tip_last_frame = Qnil; + /* When using GTK+ system tooltips (compare Bug#41200) reset + tip_last_frame. It will be reassigned when showing the next + GTK+ system tooltip. */ + if (x_gtk_use_system_tooltips) + tip_last_frame = Qnil; /* Now look whether there's an Emacs tip around. */ if (FRAMEP (tip_frame)) commit 3d819956923ecbbc79f5b3ac154109a7ec7150b7 Author: João Távora Date: Tue May 12 19:33:19 2020 +0100 Fix docstring of flymake-make-diagnostic (bug#40351) * lisp/progmodes/flymake.el (flymake-make-diagnostic): Fix docstring diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 7fca9dac1a..1ed733b7e3 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -313,9 +313,10 @@ generated it." &optional data overlay-properties) "Make a Flymake diagnostic for BUFFER's region from BEG to END. -TYPE is a key to symbol and TEXT is a description of the problem -detected in this region. DATA is any object that the caller -wishes to attach to the created diagnostic for later retrieval. +TYPE is a diagnostic symbol and TEXT is string describing the +problem detected in this region. DATA is any object that the +caller wishes to attach to the created diagnostic for later +retrieval. OVERLAY-PROPERTIES is an alist of properties attached to the created diagnostic, overriding the default properties and any commit 632aa9d57a53399088016c0cf29621653b61d7aa Author: Paul Eggert Date: Sun May 10 08:47:47 2020 -0700 Go back to “Bahá’í” * doc/emacs/calendar.texi (Holidays): Revert previous change, as bahai.org spells it “Bahá’í” (with U+2019 RIGHT SINGLE QUOTATION MARK) and that’s good enough for us. diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi index 8dc1a0b2df..fe51ad35d7 100644 --- a/doc/emacs/calendar.texi +++ b/doc/emacs/calendar.texi @@ -532,7 +532,7 @@ holidays centered around a different month, use @kbd{C-u M-x holidays}, which prompts for the month and year. The holidays known to Emacs include United States holidays and the -major Bah@'{a}@t{'}@'{i}, Chinese, Christian, Islamic, and Jewish +major Bahá'í, Chinese, Christian, Islamic, and Jewish holidays; also the solstices and equinoxes. @findex list-holidays commit e2406ff60f0fc061330c8b4dc430d1c8d94e6a79 Author: Eli Zaretskii Date: Sun May 10 19:04:51 2020 +0300 * lisp/dired.el (dired-toggle-marks): Doc fix. (Bug#41097) diff --git a/lisp/dired.el b/lisp/dired.el index f2d478e83c..4d0c2abdf5 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3641,8 +3641,8 @@ in the active region." (defun dired-toggle-marks () "Toggle marks: marked files become unmarked, and vice versa. -Files marked with other flags (such as `D') are not affected. -`.' and `..' are never toggled. +Flagged files (indicated with flags such as `C' and `D', not +with `*') are not affected, and `.' and `..' are never toggled. As always, hidden subdirs are not affected." (interactive) (save-excursion