commit 0b3bc05d15c32ffa134347896c9b9fcff89225ab (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Sat Apr 28 10:41:27 2018 +0300 * src/fns.c (Fstring_distance): Minor code reformatting. diff --git a/src/fns.c b/src/fns.c index 1d69f15b0e..c171784d29 100644 --- a/src/fns.c +++ b/src/fns.c @@ -166,10 +166,11 @@ Letter-case is significant, but text properties are ignored. */) CHECK_STRING (string1); CHECK_STRING (string2); - bool use_byte_compare = !NILP (bytecompare) + bool use_byte_compare = + !NILP (bytecompare) || (!STRING_MULTIBYTE (string1) && !STRING_MULTIBYTE (string2)); - ptrdiff_t len1 = use_byte_compare? SBYTES (string1) : SCHARS (string1); - ptrdiff_t len2 = use_byte_compare? SBYTES (string2) : SCHARS (string2); + ptrdiff_t len1 = use_byte_compare ? SBYTES (string1) : SCHARS (string1); + ptrdiff_t len2 = use_byte_compare ? SBYTES (string2) : SCHARS (string2); ptrdiff_t x, y, lastdiag, olddiag; USE_SAFE_ALLOCA; @@ -188,7 +189,8 @@ Letter-case is significant, but text properties are ignored. */) for (y = 1, lastdiag = x - 1; y <= len1; y++) { olddiag = column[y]; - column[y] = min (min (column[y] + 1, column[y-1] + 1), lastdiag + (s1[y-1] == s2[x-1]? 0 : 1)); + column[y] = min (min (column[y] + 1, column[y-1] + 1), + lastdiag + (s1[y-1] == s2[x-1] ? 0 : 1)); lastdiag = olddiag; } } @@ -206,7 +208,8 @@ Letter-case is significant, but text properties are ignored. */) { olddiag = column[y]; FETCH_STRING_CHAR_ADVANCE (c1, string1, i1, i1_byte); - column[y] = min (min (column[y] + 1, column[y-1] + 1), lastdiag + (c1 == c2? 0 : 1)); + column[y] = min (min (column[y] + 1, column[y-1] + 1), + lastdiag + (c1 == c2 ? 0 : 1)); lastdiag = olddiag; } } commit a7a3918a16c85f89d797d48b09e751ab30e0f032 Author: Eli Zaretskii Date: Sat Apr 28 10:27:53 2018 +0300 Fix documentation and tests for 'string-distance' * src/fns.c (Fstring_distance): Doc fix. * doc/lispref/strings.texi (Text Comparison): Document 'string-distance'. * etc/NEWS: Fix wording and mark as documented in the manuals. * test/src/fns-tests.el (test-string-distance): Move from subr-tests.el and rename. diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 8a9e27d00e..70ba1aa613 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -673,6 +673,28 @@ of the two strings. The sign is negative if @var{string1} (or its specified portion) is less. @end defun +@cindex Levenshtein distance +@cindex distance between strings +@cindex edit distance between strings +@defun string-distance string1 string2 &optional bytecompare +This function returns the @dfn{Levenshtein distance} between the +source string @var{string1} and the target string @var{string2}. The +Levenshtein distance is the number of single-character +changes---deletions, insertions, or replacements---required to +transform the source string into the target string; it is one possible +definition of the @dfn{edit distance} between strings. + +Letter-case of the strings is significant for the computed distance, +but their text properties are ignored. If the optional argument +@var{bytecompare} is non-@code{nil}, the function calculates the +distance in terms of bytes instead of characters. The byte-wise +comparison uses the internal Emacs representation of characters, so it +will produce inaccurate results for multibyte strings that include raw +bytes (@pxref{Text Representations}); make the strings unibyte by +encoding them (@pxref{Explicit Encoding}) if you need accurate results +with raw bytes. +@end defun + @defun assoc-string key alist &optional case-fold This function works like @code{assoc}, except that @var{key} must be a string or symbol, and comparison is done using @code{compare-strings}. diff --git a/etc/NEWS b/etc/NEWS index d40f7816b8..32fcdeff91 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -534,7 +534,8 @@ manual for more details. +++ ** New function assoc-delete-all. -** New function string-distance to calculate Levenshtein distance ++++ +** New function 'string-distance' to calculate the Levenshtein distance between two strings. ** 'print-quoted' now defaults to t, so if you want to see diff --git a/src/fns.c b/src/fns.c index 6e851c8555..1d69f15b0e 100644 --- a/src/fns.c +++ b/src/fns.c @@ -155,9 +155,11 @@ If STRING is multibyte, this may be greater than the length of STRING. */) DEFUN ("string-distance", Fstring_distance, Sstring_distance, 2, 3, 0, doc: /* Return Levenshtein distance between STRING1 and STRING2. -If BYTECOMPARE is nil, compare character of strings. -If BYTECOMPARE is t, compare byte of strings. -Case is significant, but text properties are ignored. */) +The distance is the number of deletions, insertions, and substitutions +required to transform STRING1 into STRING2. +If BYTECOMPARE is nil or omitted, compute distance in terms of characters. +If BYTECOMPARE is non-nil, compute distance in terms of bytes. +Letter-case is significant, but text properties are ignored. */) (Lisp_Object string1, Lisp_Object string2, Lisp_Object bytecompare) { diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 6b80c743a0..52b61d9fb9 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -281,24 +281,6 @@ indirectly `mapbacktrace'." (should (equal (string-match-p "\\`[[:blank:]]\\'" "\u3000") 0)) (should-not (string-match-p "\\`[[:blank:]]\\'" "\N{LINE SEPARATOR}"))) -(ert-deftest subr-tests--string-distance () - "Test `string-distance' behavior." - ;; ASCII characters are always fine - (should (equal 1 (string-distance "heelo" "hello"))) - (should (equal 2 (string-distance "aeelo" "hello"))) - (should (equal 0 (string-distance "ab" "ab" t))) - (should (equal 1 (string-distance "ab" "abc" t))) - - ;; string containing hanzi character, compare by byte - (should (equal 6 (string-distance "ab" "ab我她" t))) - (should (equal 3 (string-distance "ab" "a我b" t))) - (should (equal 3 (string-distance "我" "她" t))) - - ;; string containing hanzi character, compare by character - (should (equal 2 (string-distance "ab" "ab我她"))) - (should (equal 1 (string-distance "ab" "a我b"))) - (should (equal 1 (string-distance "我" "她")))) - (ert-deftest subr-tests--dolist--wrong-number-of-args () "Test that `dolist' doesn't accept wrong types or length of SPEC, cf. Bug#25477." diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index f8554636ba..0301ceaad5 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el @@ -575,4 +575,22 @@ :type 'wrong-type-argument) '(wrong-type-argument plistp (:foo 1 . :bar))))) +(ert-deftest test-string-distance () + "Test `string-distance' behavior." + ;; ASCII characters are always fine + (should (equal 1 (string-distance "heelo" "hello"))) + (should (equal 2 (string-distance "aeelo" "hello"))) + (should (equal 0 (string-distance "ab" "ab" t))) + (should (equal 1 (string-distance "ab" "abc" t))) + + ;; string containing hanzi character, compare by byte + (should (equal 6 (string-distance "ab" "ab我她" t))) + (should (equal 3 (string-distance "ab" "a我b" t))) + (should (equal 3 (string-distance "我" "她" t))) + + ;; string containing hanzi character, compare by character + (should (equal 2 (string-distance "ab" "ab我她"))) + (should (equal 1 (string-distance "ab" "a我b"))) + (should (equal 1 (string-distance "我" "她")))) + (provide 'fns-tests) commit c6e6503900534d939dd94b812563c27f22c49b7d Author: Chen Bin Date: Fri Apr 20 00:38:29 2018 +1000 New function 'string-distance' * src/fns.c (Fstring_distance): New primitive. (syms_of_fns): Defsubr it. * test/lisp/subr-tests.el (subr-tests--string-distance): New test. * etc/NEWS: Mention 'string-distance'. diff --git a/etc/NEWS b/etc/NEWS index ca467c0ad4..d40f7816b8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -534,6 +534,9 @@ manual for more details. +++ ** New function assoc-delete-all. +** New function string-distance to calculate Levenshtein distance +between two strings. + ** 'print-quoted' now defaults to t, so if you want to see (quote x) instead of 'x you will have to bind it to nil where applicable. diff --git a/src/fns.c b/src/fns.c index 94b9d984f0..6e851c8555 100644 --- a/src/fns.c +++ b/src/fns.c @@ -153,6 +153,67 @@ If STRING is multibyte, this may be greater than the length of STRING. */) return make_number (SBYTES (string)); } +DEFUN ("string-distance", Fstring_distance, Sstring_distance, 2, 3, 0, + doc: /* Return Levenshtein distance between STRING1 and STRING2. +If BYTECOMPARE is nil, compare character of strings. +If BYTECOMPARE is t, compare byte of strings. +Case is significant, but text properties are ignored. */) + (Lisp_Object string1, Lisp_Object string2, Lisp_Object bytecompare) + +{ + CHECK_STRING (string1); + CHECK_STRING (string2); + + bool use_byte_compare = !NILP (bytecompare) + || (!STRING_MULTIBYTE (string1) && !STRING_MULTIBYTE (string2)); + ptrdiff_t len1 = use_byte_compare? SBYTES (string1) : SCHARS (string1); + ptrdiff_t len2 = use_byte_compare? SBYTES (string2) : SCHARS (string2); + ptrdiff_t x, y, lastdiag, olddiag; + + USE_SAFE_ALLOCA; + ptrdiff_t *column = SAFE_ALLOCA ((len1 + 1) * sizeof (ptrdiff_t)); + for (y = 1; y <= len1; y++) + column[y] = y; + + if (use_byte_compare) + { + char *s1 = SSDATA (string1); + char *s2 = SSDATA (string2); + + for (x = 1; x <= len2; x++) + { + column[0] = x; + for (y = 1, lastdiag = x - 1; y <= len1; y++) + { + olddiag = column[y]; + column[y] = min (min (column[y] + 1, column[y-1] + 1), lastdiag + (s1[y-1] == s2[x-1]? 0 : 1)); + lastdiag = olddiag; + } + } + } + else + { + int c1, c2; + ptrdiff_t i1, i1_byte, i2 = 0, i2_byte = 0; + for (x = 1; x <= len2; x++) + { + column[0] = x; + FETCH_STRING_CHAR_ADVANCE (c2, string2, i2, i2_byte); + i1 = i1_byte = 0; + for (y = 1, lastdiag = x - 1; y <= len1; y++) + { + olddiag = column[y]; + FETCH_STRING_CHAR_ADVANCE (c1, string1, i1, i1_byte); + column[y] = min (min (column[y] + 1, column[y-1] + 1), lastdiag + (c1 == c2? 0 : 1)); + lastdiag = olddiag; + } + } + } + + SAFE_FREE (); + return make_number (column[len1]); +} + DEFUN ("string-equal", Fstring_equal, Sstring_equal, 2, 2, 0, doc: /* Return t if two strings have identical contents. Case is significant, but text properties are ignored. @@ -5226,6 +5287,7 @@ this variable. */); defsubr (&Slength); defsubr (&Ssafe_length); defsubr (&Sstring_bytes); + defsubr (&Sstring_distance); defsubr (&Sstring_equal); defsubr (&Scompare_strings); defsubr (&Sstring_lessp); diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 52b61d9fb9..6b80c743a0 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -281,6 +281,24 @@ indirectly `mapbacktrace'." (should (equal (string-match-p "\\`[[:blank:]]\\'" "\u3000") 0)) (should-not (string-match-p "\\`[[:blank:]]\\'" "\N{LINE SEPARATOR}"))) +(ert-deftest subr-tests--string-distance () + "Test `string-distance' behavior." + ;; ASCII characters are always fine + (should (equal 1 (string-distance "heelo" "hello"))) + (should (equal 2 (string-distance "aeelo" "hello"))) + (should (equal 0 (string-distance "ab" "ab" t))) + (should (equal 1 (string-distance "ab" "abc" t))) + + ;; string containing hanzi character, compare by byte + (should (equal 6 (string-distance "ab" "ab我她" t))) + (should (equal 3 (string-distance "ab" "a我b" t))) + (should (equal 3 (string-distance "我" "她" t))) + + ;; string containing hanzi character, compare by character + (should (equal 2 (string-distance "ab" "ab我她"))) + (should (equal 1 (string-distance "ab" "a我b"))) + (should (equal 1 (string-distance "我" "她")))) + (ert-deftest subr-tests--dolist--wrong-number-of-args () "Test that `dolist' doesn't accept wrong types or length of SPEC, cf. Bug#25477." commit 4bc74dac281ff2a502fc89e76f6210dc711cfed1 Author: Michael Albinus Date: Fri Apr 27 15:01:17 2018 +0200 ; Copyedits in etc/NEWS diff --git a/etc/NEWS b/etc/NEWS index 7d4abd384f..ca467c0ad4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -166,7 +166,7 @@ interface that's more like functions like @code{search-forward}. --- ** More commands support noncontiguous rectangular regions, namely -‘upcase-dwim’, ‘downcase-dwim’, ‘replace-string’, ‘replace-regexp’. +'upcase-dwim', 'downcase-dwim', 'replace-string', 'replace-regexp'. * Changes in Specialized Modes and Packages in Emacs 27.1 @@ -439,7 +439,7 @@ as it has been reported that many recipients can't read forwards that are formatted as MIME digests. +++ -*** `message-forward-included-headers' has changed its default to +*** 'message-forward-included-headers' has changed its default to exclude most headers when forwarding. * New Modes and Packages in Emacs 27.1 @@ -554,14 +554,14 @@ titled "Allow `&rest' or `&optional' without following variable (Bug#29165)" for a full listing of which arglists are accepted across versions. -** Internal parsing commands now use syntax-ppss and disregard -open-paren-in-column-0-is-defun-start. This affects mostly things like -forward-comment, scan-sexps, and forward-sexp when parsing backward. +** Internal parsing commands now use 'syntax-ppss' and disregard +'open-paren-in-column-0-is-defun-start'. This affects mostly things like +'forward-comment', 'scan-sexps', and 'forward-sexp' when parsing backward. The new variable 'comment-use-syntax-ppss' can be set to nil to recover the old behavior if needed. ** The 'server-name' and 'server-socket-dir' variables are set when a -socket has been pased to Emacs (Bug#24218). +socket has been passed to Emacs (Bug#24218). --- ** The 'file-system-info' function is now available on all platforms. @@ -569,7 +569,7 @@ instead of just Microsoft platforms. This fixes a 'get-free-disk-space' bug on OS X 10.8 and later (Bug#28639). +++ -** New macro combine-change-calls arranges to call the change hooks +** New macro 'combine-change-calls' arranges to call the change hooks ('before-change-functions' and 'after-change-functions') just once each around a sequence of lisp forms, given a region. This is useful when a function makes a possibly large number of repetitive commit caa93364d47bd28633cc065e31dd5972a1e916d5 Author: Michael Albinus Date: Fri Apr 27 14:43:01 2018 +0200 Manual update for Tramp * doc/misc/tramp.texi (Password handling): Explain, how passwords are saved permanently. * etc/NEWS: auth-source Secret Service backend supports :create. Tramp saves validated passwords. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 02ca75d8a4..329c46bdaa 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -1675,6 +1675,13 @@ file name syntax, must be appended to the machine and login items: machine melancholia#4711 port davs login daniel%BIZARRE password geheim @end example +@vindex auth-source-save-behavior +If there doesn't exist a proper entry, the password is read +interactively. After successful login (verification of the password), +it is offered to save a corresponding entry for further use by +@code{auth-source} backends which support this. This could be changed +by setting the variable @code{auth-source-save-behavior} to @code{nil}. + @vindex auth-source-debug Set @code{auth-source-debug} to @code{t} to debug messages. diff --git a/etc/NEWS b/etc/NEWS index ca46c88ce6..7d4abd384f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -396,17 +396,25 @@ To restore the old behavior, use Previously eshell/kill would fail if provided a kill signal to send to the process. It now accepts signals specified either by name or by its number. - ** Pcomplete *** The function 'pcomplete-uniquify-list' has been renamed from 'pcomplete-uniqify-list'. + +** Auth-source + +--- +*** The Secret Service backend supports the :create key now. + ** Tramp +++ *** New connection method "owncloud", which allows to access OwnCloud or NextCloud hosted files and directories. ++++ +*** Validated passwords are saved by auth-source backends which support this. + --- ** The options.el library has been removed. It was obsolete since Emacs 22.1, replaced by customize. commit 217202c084232f36d4fa0fead0f3aca21396d074 Author: Noam Postavsky Date: Fri Apr 27 07:27:59 2018 -0400 * lisp/epa.el (epa-decrypt-file): Apply epa-pinentry-mode (Bug#30363). diff --git a/lisp/epa.el b/lisp/epa.el index 5c237bca9b..70f27e272f 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -701,6 +701,7 @@ If you do not specify PLAIN-FILE, this functions prompts for the value to use." #'epa-progress-callback-function (format "Decrypting %s..." (file-name-nondirectory decrypt-file)))) + (setf (epg-context-pinentry-mode context) epa-pinentry-mode) (message "Decrypting %s..." (file-name-nondirectory decrypt-file)) (condition-case error (epg-decrypt-file context decrypt-file plain-file) commit 5a5e4eb76a3e9bfc7d4eeec06f874b524d4df450 Author: Lars Ingebrigtsen Date: Thu Apr 26 19:45:53 2018 +0200 Strip most headers when forwarding messages * lisp/gnus/message.el (message-forward-included-headers): Change the default to exclude most messages. (message-remove-ignored-headers): Make message-forward-included-headers actually work -- it's a list of regexps, not a list of strings. diff --git a/doc/misc/message.texi b/doc/misc/message.texi index 1d27ff1c58..671a5214ae 100644 --- a/doc/misc/message.texi +++ b/doc/misc/message.texi @@ -316,7 +316,7 @@ when forwarding a message. @item message-forward-included-headers @vindex message-forward-included-headers In non-@code{nil}, only headers that match this regexp will be kept -when forwarding a message. +when forwarding a message. This can also be a list of regexps. @item message-make-forward-subject-function @vindex message-make-forward-subject-function diff --git a/etc/NEWS b/etc/NEWS index 5416cb7c21..ca46c88ce6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -425,10 +425,15 @@ achieve this, add 'message-sign-encrypt-if-all-keys-available' to '"foo@bar.com" ', Message will elide the repeated "name" from the address field in the response. +--- *** The default of 'message-forward-as-mime' has changed from t to nil as it has been reported that many recipients can't read forwards that are formatted as MIME digests. ++++ +*** `message-forward-included-headers' has changed its default to +exclude most headers when forwarding. + * New Modes and Packages in Emacs 27.1 +++ diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 33c5e2cedb..867c3d271b 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -625,11 +625,12 @@ This may also be a list of regexps." (widget-editable-list-match widget value))) regexp)) -(defcustom message-forward-included-headers nil +(defcustom message-forward-included-headers + '("^From:" "^Subject:" "^Date:") "If non-nil, delete non-matching headers when forwarding a message. Only headers that match this regexp will be included. This variable should be a regexp or a list of regexps." - :version "25.1" + :version "27.1" :group 'message-forwarding :type '(repeat :value-to-internal (lambda (widget value) (custom-split-regexp-maybe value)) @@ -7436,7 +7437,8 @@ Optional DIGEST will use digest to forward." (when message-forward-included-headers (message-remove-header (if (listp message-forward-included-headers) - (regexp-opt message-forward-included-headers) + (mapconcat #'identity (cons "^$" message-forward-included-headers) + "\\|") message-forward-included-headers) t nil t))))) commit 4ee0919abf9421e12f29e123b00e29d72daf07c0 Author: Paul Eggert Date: Thu Apr 26 09:07:28 2018 -0700 * etc/NEWS: Fix minor quoting and spacing bugs. diff --git a/etc/NEWS b/etc/NEWS index c2f13dc037..5416cb7c21 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -71,7 +71,7 @@ However, if your init file changes the values of 'package-load-list' or work right without some adjustment: - you can move that code to the early init file (see above), so those settings apply before Emacs tries to activate the packages. -- you can use the new 'package-quickstart` so activation of packages does not +- you can use the new 'package-quickstart' so activation of packages does not need to pay attention to 'package-load-list' or 'package-user-dir' any more. @@ -116,10 +116,10 @@ indirectly, e.g., by checking that functions like 'libxml-parse-html-region' return nil. +++ -** `libxml-parse-xml-region' and `libxml-parse-html' region take +** 'libxml-parse-xml-region' and 'libxml-parse-html' region take a parameter that's called DISCARD-COMMENTS, but it really only discards the top-level comment. Therefore this parameter is now -obsolete, and the new utility function `xml-remove-comments' can be +obsolete, and the new utility function 'xml-remove-comments' can be used to remove comments before calling the libxml functions to parse the data. @@ -160,8 +160,8 @@ non-text modes. for abbrevs that have them. +++ -** The new functions and commands `text-property-search-forward' and -`text-property-search-backward' have been added. These provide an +** The new functions and commands 'text-property-search-forward' and +'text-property-search-backward' have been added. These provide an interface that's more like functions like @code{search-forward}. --- @@ -189,7 +189,7 @@ you don't need to set them in your early init file. ** Ecomplete *** The ecomplete sorting has changed to a decay-based algorithm. -This can be controlled by the new `ecomplete-sort-predicate' variable. +This can be controlled by the new 'ecomplete-sort-predicate' variable. *** The 'ecompleterc' file is now placed in ~/.emacs.d/ecompleterc by default Of course it will still find it if you have it in ~/.ecompleterc @@ -209,28 +209,28 @@ has a search engine. +++ *** Splitting mail on common mailing list headers has been added. See -the concept index in the Gnus manual for the `match-list' entry. +the concept index in the Gnus manual for the 'match-list' entry. +++ -*** nil is no longer an allowed value for `mm-text-html-renderer'. +*** nil is no longer an allowed value for 'mm-text-html-renderer'. +++ -*** A new Gnus summary mode command, `S A' -(`gnus-summary-attach-article') can be used to attach the current +*** A new Gnus summary mode command, 'S A' +('gnus-summary-attach-article') can be used to attach the current article(s) to a pre-existing Message buffer, or create a new Message buffer with the article(s) attached. ** erc --- -*** `erc-button-google-url' has been renamed `erc-button-search-url' +*** 'erc-button-google-url' has been renamed 'erc-button-search-url' and its value has been changed to Duck Duck Go. ** eww/shr *** When opening external links in eww/shr (typically with the -`C-u RET' keystroke on a link), the link will be flashed with the new -`shr-selected-link' face to give the user feedback that the command +'C-u RET' keystroke on a link), the link will be flashed with the new +'shr-selected-link' face to give the user feedback that the command has been executed. @@ -293,8 +293,10 @@ can now be searched via 'C-s'. +++ *** New isearch bindings. + 'C-M-w' in isearch changed from isearch-del-char to the new function -isearch-yank-symbol-or-char. isearch-del-char is now bound to 'C-M-d'. +isearch-yank-symbol-or-char. isearch-del-char is now bound to +'C-M-d'. +++ *** 'search-exit-option' provides new options 'move' and 'shift-move' @@ -313,7 +315,7 @@ and case-sensitivity together with search strings in the search ring. *** The runtime behavior of Edebug's instrumentation can be changed using the new variables 'edebug-behavior-alist', 'edebug-after-instrumentation-function' and -'edebug-new-definition-function'. Edebug's behavior can be changed +'edebug-new-definition-function'. Edebug's behavior can be changed globally or for individual definitions. ** Enhanced xterm support @@ -342,7 +344,7 @@ less verbose by removing non-essential information. --- *** Gamegrid now determines its default glyph size based on display -dimensions, instead of always using 16 pixels. As a result, Tetris, +dimensions, instead of always using 16 pixels. As a result, Tetris, Snake and Pong are more playable on HiDPI displays. ** Filecache @@ -423,7 +425,7 @@ achieve this, add 'message-sign-encrypt-if-all-keys-available' to '"foo@bar.com" ', Message will elide the repeated "name" from the address field in the response. -*** The default of `message-forward-as-mime' has changed from t to nil +*** The default of 'message-forward-as-mime' has changed from t to nil as it has been reported that many recipients can't read forwards that are formatted as MIME digests. @@ -535,8 +537,9 @@ backslash. For example: ** Omitting variables after '&optional' and '&rest' is now allowed. For example (defun foo (&optional)) is no longer an error. This is sometimes convenient when writing macros. See the ChangeLog entry -titled "Allow `&rest' or `&optional' without following variable" for a -full listing of which arglists are accepted across versions. +titled "Allow `&rest' or `&optional' without following variable +(Bug#29165)" for a full listing of which arglists are accepted across +versions. ** Internal parsing commands now use syntax-ppss and disregard open-paren-in-column-0-is-defun-start. This affects mostly things like @@ -544,7 +547,7 @@ forward-comment, scan-sexps, and forward-sexp when parsing backward. The new variable 'comment-use-syntax-ppss' can be set to nil to recover the old behavior if needed. -** The `server-name' and `server-socket-dir' variables are set when a +** The 'server-name' and 'server-socket-dir' variables are set when a socket has been pased to Emacs (Bug#24218). --- @@ -578,7 +581,7 @@ are implemented in C using the Jansson library. ** Mailcap --- -*** The new function `mailcap-file-name-to-mime-type' has been added. +*** The new function 'mailcap-file-name-to-mime-type' has been added. It's a simple convenience function for looking up MIME types based on file name extensions. @@ -589,7 +592,7 @@ For instance, if /etc/mailcap has an entry for image/gif, that one will be chosen even if you have an entry for image/* in your ~/.mailcap file. But with the new method, entries from ~/.mailcap overrides all system and Emacs-provided defaults. To get the old -method back, set `mailcap-prefer-mailcap-viewers' to nil. +method back, set 'mailcap-prefer-mailcap-viewers' to nil. ** URL @@ -603,7 +606,7 @@ higher-level functions. ** image-mode *** image-mode started using ImageMagick by default for all images -some years back. It now respects `imagemagick-types-inhibit' as a way +some years back. It now respects 'imagemagick-types-inhibit' as a way to disable that. @@ -630,9 +633,9 @@ Previously it was supported only in the Cygwin-w32 build. ** Emacs now handles key combinations involving the macOS "command" and "option" modifier keys more correctly. -** The special handling of `frame-title-format' on NS where setting it -to `t' would enable the macOS proxy icon has been replaced with a -separate variable, `ns-use-proxy-icon'. `frame-title-format' will now +** The special handling of 'frame-title-format' on NS where setting it +to 't' would enable the macOS proxy icon has been replaced with a +separate variable, 'ns-use-proxy-icon'. 'frame-title-format' will now work as on other platforms. commit 1d75604eaded6a8482d28d57bc8e6a4d99d5caee Author: Noam Postavsky Date: Thu Apr 26 07:36:50 2018 -0400 Add missing calendar-dlet* (Bug#31267) * lisp/calendar/calendar.el (calendar-generate-month): Use calendar-dlet* around evaluation of calendar-date-echo-text. diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 16009df824..71fb76ce21 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -1517,7 +1517,8 @@ line." (insert (propertize (format (format "%%%dd" calendar-day-digit-width) day) 'mouse-face 'highlight - 'help-echo (eval calendar-date-echo-text) + 'help-echo (calendar-dlet* ((day day) (month month) (year year)) + (eval calendar-date-echo-text)) ;; 'date property prevents intermonth text confusing re-searches. ;; (Tried intangible, it did not really work.) 'date t) commit 66dbb787a22d4ae1d513a3ee27e22eed395f5676 Author: Ivan Shmakov Date: Fri Mar 23 03:24:17 2018 +0000 Ensure woman2-roff-buffer restores functions on error (Bug#30908) * lisp/woman.el (woman2-roff-buffer): Put the fallback paragraph processing inside the protected part of the unwind-protect form, rather than the cleanup forms. Attempting to format paragraphs again after an error has been signaled is unlikely to be helpful. The fallback processing should be triggered only in case the loop terminated normally, but did not reach the end of the buffer for some reason. diff --git a/lisp/woman.el b/lisp/woman.el index eab97fb34b..238a7d389c 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -3663,46 +3663,46 @@ expression in parentheses. Leaves point after the value." (fset 'insert-and-inherit (symbol-function 'insert)) (fset 'set-text-properties 'ignore) (unwind-protect - (while - ;; Find next control line: - (re-search-forward woman-request-regexp nil t) - (cond - ;; Construct woman function to call: - ((setq fn (intern-soft - (concat "woman2-" - (setq woman-request (match-string 1))))) - ;; Delete request or macro name: - (woman-delete-match 0)) - ;; Unrecognized request: - ((prog1 nil - ;; (WoMan-warn ".%s request ignored!" woman-request) - (WoMan-warn-ignored woman-request "ignored!") - ;; (setq fn 'woman2-LP) + (progn + (while + ;; Find next control line: + (re-search-forward woman-request-regexp nil t) + (cond + ;; Construct woman function to call: + ((setq fn (intern-soft + (concat "woman2-" + (setq woman-request (match-string 1))))) + ;; Delete request or macro name: + (woman-delete-match 0)) + ;; Unrecognized request: + ((prog1 nil + ;; (WoMan-warn ".%s request ignored!" woman-request) + (WoMan-warn-ignored woman-request "ignored!") + ;; (setq fn 'woman2-LP) + ;; AVOID LEAVING A BLANK LINE! + ;; (setq fn 'woman2-format-paragraphs) + )) + ;; .LP assumes it is at eol and leaves a (blank) line, + ;; so leave point at end of line before paragraph: + ((or (looking-at "[ \t]*$") ; no argument + woman-ignore) ; ignore all + ;; (beginning-of-line) (kill-line) ;; AVOID LEAVING A BLANK LINE! - ;; (setq fn 'woman2-format-paragraphs) - )) - ;; .LP assumes it is at eol and leaves a (blank) line, - ;; so leave point at end of line before paragraph: - ((or (looking-at "[ \t]*$") ; no argument - woman-ignore) ; ignore all - ;; (beginning-of-line) (kill-line) - ;; AVOID LEAVING A BLANK LINE! - (beginning-of-line) (woman-delete-line 1)) - (t (end-of-line) (insert ?\n)) - ) - (if (not (or fn - (and (not (memq (following-char) '(?. ?'))) - (setq fn 'woman2-format-paragraphs)))) - () - ;; Find next control line: - (if (equal woman-request "TS") - (set-marker to (woman-find-next-control-line "TE")) - (set-marker to (woman-find-next-control-line))) - ;; Call the appropriate function: - (funcall fn to))) - (if (not (eobp)) ; This should not happen, but ... - (woman2-format-paragraphs (copy-marker (point-max) t) - woman-left-margin)) + (beginning-of-line) (woman-delete-line 1)) + (t (end-of-line) (insert ?\n))) + (if (not (or fn + (and (not (memq (following-char) '(?. ?'))) + (setq fn 'woman2-format-paragraphs)))) + () + ;; Find next control line: + (if (equal woman-request "TS") + (set-marker to (woman-find-next-control-line "TE")) + (set-marker to (woman-find-next-control-line))) + ;; Call the appropriate function: + (funcall fn to))) + (if (not (eobp)) ; This should not happen, but ... + (woman2-format-paragraphs (copy-marker (point-max) t) + woman-left-margin))) (fset 'canonically-space-region canonically-space-region) (fset 'set-text-properties set-text-properties) (fset 'insert-and-inherit insert-and-inherit) commit b8aa7ecf54c9b164a59f1b0e9f9fe90531dadd20 Author: Noam Postavsky Date: Sat Apr 14 01:02:25 2018 -0400 Fix cl-print for circular sublists (Bug#31146) * lisp/emacs-lisp/cl-print.el (cl-print-object) : Push each element of list being printed onto cl-print--currently-printing. * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-circle-2): New test. diff --git a/lisp/emacs-lisp/cl-print.el b/lisp/emacs-lisp/cl-print.el index 78cd6f9d9e..ada5923515 100644 --- a/lisp/emacs-lisp/cl-print.el +++ b/lisp/emacs-lisp/cl-print.el @@ -62,9 +62,12 @@ call other entry points instead, such as `cl-prin1'." (princ "(" stream) (cl-print-object car stream) (while (and (consp object) - (not (if cl-print--number-table - (numberp (gethash object cl-print--number-table)) - (memq object cl-print--currently-printing)))) + (not (cond + (cl-print--number-table + (numberp (gethash object cl-print--number-table))) + ((memq object cl-print--currently-printing)) + (t (push object cl-print--currently-printing) + nil)))) (princ " " stream) (cl-print-object (pop object) stream)) (when object diff --git a/test/lisp/emacs-lisp/cl-print-tests.el b/test/lisp/emacs-lisp/cl-print-tests.el index 660d5c8069..d986c4015d 100644 --- a/test/lisp/emacs-lisp/cl-print-tests.el +++ b/test/lisp/emacs-lisp/cl-print-tests.el @@ -55,4 +55,14 @@ (let ((print-circle t)) (should (equal "(#1=(a . #1#) #1#)" (cl-prin1-to-string x)))))) +(ert-deftest cl-print-circle-2 () + ;; Bug#31146. + (let ((x '(0 . #1=(0 . #1#)))) + (let ((print-circle nil)) + (should (string-match "\\`(0 0 . #[0-9])\\'" + (cl-prin1-to-string x)))) + (let ((print-circle t)) + (should (equal "(0 . #1=(0 . #1#))" (cl-prin1-to-string x)))))) + + ;;; cl-print-tests.el ends here. commit a92e7b4ef6915e079a97e4e33e45b11508170cb1 Author: Paul Eggert Date: Wed Apr 25 12:20:04 2018 -0700 Don’t set print-escape-newlines in the minibuffer This appears to be an unnecessary and possibly-confusing revenant from ancient code (Bug#31251). See thread containing: https://lists.gnu.org/r/emacs-devel/2018-04/msg00654.html * src/minibuf.c (read_minibuf): Do not set print-escape-newlines. * src/print.c (syms_of_print): Do not defsym print-escape-newlines or print-escape-control-characters, as these symbols are not used in C code. diff --git a/src/minibuf.c b/src/minibuf.c index 11b3fe2b9c..c41958d85f 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -595,13 +595,6 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, XWINDOW (minibuf_window)->hscroll = 0; XWINDOW (minibuf_window)->suspend_auto_hscroll = 0; - /* Why does this code set print-escape-newlines? No call to Fprin1 - or to Fprint is anywhere in sight. FIXME: Either remove the next - two lines of code along with this comment, or replace this - comment with an explanation for why the two lines are needed. */ - Fmake_local_variable (Qprint_escape_newlines); - print_escape_newlines = 1; - /* Erase the buffer. */ { ptrdiff_t count1 = SPECPDL_INDEX (); diff --git a/src/print.c b/src/print.c index a8bbb9d37a..7c6856af48 100644 --- a/src/print.c +++ b/src/print.c @@ -2447,10 +2447,8 @@ priorities. */); defsubr (&Sredirect_debugging_output); defsubr (&Sprint_preprocess); - DEFSYM (Qprint_escape_newlines, "print-escape-newlines"); DEFSYM (Qprint_escape_multibyte, "print-escape-multibyte"); DEFSYM (Qprint_escape_nonascii, "print-escape-nonascii"); - DEFSYM (Qprint_escape_control_characters, "print-escape-control-characters"); print_prune_charset_plist = Qnil; staticpro (&print_prune_charset_plist); commit 28930785d7a8ee871f000be3545daab246c96d73 Author: Glenn Morris Date: Wed Apr 25 14:45:30 2018 -0400 * lisp/foldout.el (outline-minor-mode): Remove pointless check. diff --git a/lisp/foldout.el b/lisp/foldout.el index ead5368bad..34e3c6da66 100644 --- a/lisp/foldout.el +++ b/lisp/foldout.el @@ -209,10 +209,6 @@ (require 'outline) -;; something has gone very wrong if outline-minor-mode isn't bound now. -(if (not (boundp 'outline-minor-mode)) - (error "Can't find outline-minor-mode")) - (defvar foldout-fold-list nil "List of start and end markers for the folds currently entered. An end marker of nil means the fold ends after (point-max).") commit 8c50334ad701dbf4141f8e80e9fb488c7c8de861 Author: Glenn Morris Date: Wed Apr 25 14:43:18 2018 -0400 speedbar: remove support for missing custom.el * lisp/speedbar.el (speedbar-file-regexp) (speedbar-ignored-directory-regexp): Remove support for no custom.el. diff --git a/lisp/speedbar.el b/lisp/speedbar.el index a231163715..48829d4023 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -741,13 +741,6 @@ DIRECTORY-EXPRESSION to `speedbar-ignored-directory-expressions'." (setq speedbar-ignored-directory-regexp (speedbar-extension-list-to-regex speedbar-ignored-directory-expressions))) -;; If we don't have custom, then we set it here by hand. -(if (not (fboundp 'custom-declare-variable)) - (setq speedbar-file-regexp (speedbar-extension-list-to-regex - speedbar-supported-extension-expressions) - speedbar-ignored-directory-regexp (speedbar-extension-list-to-regex - speedbar-ignored-directory-expressions))) - (defcustom speedbar-update-flag dframe-have-timer-flag "Non-nil means to automatically update the display. When this is nil then speedbar will not follow the attached frame's directory. commit bb902bf6a5629df9d54a5caf3d9ce2153f1a84c5 Author: Glenn Morris Date: Wed Apr 25 14:41:41 2018 -0400 * lisp/progmodes/sql.el (comint-line-beginning-position): Remove pre-21 fallback definition. diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 4d291c3bde..64651aff11 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -2715,17 +2715,6 @@ adds a fontification pattern to fontify identifiers ending in (sql-highlight-product)) -;;; Compatibility functions - -(if (not (fboundp 'comint-line-beginning-position)) - ;; comint-line-beginning-position is defined in Emacs 21 - (defun comint-line-beginning-position () - "Return the buffer position of the beginning of the line, after any prompt. -The prompt is assumed to be any text at the beginning of the line -matching the regular expression `comint-prompt-regexp', a buffer -local variable." - (save-excursion (comint-bol nil) (point)))) - ;;; SMIE support ;; Needs a lot more love than I can provide. --Stef commit 6e65b1e8a9e8d8a7c68ead3016ff0b9265311700 Author: Glenn Morris Date: Wed Apr 25 14:40:28 2018 -0400 * lisp/net/eudc.el (split-string): Remove pre-21 fallback definition. diff --git a/lisp/net/eudc.el b/lisp/net/eudc.el index 98f70bd1f7..00d8c60311 100644 --- a/lisp/net/eudc.el +++ b/lisp/net/eudc.el @@ -158,25 +158,6 @@ properties on the list." (setq plist (cdr (cdr plist)))) default)) -(if (not (fboundp 'split-string)) - (defun split-string (string &optional pattern) - "Return a list of substrings of STRING which are separated by PATTERN. -If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"." - (or pattern - (setq pattern "[ \f\t\n\r\v]+")) - (let (parts (start 0)) - (when (string-match pattern string 0) - (if (> (match-beginning 0) 0) - (setq parts (cons (substring string 0 (match-beginning 0)) nil))) - (setq start (match-end 0)) - (while (and (string-match pattern string start) - (> (match-end 0) start)) - (setq parts (cons (substring string start (match-beginning 0)) parts) - start (match-end 0)))) - (nreverse (if (< start (length string)) - (cons (substring string start) parts) - parts))))) - (defun eudc-replace-in-string (str regexp newtext) "Replace all matches in STR for REGEXP with NEWTEXT. Value is the new string." commit 532f5fb3877ccd535a822f7c3c08d396621b4325 Author: Basil L. Contovounesios Date: Thu Apr 12 17:46:37 2018 +0100 Do not call interprogram-paste-function repeatedly * lisp/simple.el (current-kill): Disable interprogram-paste-function so that kill-new doesn't call it repeatedly when save-interprogram-paste-before-kill is enabled. (bug#31209) diff --git a/lisp/simple.el b/lisp/simple.el index 839a4dd2c6..863547a76b 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4477,7 +4477,10 @@ move the yanking point; just return the Nth kill forward." ;; Disable the interprogram cut function when we add the new ;; text to the kill ring, so Emacs doesn't try to own the ;; selection, with identical text. - (let ((interprogram-cut-function nil)) + ;; Also disable the interprogram paste function, so that + ;; `kill-new' doesn't call it repeatedly. + (let ((interprogram-cut-function nil) + (interprogram-paste-function nil)) (if (listp interprogram-paste) ;; Use `reverse' to avoid modifying external data. (mapc #'kill-new (reverse interprogram-paste)) commit cab400aacde04e4455caea4a6525b26ca7909850 Author: Glenn Morris Date: Tue Apr 24 21:13:00 2018 -0400 socks.el: remove pre-21 compatibility code * lisp/net/socks.el (socks-split-string): Remove. (socks-nslookup-host): Just use split-string. diff --git a/lisp/net/socks.el b/lisp/net/socks.el index 32362e2543..1c2459a8e6 100644 --- a/lisp/net/socks.el +++ b/lisp/net/socks.el @@ -36,22 +36,6 @@ (require 'wid-edit)) (require 'custom) -(eval-and-compile - (if (featurep 'emacs) - (defalias 'socks-split-string 'split-string) ; since at least 21.1 - (if (fboundp 'split-string) - (defalias 'socks-split-string 'split-string) - (defun socks-split-string (string &optional pattern) - "Return a list of substrings of STRING which are separated by PATTERN. -If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"." - (or pattern - (setq pattern "[ \f\t\n\r\v]+")) - (let (parts (start 0)) - (while (string-match pattern string start) - (setq parts (cons (substring string start - (match-beginning 0)) parts) - start (match-end 0))) - (nreverse (cons (substring string start) parts))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Custom widgets ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -652,7 +636,7 @@ version.") (setq res (buffer-substring (match-beginning 2) (match-end 2)) res (mapcar 'string-to-number - (socks-split-string res "\\."))))) + (split-string res "\\."))))) (kill-buffer (current-buffer))) res) host)) commit 1a6f59573603a57f64f4bc8866d482a20ef1ea52 Author: Paul Eggert Date: Tue Apr 24 14:25:55 2018 -0700 * src/minibuf.c (read_minibuf): Add a FIXME comment. diff --git a/src/minibuf.c b/src/minibuf.c index 5cb6919a0f..11b3fe2b9c 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -595,6 +595,10 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, XWINDOW (minibuf_window)->hscroll = 0; XWINDOW (minibuf_window)->suspend_auto_hscroll = 0; + /* Why does this code set print-escape-newlines? No call to Fprin1 + or to Fprint is anywhere in sight. FIXME: Either remove the next + two lines of code along with this comment, or replace this + comment with an explanation for why the two lines are needed. */ Fmake_local_variable (Qprint_escape_newlines); print_escape_newlines = 1; commit 449751a02fc2342386e52d0d7731d8a1f079df84 Author: Glenn Morris Date: Tue Apr 24 13:32:49 2018 -0400 ; * etc/NEWS: Fix typo. diff --git a/etc/NEWS b/etc/NEWS index 706abf529b..c2f13dc037 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -386,7 +386,8 @@ To restore the old behavior, use (add-hook 'eshell-expand-input-functions #'eshell-expand-history-references) -*** The function 'shell-uniquify-list' has been renamed from +--- +*** The function 'eshell-uniquify-list' has been renamed from 'eshell-uniqify-list'. *** The function eshell/kill is now able to handle signal switches. commit c7290da0a11ebbc81cab9493aad33f6a04a13328 Author: Lars Ingebrigtsen Date: Tue Apr 24 17:23:53 2018 +0200 (add-to-invisibility-spec): Further doc tweak * lisp/subr.el (add-to-invisibility-spec): Tweak doc fix from previous patch. diff --git a/lisp/subr.el b/lisp/subr.el index 208535f00b..dd51539fa1 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4333,7 +4333,8 @@ that can be added. If `buffer-invisibility-spec' isn't a list before calling this function, `buffer-invisibility-spec' will afterwards be a list with the value `(t ELEMENT)'. This means that if text exists -with non-`t' invisibility values, that text will become visible." +that invisibility values that aren't either `t' or ELEMENT, that +text will become visible." (if (eq buffer-invisibility-spec t) (setq buffer-invisibility-spec (list t))) (setq buffer-invisibility-spec commit 400153f0850aff8c96b2da6768d53dc5885c3243 Author: Lars Ingebrigtsen Date: Tue Apr 24 17:20:15 2018 +0200 Doc fix for `*-*-invisibility-spec' * lisp/subr.el (add-to-invisibility-spec) (remove-from-invisibility-spec): Make the doc string say what happens if `buffer-invisibility-spec' is an atom (bug#30171). diff --git a/lisp/subr.el b/lisp/subr.el index 74d4a7f427..208535f00b 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4328,14 +4328,23 @@ to `display-warning'." (defun add-to-invisibility-spec (element) "Add ELEMENT to `buffer-invisibility-spec'. See documentation for `buffer-invisibility-spec' for the kind of elements -that can be added." +that can be added. + +If `buffer-invisibility-spec' isn't a list before calling this +function, `buffer-invisibility-spec' will afterwards be a list +with the value `(t ELEMENT)'. This means that if text exists +with non-`t' invisibility values, that text will become visible." (if (eq buffer-invisibility-spec t) (setq buffer-invisibility-spec (list t))) (setq buffer-invisibility-spec (cons element buffer-invisibility-spec))) (defun remove-from-invisibility-spec (element) - "Remove ELEMENT from `buffer-invisibility-spec'." + "Remove ELEMENT from `buffer-invisibility-spec'. +If `buffer-invisibility-spec' isn't a list before calling this +function, it will be made into a list containing just `t' as the +only list member. This means that if text exists with non-`t' +invisibility values, that text will become visible." (setq buffer-invisibility-spec (if (consp buffer-invisibility-spec) (delete element buffer-invisibility-spec) commit a29677a0317dd68fd4a54fbccca73b1e6f178f95 Author: Lars Ingebrigtsen Date: Tue Apr 24 16:46:42 2018 +0200 libxml-parse-*-region calling convention fix * lisp/subr.el (libxml-parse-xml-region) (libxml-parse-html-region): Adjust the calling convention to note that the final parameter is optional. diff --git a/lisp/subr.el b/lisp/subr.el index 9cf7d596cd..74d4a7f427 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1456,8 +1456,8 @@ be a list of the form returned by `event-start' and `event-end'." (set-advertised-calling-convention 'unintern '(name obarray) "23.3") (set-advertised-calling-convention 'indirect-function '(object) "25.1") (set-advertised-calling-convention 'redirect-frame-focus '(frame focus-frame) "24.3") -(set-advertised-calling-convention 'libxml-parse-xml-region '(start end base-url) "27.1") -(set-advertised-calling-convention 'libxml-parse-html-region '(start end base-url) "27.1") +(set-advertised-calling-convention 'libxml-parse-xml-region '(start end &optional base-url) "27.1") +(set-advertised-calling-convention 'libxml-parse-html-region '(start end &optional base-url) "27.1") ;;;; Obsolescence declarations for variables, and aliases. commit ca5713deffde3e4b3126e60e75c169af824365ec Author: Lars Ingebrigtsen Date: Tue Apr 24 14:09:41 2018 +0200 Make url-http-create-request work with non-ASCII data again * lisp/url/url-http.el (url-http-create-request): Ensure that the entire request string is unibyte (bug#31248). diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index d45bb323b1..0b95453b30 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -306,7 +306,7 @@ as the Referer-header (subject to `url-privacy-level'." (and (boundp 'proxy-info) proxy-info) url-http-target-url) nil 'any nil))) - (ref-url url-http-referer)) + (ref-url (url-http--encode-string url-http-referer))) (if (equal "" real-fname) (setq real-fname "/")) (setq no-cache (and no-cache (string-match "no-cache" no-cache))) @@ -355,9 +355,11 @@ as the Referer-header (subject to `url-privacy-level'." (url-scheme-get-property (url-type url-http-target-url) 'default-port)) (format - "Host: %s:%d\r\n" (puny-encode-domain host) + "Host: %s:%d\r\n" (url-http--encode-string + (puny-encode-domain host)) (url-port url-http-target-url)) - (format "Host: %s\r\n" (puny-encode-domain host))) + (format "Host: %s\r\n" + (url-http--encode-string (puny-encode-domain host)))) ;; Who its from (if url-personal-mail-address (concat commit fa3136e07148ab37fabc52007f531e71e41a1d5a Author: Eli Zaretskii Date: Mon Apr 23 20:48:12 2018 +0300 Fix recent change in lread.c * src/lread.c (openp): Avoid assertion violations in XCDR when PATH is nil. (Bug#31229) diff --git a/src/lread.c b/src/lread.c index 69b53629ec..b8db117c79 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1772,7 +1772,7 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, } } } - if (absolute) + if (absolute || NILP (path)) break; path = XCDR (path); } while (CONSP (path)); commit 3c6b59918aaaac295fd6354dae929859eaaacfa2 Author: Paul Eggert Date: Mon Apr 23 10:44:24 2018 -0700 Backspace is not a paragraph separator in Texinfo files * lisp/textmodes/texinfo.el (texinfo-mode): Omit backspace from paragraph separator and start. Perhaps there was some confusion about .texi vs .info files long ago? diff --git a/doc/misc/org.texi b/doc/misc/org.texi index 7453b1db04..807b80dbdb 100644 --- a/doc/misc/org.texi +++ b/doc/misc/org.texi @@ -19694,8 +19694,8 @@ mentioned in the manual. For a complete list, use @kbd{M-x org-customize @c Local variables: @c fill-column: 77 @c indent-tabs-mode: nil -@c paragraph-start: "\\|^@[a-zA-Z]*[ \n]\\|^@x?org\\(key\\|cmd\\)\\|\f\\|[ ]*$" -@c paragraph-separate: "\\|^@[a-zA-Z]*[ \n]\\|^@x?org\\(key\\|cmd\\)\\|[ \f]*$" +@c paragraph-start: "^@[a-zA-Z]*[ \n]\\|^@x?org\\(key\\|cmd\\)\\|\f\\|[ ]*$" +@c paragraph-separate: "^@[a-zA-Z]*[ \n]\\|^@x?org\\(key\\|cmd\\)\\|[ \f]*$" @c End: diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el index 16399bd9fd..ff723a4fb9 100644 --- a/lisp/textmodes/texinfo.el +++ b/lisp/textmodes/texinfo.el @@ -596,9 +596,9 @@ value of `texinfo-mode-hook'." (setq-local require-final-newline mode-require-final-newline) (setq-local indent-tabs-mode nil) (setq-local paragraph-separate - (concat "\b\\|@[a-zA-Z]*[ \n]\\|" + (concat "@[a-zA-Z]*[ \n]\\|" paragraph-separate)) - (setq-local paragraph-start (concat "\b\\|@[a-zA-Z]*[ \n]\\|" + (setq-local paragraph-start (concat "@[a-zA-Z]*[ \n]\\|" paragraph-start)) (setq-local sentence-end-base "\\(@\\(end\\)?dots{}\\|[.?!]\\)[]\"'”)}]*") (setq-local fill-column 70) commit d1ab86f2a4936d161ed715e1f8d7d30b6f63c3d9 Author: Eli Zaretskii Date: Mon Apr 23 19:40:44 2018 +0300 * etc/NEWS: Improve wording of next-error entries. diff --git a/etc/NEWS b/etc/NEWS index bde9b89c46..706abf529b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -359,11 +359,15 @@ are evaluated lazily. +++ *** New customizable variable 'next-error-find-buffer-function'. -This variable defines the logic of finding a next-error capable -buffer. It has an option to use a single such buffer on selected -frame, or by default use the last buffer that navigated to the current -buffer. You can use 'next-error-select-buffer' to set any other -next-error capable buffer as the last used. +The value should be a function that determines how to find the +next buffer to be used by 'next-error' and 'previous-error'. The +default is to use the last buffer that navigated to the current +error. + ++++ +*** New command 'next-error-select-buffer'. +It can be used to set any buffer as the next one to be used by +'next-error' and 'previous-error'. ** nxml-mode commit 0ecc10a7771bf1f62d15b2e6c747bee9f7a557ff Author: Michael Albinus Date: Mon Apr 23 10:16:06 2018 +0200 Let Tramp save passwords * lisp/auth-source.el (auth-source-secrets-saver): New defun. (auth-source-secrets-create): Use it. * lisp/net/secrets.el (secrets-struct-secret-content-type): (secrets-create-item): Do not hard-code :xdg:schema. * lisp/net/tramp.el (tramp-password-save-function): New defvar. (tramp-read-passwd): Set it properly. (tramp-process-actions): * lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection): Save password. * lisp/net/tramp-cmds.el (tramp-bug): Don't report `tramp-password-save-function'. * test/lisp/net/secrets-tests.el (secrets-test03-items): Extend test with another :xdg:schema. diff --git a/lisp/auth-source.el b/lisp/auth-source.el index a2ed47a0d4..df3622a412 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -1732,10 +1732,45 @@ authentication tokens: (item (plist-get artificial :label)) (secret (plist-get artificial :secret)) (secret (if (functionp secret) (funcall secret) secret))) - (lambda () (apply 'secrets-create-item collection item secret args)))) + (lambda () + (apply 'auth-source-secrets-saver collection item secret args)))) (list artificial))) +(defun auth-source-secrets-saver (collection item secret args) + "Wrapper around `secrets-create-item', prompting along the way. +Respects `auth-source-save-behavior'." + (let ((prompt (format "Save auth info to secrets collection %s? " collection)) + (done (not (eq auth-source-save-behavior 'ask))) + (bufname "*auth-source Help*") + doit k) + (while (not done) + (setq k (auth-source-read-char-choice prompt '(?y ?n ?N ??))) + (cl-case k + (?y (setq done t doit t)) + (?? (save-excursion + (with-output-to-temp-buffer bufname + (princ + (concat "(y)es, save\n" + "(n)o but use the info\n" + "(N)o and don't ask to save again\n" + "(?) for help as you can see.\n")) + ;; Why? Doesn't with-output-to-temp-buffer already do + ;; the exact same thing anyway? --Stef + (set-buffer standard-output) + (help-mode)))) + (?n (setq done t doit nil)) + (?N (setq done t doit nil) + (customize-save-variable 'auth-source-save-behavior nil)) + (t nil))) + + (when doit + (progn + (auth-source-do-debug + "secrets-create-item: wrote 1 new item to %s" collection) + (message "Saved new authentication information to %s" collection) + (apply 'secrets-create-item collection item secret args))))) + ;;; Backend specific parsing: Mac OS Keychain (using /usr/bin/security) backend (cl-defun auth-source-macos-keychain-search (&rest spec diff --git a/lisp/net/secrets.el b/lisp/net/secrets.el index 8070ccf96e..f7cc011615 100644 --- a/lisp/net/secrets.el +++ b/lisp/net/secrets.el @@ -331,9 +331,7 @@ It returns t if not." ;; Properties. `(:array (:dict-entry ,(concat secrets-interface-item ".Label") - (:variant "dummy")) - (:dict-entry ,(concat secrets-interface-item ".Type") - (:variant ,secrets-interface-item-type-generic))) + (:variant " "))) ;; Secret. `(:struct :object-path ,path (:array :signature "y") @@ -649,11 +647,24 @@ keys are keyword symbols, starting with a colon. Example: (secrets-create-item \"Tramp collection\" \"item\" \"geheim\" :method \"sudo\" :user \"joe\" :host \"remote-host\") +The key `:xdg:schema' determines the scope of the item to be +generated, i.e. for which applications the item is intended for. +This is just a string like \"org.freedesktop.NetworkManager.Mobile\" +or \"org.gnome.OnlineAccounts\", the other required keys are +determined by this. If no `:xdg:schema' is given, +\"org.freedesktop.Secret.Generic\" is used by default. + The object path of the created item is returned." (unless (member item (secrets-list-items collection)) (let ((collection-path (secrets-unlock-collection collection)) result props) (unless (secrets-empty-path collection-path) + ;; Set default type if needed. + (unless (member :xdg:schema attributes) + (setq attributes + (append + attributes + `(:xdg:schema ,secrets-interface-item-type-generic)))) ;; Create attributes list. (while (consp (cdr attributes)) (unless (keywordp (car attributes)) @@ -675,9 +686,7 @@ The object path of the created item is returned." (append `(:array (:dict-entry ,(concat secrets-interface-item ".Label") - (:variant ,item)) - (:dict-entry ,(concat secrets-interface-item ".Type") - (:variant ,secrets-interface-item-type-generic))) + (:variant ,item))) (when props `((:dict-entry ,(concat secrets-interface-item ".Attributes") (:variant ,(append '(:array) props)))))) diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index cbb9cd3700..b05f475f2f 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -181,7 +181,9 @@ This includes password cache, file cache, connection cache, buffers." "Submit a bug report to the Tramp developers." (interactive) (catch 'dont-send - (let ((reporter-prompt-for-summary-p t)) + (let ((reporter-prompt-for-summary-p t) + ;; In rare cases, it could contain the password. So we make it nil. + tramp-password-save-function) (reporter-submit-bug-report tramp-bug-report-address ; to-address (format "tramp (%s)" tramp-version) ; package name and version diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index b3d5339321..199ac4fad2 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -2041,6 +2041,9 @@ connection if a previous connection has died for some reason." (tramp-get-file-property vec "/" "fuse-mountpoint" "") "/") (tramp-error vec 'file-error "FUSE mount denied")) + ;; Save the password. + (ignore-errors (funcall tramp-password-save-function)) + ;; Set connection-local variables. (tramp-set-connection-local-variables vec) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 5c785b16d8..c394f28a56 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1192,6 +1192,11 @@ means to use always cached values for the directory contents." (defvar tramp-current-connection nil "Last connection timestamp.") +(defvar tramp-password-save-function nil + "Password save function. +Will be called once the password has been verified by successful +authentication.") + (defconst tramp-completion-file-name-handler-alist '((file-name-all-completions . tramp-completion-handle-file-name-all-completions) @@ -3852,7 +3857,9 @@ connection buffer." (with-current-buffer (tramp-get-connection-buffer vec) (widen) (tramp-message vec 6 "\n%s" (buffer-string))) - (unless (eq exit 'ok) + (if (eq exit 'ok) + (ignore-errors (funcall tramp-password-save-function)) + ;; Not successful. (tramp-clear-passwd vec) (delete-process proc) (tramp-error-with-buffer @@ -4458,12 +4465,14 @@ Invokes `password-read' if available, `read-passwd' else." (with-current-buffer (process-buffer proc) (tramp-check-for-regexp proc tramp-password-prompt-regexp) (format "%s for %s " (capitalize (match-string 1)) key)))) + (auth-source-creation-prompts `((secret . ,pw-prompt))) ;; We suspend the timers while reading the password. (stimers (with-timeout-suspend)) auth-info auth-passwd) (unwind-protect (with-parsed-tramp-file-name key nil + (setq tramp-password-save-function nil) (setq user (or user (tramp-get-connection-property key "login-as" nil))) (prog1 @@ -4474,31 +4483,38 @@ Invokes `password-read' if available, `read-passwd' else." v "first-password-request" nil) ;; Try with Tramp's current method. (setq auth-info - (auth-source-search - :max 1 - (and user :user) - (if domain - (concat user tramp-prefix-domain-format domain) - user) - :host - (if port - (concat host tramp-prefix-port-format port) - host) - :port method - :require (cons :secret (and user '(:user)))) - auth-passwd (plist-get - (nth 0 auth-info) :secret) + (car + (auth-source-search + :max 1 + (and user :user) + (if domain + (concat + user tramp-prefix-domain-format domain) + user) + :host + (if port + (concat + host tramp-prefix-port-format port) + host) + :port method + :require (cons :secret (and user '(:user))) + :create t)) + tramp-password-save-function + (plist-get auth-info :save-function) + auth-passwd (plist-get auth-info :secret) auth-passwd (if (functionp auth-passwd) (funcall auth-passwd) auth-passwd)))) + ;; Try the password cache. (let ((password (password-read pw-prompt key))) - ;; FIXME test password works before caching it. - (password-cache-add key password) + (setq tramp-password-save-function + (lambda () (password-cache-add key password))) password) ;; Else, get the password interactively. (read-passwd pw-prompt)) (tramp-set-connection-property v "first-password-request" nil))) + ;; Reenable the timers. (with-timeout-unsuspend stimers)))) diff --git a/test/lisp/net/secrets-tests.el b/test/lisp/net/secrets-tests.el index dc9c7f1004..23512d48ee 100644 --- a/test/lisp/net/secrets-tests.el +++ b/test/lisp/net/secrets-tests.el @@ -169,9 +169,16 @@ (should (equal (secrets-get-attributes "session" "bar") - '((:host . "remote-host") (:user . "joe") - (:method . "sudo") - (:xdg:schema . "org.freedesktop.Secret.Generic")))) + '((:xdg:schema . "org.freedesktop.Secret.Generic") + (:host . "remote-host") (:user . "joe") (:method . "sudo")))) + + ;; Create an item with another schema. + (secrets-create-item + "session" "baz" "secret" :xdg:schema "org.gnu.Emacs.foo") + (should + (equal + (secrets-get-attributes "session" "baz") + '((:xdg:schema . "org.gnu.Emacs.foo")))) ;; Delete them. (dolist (item (secrets-list-items "session")) @@ -206,6 +213,8 @@ ;; Search the items. (should-not (secrets-search-items "session" :user "john")) + (should-not + (secrets-search-items "session" :xdg:schema "org.gnu.Emacs.foo")) (should (equal (sort (secrets-search-items "session" :user "joe") 'string-lessp) commit e7044d294c1b1779b3124b27ba0f09b22b64df20 Author: Michael Albinus Date: Mon Apr 23 10:01:27 2018 +0200 Ensure proper EOL handling for Tramp on macOS * lisp/net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): Ensure proper EOL handling for Darwin. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 2fb5566a3b..58982e58bb 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4157,7 +4157,10 @@ process to set up. VEC specifies the connection." (with-current-buffer (process-buffer proc) ;; Use MULE to select the right EOL convention for communicating ;; with the process. - (let ((cs (or (and (memq 'utf-8 (coding-system-list)) + (let ((cs (or (and (memq 'utf-8-hfs (coding-system-list)) + (string-match "^Darwin" uname) + (cons 'utf-8-hfs 'utf-8-hfs)) + (and (memq 'utf-8 (coding-system-list)) (string-match "utf-?8" (tramp-get-remote-locale vec)) (cons 'utf-8 'utf-8)) (process-coding-system proc) @@ -4173,11 +4176,6 @@ process to set up. VEC specifies the connection." (goto-char (point-min)) (when (search-forward "\r" nil t) (setq cs-decode (coding-system-change-eol-conversion cs-decode 'dos))) - ;; Special setting for macOS. - (when (and (string-match "^Darwin" uname) - (memq 'utf-8-hfs (coding-system-list))) - (setq cs-decode 'utf-8-hfs - cs-encode 'utf-8-hfs)) (set-process-coding-system proc cs-decode cs-encode) (tramp-message vec 5 "Setting coding system to `%s' and `%s'" cs-decode cs-encode))) commit 7abd3f2dcf1d31e31f40ca817666e8f66a17284f Author: Juri Linkov Date: Mon Apr 23 01:10:49 2018 +0300 Improve Isearch error handling * lisp/isearch.el (isearch--momentary-message): Propertize message suffix with minibuffer-prompt face. (isearch--describe-regexp-mode): Do not omit description in case of error in default non-literal search. (isearch-message-prefix): Display “case-sensitive” in case of error. (isearch-message-suffix): Propertize message suffix with minibuffer-prompt face. (isearch-search-fun-default): Remove unused error handling. * lisp/vc/add-log.el (change-log-next-buffer): Better handle errors during wrapping. diff --git a/etc/NEWS b/etc/NEWS index ffe2f508a8..bde9b89c46 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -141,11 +141,6 @@ regular expression was previously invalid, but is now accepted: * Editing Changes in Emacs 27.1 -+++ -** New isearch bindings. -'C-M-w' in isearch changed from isearch-del-char to the new function -isearch-yank-symbol-or-char. isearch-del-char is now bound to 'C-M-d'. - --- ** New variable 'x-wait-for-event-timeout'. This controls how long Emacs will wait for updates to the graphical @@ -169,6 +164,10 @@ for abbrevs that have them. `text-property-search-backward' have been added. These provide an interface that's more like functions like @code{search-forward}. +--- +** More commands support noncontiguous rectangular regions, namely +‘upcase-dwim’, ‘downcase-dwim’, ‘replace-string’, ‘replace-regexp’. + * Changes in Specialized Modes and Packages in Emacs 27.1 @@ -292,6 +291,11 @@ can now be searched via 'C-s'. ** Search and Replace ++++ +*** New isearch bindings. +'C-M-w' in isearch changed from isearch-del-char to the new function +isearch-yank-symbol-or-char. isearch-del-char is now bound to 'C-M-d'. + +++ *** 'search-exit-option' provides new options 'move' and 'shift-move' to extend the search string by yanking text that ends at the new @@ -299,6 +303,10 @@ position after moving point in the current buffer. 'shift-move' extends the search string by motion commands while holding down the shift key. +--- +*** Isearch now remembers the regexp-based search mode for words/symbols +and case-sensitivity together with search strings in the search ring. + ** Edebug +++ diff --git a/lisp/info.el b/lisp/info.el index 0db84fb3da..bbce55f621 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -2017,7 +2017,7 @@ If DIRECTION is `backward', search in the reverse direction." Info-isearch-initial-node bound (and found (> found opoint-min) (< found opoint-max))) - (signal 'user-search-failed (list regexp "(end of node)"))) + (signal 'user-search-failed (list regexp "end of node"))) ;; If no subfiles, give error now. (unless (or found Info-current-subfile) diff --git a/lisp/isearch.el b/lisp/isearch.el index db196e00ef..5cbb4c941a 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1143,10 +1143,10 @@ REGEXP if non-nil says use the regexp search ring." (defun isearch-update-from-string-properties (string) "Update isearch properties from the isearch string" - (when (memq 'isearch-case-fold-search (text-properties-at 0 string)) + (when (plist-member (text-properties-at 0 string) 'isearch-case-fold-search) (setq isearch-case-fold-search (get-text-property 0 'isearch-case-fold-search string))) - (when (memq 'isearch-regexp-function (text-properties-at 0 string)) + (when (plist-member (text-properties-at 0 string) 'isearch-regexp-function) (setq isearch-regexp-function (get-text-property 0 'isearch-regexp-function string)))) @@ -1602,10 +1602,10 @@ Turning on character-folding turns off regexp mode.") (defun isearch--momentary-message (string) "Print STRING at the end of the isearch prompt for 1 second" (let ((message-log-max nil)) - (message "%s%s [%s]" + (message "%s%s%s" (isearch-message-prefix nil isearch-nonincremental) isearch-message - string)) + (propertize (format " [%s]" string) 'face 'minibuffer-prompt))) (sit-for 1)) (isearch-define-mode-toggle lax-whitespace " " nil @@ -2693,12 +2693,16 @@ the word mode." (cond ;; 1. Do not use a description on the default search mode, ;; but only if the default search mode is non-nil. - ((or (and search-default-mode - (equal search-default-mode regexp-function)) - ;; Special case where `search-default-mode' is t - ;; (defaults to regexp searches). - (and (eq search-default-mode t) - (eq search-default-mode isearch-regexp))) "") + ((and (or (and search-default-mode + (equal search-default-mode regexp-function)) + ;; Special case where `search-default-mode' is t + ;; (defaults to regexp searches). + (and (eq search-default-mode t) + (eq search-default-mode isearch-regexp))) + ;; Also do not omit description in case of error + ;; in default non-literal search. + (or isearch-success (not (or regexp-function isearch-regexp)))) + "") ;; 2. Use the `isearch-message-prefix' set for ;; `regexp-function' if available. (regexp-function @@ -2741,6 +2745,8 @@ the word mode." (< (point) isearch-opoint))) "over") (if isearch-wrapped "wrapped ") + (if (and (not isearch-success) (not isearch-case-fold-search)) + "case-sensitive ") (let ((prefix "")) (advice-function-mapc (lambda (_ props) @@ -2768,11 +2774,12 @@ the word mode." 'face 'minibuffer-prompt))) (defun isearch-message-suffix (&optional c-q-hack) - (concat (if c-q-hack "^Q" "") - (if isearch-error - (concat " [" isearch-error "]") - "") - (or isearch-message-suffix-add ""))) + (propertize (concat (if c-q-hack "^Q" "") + (if isearch-error + (concat " [" isearch-error "]") + "") + (or isearch-message-suffix-add "")) + 'face 'minibuffer-prompt)) ;; Searching @@ -2808,25 +2815,18 @@ Can be changed via `isearch-search-fun-function' for special needs." (isearch-regexp isearch-regexp-lax-whitespace) (t isearch-lax-whitespace)) search-whitespace-regexp))) - (condition-case er - (funcall - (if isearch-forward #'re-search-forward #'re-search-backward) - (cond (isearch-regexp-function - (let ((lax (and (not bound) (isearch--lax-regexp-function-p)))) - (when lax - (setq isearch-adjusted t)) - (if (functionp isearch-regexp-function) - (funcall isearch-regexp-function string lax) - (word-search-regexp string lax)))) - (isearch-regexp string) - (t (regexp-quote string))) - bound noerror count) - (search-failed - (signal (car er) - (let ((prefix (get isearch-regexp-function 'isearch-message-prefix))) - (if (and isearch-regexp-function (stringp prefix)) - (list (format "%s [using %ssearch]" string prefix)) - (cdr er))))))))) + (funcall + (if isearch-forward #'re-search-forward #'re-search-backward) + (cond (isearch-regexp-function + (let ((lax (and (not bound) (isearch--lax-regexp-function-p)))) + (when lax + (setq isearch-adjusted t)) + (if (functionp isearch-regexp-function) + (funcall isearch-regexp-function string lax) + (word-search-regexp string lax)))) + (isearch-regexp string) + (t (regexp-quote string))) + bound noerror count)))) (defun isearch-search-string (string bound noerror) "Search for the first occurrence of STRING or its translation. diff --git a/lisp/replace.el b/lisp/replace.el index d5d34f652a..3503b656d9 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -314,7 +314,7 @@ the original string if not." (query-replace-read-to from prompt regexp-flag)))) (list from to (or (and current-prefix-arg (not (eq current-prefix-arg '-))) - (and (memq 'isearch-regexp-function (text-properties-at 0 from)) + (and (plist-member (text-properties-at 0 from) 'isearch-regexp-function) (get-text-property 0 'isearch-regexp-function from))) (and current-prefix-arg (eq current-prefix-arg '-))))) diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el index 41a9991699..4c64ae1f60 100644 --- a/lisp/vc/add-log.el +++ b/lisp/vc/add-log.el @@ -1099,9 +1099,17 @@ file were isearch was started." ;; If there are no files that match the default pattern ChangeLog.[0-9], ;; return the current buffer to force isearch wrapping to its beginning. ;; If file is nil, multi-isearch-search-fun will signal "end of multi". - (if (and file (file-exists-p file)) - (find-file-noselect file) - (current-buffer)))) + (cond + ;; Wrapping doesn't catch errors from the nil arg of file-exists-p, + ;; so handle it explicitly. + ((and wrap (null file)) + (current-buffer)) + ;; When there is no next file, file-exists-p raises the error to be + ;; catched by the search function that displays the error message. + ((file-exists-p file) + (find-file-noselect file)) + (t + (current-buffer))))) (defun change-log-fill-forward-paragraph (n) "Cut paragraphs so filling preserves open parentheses at beginning of lines." commit b26872a3b13f69f7f67a4964722d2ef155964c45 Author: Lars Ingebrigtsen Date: Sun Apr 22 20:34:40 2018 +0200 (text-property-search-forward): Copy edits in doc string * lisp/emacs-lisp/text-property-search.el (text-property-search-forward): Copy edits in doc string. diff --git a/lisp/emacs-lisp/text-property-search.el b/lisp/emacs-lisp/text-property-search.el index 7d05953752..b464402458 100644 --- a/lisp/emacs-lisp/text-property-search.el +++ b/lisp/emacs-lisp/text-property-search.el @@ -49,10 +49,10 @@ If `not-immediate', if the match is under point, it will not be returned, but instead the next instance is returned, if any. The return value (if a match is made) is a `prop-match' -structure. The accessor avaliable are -`prop-match-beginning'/`prop-match-end' (which is the region in -the buffer that's matching), and `prop-match-value', which is the -value of PROPERTY at the start of the region." +structure. The accessors available are +`prop-match-beginning'/`prop-match-end' (the region in the buffer +that's matching), and `prop-match-value' (the value of PROPERTY +at the start of the region)." (interactive (list (let ((string (completing-read "Search for property: " obarray))) commit 415e8593edfa582edd9d2c03748e9ae9cec5022c Author: Eli Zaretskii Date: Sun Apr 22 20:39:46 2018 +0300 Minor improvements of next-error docs * lisp/simple.el (next-error-find-buffer-function) (previous-error, next-error-select-buffer): Doc fixes. * doc/emacs/maintaining.texi (Change Log Commands): * doc/emacs/building.texi (Compilation Mode): Index the new commands and variables. Improve wording. (Bug#20493) diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 1e2dac9534..496c4275bc 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -190,6 +190,9 @@ compilation buffer produce automatic source display. @item g Re-run the last command whose output is shown in the @file{*compilation*} buffer. +@item M-x next-error-select-buffer +Select a buffer to be used by next invocation of @code{next-error} and +@code{previous-error}. @end table @kindex M-g M-n @@ -212,6 +215,8 @@ the beginning of the compilation buffer, and visits the first locus. @kbd{M-g M-p} or @kbd{M-g p} (@code{previous-error}) iterates through errors in the opposite direction. +@vindex next-error-find-buffer-function +@findex next-error-select-buffer The @code{next-error} and @code{previous-error} commands don't just act on the errors or matches listed in @file{*compilation*} and @file{*grep*} buffers; they also know how to iterate through error or diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 649ca1ec51..df8c447900 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1640,14 +1640,15 @@ entry is considered a page. This facilitates editing the entries. @kbd{C-j} and auto-fill indent each new line like the previous line; this is convenient for entering the contents of an entry. -You can use the @code{change-log-goto-source} command (by default +@findex change-log-goto-source + You can use the command @code{change-log-goto-source} (by default bound to @kbd{C-c C-c}) to go to the source location of the change log entry near point, when Change Log mode is on. Then subsequent invocations of the @code{next-error} command (by default bound to -@kbd{M-g M-n}) will move between entries in the change log. You will -jump to the actual site in the file that was changed, not just to the -next change log entry. You can also use @code{previous-error} to move -back in the same list. +@kbd{M-g M-n} and @kbd{C-x `}) will move between entries in the change +log. You will jump to the actual site in the file that was changed, +not just to the next change log entry. You can also use +@code{previous-error} to move back through the change log entries. @findex change-log-merge You can use the command @kbd{M-x change-log-merge} to merge other diff --git a/lisp/simple.el b/lisp/simple.el index 56b89b36fd..839a4dd2c6 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -180,8 +180,12 @@ rejected, and the function returns nil." (defcustom next-error-find-buffer-function #'ignore "Function called to find a `next-error' capable buffer. This functions takes the same three arguments as the function -`next-error-find-buffer', and returns the buffer to be used -by the subsequent invocation of the command `next-error'." +`next-error-find-buffer', and should return the buffer to be +used by the subsequent invocation of the command `next-error' +and `previous-error'. +If the function returns nil, `next-error-find-buffer' will +try to use the buffer it used previously, and failing that +all other buffers." :type '(choice (const :tag "No default" ignore) (const :tag "Single next-error capable buffer on selected frame" next-error-buffer-on-selected-frame) @@ -340,9 +344,9 @@ and TO-BUFFER is a target buffer." (defun next-error-select-buffer (buffer) "Select a `next-error' capable BUFFER and set it as the last used. This means that the selected buffer becomes the source of locations -for the subsequent invocation of `next-error'. Interactively, this command -allows selection only among buffers where `next-error-function' is bound to -an appropriate function." +for the subsequent invocation of `next-error' or `previous-error'. +Interactively, this command allows selection only among buffers +where `next-error-function' is bound to an appropriate function." (interactive (list (get-buffer (read-buffer "Select next-error buffer: " nil nil @@ -358,7 +362,9 @@ an appropriate function." Prefix arg N says how many error messages to move backwards (or forwards, if negative). -This operates on the output from the \\[compile] and \\[grep] commands." +This operates on the output from the \\[compile] and \\[grep] commands. + +See `next-error' for the details." (interactive "p") (next-error (- (or n 1)))) commit d7faaef501eefb7c8a62af086b3cca7e86b635e7 Author: Lars Ingebrigtsen Date: Sun Apr 22 17:05:04 2018 +0200 (text-property-search-forward): Doc string tweak * lisp/emacs-lisp/text-property-search.el (text-property-search-forward): Doc string tweak. diff --git a/lisp/emacs-lisp/text-property-search.el b/lisp/emacs-lisp/text-property-search.el index ce7733acb2..7d05953752 100644 --- a/lisp/emacs-lisp/text-property-search.el +++ b/lisp/emacs-lisp/text-property-search.el @@ -50,8 +50,8 @@ returned, but instead the next instance is returned, if any. The return value (if a match is made) is a `prop-match' structure. The accessor avaliable are -`prop-match-beginning'/`prop-match-end' (which are the region in -the buffer that's matching, and `prop-match-value', which is the +`prop-match-beginning'/`prop-match-end' (which is the region in +the buffer that's matching), and `prop-match-value', which is the value of PROPERTY at the start of the region." (interactive (list commit e6edd177a93b36e969d72008b426deac51c86d9a Author: Lars Ingebrigtsen Date: Sun Apr 22 16:58:10 2018 +0200 (text-property-search-forward): Fix search at the end * lisp/emacs-lisp/text-property-search.el (text-property-search-forward): Fix search at the end of the buffer with no text properties. diff --git a/lisp/emacs-lisp/text-property-search.el b/lisp/emacs-lisp/text-property-search.el index cd4471a045..ce7733acb2 100644 --- a/lisp/emacs-lisp/text-property-search.el +++ b/lisp/emacs-lisp/text-property-search.el @@ -58,12 +58,17 @@ value of PROPERTY at the start of the region." (let ((string (completing-read "Search for property: " obarray))) (when (> (length string) 0) (intern string obarray))))) - ;; We're standing in the property we're looking for, so find the - ;; end. - (if (and (text-property--match-p value (get-text-property (point) property) - predicate) - (not not-immediate)) - (text-property--find-end-forward (point) property value predicate) + (cond + ;; No matches at the end of the buffer. + ((eobp) + nil) + ;; We're standing in the property we're looking for, so find the + ;; end. + ((and (text-property--match-p value (get-text-property (point) property) + predicate) + (not not-immediate)) + (text-property--find-end-forward (point) property value predicate)) + (t (let ((origin (point)) (ended nil) pos) @@ -86,7 +91,7 @@ value of PROPERTY at the start of the region." (goto-char origin) (setq ended t))))) (and (not (eq ended t)) - ended)))) + ended))))) (defun text-property--find-end-forward (start property value predicate) (let (end) commit 214ca3b5857c3fc9f425bb1949cfc26f8c53da56 Author: Lars Ingebrigtsen Date: Sun Apr 22 16:57:16 2018 +0200 Add a test suite for text-property-search diff --git a/test/lisp/emacs-lisp/text-property-search-tests.el b/test/lisp/emacs-lisp/text-property-search-tests.el new file mode 100644 index 0000000000..5ea6b5372e --- /dev/null +++ b/test/lisp/emacs-lisp/text-property-search-tests.el @@ -0,0 +1,113 @@ +;;; text-property-search-tests.el --- Testing text-property-search + +;; Copyright (C) 2018 Free Software Foundation, Inc. + +;; Author: Lars Ingebrigtsen +;; Keywords: + +;; This program 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. + +;; This program 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 this program. If not, see . + +;;; Commentary: + +;; + +;;; Code: + +(require 'ert) +(require 'text-property-search) +(require 'cl-lib) + +(defun text-property-setup () + (insert "This is " + (propertize "bold1" 'face 'bold) + " and this is " + (propertize "italic1" 'face 'italic) + (propertize "bold2" 'face 'bold) + (propertize "italic2" 'face 'italic) + " at the end") + (goto-char (point-min))) + +(defmacro with-test (form result &optional point) + `(with-temp-buffer + (text-property-setup) + (when ,point + (goto-char ,point)) + (should + (equal + (cl-loop for match = ,form + while match + collect (buffer-substring (prop-match-beginning match) + (prop-match-end match))) + ,result)))) + +(ert-deftest text-property-search-forward-bold-t () + (with-test (text-property-search-forward 'face 'bold t) + '("bold1" "bold2"))) + +(ert-deftest text-property-search-forward-bold-nil () + (with-test (text-property-search-forward 'face 'bold nil) + '("This is " " and this is italic1" "italic2 at the end"))) + +(ert-deftest text-property-search-forward-nil-t () + (with-test (text-property-search-forward 'face nil t) + '("This is " " and this is " " at the end"))) + +(ert-deftest text-property-search-forward-nil-nil () + (with-test (text-property-search-forward 'face nil nil) + '("bold1" "italic1" "bold2" "italic2"))) + +(ert-deftest text-property-search-forward-partial-bold-t () + (with-test (text-property-search-forward 'face 'bold t) + '("old1" "bold2") + 10)) + +(ert-deftest text-property-search-forward-partial-non-current-bold-t () + (with-test (text-property-search-forward 'face 'bold t t) + '("bold2") + 10)) + + +(ert-deftest text-property-search-backward-bold-t () + (with-test (text-property-search-backward 'face 'bold t) + '("bold2" "bold1") + (point-max))) + +(ert-deftest text-property-search-backward-bold-nil () + (with-test (text-property-search-backward 'face 'bold nil) + '( "italic2 at the end" " and this is italic1" "This is ") + (point-max))) + +(ert-deftest text-property-search-backward-nil-t () + (with-test (text-property-search-backward 'face nil t) + '(" at the end" " and this is " "This is ") + (point-max))) + +(ert-deftest text-property-search-backward-nil-nil () + (with-test (text-property-search-backward 'face nil nil) + '("italic2" "bold2" "italic1" "bold1") + (point-max))) + +(ert-deftest text-property-search-backward-partial-bold-t () + (with-test (text-property-search-backward 'face 'bold t) + '("b" "bold1") + 35)) + +(ert-deftest text-property-search-backward-partial-non-current-bold-t () + (with-test (text-property-search-backward 'face 'bold t t) + '("bold1") + 35)) + +(provide 'text-property-search-tests) + +;;; text-property-search-tests.el ends here commit 47d8e79960fe3ba98e360b201a6893812212880d Author: Juri Linkov Date: Sat Apr 21 22:52:47 2018 +0300 Update documentation for more next-error features * doc/emacs/maintaining.texi (Change Log Commands): Mention change-log-goto-source. * doc/emacs/building.texi (Compilation Mode): Document next-error-find-buffer-function and next-error-select-buffer. * doc/emacs/building.texi (Grep Searching): * doc/emacs/files.texi (Diff Mode): * doc/emacs/search.texi (Other Repeating Search): * doc/emacs/windows.texi (Displaying Buffers): Prefer ‘M-g M-n’ over ‘C-x `’. * lisp/simple.el (next-error-find-buffer-function, next-error) (next-error-select-buffer): Elaborate docstrings. (Bug#20493) diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index a4ff69d21b..1e2dac9534 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -202,11 +202,11 @@ Re-run the last command whose output is shown in the This command can be invoked from any buffer, not just a Compilation mode buffer. The first time you invoke it after a compilation, it visits the locus of the first error message. Each subsequent -@w{@kbd{C-x `}} visits the next error, in a similar fashion. If you +@w{@kbd{M-g M-n}} visits the next error, in a similar fashion. If you visit a specific error with @key{RET} or a mouse click in the -@file{*compilation*} buffer, subsequent @w{@kbd{C-x `}} commands -advance from there. When @w{@kbd{C-x `}} finds no more error messages -to visit, it signals an error. @w{@kbd{C-u C-x `}} starts again from +@file{*compilation*} buffer, subsequent @w{@kbd{M-g M-n}} commands +advance from there. When @w{@kbd{M-g M-n}} finds no more error messages +to visit, it signals an error. @w{@kbd{C-u M-g M-n}} starts again from the beginning of the compilation buffer, and visits the first locus. @kbd{M-g M-p} or @kbd{M-g p} (@code{previous-error}) iterates @@ -219,10 +219,15 @@ match lists produced by other commands, such as @kbd{M-x occur} (@pxref{Other Repeating Search}). If the current buffer contains error messages or matches, these commands will iterate through them; otherwise, Emacs looks for a buffer containing error messages or -matches amongst the windows of the selected frame, then for any buffer -that @code{next-error} or @code{previous-error} previously visited, -and finally all other buffers. Any buffer these commands iterate -through that is not currently displayed in a window will be displayed. +matches amongst the windows of the selected frame (if the variable +@code{next-error-find-buffer-function} is customized to the value +@code{next-error-buffer-on-selected-frame}), then for a buffer used +previously by @code{next-error} or @code{previous-error}, and finally +all other buffers. Any buffer these commands iterate through that is +not currently displayed in a window will be displayed. You can use +the @command{next-error-select-buffer} command to switch to +a different buffer to be used by the subsequent invocation of +@code{next-error}. @vindex compilation-skip-threshold By default, the @code{next-error} and @code{previous-error} commands @@ -394,8 +399,8 @@ grep -nH -e foo *.el | grep bar | grep toto @end example The output from @command{grep} goes in the @file{*grep*} buffer. You -can find the corresponding lines in the original files using @w{@kbd{C-x -`}}, @key{RET}, and so forth, just like compilation errors. +can find the corresponding lines in the original files using @w{@kbd{M-g +M-n}}, @key{RET}, and so forth, just like compilation errors. @xref{Compilation Mode}, for detailed description of commands and key bindings available in the @file{*grep*} buffer. diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 4e9e7ac3f0..79420878e8 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -1430,7 +1430,7 @@ remains correct. To disable automatic line number correction, change the variable @code{diff-update-on-the-fly} to @code{nil}. Diff mode treats each hunk as an error message, similar to -Compilation mode. Thus, you can use commands such as @kbd{C-x `} to +Compilation mode. Thus, you can use commands such as @kbd{M-g M-n} to visit the corresponding source locations. @xref{Compilation Mode}. In addition, Diff mode provides the following commands to navigate, diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 9421691ba7..649ca1ec51 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1640,11 +1640,14 @@ entry is considered a page. This facilitates editing the entries. @kbd{C-j} and auto-fill indent each new line like the previous line; this is convenient for entering the contents of an entry. -You can use the @code{next-error} command (by default bound to -@kbd{C-x `}) to move between entries in the Change Log, when Change -Log mode is on. You will jump to the actual site in the file that was -changed, not just to the next Change Log entry. You can also use -@code{previous-error} to move back in the same list. +You can use the @code{change-log-goto-source} command (by default +bound to @kbd{C-c C-c}) to go to the source location of the change log +entry near point, when Change Log mode is on. Then subsequent +invocations of the @code{next-error} command (by default bound to +@kbd{M-g M-n}) will move between entries in the change log. You will +jump to the actual site in the file that was changed, not just to the +next change log entry. You can also use @code{previous-error} to move +back in the same list. @findex change-log-merge You can use the command @kbd{M-x change-log-merge} to merge other @@ -1654,7 +1657,7 @@ ordering of entries. Version control systems are another way to keep track of changes in your program and keep a change log. In the VC log buffer, typing @kbd{C-c C-a} (@code{log-edit-insert-changelog}) inserts the relevant -Change Log entry, if one exists. @xref{Log Buffer}. +change log entry, if one exists. @xref{Log Buffer}. @node Format of ChangeLog @subsection Format of ChangeLog diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index b93010eab4..263c4c5dcc 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -1796,7 +1796,7 @@ In the @file{*Occur*} buffer, you can click on each entry, or move point there and type @key{RET}, to visit the corresponding position in the buffer that was searched. @kbd{o} and @kbd{C-o} display the match in another window; @kbd{C-o} does not select it. Alternatively, you -can use the @kbd{C-x `} (@code{next-error}) command to visit the +can use the @kbd{M-g M-n} (@code{next-error}) command to visit the occurrences one by one (@pxref{Compilation Mode}). @cindex Occur Edit mode diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index 7dbd680b9b..809363305f 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi @@ -354,7 +354,7 @@ various help commands (@pxref{Help}), work by calling Other commands do the same as @code{display-buffer}, and additionally select the displaying window so that you can begin -editing its buffer. The command @kbd{C-x `} (@code{next-error}) is +editing its buffer. The command @kbd{M-g M-n} (@code{next-error}) is one example (@pxref{Compilation Mode}). Such commands work by calling the function @code{pop-to-buffer} internally. @xref{Switching Buffers,,Switching to a Buffer in a Window, elisp, The Emacs Lisp diff --git a/etc/NEWS b/etc/NEWS index 366eccae80..ffe2f508a8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -292,6 +292,7 @@ can now be searched via 'C-s'. ** Search and Replace ++++ *** 'search-exit-option' provides new options 'move' and 'shift-move' to extend the search string by yanking text that ends at the new position after moving point in the current buffer. 'shift-move' @@ -317,6 +318,7 @@ by default. ** grep ++++ *** rgrep, lgrep and zrgrep now hide part of the command line that contains a list of ignored directories and files. Clicking on the button with ellipsis unhides it. @@ -347,6 +349,7 @@ are evaluated lazily. ** next-error ++++ *** New customizable variable 'next-error-find-buffer-function'. This variable defines the logic of finding a next-error capable buffer. It has an option to use a single such buffer on selected diff --git a/lisp/simple.el b/lisp/simple.el index b51be3a8f8..56b89b36fd 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -178,7 +178,10 @@ rejected, and the function returns nil." (funcall extra-test-inclusive)))))) (defcustom next-error-find-buffer-function #'ignore - "Function called to find a `next-error' capable buffer." + "Function called to find a `next-error' capable buffer. +This functions takes the same three arguments as the function +`next-error-find-buffer', and returns the buffer to be used +by the subsequent invocation of the command `next-error'." :type '(choice (const :tag "No default" ignore) (const :tag "Single next-error capable buffer on selected frame" next-error-buffer-on-selected-frame) @@ -287,8 +290,9 @@ more generally, on any buffer in Compilation mode or with Compilation Minor mode enabled, or any buffer in which `next-error-function' is bound to an appropriate function. To specify use of a particular buffer for error messages, type -\\[next-error] in that buffer when it is the only one displayed -in the current frame. +\\[next-error] in that buffer. You can also use the command +`next-error-select-buffer' to select the buffer to use for the subsequent +invocation of `next-error'. Once \\[next-error] has chosen the buffer for error messages, it runs `next-error-hook' with `run-hooks', and stays with that buffer @@ -334,7 +338,11 @@ and TO-BUFFER is a target buffer." (run-hooks 'next-error-hook)) (defun next-error-select-buffer (buffer) - "Select a `next-error' capable buffer and set it as the last used." + "Select a `next-error' capable BUFFER and set it as the last used. +This means that the selected buffer becomes the source of locations +for the subsequent invocation of `next-error'. Interactively, this command +allows selection only among buffers where `next-error-function' is bound to +an appropriate function." (interactive (list (get-buffer (read-buffer "Select next-error buffer: " nil nil commit 94e794c8d8b93a1d6813742da12135f2746ef80b Author: Glenn Morris Date: Fri Apr 20 19:02:16 2018 -0400 Tweak recent bytecomp defvaralias change * lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defvar-function): Respect with-no-warnings. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 50e67046e8..ad6b5b7ce2 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2433,8 +2433,9 @@ list that represents a doc string reference. (pcase form (`(defvaralias ,_ ',newname . ,_) (when (memq newname byte-compile-bound-variables) - (byte-compile-warn - "Alias for `%S' should be declared before its referent" newname)))) + (if (byte-compile-warning-enabled-p 'suspicious) + (byte-compile-warn + "Alias for `%S' should be declared before its referent" newname))))) (byte-compile-keep-pending form)) (put 'custom-declare-variable 'byte-hunk-handler commit 18de2ada243653ece98b18044233e5d29eee5903 Author: Glenn Morris Date: Fri Apr 20 18:55:04 2018 -0400 More alias-related tedium * lisp/comint.el (comint-scroll-to-bottom-on-output): * lisp/completion.el (cmpl-syntax-table): * lisp/erc/erc-button.el (erc-button-google-url): * lisp/font-lock.el (font-lock-reference-face): * lisp/hfy-cmap.el (hfy-fallback-colour-map, hfy-rgb-txt-colour-map): * lisp/isearch.el (isearch-regexp-function, isearch-new-word): * lisp/startup.el (argv): * lisp/version.el (emacs-bzr-version): * lisp/org/org.el (org-CUA-compatible) (org-popup-calendar-for-date-prompt): Move aliases before targets, to silence new compiler warning. diff --git a/lisp/comint.el b/lisp/comint.el index 3182cba866..0a33e74944 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -263,6 +263,8 @@ See `comint-preinput-scroll-to-bottom'. This variable is buffer-local." (const this)) :group 'comint) +(defvaralias 'comint-scroll-to-bottom-on-output 'comint-move-point-for-output) + (defcustom comint-move-point-for-output nil "Controls whether interpreter output moves point to the end of the output. If nil, then output never moves point to the output. @@ -295,8 +297,6 @@ end of the current logical (not visual) line after insertion." (const :tag "Move to end of line" end-of-line)) :group 'comint) -(defvaralias 'comint-scroll-to-bottom-on-output 'comint-move-point-for-output) - (defcustom comint-scroll-show-maximum-output t "Controls how to scroll due to interpreter output. This variable applies when point is at the end of the buffer diff --git a/lisp/completion.el b/lisp/completion.el index ff94294086..2ddf0999e4 100644 --- a/lisp/completion.el +++ b/lisp/completion.el @@ -518,6 +518,9 @@ Used to decide whether to save completions.") (modify-syntax-entry char "w" table))) table)) +;; Old name, non-namespace-clean. +(defvaralias 'cmpl-syntax-table 'completion-syntax-table) + (defvar completion-syntax-table completion-standard-syntax-table "This variable holds the current completion syntax table.") (make-variable-buffer-local 'completion-syntax-table) @@ -2360,8 +2363,7 @@ if ARG is omitted or nil." (completion-def-wrapper 'delete-backward-char :backward) (completion-def-wrapper 'delete-backward-char-untabify :backward) -;; Old names, non-namespace-clean. -(defvaralias 'cmpl-syntax-table 'completion-syntax-table) +;; Old name, non-namespace-clean. (defalias 'initialize-completions 'completion-initialize) (provide 'completion) diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index 749ae5db5a..7599053e9d 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -121,6 +121,9 @@ longer than `erc-fill-column'." :group 'erc-button :type 'string) +(define-obsolete-variable-alias 'erc-button-google-url + 'erc-button-search-url "27.1") + (defcustom erc-button-search-url "http://duckduckgo.com/?q=%s" "URL used to search for a term. %s is replaced by the search string." @@ -128,9 +131,6 @@ longer than `erc-fill-column'." :group 'erc-button :type 'string) -(define-obsolete-variable-alias 'erc-button-google-url - 'erc-button-search-url "27.1") - (defcustom erc-button-alist ;; Since the callback is only executed when the user is clicking on ;; a button, it makes no sense to optimize performance by diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 0ed94bd0e8..be9fb4dc93 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -327,6 +327,9 @@ If a number, only buffers greater than this size have fontification messages." (defvar font-lock-type-face 'font-lock-type-face "Face name to use for type and class names.") +(define-obsolete-variable-alias + 'font-lock-reference-face 'font-lock-constant-face "20.3") + (defvar font-lock-constant-face 'font-lock-constant-face "Face name to use for constant and label names.") @@ -340,9 +343,6 @@ This can be an \"!\" or the \"n\" in \"ifndef\".") (defvar font-lock-preprocessor-face 'font-lock-preprocessor-face "Face name to use for preprocessor directives.") -(define-obsolete-variable-alias - 'font-lock-reference-face 'font-lock-constant-face "20.3") - ;; Fontification variables: (defvar font-lock-keywords nil diff --git a/lisp/hfy-cmap.el b/lisp/hfy-cmap.el index 4ec24cea70..ee6e18edb0 100644 --- a/lisp/hfy-cmap.el +++ b/lisp/hfy-cmap.el @@ -32,6 +32,10 @@ ;;; Code: +(define-obsolete-variable-alias + 'hfy-fallback-colour-map + 'hfy-fallback-color-map "27.1") + (defconst hfy-fallback-color-map '(("snow" 65535 64250 64250) ("ghost white" 63736 63736 65535) @@ -785,15 +789,13 @@ ("DarkRed" 35723 0 0) ("light green" 37008 61166 37008) ("LightGreen" 37008 61166 37008)) ) -(define-obsolete-variable-alias - 'hfy-fallback-colour-map - 'hfy-fallback-color-map "27.1") -(defvar hfy-rgb-txt-color-map nil) (define-obsolete-variable-alias 'hfy-rgb-txt-colour-map 'hfy-rgb-txt-color-map "27.1") +(defvar hfy-rgb-txt-color-map nil) + (defvar hfy-rgb-load-path (list "/etc/X11" (format "/usr/share/emacs/%d.%d/etc" diff --git a/lisp/isearch.el b/lisp/isearch.el index 0874ebb54e..db196e00ef 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -562,6 +562,9 @@ This is like `describe-bindings', but displays only Isearch keys." (defvar isearch-forward nil) ; Searching in the forward direction. (defvar isearch-regexp nil) ; Searching for a regexp. +;; We still support setting this to t for backwards compatibility. +(define-obsolete-variable-alias 'isearch-word + 'isearch-regexp-function "25.1") (defvar isearch-regexp-function nil "Regexp-based search mode for words/symbols. If the value is a function (e.g. `isearch-symbol-regexp'), it is @@ -573,9 +576,6 @@ specifies the prefix string displayed in the search message. This variable is set and changed during isearch. To change the default behavior used for searches, see `search-default-mode' instead.") -;; We still support setting this to t for backwards compatibility. -(define-obsolete-variable-alias 'isearch-word - 'isearch-regexp-function "25.1") (defvar isearch-lax-whitespace t "If non-nil, a space will match a sequence of whitespace chars. @@ -1242,13 +1242,14 @@ If MSG is non-nil, use variable `isearch-message', otherwise `isearch-string'." (length succ-msg) 0)))) +(define-obsolete-variable-alias 'isearch-new-word + 'isearch-new-regexp-function "25.1") + (defvar isearch-new-regexp-function nil "Holds the next `isearch-regexp-function' inside `with-isearch-suspended'. If this is set inside code wrapped by the macro `with-isearch-suspended', then the value set will be used as the `isearch-regexp-function' once isearch resumes.") -(define-obsolete-variable-alias 'isearch-new-word - 'isearch-new-regexp-function "25.1") (defvar isearch-suspended nil) diff --git a/lisp/org/org.el b/lisp/org/org.el index 7f4c6d5936..e45bc55b24 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -1071,6 +1071,8 @@ has been set." :group 'org-startup :type 'boolean) +(defvaralias 'org-CUA-compatible 'org-replace-disputed-keys) + (defcustom org-replace-disputed-keys nil "Non-nil means use alternative key bindings for some keys. Org mode uses S- keys for changing timestamps and priorities. @@ -1095,8 +1097,6 @@ loading Org." :group 'org-startup :type 'boolean) -(defvaralias 'org-CUA-compatible 'org-replace-disputed-keys) - (defcustom org-disputed-keys '(([(shift up)] . [(meta p)]) ([(shift down)] . [(meta n)]) @@ -3343,6 +3343,9 @@ This display will be in an overlay, in the minibuffer." :group 'org-time :type 'boolean) +(defvaralias 'org-popup-calendar-for-date-prompt + 'org-read-date-popup-calendar) + (defcustom org-read-date-popup-calendar t "Non-nil means pop up a calendar when prompting for a date. In the calendar, the date can be selected with mouse-1. However, the @@ -3350,8 +3353,6 @@ minibuffer will also be active, and you can simply enter the date as well. When nil, only the minibuffer will be available." :group 'org-time :type 'boolean) -(defvaralias 'org-popup-calendar-for-date-prompt - 'org-read-date-popup-calendar) (defcustom org-extend-today-until 0 "The hour when your day really ends. Must be an integer. diff --git a/lisp/startup.el b/lisp/startup.el index bb3e70493c..5b2d3e58cb 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -120,9 +120,6 @@ Elements look like (SWITCH-STRING . HANDLER-FUNCTION). HANDLER-FUNCTION receives the switch string as its sole argument; the remaining command-line args are in the variable `command-line-args-left'.") -(defvar command-line-args-left nil - "List of command-line args not yet processed.") - (with-no-warnings (defvaralias 'argv 'command-line-args-left "List of command-line args not yet processed. @@ -131,6 +128,9 @@ inside of --eval command line arguments in order to access following arguments.")) (internal-make-var-non-special 'argv) +(defvar command-line-args-left nil + "List of command-line args not yet processed.") + (with-no-warnings (defvar argi nil "Current command-line argument.")) diff --git a/lisp/version.el b/lisp/version.el index 3a38b1d83c..8491930819 100644 --- a/lisp/version.el +++ b/lisp/version.el @@ -99,15 +99,15 @@ to the system configuration; look at `system-configuration' instead." ;; We hope that this alias is easier for people to find. (defalias 'version 'emacs-version) +(define-obsolete-variable-alias 'emacs-bzr-version + 'emacs-repository-version "24.4") + ;; Set during dumping, this is a defvar so that it can be setq'd. (defvar emacs-repository-version nil "String giving the repository revision from which this Emacs was built. Value is nil if Emacs was not built from a repository checkout, or if we could not determine the revision.") -(define-obsolete-variable-alias 'emacs-bzr-version - 'emacs-repository-version "24.4") - (define-obsolete-function-alias 'emacs-bzr-get-version 'emacs-repository-get-version "24.4") commit 9c3eeba4db26ddaeead100beea7a96f9fa640918 Author: Glenn Morris Date: Fri Apr 20 18:34:39 2018 -0400 The tedious game of whack-a-mole with compiler warnings continues * lisp/abbrev.el (edit-abbrevs-map): * lisp/emacs-lock.el (emacs-lock-from-exiting): * lisp/htmlfontify.el (hfy-optimisations): * lisp/ielm.el (inferior-emacs-lisp-mode-hook) (inferior-emacs-lisp-mode-map): * lisp/isearch.el (isearch-lazy-highlight-word): * lisp/select.el (x-select-enable-clipboard, x-select-enable-primary): * lisp/shell.el (shell-dirtrack-mode): * lisp/skeleton.el (skeleton-transformation, skeleton-filter): * lisp/startup.el (inhibit-splash-screen, inhibit-startup-message): * lisp/window.el (even-window-heights): * lisp/calendar/timeclock.el (timeclock-modeline-display): * lisp/cedet/semantic/db-mode.el (semanticdb-mode-hook) (semanticdb-global-mode): * lisp/emacs-lisp/edebug.el (gud-inhibit-global-bindings): * lisp/emacs-lisp/warnings.el (display-warning-minimum-level) (log-warning-minimum-level): * lisp/erc/erc-dcc.el (erc-dcc-chat-filter-hook): * lisp/gnus/nnspool.el (news-path): * lisp/org/org-agenda.el (org-agenda-search-view-search-words-only) (org-agenda-remove-tags-when-in-prefix) (org-agenda-align-tags-to-column, org-agenda-keymap): * lisp/org/org.el (org-special-ctrl-a) (org-log-state-notes-into-drawer) (org-agenda-multi-occur-extra-files): * lisp/progmodes/flymake-proc.el (flymake-err-line-patterns) (flymake-check-file-limit): * lisp/progmodes/make-mode.el (makefile-query-one-target-method): * lisp/progmodes/octave.el (inferior-octave-startup-hook): * lisp/progmodes/python.el (python-buffer) (python-preoutput-result): * lisp/progmodes/sql.el (sql-dialect): * lisp/textmodes/artist.el (artist-text-renderer): * lisp/textmodes/bibtex.el (bibtex-autokey-name-case-convert) (bibtex-autokey-titleword-case-convert): * lisp/textmodes/flyspell.el (flyspell-generic-check-word-p): * lisp/textmodes/ispell.el (ispell-format-word): * lisp/textmodes/rst.el (rst-preferred-decorations): * lisp/textmodes/sgml-mode.el (sgml-transformation): Move aliases before targets, to silence new compiler warning. * lisp/term/ns-win.el (ns-option-modifier, ns-right-option-modifier): Silence warning. diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 197276cc9c..fd2f36e198 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -68,6 +68,8 @@ be replaced by its expansion." (put 'abbrev-mode 'safe-local-variable 'booleanp) +(define-obsolete-variable-alias 'edit-abbrevs-map + 'edit-abbrevs-mode-map "24.4") (defvar edit-abbrevs-mode-map (let ((map (make-sparse-keymap))) (define-key map "\C-x\C-s" 'abbrev-edit-save-buffer) @@ -75,8 +77,6 @@ be replaced by its expansion." (define-key map "\C-c\C-c" 'edit-abbrevs-redefine) map) "Keymap used in `edit-abbrevs'.") -(define-obsolete-variable-alias 'edit-abbrevs-map - 'edit-abbrevs-mode-map "24.4") (defun kill-all-abbrevs () "Undefine all defined abbrevs." diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index 3b96d42702..b46e7732fd 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -144,6 +144,9 @@ This variable only has effect if set with \\[customize]." (defvar timeclock-update-timer nil "The timer used to update `timeclock-mode-string'.") +(define-obsolete-variable-alias 'timeclock-modeline-display + 'timeclock-mode-line-display "24.3") + ;; For byte-compiler. (defvar display-time-hook) (defvar timeclock-mode-line-display) @@ -271,8 +274,6 @@ The time is bracketed by <> if you are clocked in, otherwise by [].") (define-obsolete-function-alias 'timeclock-modeline-display 'timeclock-mode-line-display "24.3") -(define-obsolete-variable-alias 'timeclock-modeline-display - 'timeclock-mode-line-display "24.3") ;;;###autoload (define-minor-mode timeclock-mode-line-display diff --git a/lisp/cedet/semantic/db-mode.el b/lisp/cedet/semantic/db-mode.el index 8a136132b7..e6a2340b8c 100644 --- a/lisp/cedet/semantic/db-mode.el +++ b/lisp/cedet/semantic/db-mode.el @@ -50,6 +50,9 @@ (member (car (car semanticdb-hooks)) (symbol-value (car (cdr (car semanticdb-hooks)))))) +(defvaralias 'semanticdb-mode-hook 'global-semanticdb-minor-mode-hook) +(defvaralias 'semanticdb-global-mode 'global-semanticdb-minor-mode) + ;;;###autoload (define-minor-mode global-semanticdb-minor-mode "Toggle Semantic DB mode. @@ -67,8 +70,6 @@ database, which can be saved for future Emacs sessions." (dolist (elt semanticdb-hooks) (remove-hook (cadr elt) (car elt))))) -(defvaralias 'semanticdb-mode-hook 'global-semanticdb-minor-mode-hook) -(defvaralias 'semanticdb-global-mode 'global-semanticdb-minor-mode) (semantic-varalias-obsolete 'semanticdb-mode-hooks 'global-semanticdb-minor-mode-hook "23.2") diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 4f97712b98..e759c5b5b2 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -3546,14 +3546,14 @@ This prints the value into current buffer." ;;; Edebug Minor Mode +(define-obsolete-variable-alias 'gud-inhibit-global-bindings + 'edebug-inhibit-emacs-lisp-mode-bindings "24.3") + (defvar edebug-inhibit-emacs-lisp-mode-bindings nil "If non-nil, inhibit Edebug bindings on the C-x C-a key. By default, loading the `edebug' library causes these bindings to be installed in `emacs-lisp-mode-map'.") -(define-obsolete-variable-alias 'gud-inhibit-global-bindings - 'edebug-inhibit-emacs-lisp-mode-bindings "24.3") - ;; Global GUD bindings for all emacs-lisp-mode buffers. (unless edebug-inhibit-emacs-lisp-mode-bindings (define-key emacs-lisp-mode-map "\C-x\C-a\C-s" 'edebug-step-mode) diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el index 489611d4d1..665733181c 100644 --- a/lisp/emacs-lisp/warnings.el +++ b/lisp/emacs-lisp/warnings.el @@ -68,6 +68,7 @@ Each element looks like (ALIAS . LEVEL) and defines ALIAS as equivalent to LEVEL. LEVEL must be defined in `warning-levels'; it may not itself be an alias.") +(defvaralias 'display-warning-minimum-level 'warning-minimum-level) (defcustom warning-minimum-level :warning "Minimum severity level for displaying the warning buffer. If a warning's severity level is lower than this, @@ -77,8 +78,8 @@ is not immediately displayed. See also `warning-minimum-log-level'." :type '(choice (const :emergency) (const :error) (const :warning) (const :debug)) :version "22.1") -(defvaralias 'display-warning-minimum-level 'warning-minimum-level) +(defvaralias 'log-warning-minimum-level 'warning-minimum-log-level) (defcustom warning-minimum-log-level :warning "Minimum severity level for logging a warning. If a warning severity level is lower than this, @@ -89,7 +90,6 @@ because warnings not logged aren't displayed either." :type '(choice (const :emergency) (const :error) (const :warning) (const :debug)) :version "22.1") -(defvaralias 'log-warning-minimum-level 'warning-minimum-log-level) (defcustom warning-suppress-log-types nil "List of warning types that should not be logged. diff --git a/lisp/emacs-lock.el b/lisp/emacs-lock.el index 0a6fa9e625..b6e28fb253 100644 --- a/lisp/emacs-lock.el +++ b/lisp/emacs-lock.el @@ -88,6 +88,9 @@ The functions get one argument, the first locked buffer found." :group 'emacs-lock :version "24.3") +(define-obsolete-variable-alias 'emacs-lock-from-exiting + 'emacs-lock-mode "24.1") + (defvar-local emacs-lock-mode nil "If non-nil, the current buffer is locked. It can be one of the following values: @@ -182,9 +185,6 @@ Return a value appropriate for `kill-buffer-query-functions' (which see)." ;; anything else (turn off) mode)))) -(define-obsolete-variable-alias 'emacs-lock-from-exiting - 'emacs-lock-mode "24.1") - ;;;###autoload (define-minor-mode emacs-lock-mode "Toggle Emacs Lock mode in the current buffer. diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index 5bc8c2f38b..fdc209991a 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -1094,14 +1094,14 @@ Possible values are: ask, auto, ignore." (pcomplete-here '("auto" "ask" "ignore"))) (defalias 'pcomplete/erc-mode/SREQ 'pcomplete/erc-mode/CREQ) +(define-obsolete-variable-alias 'erc-dcc-chat-filter-hook + 'erc-dcc-chat-filter-functions "24.3") + (defvar erc-dcc-chat-filter-functions '(erc-dcc-chat-parse-output) "Abnormal hook run after parsing (and maybe inserting) a DCC message. Each function is called with two arguments: the ERC process and the unprocessed output.") -(define-obsolete-variable-alias 'erc-dcc-chat-filter-hook - 'erc-dcc-chat-filter-functions "24.3") - (defvar erc-dcc-chat-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "RET") 'erc-send-current-line) diff --git a/lisp/gnus/nnspool.el b/lisp/gnus/nnspool.el index c4dc575dcd..2f16b65392 100644 --- a/lisp/gnus/nnspool.el +++ b/lisp/gnus/nnspool.el @@ -35,11 +35,11 @@ ;; It's only used to init nnspool-spool-directory, so why not just ;; set that variable's default directly? (eval-and-compile + (defvaralias 'news-path 'news-directory) (defvar news-directory (if (file-exists-p "/usr/spool/news/") "/usr/spool/news/" "/var/spool/news/") - "The root directory below which all news files are stored.") - (defvaralias 'news-path 'news-directory)) + "The root directory below which all news files are stored.")) ;; Ditto re obsolescence. (defvar news-inews-program diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index 49a86c477d..10cfca3370 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -448,6 +448,7 @@ and so on." (background (choice (const :tag "Dark" dark ) (const :tag "Bright" light ))) )) +(define-obsolete-variable-alias 'hfy-optimisations 'hfy-optimizations "25.1") (defcustom hfy-optimizations (list 'keep-overlays) "Optimizations to turn on: So far, the following have been implemented:\n merge-adjacent-tags: If two (or more) span tags are adjacent, identical and @@ -483,7 +484,6 @@ which can never slow you down, but may result in incomplete fontification." (const :tag "body-text-only" body-text-only )) :group 'htmlfontify :tag "optimizations") -(define-obsolete-variable-alias 'hfy-optimisations 'hfy-optimizations "25.1") (defvar hfy-tags-cache nil "Alist of the form:\n diff --git a/lisp/ielm.el b/lisp/ielm.el index 59e333f19c..b4ad69e4c7 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -115,12 +115,12 @@ such as `edebug-defun' to work with such inputs." :type 'boolean :group 'ielm) +(defvaralias 'inferior-emacs-lisp-mode-hook 'ielm-mode-hook) (defcustom ielm-mode-hook nil "Hooks to be run when IELM (`inferior-emacs-lisp-mode') is started." :options '(eldoc-mode) :type 'hook :group 'ielm) -(defvaralias 'inferior-emacs-lisp-mode-hook 'ielm-mode-hook) (defvar * nil "Most recent value evaluated in IELM.") @@ -165,6 +165,7 @@ This variable is buffer-local.") "*** Welcome to IELM *** Type (describe-mode) for help.\n" "Message to display when IELM is started.") +(defvaralias 'inferior-emacs-lisp-mode-map 'ielm-map) (defvar ielm-map (let ((map (make-sparse-keymap))) (define-key map "\t" 'ielm-tab) @@ -183,7 +184,6 @@ This variable is buffer-local.") (define-key map "\C-c\C-v" 'ielm-print-working-buffer) map) "Keymap for IELM mode.") -(defvaralias 'inferior-emacs-lisp-mode-map 'ielm-map) (easy-menu-define ielm-menu ielm-map "IELM mode menu." diff --git a/lisp/isearch.el b/lisp/isearch.el index 85193738c6..0874ebb54e 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -3181,9 +3181,9 @@ since they have special meaning in a regexp." (defvar isearch-lazy-highlight-regexp nil) (defvar isearch-lazy-highlight-lax-whitespace nil) (defvar isearch-lazy-highlight-regexp-lax-whitespace nil) -(defvar isearch-lazy-highlight-regexp-function nil) (define-obsolete-variable-alias 'isearch-lazy-highlight-word 'isearch-lazy-highlight-regexp-function "25.1") +(defvar isearch-lazy-highlight-regexp-function nil) (defvar isearch-lazy-highlight-forward nil) (defvar isearch-lazy-highlight-error nil) diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index fcd6eac809..cbfaf88fb4 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -1401,6 +1401,9 @@ current display in the agenda." :group 'org-agenda-daily/weekly :type 'plist) +(defvaralias 'org-agenda-search-view-search-words-only + 'org-agenda-search-view-always-boolean) + (defcustom org-agenda-search-view-always-boolean nil "Non-nil means the search string is interpreted as individual parts. @@ -1429,9 +1432,6 @@ boolean search." :version "24.1" :type 'boolean) -(defvaralias 'org-agenda-search-view-search-words-only - 'org-agenda-search-view-always-boolean) - (defcustom org-agenda-search-view-force-full-words nil "Non-nil means, search words must be matches as complete words. When nil, they may also match part of a word." @@ -1873,6 +1873,9 @@ Nil means don't hide any tags." (const :tag "Hide none" nil) (string :tag "Regexp "))) +(defvaralias 'org-agenda-remove-tags-when-in-prefix + 'org-agenda-remove-tags) + (defcustom org-agenda-remove-tags nil "Non-nil means remove the tags from the headline copy in the agenda. When this is the symbol `prefix', only remove tags when @@ -1883,8 +1886,7 @@ When this is the symbol `prefix', only remove tags when (const :tag "Never" nil) (const :tag "When prefix format contains %T" prefix))) -(defvaralias 'org-agenda-remove-tags-when-in-prefix - 'org-agenda-remove-tags) +(defvaralias 'org-agenda-align-tags-to-column 'org-agenda-tags-column) (defcustom org-agenda-tags-column 'auto "Shift tags in agenda items to this column. @@ -1902,8 +1904,6 @@ character screen." :package-version '(Org . "9.1") :version "26.1") -(defvaralias 'org-agenda-align-tags-to-column 'org-agenda-tags-column) - (defcustom org-agenda-fontify-priorities 'cookies "Non-nil means highlight low and high priorities in agenda. When t, the highest priority entries are bold, lowest priority italic. @@ -2067,9 +2067,9 @@ works you probably want to add it to `org-agenda-custom-commands' for good." ;;; Define the org-agenda-mode +(defvaralias 'org-agenda-keymap 'org-agenda-mode-map) (defvar org-agenda-mode-map (make-sparse-keymap) "Keymap for `org-agenda-mode'.") -(defvaralias 'org-agenda-keymap 'org-agenda-mode-map) (defvar org-agenda-menu) ; defined later in this file. (defvar org-agenda-restrict nil) ; defined later in this file. diff --git a/lisp/org/org.el b/lisp/org/org.el index b68c68bc35..7f4c6d5936 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -1490,6 +1490,8 @@ time in Emacs." :group 'org-edit-structure :type 'boolean) +(defvaralias 'org-special-ctrl-a 'org-special-ctrl-a/e) + (defcustom org-special-ctrl-a/e nil "Non-nil means `C-a' and `C-e' behave specially in headlines and items. @@ -1527,7 +1529,6 @@ This may also be a cons cell where the behavior for `C-a' and (const :tag "off" nil) (const :tag "on: before tags first" t) (const :tag "reversed: after tags first" reversed))))) -(defvaralias 'org-special-ctrl-a 'org-special-ctrl-a/e) (defcustom org-special-ctrl-k nil "Non-nil means `C-k' will behave specially in headlines. @@ -3005,6 +3006,8 @@ because Agenda Log mode depends on the format of these entries." (unless (assq 'note org-log-note-headings) (push '(note . "%t") org-log-note-headings)) +(defvaralias 'org-log-state-notes-into-drawer 'org-log-into-drawer) + (defcustom org-log-into-drawer nil "Non-nil means insert state change notes and time stamps into a drawer. When nil, state changes notes will be inserted after the headline and @@ -3036,8 +3039,6 @@ function `org-log-into-drawer' instead." (const :tag "LOGBOOK" t) (string :tag "Other"))) -(defvaralias 'org-log-state-notes-into-drawer 'org-log-into-drawer) - (defun org-log-into-drawer () "Name of the log drawer, as a string, or nil. This is the value of `org-log-into-drawer'. However, if the @@ -3798,6 +3799,9 @@ regular expression will be included." :group 'org-agenda :type 'regexp) +(defvaralias 'org-agenda-multi-occur-extra-files + 'org-agenda-text-search-extra-files) + (defcustom org-agenda-text-search-extra-files nil "List of extra files to be searched by text search commands. These files will be searched in addition to the agenda files by the @@ -3815,9 +3819,6 @@ scope." (const :tag "Agenda Archives" agenda-archives) (repeat :inline t (file)))) -(defvaralias 'org-agenda-multi-occur-extra-files - 'org-agenda-text-search-extra-files) - (defcustom org-agenda-skip-unavailable-files nil "Non-nil means to just skip non-reachable files in `org-agenda-files'. A nil value means to remove them, after a query, from the list." diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el index f842563be2..9bb328d6a6 100644 --- a/lisp/progmodes/flymake-proc.el +++ b/lisp/progmodes/flymake-proc.el @@ -158,6 +158,9 @@ Convert it to Flymake internal format." (setq converted-list (cons (list regexp file line col) converted-list))))) converted-list)) +(define-obsolete-variable-alias 'flymake-err-line-patterns + 'flymake-proc-err-line-patterns "26.1") + (defvar flymake-proc-err-line-patterns ; regexp file-idx line-idx col-idx (optional) text-idx(optional), match-end to end of string is error text (append '( @@ -335,6 +338,9 @@ to the beginning of the list (File.h -> File.cpp moved to top)." (file-name-base file-one)) (not (equal file-one file-two)))) +(define-obsolete-variable-alias 'flymake-check-file-limit + 'flymake-proc-check-file-limit "26.1") + (defvar flymake-proc-check-file-limit 8192 "Maximum number of chars to look at when checking possible master file. Nil means search the entire file.") @@ -1148,12 +1154,8 @@ Use CREATE-TEMP-F for creating temp copy." ;;;; -(define-obsolete-variable-alias 'flymake-check-file-limit - 'flymake-proc-check-file-limit "26.1") (define-obsolete-function-alias 'flymake-reformat-err-line-patterns-from-compile-el 'flymake-proc-reformat-err-line-patterns-from-compile-el "26.1") -(define-obsolete-variable-alias 'flymake-err-line-patterns - 'flymake-proc-err-line-patterns "26.1") (define-obsolete-function-alias 'flymake-parse-line 'flymake-proc-parse-line "26.1") (define-obsolete-function-alias 'flymake-get-include-dirs diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index a1a66c09c6..ba2b1cb94a 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el @@ -557,6 +557,9 @@ This should identify a `make' command that can handle the `-q' option." :type 'string :group 'makefile) +(defvaralias 'makefile-query-one-target-method + 'makefile-query-one-target-method-function) + (defcustom makefile-query-one-target-method-function 'makefile-query-by-make-minus-q "Function to call to determine whether a make target is up to date. @@ -574,8 +577,6 @@ The function must satisfy this calling convention: makefile, any nonzero integer value otherwise." :type 'function :group 'makefile) -(defvaralias 'makefile-query-one-target-method - 'makefile-query-one-target-method-function) (defcustom makefile-up-to-date-buffer-name "*Makefile Up-to-date overview*" "Name of the Up-to-date overview buffer." diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index f5d764e16c..984bb73c73 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -639,6 +639,9 @@ mode, include \"-q\" and \"--traditional\"." :type '(repeat string) :version "24.4") +(define-obsolete-variable-alias 'inferior-octave-startup-hook + 'inferior-octave-mode-hook "24.4") + (defcustom inferior-octave-mode-hook nil "Hook to be run when Inferior Octave mode is started." :type 'hook) @@ -693,9 +696,6 @@ mode, include \"-q\" and \"--traditional\"." (defvar inferior-octave-output-string nil) (defvar inferior-octave-receive-in-progress nil) -(define-obsolete-variable-alias 'inferior-octave-startup-hook - 'inferior-octave-mode-hook "24.4") - (defvar inferior-octave-dynamic-complete-functions '(inferior-octave-completion-at-point comint-filename-completion) "List of functions called to perform completion for inferior Octave. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index adf7b33ccb..32d645cfcc 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2923,11 +2923,17 @@ be asked for their values." "Instead call `python-shell-get-process' and create one if returns nil." "25.1") +(define-obsolete-variable-alias + 'python-buffer 'python-shell-internal-buffer "24.3") + (defvar python-shell-internal-buffer nil "Current internal shell buffer for the current buffer. This is really not necessary at all for the code to work but it's there for compatibility with CEDET.") +(define-obsolete-variable-alias + 'python-preoutput-result 'python-shell-internal-last-output "24.3") + (defvar python-shell-internal-last-output nil "Last output captured by the internal shell. This is really not necessary at all for the code to work but it's @@ -2943,12 +2949,6 @@ there for compatibility with CEDET.") (define-obsolete-function-alias 'python-proc 'python-shell-internal-get-or-create-process "24.3") -(define-obsolete-variable-alias - 'python-buffer 'python-shell-internal-buffer "24.3") - -(define-obsolete-variable-alias - 'python-preoutput-result 'python-shell-internal-last-output "24.3") - (defun python-shell--save-temp-file (string) (let* ((temporary-file-directory (if (file-remote-p default-directory) diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index ebbef8d89e..4d291c3bde 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -691,6 +691,8 @@ making new SQLi sessions." :version "24.1" :group 'SQL) +(defvaralias 'sql-dialect 'sql-product) + (defcustom sql-product 'ansi "Select the SQL database product used. This allows highlighting buffers properly when you open them." @@ -703,7 +705,6 @@ This allows highlighting buffers properly when you open them." sql-product-alist)) :group 'SQL :safe 'symbolp) -(defvaralias 'sql-dialect 'sql-product) ;; misc customization of sql.el behavior diff --git a/lisp/select.el b/lisp/select.el index 698be83754..bd7fd0c1ff 100644 --- a/lisp/select.el +++ b/lisp/select.el @@ -86,6 +86,8 @@ After the communication, this variable is set to nil.") ;; Only declared obsolete in 23.3. (define-obsolete-function-alias 'x-selection 'x-get-selection "at least 19.34") +(define-obsolete-variable-alias 'x-select-enable-clipboard + 'select-enable-clipboard "25.1") (defcustom select-enable-clipboard t "Non-nil means cutting and pasting uses the clipboard. This can be in addition to, but in preference to, the primary selection, @@ -94,9 +96,9 @@ if applicable (i.e. under X11)." :group 'killing ;; The GNU/Linux version changed in 24.1, the MS-Windows version did not. :version "24.1") -(define-obsolete-variable-alias 'x-select-enable-clipboard - 'select-enable-clipboard "25.1") +(define-obsolete-variable-alias 'x-select-enable-primary + 'select-enable-primary "25.1") (defcustom select-enable-primary nil "Non-nil means cutting and pasting uses the primary selection. The existence of a primary selection depends on the underlying GUI you use. @@ -104,8 +106,6 @@ E.g. it doesn't exist under MS-Windows." :type 'boolean :group 'killing :version "25.1") -(define-obsolete-variable-alias 'x-select-enable-primary - 'select-enable-primary "25.1") ;; We keep track of the last text selected here, so we can check the ;; current selection against it, and avoid passing back our own text diff --git a/lisp/shell.el b/lisp/shell.el index d4a0556ceb..232186083d 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -315,6 +315,8 @@ for Shell mode only." "List of directories saved by pushd in this buffer's shell. Thus, this does not include the shell's current directory.") +(defvaralias 'shell-dirtrack-mode 'shell-dirtrackp) + (defvar shell-dirtrackp t "Non-nil in a shell buffer means directory tracking is enabled.") @@ -961,7 +963,6 @@ Environment variables are expanded, see function `substitute-in-file-name'." (and (string-match "^\\+[1-9][0-9]*$" str) (string-to-number str))) -(defvaralias 'shell-dirtrack-mode 'shell-dirtrackp) (define-minor-mode shell-dirtrack-mode "Toggle directory tracking in this shell buffer (Shell Dirtrack mode). With a prefix argument ARG, enable Shell Dirtrack mode if ARG is diff --git a/lisp/skeleton.el b/lisp/skeleton.el index 90e3819cb7..1d1af825a1 100644 --- a/lisp/skeleton.el +++ b/lisp/skeleton.el @@ -37,13 +37,13 @@ ;; page 2: paired insertion ;; page 3: mirror-mode, an example for setting up paired insertion +(defvaralias 'skeleton-transformation 'skeleton-transformation-function) (defvar skeleton-transformation-function 'identity "If non-nil, function applied to literal strings before they are inserted. It should take strings and characters and return them transformed, or nil which means no transformation. Typical examples might be `upcase' or `capitalize'.") -(defvaralias 'skeleton-transformation 'skeleton-transformation-function) ; this should be a fourth argument to defvar (put 'skeleton-transformation-function 'variable-interactive @@ -65,11 +65,11 @@ region.") "Hook called at end of skeleton but before going to point of interest. The variables `v1' and `v2' are still set when calling this.") +(defvaralias 'skeleton-filter 'skeleton-filter-function) ;;;###autoload (defvar skeleton-filter-function 'identity "Function for transforming a skeleton proxy's aliases' variable value.") -(defvaralias 'skeleton-filter 'skeleton-filter-function) (defvar skeleton-untabify nil ; bug#12223 "When non-nil untabifies when deleting backwards with element -ARG.") diff --git a/lisp/startup.el b/lisp/startup.el index f6907a821b..bb3e70493c 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -63,6 +63,9 @@ string or function value that this variable has." :version "23.1" :group 'initialization) +(defvaralias 'inhibit-splash-screen 'inhibit-startup-screen) +(defvaralias 'inhibit-startup-message 'inhibit-startup-screen) + (defcustom inhibit-startup-screen nil "Non-nil inhibits the startup screen. @@ -71,9 +74,6 @@ once you are familiar with the contents of the startup screen." :type 'boolean :group 'initialization) -(defvaralias 'inhibit-splash-screen 'inhibit-startup-screen) -(defvaralias 'inhibit-startup-message 'inhibit-startup-screen) - (defvar startup-screen-inhibit-startup-screen nil) ;; The mechanism used to ensure that only end users can disable this diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el index fa988ad5f2..eff8adcd3b 100644 --- a/lisp/term/ns-win.el +++ b/lisp/term/ns-win.el @@ -549,8 +549,9 @@ the last file dropped is selected." (defvar ns-right-control-modifier) ;; You say tomAYto, I say tomAHto.. -(defvaralias 'ns-option-modifier 'ns-alternate-modifier) -(defvaralias 'ns-right-option-modifier 'ns-right-alternate-modifier) +(with-no-warnings + (defvaralias 'ns-option-modifier 'ns-alternate-modifier) + (defvaralias 'ns-right-option-modifier 'ns-right-alternate-modifier)) (defun ns-do-hide-emacs () (interactive) diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index e9ae6a4ce9..61ca0856bc 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -351,13 +351,12 @@ Example: (defvar artist-pointer-shape (if (eq window-system 'x) x-pointer-crosshair nil) "If in X Windows, use this pointer shape while drawing with the mouse.") +(defvaralias 'artist-text-renderer 'artist-text-renderer-function) (defcustom artist-text-renderer-function 'artist-figlet "Function for doing text rendering." :group 'artist-text :type 'symbol) -(defvaralias 'artist-text-renderer 'artist-text-renderer-function) - (defcustom artist-figlet-program "figlet" "Program to run for `figlet'." diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 79eb22e5ed..89c94eb7e9 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -1038,6 +1038,9 @@ See `bibtex-generate-autokey' for details." :type '(repeat (cons (regexp :tag "Old") (string :tag "New")))) +(defvaralias 'bibtex-autokey-name-case-convert + 'bibtex-autokey-name-case-convert-function) + (defcustom bibtex-autokey-name-case-convert-function 'downcase "Function called for each name to perform case conversion. See `bibtex-generate-autokey' for details." @@ -1049,8 +1052,6 @@ See `bibtex-generate-autokey' for details." (function :tag "Conversion function"))) (put 'bibtex-autokey-name-case-convert-function 'safe-local-variable (lambda (x) (memq x '(upcase downcase capitalize identity)))) -(defvaralias 'bibtex-autokey-name-case-convert - 'bibtex-autokey-name-case-convert-function) (defcustom bibtex-autokey-name-length 'infty "Number of characters from name to incorporate into key. @@ -1113,6 +1114,9 @@ Case is significant. See `bibtex-generate-autokey' for details." :group 'bibtex-autokey :type '(repeat regexp)) +(defvaralias 'bibtex-autokey-titleword-case-convert + 'bibtex-autokey-titleword-case-convert-function) + (defcustom bibtex-autokey-titleword-case-convert-function 'downcase "Function called for each titleword to perform case conversion. See `bibtex-generate-autokey' for details." @@ -1122,8 +1126,6 @@ See `bibtex-generate-autokey' for details." (const :tag "Capitalize" capitalize) (const :tag "Upcase" upcase) (function :tag "Conversion function"))) -(defvaralias 'bibtex-autokey-titleword-case-convert - 'bibtex-autokey-titleword-case-convert-function) (defcustom bibtex-autokey-titleword-abbrevs nil "Determines exceptions to the usual abbreviation mechanism. diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 2d0307845c..9747f8e2eb 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -321,14 +321,16 @@ If this variable is nil, all regions are treated as small." ;;* (lambda () (setq flyspell-generic-check-word-predicate */ ;;* 'mail-mode-flyspell-verify))) */ ;;*---------------------------------------------------------------------*/ + +(define-obsolete-variable-alias 'flyspell-generic-check-word-p + 'flyspell-generic-check-word-predicate "25.1") + (defvar flyspell-generic-check-word-predicate nil "Function providing per-mode customization over which words are flyspelled. Returns t to continue checking, nil otherwise. Flyspell mode sets this variable to whatever is the `flyspell-mode-predicate' property of the major mode name.") (make-variable-buffer-local 'flyspell-generic-check-word-predicate) -(define-obsolete-variable-alias 'flyspell-generic-check-word-p - 'flyspell-generic-check-word-predicate "25.1") ;;*--- mail mode -------------------------------------------------------*/ (put 'mail-mode 'flyspell-mode-predicate 'mail-mode-flyspell-verify) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index ba98ea5519..18bf2630e5 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -318,12 +318,13 @@ The following values are supported: :type 'boolean :group 'ispell) +(defvaralias 'ispell-format-word 'ispell-format-word-function) + (defcustom ispell-format-word-function (function upcase) "Formatting function for displaying word being spell checked. The function must take one string argument and return a string." :type 'function :group 'ispell) -(defvaralias 'ispell-format-word 'ispell-format-word-function) (defcustom ispell-use-framepop-p nil "When non-nil ispell uses framepop to display choices in a dedicated frame. diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 48c0128934..40d75a9db8 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -796,6 +796,9 @@ Return ADO if so or signal an error otherwise." ;; Public class methods +(define-obsolete-variable-alias + 'rst-preferred-decorations 'rst-preferred-adornments "rst 1.0.0") + (defvar rst-preferred-adornments) ; Forward declaration. (defun rst-Hdr-preferred-adornments () @@ -1481,8 +1484,6 @@ for modes derived from Text mode, like Mail mode." :group 'rst :version "21.1") -(define-obsolete-variable-alias - 'rst-preferred-decorations 'rst-preferred-adornments "rst 1.0.0") ;; FIXME: Default must match suggestion in ;; http://sphinx-doc.org/rest.html#sections for Python documentation. (defcustom rst-preferred-adornments '((?= over-and-under 1) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 811eb6622a..30ca11199d 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -76,6 +76,8 @@ a DOCTYPE or an XML declaration." :version "22.1" :group 'sgml) +(defvaralias 'sgml-transformation 'sgml-transformation-function) + (defcustom sgml-transformation-function 'identity "Default value for `skeleton-transformation-function' in SGML mode." :type 'function @@ -92,7 +94,6 @@ a DOCTYPE or an XML declaration." (put 'sgml-transformation-function 'variable-interactive "aTransformation function: ") -(defvaralias 'sgml-transformation 'sgml-transformation-function) (defcustom sgml-mode-hook nil "Hook run by command `sgml-mode'. diff --git a/lisp/window.el b/lisp/window.el index 8c5e441e4b..8055e5babc 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -6641,6 +6641,7 @@ represents a live window, nil otherwise." )) frame)))) +(defvaralias 'even-window-heights 'even-window-sizes) (defcustom even-window-sizes t "If non-nil `display-buffer' will try to even window sizes. Otherwise `display-buffer' will leave the window configuration @@ -6654,7 +6655,6 @@ any of them." (const :tag "Always" t)) :version "25.1" :group 'windows) -(defvaralias 'even-window-heights 'even-window-sizes) (defun window--even-window-sizes (window) "Even sizes of WINDOW and selected window. commit 495963cfaf535646350051f47c085b84319572f0 Author: Stefan Monnier Date: Fri Apr 20 17:22:47 2018 -0400 * lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defvar-function): Warn about defvaralias that follows instead of precedes its var. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index ea9e3f0655..50e67046e8 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2426,6 +2426,15 @@ list that represents a doc string reference. (defun byte-compile-file-form-defvar-function (form) (pcase-let (((or `',name (let name nil)) (nth 1 form))) (if name (byte-compile--declare-var name))) + ;; Variable aliases are better declared before the corresponding variable, + ;; since it makes it more likely that only one of the two vars has a value + ;; before the `defvaralias' gets executed, which avoids the need to + ;; merge values. + (pcase form + (`(defvaralias ,_ ',newname . ,_) + (when (memq newname byte-compile-bound-variables) + (byte-compile-warn + "Alias for `%S' should be declared before its referent" newname)))) (byte-compile-keep-pending form)) (put 'custom-declare-variable 'byte-hunk-handler commit 71b108a5d771a5d9a777dd9bdafa082fa6a6384b Author: Stefan Monnier Date: Fri Apr 20 16:56:53 2018 -0400 * lisp/url/url-file.el: Use lexical-binding. diff --git a/lisp/url/url-file.el b/lisp/url/url-file.el index 92edd9901e..1c7c20e7c8 100644 --- a/lisp/url/url-file.el +++ b/lisp/url/url-file.el @@ -1,4 +1,4 @@ -;;; url-file.el --- File retrieval code +;;; url-file.el --- File retrieval code -*- lexical-binding:t -*- ;; Copyright (C) 1996-1999, 2004-2018 Free Software Foundation, Inc. @@ -33,7 +33,7 @@ (defconst url-file-asynchronous-p t "FTP transfers are asynchronous.") (defalias 'url-file-expand-file-name 'url-default-expander) -(defun url-file-find-possibly-compressed-file (fname &rest args) +(defun url-file-find-possibly-compressed-file (fname &rest _) "Find the exact file referenced by `fname'. This tries the common compression extensions, because things like ange-ftp and efs are not quite smart enough to realize when a server @@ -63,7 +63,7 @@ to them." (match-beginning 0)) (system-name))))))) -(defun url-file-asynch-callback (x y name buff func args &optional efs) +(defun url-file-asynch-callback (_x _y name buff func args &optional efs) (if (not (featurep 'ange-ftp)) ;; EFS passes us an extra argument (setq name buff @@ -114,8 +114,7 @@ to them." ((string-match "\\`/[^/]+:/" file) (concat "/:" file)) (t - file))) - pos-index) + file)))) (and user pass (cond @@ -200,7 +199,7 @@ to them." (if (featurep 'ange-ftp) (ange-ftp-copy-file-internal filename (expand-file-name new) t nil t - (list 'url-file-asynch-callback + (list #'url-file-asynch-callback new (current-buffer) callback cbargs) t) @@ -209,7 +208,7 @@ to them." (efs-copy-file-internal filename (efs-ftp-path filename) new (efs-ftp-path new) t nil 0 - (list 'url-file-asynch-callback + (list #'url-file-asynch-callback new (current-buffer) callback cbargs) 0 nil))))))) commit be96414a62f670655320605955a7b60817d67bdb Author: Glenn Morris Date: Fri Apr 20 13:46:45 2018 -0400 * lisp/net/newst-backend.el (newsticker--sentinel-work): Replace obsolete form of libxml-parse-xml-region. diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el index 520a9e19b4..32893d2eea 100644 --- a/lisp/net/newst-backend.el +++ b/lisp/net/newst-backend.el @@ -874,11 +874,12 @@ Argument BUFFER is the buffer of the retrieval process." (decode-coding-region (point-min) (point-max) coding-system)) (condition-case errordata - ;; The xml parser might fail or the xml might be - ;; bugged + ;; The xml parser might fail or the xml might be bugged. (if (fboundp 'libxml-parse-xml-region) - (list (libxml-parse-xml-region (point-min) (point-max) - nil t)) + (progn + (xml-remove-comments (point-min) (point-max)) + (list (libxml-parse-xml-region (point-min) (point-max) + nil))) (xml-parse-region (point-min) (point-max))) (error (message "Could not parse %s: %s" (buffer-name) (cadr errordata)) commit 3e233dd1c9a460e93974d9f13dfe564caed5ab56 Author: Glenn Morris Date: Fri Apr 20 13:35:20 2018 -0400 * lisp/replace.el (query-replace-descr): Silence compiler. diff --git a/lisp/replace.el b/lisp/replace.el index 0e72339034..d5d34f652a 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -148,7 +148,7 @@ See `replace-regexp' and `query-replace-regexp-eval'.") (defun query-replace-descr (string) (setq string (copy-sequence string)) - (dotimes (i (length string) string) + (dotimes (i (length string)) (let ((c (aref string i))) (cond ((< c ?\s) (add-text-properties @@ -158,7 +158,8 @@ See `replace-regexp' and `query-replace-regexp-eval'.") ((= c ?\^?) (add-text-properties i (1+ i) `(display ,(propertize "^?" 'face 'escape-glyph)) - string)))))) + string))))) + string) (defun query-replace--split-string (string) "Split string STRING at a substring with property `separator'." commit 15a62a60d12eef50c21e2271acde2b47b397a093 Author: Michael Albinus Date: Fri Apr 20 19:32:52 2018 +0200 Revert "* etc/HELLO: Add langugae Emoji. Use utf-8 coding." This reverts commit c4cfb5d20487f9912f5896b3f1d291fe7ccc9804. diff --git a/etc/HELLO b/etc/HELLO index f780d7093c..2c95e21136 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -3,76 +3,75 @@ It is not intended to be comprehensive, but to demonstrate some of the character sets that Emacs supports. Non-ASCII examples: - Europe: ¡Hola!, Grüß Gott, Hyvää päivää, Tere õhtust, Bonġu - Cześć!, Dobrý den, Здравствуйте!, Γειά σας, გამარჯობა - Africa: ሠላም - Middle/Near East: שלום, السّلام عليكم - South Asia: નમસ્તે, नमस्ते, ನಮಸ್ಕಾರ, നമസ്കാരം, ଶୁଣିବେ, - ආයුබෝවන්, வணக்கம், నమస్కారం, བཀྲ་ཤིས་བདེ་ལེགས༎ - South East Asia: ជំរាបសួរ, ສະບາຍດີ, မင်္ဂလာပါ, สวัสดีครับ, Chào bạn - East Asia: 你好, 早晨, こんにちは, 안녕하세요 - Misc: Eĥoŝanĝo ĉiuĵaŭde, ⠓⠑⠇⠇⠕, ∀ p ∈ world • hello p □ - CJK variety: GB(元气,开发), BIG5(元氣,開發), JIS(元気,開発), KSC(元氣,開發) - Unicode charset: Eĥoŝanĝo ĉiuĵaŭde, Γειά σας, שלום, Здравствуйте! + Europe: ,A!(BHola!, Gr,A|_(B Gott, Hyv,Add(B p,Ad(Biv,Add(B, Tere ,Au(Bhtust, Bon,Cu(Bu + Cze,B6f(B!, Dobr,B}(B den, ,L7T`PRabRcYbU(B!, ,FCei\(B ,Fsar(B, $,1J2J0J;J0J@JOJ=J1J0(B + Africa: $(3!A!,!>(B + Middle/Near East: ,Hylem(B, $,1-g.$-s.1.$-g.%(B $,1-y.$.*.#.%(B + South Asia: $,19h9n9x:-9d:'(B, $,15h5n5x6-5d6'(B, $,1?(?.?8?M>u?>?0(B, $,1@H@N@X@m@5@^@P@"(B, $,1;6;A;#;?;,;G(B, + $,1AFAzB4AvB=B AqB*(B, $,1-=U=~=p=B(B, $(7"7"!#C!;"E"S"G!;"7"2"[!;"D"["#"G!>(B + South East Asia: $,1\'\f\:\V\4\?\]\:(B, (1JP:R-4U(B, $,1H9H$HZHYH"HH3gGO<6b727>(B) $,17(7.787M6u7>70(B +Braille $,2(3(1('('(5(B +Burmese ($,1H9H\H4HZH9HL(B) $,1H9H$HZHYH"Hu?(?M?(?!(B) $,1?(?.?8?M>u?>?0(B +Khmer ($,1\7\V\?\V\!\r\8\b\:(B) $,1\'\f\:\V\4\?\]\:(B +Lao ((1>RJRERG(B) (1JP:R-4U(B / (1"mcKib*!4U(B +Malayalam ($,1@N@R@O@^@S@"(B) $,1@H@N@X@m@5@^@P@"(B +Maltese (il-Malti) Bon,Cu(Bu / Sa,C11(Ba +Mathematics $,1x (B p $,1x((B world $,1s"(B hello p $,2!a(B +Mongolian (,L\^]S^[(B ,Lem[(B) ,LAPY](B ,LQPY]P(B ,Lcc(B? Norwegian (norsk) Hei / God dag -Oriya (ଓଡ଼ିଆ) ଶୁଣିବେ -Polish (język polski) Dzień dobry! / Cześć! -Russian (русский) Здра́вствуйте! -Sinhala (සිංහල) ආයුබෝවන් -Slovak (slovenčina) Dobrý deň -Slovenian (slovenščina) Pozdravljeni! -Spanish (español) ¡Hola! -Swedish (svenska) Hej / Goddag / Hallå -Tamil (தமிழ்) வணக்கம் -Telugu (తెలుగు) నమస్కారం -Thai (ภาษาไทย) สวัสดีครับ / สวัสดีค่ะ -Tibetan (བོད་སྐད་) བཀྲ་ཤིས་བདེ་ལེགས༎ -Tigrigna (ትግርኛ) ሰላማት -Turkish (Türkçe) Merhaba -Ukrainian (українська) Вітаю -Vietnamese (tiếng Việt) Chào bạn +Oriya ($,1:s;\;?:f(B) $,1;6;A;#;?;,;G(B +Polish (j,Bj(Bzyk polski) Dzie,Bq(B dobry! / Cze,B6f(B! +Russian (,L`caaZXY(B) ,L7T`P$(O+Z,LRabRcYbU(B! +Sinhala ($,1B#B2ABB$A}(B) $,1AFAzB4AvB=B AqB*(B +Slovak (sloven,Bh(Bina) Dobr,A}(B de,Br(B +Slovenian (sloven,B9h(Bina) Pozdravljeni! +Spanish (espa,Aq(Bol) ,A!(BHola! +Swedish (svenska) Hej / Goddag / Hall,Ae(B +Tamil ($,1&=r>!=W>!(B) $,1=h=n=x>-=U=~=p=B(B +Thai (,T@RIRd7B(B) ,TJGQJ4U$CQ:(B / ,TJGQJ4U$hP(B +Tibetan ($(7"7"]"2!;"G#!"2!;(B) $(7"7"!#C!;"E"S"G!;"7"2"[!;"D"["#"G!>(B +Tigrigna ($,1NUP-MmN{(B) $,1MpMKM[NU(B +Turkish (T,A|(Brk,Ag(Be) Merhaba +Ukrainian (,LcZ`Pw]alZP(B) ,L2vbPn(B +Vietnamese (ti,1*(Bng Vi,1.(Bt) Ch,A`(Bo b,1U(Bn -Japanese (日本語) こんにちは / コンニチハ -Chinese (中文,普通话,汉语) 你好 -Cantonese (粵語,廣東話) 早晨, 你好 -Korean (한글) 안녕하세요 / 안녕하십니까 +Japanese ($BF|K\8l(B) $B$3$s$K$A$O(B / (I:]FAJ(B +Chinese ($AVPND(B,$AFUM(;0(B,$A::So(B) $ADc:C(B +Cantonese ($(0GnM$(B,$(0N]0*Hd(B) $(0*/=((B, $(0+$)p(B +Korean ($(CGQ1[(B) $(C>H3gGO<H3gGO=J4O1n(B @@ -96,5 +95,5 @@ along with GNU Emacs. If not, see . ;;; Local Variables: ;;; tab-width: 32 ;;; bidi-display-reordering: t -;;; coding: utf-8 +;;; coding: iso-2022-7bit ;;; End: commit bbc9ae3ad147e770bd486c5404826f406bd22ca6 Author: Michael Albinus Date: Fri Apr 20 19:32:28 2018 +0200 Revert "* admin/notes/unicode: HELLO is now UTF-8." This reverts commit 0585bd643dae2592214e77998b875347e6e59bab. diff --git a/admin/notes/unicode b/admin/notes/unicode index b3a962deee..ff0de8aeff 100644 --- a/admin/notes/unicode +++ b/admin/notes/unicode @@ -232,6 +232,10 @@ nontrivial changes to the build process. * iso-2022-7bit + This file switches between CJK charsets, which is not encoded in UTF-8. + + etc/HELLO + Each of these files contains just one CJK charset, but Emacs currently has no easy way to specify set-charset-priority on a per-file basis, so converting any of these files to UTF-8 might commit 0585bd643dae2592214e77998b875347e6e59bab Author: Paul Eggert Date: Fri Apr 20 09:43:01 2018 -0700 * admin/notes/unicode: HELLO is now UTF-8. diff --git a/admin/notes/unicode b/admin/notes/unicode index ff0de8aeff..b3a962deee 100644 --- a/admin/notes/unicode +++ b/admin/notes/unicode @@ -232,10 +232,6 @@ nontrivial changes to the build process. * iso-2022-7bit - This file switches between CJK charsets, which is not encoded in UTF-8. - - etc/HELLO - Each of these files contains just one CJK charset, but Emacs currently has no easy way to specify set-charset-priority on a per-file basis, so converting any of these files to UTF-8 might commit 2a8f8f75639505b0f04757a1034480843fbd8398 Merge: e927a36f3c 5de608f3ed Author: Glenn Morris Date: Fri Apr 20 08:07:43 2018 -0700 Merge from origin/emacs-26 5de608f (origin/emacs-26) Update the documentation of 'perform-replace' 06245b6 * etc/NEWS: Another fix for the last change (noted by Juri Li... 8f6293c Fix use of @key in Texinfo manuals f4c9894 Improve documentation of actual arglist ce0e253 ; * etc/NEWS: Improve last change as proposed by Phil Sainty b89ff0e Don't assume term-current-row cache is valid (Bug#31193) 326a296 ; * etc/NEWS: Mention 'display-buffer-in-major-side-window' c... 3bdc9a1 Fix flyspell-auto-correct-previous-word broken by recent change a539eb5 * test/src/lread-tests.el (lread-test-bug-31186): New test. 3fa472b Fix undefined behaviour while looking for lexical-binding fil... 4341aac Minor wording improvement in "Bookmarks" Conflicts: test/src/lread-tests.el commit e927a36f3cf974a57094d10023ee075bb4596fb9 Author: Stefan Monnier Date: Fri Apr 20 09:16:55 2018 -0400 * lisp/international/mule-cmds.el (view-hello-file): Avoid duplicate Don't hardcode the coding-system, now that it's specified with a "coding:" tag diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index c66cc6747d..6c49b8fa6a 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -281,9 +281,7 @@ wrong, use this command again to toggle back to the right mode." (defun view-hello-file () "Display the HELLO file, which lists many languages and characters." (interactive) - ;; We have to decode the file in any environment. - (let ((coding-system-for-read 'utf-8)) - (view-file (expand-file-name "HELLO" data-directory)))) + (view-file (expand-file-name "HELLO" data-directory))) (defun universal-coding-system-argument (coding-system) "Execute an I/O command using the specified coding system." commit e2ae724460e6d73d3ddcc6066427471799c4bd57 Author: Michael Albinus Date: Fri Apr 20 14:25:51 2018 +0200 * lisp/international/mule-cmds.el (view-hello-file): Use utf-8 coding. diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index f737869eef..c66cc6747d 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -282,7 +282,7 @@ wrong, use this command again to toggle back to the right mode." "Display the HELLO file, which lists many languages and characters." (interactive) ;; We have to decode the file in any environment. - (let ((coding-system-for-read 'iso-2022-7bit)) + (let ((coding-system-for-read 'utf-8)) (view-file (expand-file-name "HELLO" data-directory)))) (defun universal-coding-system-argument (coding-system) commit c4cfb5d20487f9912f5896b3f1d291fe7ccc9804 Author: Michael Albinus Date: Fri Apr 20 14:16:33 2018 +0200 * etc/HELLO: Add langugae Emoji. Use utf-8 coding. diff --git a/etc/HELLO b/etc/HELLO index 2c95e21136..f780d7093c 100644 --- a/etc/HELLO +++ b/etc/HELLO @@ -3,75 +3,76 @@ It is not intended to be comprehensive, but to demonstrate some of the character sets that Emacs supports. Non-ASCII examples: - Europe: ,A!(BHola!, Gr,A|_(B Gott, Hyv,Add(B p,Ad(Biv,Add(B, Tere ,Au(Bhtust, Bon,Cu(Bu - Cze,B6f(B!, Dobr,B}(B den, ,L7T`PRabRcYbU(B!, ,FCei\(B ,Fsar(B, $,1J2J0J;J0J@JOJ=J1J0(B - Africa: $(3!A!,!>(B - Middle/Near East: ,Hylem(B, $,1-g.$-s.1.$-g.%(B $,1-y.$.*.#.%(B - South Asia: $,19h9n9x:-9d:'(B, $,15h5n5x6-5d6'(B, $,1?(?.?8?M>u?>?0(B, $,1@H@N@X@m@5@^@P@"(B, $,1;6;A;#;?;,;G(B, - $,1AFAzB4AvB=B AqB*(B, $,1-=U=~=p=B(B, $(7"7"!#C!;"E"S"G!;"7"2"[!;"D"["#"G!>(B - South East Asia: $,1\'\f\:\V\4\?\]\:(B, (1JP:R-4U(B, $,1H9H$HZHYH"HH3gGO<6b727>(B) $,17(7.787M6u7>70(B -Braille $,2(3(1('('(5(B -Burmese ($,1H9H\H4HZH9HL(B) $,1H9H$HZHYH"Hu?(?M?(?!(B) $,1?(?.?8?M>u?>?0(B -Khmer ($,1\7\V\?\V\!\r\8\b\:(B) $,1\'\f\:\V\4\?\]\:(B -Lao ((1>RJRERG(B) (1JP:R-4U(B / (1"mcKib*!4U(B -Malayalam ($,1@N@R@O@^@S@"(B) $,1@H@N@X@m@5@^@P@"(B -Maltese (il-Malti) Bon,Cu(Bu / Sa,C11(Ba -Mathematics $,1x (B p $,1x((B world $,1s"(B hello p $,2!a(B -Mongolian (,L\^]S^[(B ,Lem[(B) ,LAPY](B ,LQPY]P(B ,Lcc(B? +Kannada (ಕನ್ನಡ) ನಮಸ್ಕಾರ +Khmer (ភាសាខ្មែរ) ជំរាបសួរ +Lao (ພາສາລາວ) ສະບາຍດີ / ຂໍໃຫ້ໂຊກດີ +Malayalam (മലയാളം) നമസ്കാരം +Maltese (il-Malti) Bonġu / Saħħa +Mathematics ∀ p ∈ world • hello p □ +Mongolian (монгол хэл) Сайн байна уу? Norwegian (norsk) Hei / God dag -Oriya ($,1:s;\;?:f(B) $,1;6;A;#;?;,;G(B -Polish (j,Bj(Bzyk polski) Dzie,Bq(B dobry! / Cze,B6f(B! -Russian (,L`caaZXY(B) ,L7T`P$(O+Z,LRabRcYbU(B! -Sinhala ($,1B#B2ABB$A}(B) $,1AFAzB4AvB=B AqB*(B -Slovak (sloven,Bh(Bina) Dobr,A}(B de,Br(B -Slovenian (sloven,B9h(Bina) Pozdravljeni! -Spanish (espa,Aq(Bol) ,A!(BHola! -Swedish (svenska) Hej / Goddag / Hall,Ae(B -Tamil ($,1&=r>!=W>!(B) $,1=h=n=x>-=U=~=p=B(B -Thai (,T@RIRd7B(B) ,TJGQJ4U$CQ:(B / ,TJGQJ4U$hP(B -Tibetan ($(7"7"]"2!;"G#!"2!;(B) $(7"7"!#C!;"E"S"G!;"7"2"[!;"D"["#"G!>(B -Tigrigna ($,1NUP-MmN{(B) $,1MpMKM[NU(B -Turkish (T,A|(Brk,Ag(Be) Merhaba -Ukrainian (,LcZ`Pw]alZP(B) ,L2vbPn(B -Vietnamese (ti,1*(Bng Vi,1.(Bt) Ch,A`(Bo b,1U(Bn +Oriya (ଓଡ଼ିଆ) ଶୁଣିବେ +Polish (język polski) Dzień dobry! / Cześć! +Russian (русский) Здра́вствуйте! +Sinhala (සිංහල) ආයුබෝවන් +Slovak (slovenčina) Dobrý deň +Slovenian (slovenščina) Pozdravljeni! +Spanish (español) ¡Hola! +Swedish (svenska) Hej / Goddag / Hallå +Tamil (தமிழ்) வணக்கம் +Telugu (తెలుగు) నమస్కారం +Thai (ภาษาไทย) สวัสดีครับ / สวัสดีค่ะ +Tibetan (བོད་སྐད་) བཀྲ་ཤིས་བདེ་ལེགས༎ +Tigrigna (ትግርኛ) ሰላማት +Turkish (Türkçe) Merhaba +Ukrainian (українська) Вітаю +Vietnamese (tiếng Việt) Chào bạn -Japanese ($BF|K\8l(B) $B$3$s$K$A$O(B / (I:]FAJ(B -Chinese ($AVPND(B,$AFUM(;0(B,$A::So(B) $ADc:C(B -Cantonese ($(0GnM$(B,$(0N]0*Hd(B) $(0*/=((B, $(0+$)p(B -Korean ($(CGQ1[(B) $(C>H3gGO<H3gGO=J4O1n(B +Japanese (日本語) こんにちは / コンニチハ +Chinese (中文,普通话,汉语) 你好 +Cantonese (粵語,廣東話) 早晨, 你好 +Korean (한글) 안녕하세요 / 안녕하십니까 @@ -95,5 +96,5 @@ along with GNU Emacs. If not, see . ;;; Local Variables: ;;; tab-width: 32 ;;; bidi-display-reordering: t -;;; coding: iso-2022-7bit +;;; coding: utf-8 ;;; End: commit 8509fc2293cf90a3490f0fdb0bbdbd456d05db55 Author: Eli Zaretskii Date: Fri Apr 20 10:50:10 2018 +0300 ; * etc/NEWS: Minor reformatting of a recent entry. diff --git a/etc/NEWS b/etc/NEWS index 26dfe1555d..59586446fd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -347,12 +347,12 @@ are evaluated lazily. ** next-error -*** New customizable variable next-error-find-buffer-function -defines the logic of finding a next-error capable buffer. -It has an option to use a single such buffer on selected frame, or -by default use the last buffer that navigated to the current buffer. -You can use next-error-select-buffer to set any other next-error -capable buffer as the last used. +*** New customizable variable 'next-error-find-buffer-function'. +This variable defines the logic of finding a next-error capable +buffer. It has an option to use a single such buffer on selected +frame, or by default use the last buffer that navigated to the current +buffer. You can use 'next-error-select-buffer' to set any other +next-error capable buffer as the last used. ** nxml-mode commit 5de608f3edb54b4f8d9774e159d0fa99484d3ac8 Author: Eli Zaretskii Date: Fri Apr 20 10:18:06 2018 +0300 Update the documentation of 'perform-replace' * doc/lispref/searching.texi (Search and Replace): Update the documentation of 'perform-replace'. diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index e759967aa8..fca877117d 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -1751,13 +1751,14 @@ of matching @var{regexp} against a substring of @var{string}. If you want to write a command along the lines of @code{query-replace}, you can use @code{perform-replace} to do the work. -@defun perform-replace from-string replacements query-flag regexp-flag delimited-flag &optional repeat-count map start end +@defun perform-replace from-string replacements query-flag regexp-flag delimited-flag &optional repeat-count map start end backward region-noncontiguous-p This function is the guts of @code{query-replace} and related commands. It searches for occurrences of @var{from-string} in the text between positions @var{start} and @var{end} and replaces some or all of them. If @var{start} is @code{nil} (or omitted), point is used instead, and the end of the buffer's accessible portion is used for -@var{end}. +@var{end}. (If the optional argument @var{backward} is +non-@code{nil}, the search starts at @var{end} and goes backward.) If @var{query-flag} is @code{nil}, it replaces all occurrences; otherwise, it asks the user what to do about each one. @@ -1789,6 +1790,11 @@ user responses for queries. The argument @var{map}, if non-@code{nil}, specifies a keymap to use instead of @code{query-replace-map}. +Non-@code{nil} @var{region-noncontiguous-p} means that the region +between @var{start} and @var{end} is composed of noncontiguous pieces. +The most common example of this is a rectangular region, where the +pieces are separated by newline characters. + This function uses one of two functions to search for the next occurrence of @var{from-string}. These functions are specified by the values of two variables: @code{replace-re-search-function} and commit 06245b625e2b8f42126a93390bd9b8946e09b03e Author: Martin Rudalics Date: Fri Apr 20 08:12:10 2018 +0200 * etc/NEWS: Another fix for the last change (noted by Juri Linkov) diff --git a/etc/NEWS b/etc/NEWS index 122eebdd1d..65a7210f5e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1278,13 +1278,13 @@ passphrases, but it was also removed from other pinentry programs as the attack is unrealistic on modern computer systems which don't utilize swap memory usually. -** The function 'display-⁠buffer-⁠in-⁠major-⁠side-⁠window' no longer exists. +** The function 'display-buffer-in-major-side-window' no longer exists. It has been renamed as internal function 'window--make-major-side-window', -however applications should instead call 'display-⁠buffer-⁠in-⁠side-⁠window' +however applications should instead call 'display-buffer-in-side-window' (passing the SIDE and SLOT parameters as elements of ALIST). This approach -is backwards-⁠compatible with versions of Emacs in which the old function -exists. See the node "(elisp) Displaying Buffers in Side Windows" -in the ELisp manual for more details. +is backwards-compatible with versions of Emacs in which the old function +exists. See the node "Displaying Buffers in Side Windows" in the ELisp +manual for more details. * Lisp Changes in Emacs 26.1 commit 811e4d48597800610d89c271263f97267801933c Author: Glenn Morris Date: Thu Apr 19 21:18:24 2018 -0400 * lisp/url/url-util.el (puny-encode-domain): Autoload it. diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index b206448480..51c5624969 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el @@ -627,6 +627,7 @@ Creates FILE and its parent directories if they do not exist." (error "Danger: `%s' is a symbolic link" file)) (set-file-modes file #o0600)))) +(autoload 'puny-encode-domain "puny") (autoload 'dns-query "dns") (defvar url--domain-cache (make-hash-table :test 'equal :size 17) commit 721508eafce67e86046db6032402b1139d5fb18f Author: Juri Linkov Date: Fri Apr 20 00:11:55 2018 +0300 Mention next-error-select-buffer in etc/NEWS diff --git a/etc/NEWS b/etc/NEWS index d402401619..26dfe1555d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -351,7 +351,8 @@ are evaluated lazily. defines the logic of finding a next-error capable buffer. It has an option to use a single such buffer on selected frame, or by default use the last buffer that navigated to the current buffer. - +You can use next-error-select-buffer to set any other next-error +capable buffer as the last used. ** nxml-mode commit 5a45a6bfe06afbe0e76544acec02b694611c777f Author: Alan Mackenzie Date: Thu Apr 19 20:42:17 2018 +0000 Amend c-colon-type-list-re also to handle compound identifiers * lisp/progmodes/cc-langs.el (c-colon-type-list-re): Amend to recognize and skip over "::" in C++ and "." in Java. diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 8671e18e2d..4a7c79a6df 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -2461,7 +2461,11 @@ regexp if `c-colon-type-list-kwds' isn't nil." ;; before the ":" that starts the inherit list after "class" ;; or "struct" in C++. (Also used as default for other ;; languages.) - "[^][{}();,/#=:]*:")) + (if (c-lang-const c-opt-identifier-concat-key) + (concat "\\([^][{}();,/#=:]\\|" + (c-lang-const c-opt-identifier-concat-key) + "\\)*:") + "[^][{}();,/#=:]*:"))) (c-lang-defvar c-colon-type-list-re (c-lang-const c-colon-type-list-re)) (c-lang-defconst c-paren-nontype-kwds commit 99de04e6a84dbc93aab479666af126c8fb109b95 Author: Juri Linkov Date: Thu Apr 19 23:30:46 2018 +0300 Use text properties to save search parameters. (Bug#22479) * lisp/isearch.el (isearch-update-ring): Call isearch-string-propertize. Delete duplicates with possibly different text properties. (isearch-string-propertize) (isearch-update-from-string-properties): New functions. (with-isearch-suspended, isearch-ring-adjust1): Call isearch-update-from-string-properties. (isearch-edit-string): Let-bind minibuffer-allow-text-properties to t. (isearch-query-replace): Use propertized isearch-string. (isearch--lax-regexp-function-p): Simplify. * lisp/replace.el (query-replace-descr): Rewrite to keep text properties non-destructively in the replacement string. (query-replace--split-string): Don't remove text properties by substring-no-properties. (query-replace-read-args): Try to get isearch-regexp-function from text-properties. (perform-replace): Display parameters in the replacement message. * lisp/desktop.el (desktop--v2s): Check if text properties are unreadable. (Bug#30786) diff --git a/lisp/desktop.el b/lisp/desktop.el index 55ec71c1b9..3e1ba200b5 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -841,10 +841,12 @@ QUOTE may be `may' (value may be quoted), ((or (numberp value) (null value) (eq t value) (keywordp value)) (cons 'may value)) ((stringp value) - (let ((copy (copy-sequence value))) - (set-text-properties 0 (length copy) nil copy) - ;; Get rid of text properties because we cannot read them. - (cons 'may copy))) + ;; Get rid of unreadable text properties. + (if (condition-case nil (read (format "%S" value)) (error nil)) + (cons 'may value) + (let ((copy (copy-sequence value))) + (set-text-properties 0 (length copy) nil copy) + (cons 'may copy)))) ((symbolp value) (cons 'must value)) ((vectorp value) diff --git a/lisp/isearch.el b/lisp/isearch.el index e0066942f9..85193738c6 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1126,10 +1126,29 @@ NOPUSH is t and EDIT is t." (defun isearch-update-ring (string &optional regexp) "Add STRING to the beginning of the search ring. REGEXP if non-nil says use the regexp search ring." - (add-to-history - (if regexp 'regexp-search-ring 'search-ring) - string - (if regexp regexp-search-ring-max search-ring-max))) + (let ((history-delete-duplicates t)) + (add-to-history + (if regexp 'regexp-search-ring 'search-ring) + (isearch-string-propertize string) + (if regexp regexp-search-ring-max search-ring-max) + t))) + +(defun isearch-string-propertize (string &optional properties) + "Add isearch properties to the isearch string." + (unless properties + (setq properties `(isearch-case-fold-search ,isearch-case-fold-search)) + (unless isearch-regexp + (setq properties (append properties `(isearch-regexp-function ,isearch-regexp-function))))) + (apply 'propertize string properties)) + +(defun isearch-update-from-string-properties (string) + "Update isearch properties from the isearch string" + (when (memq 'isearch-case-fold-search (text-properties-at 0 string)) + (setq isearch-case-fold-search + (get-text-property 0 'isearch-case-fold-search string))) + (when (memq 'isearch-regexp-function (text-properties-at 0 string)) + (setq isearch-regexp-function + (get-text-property 0 'isearch-regexp-function string)))) ;; The search status structure and stack. @@ -1335,6 +1354,8 @@ You can update the global isearch variables by setting new values to multi-isearch-file-list multi-isearch-file-list-new multi-isearch-buffer-list multi-isearch-buffer-list-new) + (isearch-update-from-string-properties isearch-string) + ;; Restore the minibuffer message before moving point. (funcall (or isearch-message-function #'isearch-message) nil t) @@ -1401,7 +1422,9 @@ The following additional command keys are active while editing. (history-add-new-input nil) ;; Binding minibuffer-history-symbol to nil is a work-around ;; for some incompatibility with gmhist. - (minibuffer-history-symbol)) + (minibuffer-history-symbol) + ;; Search string might have meta information on text properties. + (minibuffer-allow-text-properties t)) (setq isearch-new-string (read-from-minibuffer (isearch-message-prefix nil isearch-nonincremental) @@ -1826,7 +1849,9 @@ replacements from Isearch is `M-s w ... M-%'." ;; `exit-recursive-edit' in `isearch-done' that terminates ;; the execution of this command when it is non-nil. ;; We call `exit-recursive-edit' explicitly at the end below. - (isearch-recursive-edit nil)) + (isearch-recursive-edit nil) + (isearch-string-propertized + (isearch-string-propertize isearch-string))) (isearch-done nil t) (isearch-clean-overlays) (if (and isearch-other-end @@ -1839,12 +1864,12 @@ replacements from Isearch is `M-s w ... M-%'." (< (mark) (point)))))) (goto-char isearch-other-end)) (set query-replace-from-history-variable - (cons isearch-string + (cons isearch-string-propertized (symbol-value query-replace-from-history-variable))) (perform-replace - isearch-string + isearch-string-propertized (query-replace-read-to - isearch-string + isearch-string-propertized (concat "Query replace" (isearch--describe-regexp-mode (or delimited isearch-regexp-function) t) (if backward " backward" "") @@ -2552,7 +2577,8 @@ Search is updated accordingly." length))) (setq isearch-string (nth yank-pointer ring) isearch-message (mapconcat 'isearch-text-char-description - isearch-string ""))))) + isearch-string "")) + (isearch-update-from-string-properties isearch-string)))) (defun isearch-ring-adjust (advance) ;; Helper for isearch-ring-advance and isearch-ring-retreat @@ -2768,11 +2794,8 @@ Can be changed via `isearch-search-fun-function' for special needs." (defun isearch--lax-regexp-function-p () "Non-nil if next regexp-function call should be lax." - (not (or isearch-nonincremental - (null (car isearch-cmds)) - (eq (length isearch-string) - (length (isearch--state-string - (car isearch-cmds))))))) + (or (memq this-command '(isearch-printing-char isearch-del-char)) + isearch-yank-flag)) (defun isearch-search-fun-default () "Return default functions to use for the search." diff --git a/lisp/replace.el b/lisp/replace.el index 7f3541d773..0e72339034 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -147,15 +147,26 @@ is highlighted lazily using isearch lazy highlighting (see See `replace-regexp' and `query-replace-regexp-eval'.") (defun query-replace-descr (string) - (mapconcat 'isearch-text-char-description string "")) + (setq string (copy-sequence string)) + (dotimes (i (length string) string) + (let ((c (aref string i))) + (cond + ((< c ?\s) (add-text-properties + i (1+ i) + `(display ,(propertize (format "^%c" (+ c 64)) 'face 'escape-glyph)) + string)) + ((= c ?\^?) (add-text-properties + i (1+ i) + `(display ,(propertize "^?" 'face 'escape-glyph)) + string)))))) (defun query-replace--split-string (string) "Split string STRING at a substring with property `separator'." (let* ((length (length string)) (split-pos (text-property-any 0 length 'separator t string))) (if (not split-pos) - (substring-no-properties string) - (cons (substring-no-properties string 0 split-pos) + string + (cons (substring string 0 split-pos) (substring-no-properties string (or (text-property-not-all (1+ split-pos) length 'separator t string) @@ -301,7 +312,9 @@ the original string if not." (to (if (consp from) (prog1 (cdr from) (setq from (car from))) (query-replace-read-to from prompt regexp-flag)))) (list from to - (and current-prefix-arg (not (eq current-prefix-arg '-))) + (or (and current-prefix-arg (not (eq current-prefix-arg '-))) + (and (memq 'isearch-regexp-function (text-properties-at 0 from)) + (get-text-property 0 'isearch-regexp-function from))) (and current-prefix-arg (eq current-prefix-arg '-))))) (defun query-replace (from-string to-string &optional delimited start end backward region-noncontiguous-p) @@ -2379,8 +2392,17 @@ characters." (message (if query-flag (apply 'propertize - (substitute-command-keys - "Query replacing %s with %s: (\\\\[help] for help) ") + (concat "Query replacing " + (if backward "backward " "") + (if delimited-flag + (or (and (symbolp delimited-flag) + (get delimited-flag + 'isearch-message-prefix)) + "word ") "") + (if regexp-flag "regexp " "") + "%s with %s: " + (substitute-command-keys + "(\\\\[help] for help) ")) minibuffer-prompt-properties)))) ;; Unless a single contiguous chunk is selected, operate on multiple chunks. @@ -2598,13 +2620,13 @@ characters." (with-output-to-temp-buffer "*Help*" (princ (concat "Query replacing " + (if backward "backward " "") (if delimited-flag (or (and (symbolp delimited-flag) (get delimited-flag 'isearch-message-prefix)) "word ") "") (if regexp-flag "regexp " "") - (if backward "backward " "") from-string " with " next-replacement ".\n\n" (substitute-command-keys commit 54f60fcad198be5f39fead6f4d453cea0942322a Author: Juri Linkov Date: Thu Apr 19 22:45:08 2018 +0300 * lisp/isearch.el (isearch-mode-map): Restore advertised bindings. Remove obsolete comments and code. * lisp/replace.el (occur-find-match): Use user-error instead of error. (Bug#14912) diff --git a/lisp/isearch.el b/lisp/isearch.el index 15a15436f7..e0066942f9 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -525,6 +525,8 @@ This is like `describe-bindings', but displays only Isearch keys." (define-key map "\M-r" 'isearch-toggle-regexp) (define-key map "\M-e" 'isearch-edit-string) + (put 'isearch-toggle-case-fold :advertised-binding "\M-sc") + (put 'isearch-toggle-regexp :advertised-binding "\M-sr") (put 'isearch-edit-string :advertised-binding "\M-se") (define-key map "\M-se" 'isearch-edit-string) @@ -1129,15 +1131,6 @@ REGEXP if non-nil says use the regexp search ring." string (if regexp regexp-search-ring-max search-ring-max))) -;; Switching buffers should first terminate isearch-mode. -;; ;; For Emacs 19, the frame switch event is handled. -;; (defun isearch-switch-frame-handler () -;; (interactive) ;; Is this necessary? -;; ;; First terminate isearch-mode. -;; (isearch-done) -;; (isearch-clean-overlays) -;; (handle-switch-frame (car (cdr last-command-event)))) - ;; The search status structure and stack. @@ -1577,7 +1570,6 @@ Turning on word search turns off regexp mode.") Turning on symbol search turns off regexp mode.") (isearch-define-mode-toggle char-fold "'" char-fold-to-regexp "\ Turning on character-folding turns off regexp mode.") -(put 'char-fold-to-regexp 'isearch-message-prefix "char-fold ") (isearch-define-mode-toggle regexp "r" nil nil (setq isearch-regexp (not isearch-regexp)) @@ -1776,8 +1768,6 @@ the beginning or the end of the string need not match a symbol boundary." (if (string-match-p (format "%s\\'" not-word-symbol-re) string) not-word-symbol-re (unless lax "\\_>"))))))) -(put 'isearch-symbol-regexp 'isearch-message-prefix "symbol ") - ;; Search with lax whitespace (defun search-forward-lax-whitespace (string &optional bound noerror count) @@ -2938,8 +2928,6 @@ Optional third argument, if t, means if fail just return nil (no error). (funcall (overlay-get ov 'isearch-open-invisible-temporary) ov nil) ;; Store the values for the `invisible' property, and then set it to nil. ;; This way the text hidden by this overlay becomes visible. - - ;; In 19.34 this does not exist so I cannot test it. (overlay-put ov 'isearch-invisible (overlay-get ov 'invisible)) (overlay-put ov 'invisible nil))) diff --git a/lisp/replace.el b/lisp/replace.el index ebdf99d6eb..7f3541d773 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1258,7 +1258,7 @@ To return to ordinary Occur mode, use \\[occur-cease-edit]." (setq r (funcall search r 'occur-match))) (if r (goto-char r) - (error message)) + (user-error message)) (setq n (1- n))))) (defun occur-next (&optional n) commit 75a32f48745a647755821a0d9ae09272286b36ef Author: Drew Adams Date: Thu Apr 19 22:36:23 2018 +0300 Add REGION-NONCONTIGUOUS-P arg to other replace.el commands * lisp/replace.el (query-replace, query-replace-regexp): Doc fix. (query-replace-regexp-eval, map-query-replace-regexp) (replace-string, replace-regexp): Add REGION-NONCONTIGUOUS-P arg. (perform-replace): Doc fix. (Bug#27897) diff --git a/lisp/replace.el b/lisp/replace.el index 058e14452d..ebdf99d6eb 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -345,6 +345,9 @@ character strings. Fourth and fifth arg START and END specify the region to operate on. +Arguments FROM-STRING, TO-STRING, DELIMITED, START, END, BACKWARD, and +REGION-NONCONTIGUOUS-P are passed to `perform-replace' (which see). + To customize possible responses, change the bindings in `query-replace-map'." (interactive (let ((common @@ -427,7 +430,10 @@ to terminate it. One space there, if any, will be discarded. When using those Lisp features interactively in the replacement text, TO-STRING is actually made a list instead of a string. -Use \\[repeat-complex-command] after this command for details." +Use \\[repeat-complex-command] after this command for details. + +Arguments REGEXP, TO-STRING, DELIMITED, START, END, BACKWARD, and +REGION-NONCONTIGUOUS-P are passed to `perform-replace' (which see)." (interactive (let ((common (query-replace-read-args @@ -450,7 +456,7 @@ Use \\[repeat-complex-command] after this command for details." (define-key esc-map [?\C-%] 'query-replace-regexp) -(defun query-replace-regexp-eval (regexp to-expr &optional delimited start end) +(defun query-replace-regexp-eval (regexp to-expr &optional delimited start end region-noncontiguous-p) "Replace some things after point matching REGEXP with the result of TO-EXPR. Interactive use of this function is deprecated in favor of the @@ -496,7 +502,10 @@ This function is not affected by `replace-char-fold'. Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace only matches that are surrounded by word boundaries. -Fourth and fifth arg START and END specify the region to operate on." +Fourth and fifth arg START and END specify the region to operate on. + +Arguments REGEXP, DELIMITED, START, END, and REGION-NONCONTIGUOUS-P +are passed to `perform-replace' (which see)." (declare (obsolete "use the `\\,' feature of `query-replace-regexp' for interactive calls, and `search-forward-regexp'/`replace-match' for Lisp calls." "22.1")) @@ -518,11 +527,12 @@ for Lisp calls." "22.1")) (replace-match-string-symbols to) (list from (car to) current-prefix-arg (if (use-region-p) (region-beginning)) - (if (use-region-p) (region-end)))))) + (if (use-region-p) (region-end)) + (if (use-region-p) (region-noncontiguous-p)))))) (perform-replace regexp (cons 'replace-eval-replacement to-expr) - t 'literal delimited nil nil start end)) + t 'literal delimited nil nil start end nil region-noncontiguous-p)) -(defun map-query-replace-regexp (regexp to-strings &optional n start end) +(defun map-query-replace-regexp (regexp to-strings &optional n start end region-noncontiguous-p) "Replace some matches for REGEXP with various strings, in rotation. The second argument TO-STRINGS contains the replacement strings, separated by spaces. This command works like `query-replace-regexp' except that @@ -542,7 +552,10 @@ that reads REGEXP. A prefix argument N says to use each replacement string N times before rotating to the next. -Fourth and fifth arg START and END specify the region to operate on." +Fourth and fifth arg START and END specify the region to operate on. + +Arguments REGEXP, START, END, and REGION-NONCONTIGUOUS-P are passed to +`perform-replace' (which see)." (interactive (let* ((from (read-regexp "Map query replace (regexp): " nil query-replace-from-history-variable)) @@ -555,7 +568,8 @@ Fourth and fifth arg START and END specify the region to operate on." (and current-prefix-arg (prefix-numeric-value current-prefix-arg)) (if (use-region-p) (region-beginning)) - (if (use-region-p) (region-end))))) + (if (use-region-p) (region-end)) + (if (use-region-p) (region-noncontiguous-p))))) (let (replacements) (if (listp to-strings) (setq replacements to-strings) @@ -569,9 +583,9 @@ Fourth and fifth arg START and END specify the region to operate on." (1+ (string-match " " to-strings)))) (setq replacements (append replacements (list to-strings)) to-strings "")))) - (perform-replace regexp replacements t t nil n nil start end))) + (perform-replace regexp replacements t t nil n nil start end nil region-noncontiguous-p))) -(defun replace-string (from-string to-string &optional delimited start end backward) +(defun replace-string (from-string to-string &optional delimited start end backward region-noncontiguous-p) "Replace occurrences of FROM-STRING with TO-STRING. Preserve case in each match if `case-replace' and `case-fold-search' are non-nil and FROM-STRING has no uppercase letters. @@ -625,10 +639,11 @@ and TO-STRING is also null.)" (list (nth 0 common) (nth 1 common) (nth 2 common) (if (use-region-p) (region-beginning)) (if (use-region-p) (region-end)) - (nth 3 common)))) - (perform-replace from-string to-string nil nil delimited nil nil start end backward)) + (nth 3 common) + (if (use-region-p) (region-noncontiguous-p))))) + (perform-replace from-string to-string nil nil delimited nil nil start end backward region-noncontiguous-p)) -(defun replace-regexp (regexp to-string &optional delimited start end backward) +(defun replace-regexp (regexp to-string &optional delimited start end backward region-noncontiguous-p) "Replace things after point matching REGEXP with TO-STRING. Preserve case in each match if `case-replace' and `case-fold-search' are non-nil and REGEXP has no uppercase letters. @@ -701,8 +716,9 @@ which will run faster and will not set the mark or print anything." (list (nth 0 common) (nth 1 common) (nth 2 common) (if (use-region-p) (region-beginning)) (if (use-region-p) (region-end)) - (nth 3 common)))) - (perform-replace regexp to-string nil t delimited nil nil start end backward)) + (nth 3 common) + (if (use-region-p) (region-noncontiguous-p))))) + (perform-replace regexp to-string nil t delimited nil nil start end backward region-noncontiguous-p)) (defvar regexp-history nil @@ -2313,7 +2329,12 @@ REPLACEMENTS is either a string, a list of strings, or a cons cell containing a function and its first argument. The function is called to generate each replacement like this: (funcall (car replacements) (cdr replacements) replace-count) -It must return a string." +It must return a string. + +Non-nil REGION-NONCONTIGUOUS-P means that the region is composed of +noncontiguous pieces. The most common example of this is a +rectangular region, where the pieces are separated by newline +characters." (or map (setq map query-replace-map)) (and query-flag minibuffer-auto-raise (raise-frame (window-frame (minibuffer-window)))) commit 4fe8e8ba41bf994d36926fce4b566a7a27ce591b Author: Glenn Morris Date: Thu Apr 19 13:09:24 2018 -0400 * lisp/emacs-lisp/autoload.el (autoload--make-defs-autoload): Sort definition-prefixes, for stability. diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 5274ec880c..c458e7b1cb 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -607,7 +607,8 @@ Don't try to split prefixes that are already longer than that.") nil)))) prefixes))) `(if (fboundp 'register-definition-prefixes) - (register-definition-prefixes ,file ',(delq nil strings))))))) + (register-definition-prefixes ,file ',(sort (delq nil strings) + 'string<))))))) (defun autoload--setup-output (otherbuf outbuf absfile load-name) (let ((outbuf commit 8f6293ca789edf06ea8e7b4b80edf7558d590ca7 Author: Eli Zaretskii Date: Thu Apr 19 12:21:06 2018 +0300 Fix use of @key in Texinfo manuals * doc/misc/efaq-w32.texi (Location of init file): * doc/misc/org.texi (Editing source code, Export settings) (Closing items, Drawers, Structure editing): * doc/misc/gnus.texi (Spam and Ham Processors, Terminology): * doc/misc/calc.texi (Keypad Functions Menu, Keypad Binary Menu) (Keypad Vectors Menu, Keypad Main Menu, Basic Arithmetic) (Symbolic Mode): * doc/misc/sc.texi (Electric References): * doc/misc/info.texi (Help-^L): * doc/misc/reftex.texi (Reference Styles): * doc/misc/idlwave.texi (Troubleshooting, Examining Variables) (Lesson III---User Catalog, Using the Shell): * doc/misc/eshell.texi (Bugs and ideas): * doc/misc/ada-mode.texi (Automatic Casing): * doc/misc/ediff.texi (Selective Browsing): * doc/misc/vip.texi (Customizing Constants): * doc/misc/pcl-cvs.texi (Selected files): * doc/misc/efaq.texi (Replying to the sender of a message) (Basic keys, No Meta key, Matching parentheses) (Origin of the term Emacs, Installing Texinfo documentation) (Learning how to do something, Emacs manual, Extended commands): * doc/misc/viper.texi (Rudimentary Changes): * doc/misc/tramp.texi (Frequently Asked Questions): * doc/emacs/kmacro.texi (Basic Keyboard Macro): * doc/emacs/frames.texi (Frame Commands): * doc/emacs/msdos.texi (Windows Keyboard): * doc/emacs/search.texi (Query Replace): * doc/lispintro/emacs-lisp-intro.texi (Keybindings) (Note for Novices): * doc/lispref/tips.texi (Key Binding Conventions): Fix use of @key. For the details, see http://lists.gnu.org/archive/html/emacs-devel/2018-04/msg00390.html. diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 11611e7351..9f4c7821e9 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -485,7 +485,7 @@ Delete all frames on the current terminal, except the selected one. Toggle the maximization state of the current frame. When a frame is maximized, it fills the screen. -@item @key{F11>} +@item @key{F11} @kindex F11 @findex toggle-frame-fullscreen Toggle full-screen mode for the current frame. (The difference diff --git a/doc/emacs/kmacro.texi b/doc/emacs/kmacro.texi index 8528c9f6bd..dac41fdb87 100644 --- a/doc/emacs/kmacro.texi +++ b/doc/emacs/kmacro.texi @@ -157,7 +157,7 @@ definition, type @kbd{C-x )} (@code{kmacro-end-macro}). To execute the most recent macro, type @kbd{C-x e} (@code{kmacro-end-and-call-macro}). If you enter @kbd{C-x e} while defining a macro, the macro is terminated and executed immediately. -Immediately after typing @kbd{C-x e}, you can type @key{e} repeatedly +Immediately after typing @kbd{C-x e}, you can type @kbd{e} repeatedly to immediately repeat the macro one or more times. You can also give @kbd{C-x e} a repeat argument, just like @key{F4} (when it is used to execute a macro). diff --git a/doc/emacs/msdos.texi b/doc/emacs/msdos.texi index 9353f4b6e8..b1846919b6 100644 --- a/doc/emacs/msdos.texi +++ b/doc/emacs/msdos.texi @@ -597,7 +597,7 @@ search string against previously sought strings during incremental search. @code{(w32-register-hot-key [s-])} with @code{w32-lwindow-modifier} bound to @code{super} disables all the Windows' own Windows key based shortcuts.@footnote{There is one known -exception: The combination @kbd{@key{Windows}-@key{L}} that locks the +exception: The combination @kbd{@key{Windows}-L} that locks the workstation is handled by the system on a lower level. For this reason, @code{w32-register-hot-key} cannot override this key combination - it always locks the computer.} @@ -607,9 +607,9 @@ combination - it always locks the computer.} call. Thus, you can set @code{w32-lwindow-modifier} as @code{super}, then call @code{(w32-register-hot-key [s-r])}, and finally set @code{w32-rwindow-modifier} as @code{super} as well. The result is -that the left Windows key together with @key{R} invokes whichever +that the left Windows key together with @kbd{R} invokes whichever function you have bound for the combination in Emacs, and the right -Windows key and @key{R} opens the Windows @code{Run} dialog. +Windows key and @kbd{R} opens the Windows @code{Run} dialog. The hotkey registrations always also include all the shift and control modifier combinations for the given hotkey; that is, diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index 723bdf1ad8..053603e54f 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -1654,7 +1654,7 @@ specify what to do with this occurrence. @item Y @r{(Upper-case)} to replace all remaining occurrences in all remaining buffers in -multi-buffer replacements (like the Dired @key{Q} command that performs +multi-buffer replacements (like the Dired @kbd{Q} command that performs query replace on selected files). It answers this question and all subsequent questions in the series with ``yes'', without further user interaction. diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index b79432e719..ebc4c7f009 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -914,17 +914,17 @@ the command in parentheses, like this: @kbd{M-C-\} @kbd{M-C-\}. (You can, if you wish, change the keys that are typed to invoke the command; this is called @dfn{rebinding}. @xref{Keymaps, , Keymaps}.) The abbreviation @kbd{M-C-\} means that you type your -@key{META} key, @key{CTRL} key and @key{\} key all at the same time. +@key{META} key, @key{CTRL} key and @kbd{\} key all at the same time. (On many modern keyboards the @key{META} key is labeled @key{ALT}.) Sometimes a combination like this is called a keychord, since it is similar to the way you play a chord on a piano. If your keyboard does not have a @key{META} key, the @key{ESC} key prefix is used in place of it. In this case, @kbd{M-C-\} means that you press and release your -@key{ESC} key and then type the @key{CTRL} key and the @key{\} key at +@key{ESC} key and then type the @key{CTRL} key and the @kbd{\} key at the same time. But usually @kbd{M-C-\} means press the @key{CTRL} key along with the key that is labeled @key{ALT} and, at the same time, -press the @key{\} key. +press the @kbd{\} key. In addition to typing a lone keychord, you can prefix what you type with @kbd{C-u}, which is called the @dfn{universal argument}. The @@ -17109,8 +17109,8 @@ This also shows how to set a key globally, for all modes. The command is @code{global-set-key}. It is followed by the keybinding. In a @file{.emacs} file, the keybinding is written as shown: @code{\C-c} stands for Control-C, which means to press the -control key and the @key{c} key at the same time. The @code{w} means -to press the @key{w} key. The keybinding is surrounded by double +control key and the @kbd{c} key at the same time. The @code{w} means +to press the @kbd{w} key. The keybinding is surrounded by double quotation marks. In documentation, you would write this as @w{@kbd{C-c w}}. (If you were binding a @key{META} key, such as @kbd{M-c}, rather than a @key{CTRL} key, you would write diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index c62cfcfa8f..08cc10da14 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi @@ -316,7 +316,7 @@ any context prevents recognition of escape sequences as function keys in that context. @item -Similarly, don't bind a key sequence ending in @key{C-g}, since that +Similarly, don't bind a key sequence ending in @kbd{C-g}, since that is commonly used to cancel a key sequence. @item diff --git a/doc/misc/ada-mode.texi b/doc/misc/ada-mode.texi index 4a4dbd56a9..ca6214527c 100644 --- a/doc/misc/ada-mode.texi +++ b/doc/misc/ada-mode.texi @@ -1356,7 +1356,7 @@ specified by the variable @code{ada-case-exception-file} specifies the casing of one word or word fragment. Comments may be included, separated from the word by a space. -If the word starts with an asterisk (@key{*}), it defines the casing +If the word starts with an asterisk (@samp{*}), it defines the casing as a word fragment (or ``substring''); part of a word between two underscores or word boundary. diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 0c8c2db493..b1b38620ff 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -12422,7 +12422,7 @@ Calculations are normally performed numerically wherever possible. For example, the @code{calc-sqrt} command, or @code{sqrt} function in an algebraic expression, produces a numeric answer if the argument is a number or a symbolic expression if the argument is an expression: -@kbd{2 Q} pushes 1.4142 but @kbd{@key{'} x+1 @key{RET} Q} pushes @samp{sqrt(x+1)}. +@kbd{2 Q} pushes 1.4142 but @kbd{' x+1 @key{RET} Q} pushes @samp{sqrt(x+1)}. @kindex m s @pindex calc-symbolic-mode @@ -16338,7 +16338,7 @@ computes an Nth root: @kbd{125 @key{RET} 3 I ^} computes the number 5. @tindex \ The @kbd{\} (@code{calc-idiv}) command divides two numbers on the stack to produce an integer result. It is equivalent to dividing with -@key{/}, then rounding down with @kbd{F} (@code{calc-floor}), only a bit +@kbd{/}, then rounding down with @kbd{F} (@code{calc-floor}), only a bit more convenient and efficient. Also, since it is an all-integer operation when the arguments are integers, it avoids problems that @kbd{/ F} would have with floating-point roundoff. @@ -30289,7 +30289,7 @@ is the same as @key{CONJ}. @item INV * is the same as @key{y^x}. @item INV / -is the same as @key{INV y^x} (the @expr{x}th root of @expr{y}). +is the same as @kbd{INV y^x} (the @expr{x}th root of @expr{y}). @item HYP/INV 1 are the same as @key{SIN} / @kbd{INV SIN}. @item HYP/INV 2 @@ -30366,9 +30366,9 @@ number. (@xref{Random Numbers}.) @key{RAGN} is the ``random again'' command; it computes another random number using the same limit as last time. -@key{INV GCD} computes the LCM (least common multiple) function. +@kbd{INV GCD} computes the LCM (least common multiple) function. -@key{INV FACT} is the gamma function. +@kbd{INV FACT} is the gamma function. @texline @math{\Gamma(x) = (x-1)!}. @infoline @expr{gamma(x) = (x-1)!}. @@ -30396,14 +30396,14 @@ finds the previous prime. @noindent The keys in this menu perform operations on binary integers. Note that both logical and arithmetic right-shifts are provided. -@key{INV LSH} rotates one bit to the left. +@kbd{INV LSH} rotates one bit to the left. -The ``difference'' function (normally on @kbd{b d}) is on @key{INV AND}. -The ``clip'' function (normally on @w{@kbd{b c}}) is on @key{INV NOT}. +The ``difference'' function (normally on @kbd{b d}) is on @kbd{INV AND}. +The ``clip'' function (normally on @w{@kbd{b c}}) is on @kbd{INV NOT}. The @key{DEC}, @key{HEX}, @key{OCT}, and @key{BIN} keys select the current radix for display and entry of numbers: Decimal, hexadecimal, -octal, or binary. The six letter keys @key{A} through @key{F} are used +octal, or binary. The six letter keys @kbd{A} through @kbd{F} are used for entering hexadecimal numbers. The @key{WSIZ} key displays the current word size for binary operations @@ -30461,13 +30461,13 @@ equivalent to @kbd{u +} in normal Calc (@pxref{Statistical Operations}). @key{PROD} computes the product of the elements of a vector, and @key{MAX} computes the maximum of all the elements of a vector. -@key{INV SUM} computes the alternating sum of the first element +@kbd{INV SUM} computes the alternating sum of the first element minus the second, plus the third, minus the fourth, and so on. -@key{INV MAX} computes the minimum of the vector elements. +@kbd{INV MAX} computes the minimum of the vector elements. -@key{HYP SUM} computes the mean of the vector elements. -@key{HYP PROD} computes the sample standard deviation. -@key{HYP MAX} computes the median. +@kbd{HYP SUM} computes the mean of the vector elements. +@kbd{HYP PROD} computes the sample standard deviation. +@kbd{HYP MAX} computes the median. @key{MAP*} multiplies two vectors elementwise. It is equivalent to the @kbd{V M *} command. @key{MAP^} computes powers elementwise. diff --git a/doc/misc/ediff.texi b/doc/misc/ediff.texi index 8ffa90fb5b..746c4c829d 100644 --- a/doc/misc/ediff.texi +++ b/doc/misc/ediff.texi @@ -1557,7 +1557,7 @@ selective browsing. To change the default Ediff function, add a function to @strong{Useful hint}: To specify a regexp that matches everything, don't simply type @key{RET} in response to a prompt. Typing @key{RET} tells Ediff to accept the default value, which may not be what you want. Instead, you -should enter something like @key{^} or @key{$}. These match every +should enter something like @kbd{^} or @kbd{$}. These match every line. You can use the status command, @kbd{i}, to find out whether diff --git a/doc/misc/efaq-w32.texi b/doc/misc/efaq-w32.texi index a4e82e2d92..e18bb739f8 100644 --- a/doc/misc/efaq-w32.texi +++ b/doc/misc/efaq-w32.texi @@ -398,7 +398,7 @@ of which varies according to Windows version and whether the computer is part of a domain. @end enumerate -Within Emacs, @key{~} at the beginning of a file name is expanded to your +Within Emacs, @kbd{~} at the beginning of a file name is expanded to your @env{HOME} directory, so you can always find your @file{.emacs} file by typing the command @kbd{C-x C-f ~/.emacs}. diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index e0dfc8936d..f6a5b4d8db 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -134,14 +134,14 @@ used in the FAQ. @itemize @bullet @item -@kbd{C-x}: press the @key{x} key while holding down the @key{Control} key +@kbd{C-x}: press the @kbd{x} key while holding down the @key{Control} key @item -@kbd{M-x}: press the @key{x} key while holding down the @key{Meta} key +@kbd{M-x}: press the @kbd{x} key while holding down the @key{Meta} key (if your computer doesn't have a @key{Meta} key, @pxref{No Meta key}) @item -@kbd{M-C-x}: press the @key{x} key while holding down both @key{Control} +@kbd{M-C-x}: press the @kbd{x} key while holding down both @key{Control} and @key{Meta} @item @@ -181,10 +181,10 @@ Any real spaces in such a key sequence should be ignored; only @key{SPC} really means press the space key. The @acronym{ASCII} code sent by @kbd{C-x} (except for @kbd{C-?}) is the value -that would be sent by pressing just @key{x} minus 96 (or 64 for -upper-case @key{X}) and will be from 0 to 31. On Unix and GNU/Linux +that would be sent by pressing just @kbd{x} minus 96 (or 64 for +upper-case @kbd{X}) and will be from 0 to 31. On Unix and GNU/Linux terminals, the @acronym{ASCII} code sent by @kbd{M-x} is the sum of 128 and the -@acronym{ASCII} code that would be sent by pressing just @key{x}. Essentially, +@acronym{ASCII} code that would be sent by pressing just @kbd{x}. Essentially, @key{Control} turns off bits 5 and 6 and @key{Meta} turns on bit 7@footnote{ DOS and Windows terminals don't set bit 7 when the @key{Meta} key is @@ -211,7 +211,7 @@ what @kbd{M-x} and @key{RET} mean.) @code{execute-extended-command}. This command allows you to run any Emacs command if you can remember the command's name. If you can't remember the command's name, you can type @key{TAB} and @key{SPC} for -completion, @key{?} for a list of possibilities, and @kbd{M-p} and +completion, @kbd{?} for a list of possibilities, and @kbd{M-p} and @kbd{M-n} (or up-arrow and down-arrow) to see previous commands entered. An Emacs @dfn{command} is an @dfn{interactive} Emacs function. @@ -235,7 +235,7 @@ read this manual node inside Emacs (assuming nothing is broken) by typing @kbd{C-h i m emacs @key{RET} m @var{topic} @key{RET}}. This invokes Info, the GNU hypertext documentation browser. If you don't -already know how to use Info, type @key{?} from within Info. +already know how to use Info, type @kbd{?} from within Info. If we refer to @var{topic}:@var{subtopic}, type @kbd{C-h i m emacs @key{RET} m @var{topic} @key{RET} m @var{subtopic} @key{RET}}. @@ -576,7 +576,7 @@ There are several methods for finding out how to do things in Emacs. @item The complete text of the Emacs manual is available via the Info hypertext reader. Type @kbd{C-h r} to display the manual in Info mode. -Typing @key{h} immediately after entering Info will provide a short +Typing @kbd{h} immediately after entering Info will provide a short tutorial on how to use it. @cindex Lookup a subject in a manual @@ -761,7 +761,7 @@ named @samp{Top} in that file. For example, to view an Info file named @end example Alternatively, you can feed a file name to the @code{Info-goto-node} -command (invoked by pressing @key{g} in Info mode) by typing the name +command (invoked by pressing @kbd{g} in Info mode) by typing the name of the file in parentheses, like this: @example @@ -946,7 +946,7 @@ status of its latest version. @cindex Original version of Emacs Emacs originally was an acronym for Editor MACroS@. RMS says he ``picked -the name Emacs because @key{E} was not in use as an abbreviation on ITS at +the name Emacs because @kbd{E} was not in use as an abbreviation on ITS at the time.'' The first Emacs was a set of macros written in 1976 at MIT by RMS for the editor TECO (Text Editor and COrrector, originally Tape Editor and COrrector) under ITS (the Incompatible Timesharing System) on @@ -2210,7 +2210,7 @@ and braces at the same time by modifying the syntax table.) @cindex Show matching paren as in @code{vi} @item -Here is some Emacs Lisp that will make the @key{%} key show the matching +Here is some Emacs Lisp that will make the @kbd{%} key show the matching parenthesis, like in @code{vi}. In addition, if the cursor isn't over a parenthesis, it simply inserts a % like normal. @@ -3963,8 +3963,8 @@ On many keyboards, the @key{Alt} key acts as @key{Meta}, so try it. Instead of typing @kbd{M-a}, you can type @kbd{@key{ESC} a}. In fact, Emacs converts @kbd{M-a} internally into @kbd{@key{ESC} a} anyway (depending on the value of @code{meta-prefix-char}). Note that you -press @key{Meta} and @key{a} together, but with @key{ESC}, you press -@key{ESC}, release it, and then press @key{a}. +press @key{Meta} and @kbd{a} together, but with @key{ESC}, you press +@key{ESC}, release it, and then press @kbd{a}. @node No Escape key @section What if I don't have an @key{Escape} key? @@ -4457,9 +4457,9 @@ these systems, you should configure @code{movemail} to use @code{flock}. @c isaacson@@seas.upenn.edu Ron Isaacson says: When you hit -@key{r} to reply in Rmail, by default it CCs all of the original +@kbd{r} to reply in Rmail, by default it CCs all of the original recipients (everyone on the original @samp{To} and @samp{CC} -lists). With a prefix argument (i.e., typing @kbd{C-u} before @key{r}), +lists). With a prefix argument (i.e., typing @kbd{C-u} before @kbd{r}), it replies only to the sender. However, going through the whole @kbd{C-u} business every time you want to reply is a pain. This is the best fix I've been able to come up with: diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 80077e5ccd..951a28f482 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -1204,7 +1204,7 @@ perform this on-thy-fly rewriting. @item Write an alias for @command{less} that brings up a @code{view-mode} buffer -Such that the user can press @key{SPC} and @key{DEL}, and then @key{q} +Such that the user can press @key{SPC} and @key{DEL}, and then @kbd{q} to return to Eshell. It would be equivalent to: @samp{X > #; view-buffer #}. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index a166b33a13..6271cd6601 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -24548,7 +24548,7 @@ determined by either the @code{ham-process-destination} group parameter or a match in the @code{gnus-ham-process-destinations} variable, which is a list of regular expressions matched with group names (it's easiest to customize this variable with @kbd{M-x -customize-variable @key{@key{RET}} gnus-ham-process-destinations}). Each +customize-variable @key{RET} gnus-ham-process-destinations}). Each group name list is a standard Lisp list, if you prefer to customize the variable manually. If the @code{ham-process-destination} parameter is not set, ham articles are left in place. If the @@ -24584,7 +24584,7 @@ When you leave a @emph{ham} or @emph{unclassified} group, all the @code{spam-process-destination} group parameter or a match in the @code{gnus-spam-process-destinations} variable, which is a list of regular expressions matched with group names (it's easiest to -customize this variable with @kbd{M-x customize-variable @key{@key{RET}} +customize this variable with @kbd{M-x customize-variable @key{RET} gnus-spam-process-destinations}). Each group name list is a standard Lisp list, if you prefer to customize the variable manually. If the @code{spam-process-destination} parameter is not set, the spam @@ -28703,7 +28703,7 @@ commonly fetched via the protocol @acronym{NNTP}, whereas mail messages could be read from a file on the local disk. The internal architecture of Gnus thus comprises a ``front end'' and a number of ``back ends''. Internally, when you enter a group (by hitting -@key{@key{RET}}, say), you thereby invoke a function in the front end in +@key{RET}, say), you thereby invoke a function in the front end in Gnus. The front end then ``talks'' to a back end and says things like ``Give me the list of articles in the foo group'' or ``Show me article number 4711''. diff --git a/doc/misc/idlwave.texi b/doc/misc/idlwave.texi index 204a449925..ca4d89c5f8 100644 --- a/doc/misc/idlwave.texi +++ b/doc/misc/idlwave.texi @@ -702,13 +702,13 @@ be located in the library. E.g., if you have scanned the IDL-Astro library: @example - a=readf@key{M-@key{TAB}} + a=readf@kbd{M-@key{TAB}} @end example expands to ``readfits(''. Then try @example - a=readfits(@key{C-c ?} + a=readfits(@kbd{C-c ?} @end example and you get: @@ -2519,9 +2519,9 @@ between emacs and IDL sessions. Here is a list of commonly used commands: @multitable @columnfractions .12 .88 -@item @key{UP}, @key{M-p} +@item @key{UP}, @kbd{M-p} @tab Cycle backwards in input history -@item @key{DOWN}, @key{M-n} +@item @key{DOWN}, @kbd{M-n} @tab Cycle forwards in input history @item @kbd{M-r} @tab Previous input matching a regexp @@ -3131,8 +3131,8 @@ variable, number, or function you see can be examined. If the variable @code{idlwave-shell-separate-examine-output} is non-@code{nil} (the default), all examine output will be sent to a special @file{*Examine*} buffer, rather than the shell. The output of -prior examine commands is saved in this buffer. In this buffer @key{c} -clears the contents, and @key{q} hides the buffer. +prior examine commands is saved in this buffer. In this buffer @kbd{c} +clears the contents, and @kbd{q} hides the buffer. The two most basic examine commands are bound to @kbd{C-c C-d C-p}, to print the expression at point, and @kbd{C-c C-d ?}, to invoke help on @@ -4249,7 +4249,7 @@ This actually happens when running IDL in an XTerm as well. There are a couple of workarounds: @code{define_key,/control,'^d'} (e.g., in your @file{$IDL_STARTUP} file) will disable the @samp{EOF} character and give you a 512 character limit. You won't be able to use -@key{C-d} to quit the shell, however. Another possibility is +@kbd{C-d} to quit the shell, however. Another possibility is @code{!EDIT_INPUT=0}, which gives you an @emph{infinite} limit (OK, a memory-bounded limit), but disables the processing of background widget events (those with @code{/NO_BLOCK} passed to @code{XManager}). diff --git a/doc/misc/info.texi b/doc/misc/info.texi index 3e871936d2..e277b13ba8 100644 --- a/doc/misc/info.texi +++ b/doc/misc/info.texi @@ -405,7 +405,7 @@ brief list of commands. When you are finished looking at the list, make it go away by typing @key{SPC} repeatedly. @format ->> Type a @key{?} (or @key{H} in the stand-alone Info reader) now. +>> Type @kbd{?} (or @kbd{H} in the stand-alone Info reader) now. Press @key{SPC} to see consecutive screenfuls of the list until finished. Then type @key{SPC} several times. If you are using Emacs, the help will then go away automatically. diff --git a/doc/misc/org.texi b/doc/misc/org.texi index cf1c03772e..08ba33605e 100644 --- a/doc/misc/org.texi +++ b/doc/misc/org.texi @@ -1470,8 +1470,8 @@ level). Move subtree down (swap with next subtree of same level). @orgcmd{M-h,org-mark-element} Mark the element at point. Hitting repeatedly will mark subsequent elements -of the one just marked. E.g., hitting @key{M-h} on a paragraph will mark it, -hitting @key{M-h} immediately again will mark the next one. +of the one just marked. E.g., hitting @kbd{M-h} on a paragraph will mark it, +hitting @kbd{M-h} immediately again will mark the next one. @orgcmd{C-c @@,org-mark-subtree} Mark the subtree at point. Hitting repeatedly will mark subsequent subtrees of the same level than the marked subtree. @@ -1838,7 +1838,7 @@ this: @end example You can interactively insert drawers at point by calling -@code{org-insert-drawer}, which is bound to @key{C-c C-x d}. With an active +@code{org-insert-drawer}, which is bound to @kbd{C-c C-x d}. With an active region, this command will put the region inside the drawer. With a prefix argument, this command calls @code{org-insert-property-drawer} and add a property drawer right below the current headline. Completion over drawer @@ -4412,7 +4412,7 @@ Then each time you turn an entry from a TODO (not-done) state into any of the DONE states, a line @samp{CLOSED: [timestamp]} will be inserted just after the headline. If you turn the entry back into a TODO item through further state cycling, that line will be removed again. If you turn the entry back -to a non-TODO state (by pressing @key{C-c C-t @key{SPC}} for example), that line +to a non-TODO state (by pressing @kbd{C-c C-t @key{SPC}} for example), that line will also be removed, unless you set @code{org-closed-keep-when-no-todo} to non-@code{nil}. If you want to record a note along with the timestamp, use@footnote{The corresponding in-buffer setting is: @code{#+STARTUP: @@ -10608,7 +10608,7 @@ In-buffer settings may appear anywhere in the file, either directly or indirectly through a file included using @samp{#+SETUPFILE: filename or URL} syntax. Option keyword sets tailored to a particular back-end can be inserted from the export dispatcher (@pxref{The export dispatcher}) using the -@code{Insert template} command by pressing @key{#}. To insert keywords +@code{Insert template} command by pressing @kbd{#}. To insert keywords individually, a good way to make sure the keyword is correct is to type @code{#+} and then to use @kbd{M-@key{TAB}}@footnote{Many desktops intercept @kbd{M-@key{TAB}} to switch windows. Use @kbd{C-M-i} or @kbd{@key{ESC} @@ -15247,7 +15247,7 @@ Source code in the dialect of the specified language identifier. edit buffer containing the body of the @samp{src} code block, ready for any edits. @kbd{C-c '} again to close the buffer and return to the Org buffer. -@key{C-x C-s} saves the buffer and updates the contents of the Org buffer. +@kbd{C-x C-s} saves the buffer and updates the contents of the Org buffer. Set @code{org-edit-src-auto-save-idle-delay} to save the base buffer after a certain idle delay time. diff --git a/doc/misc/pcl-cvs.texi b/doc/misc/pcl-cvs.texi index 4c61aed5b3..fe501542f8 100644 --- a/doc/misc/pcl-cvs.texi +++ b/doc/misc/pcl-cvs.texi @@ -470,7 +470,7 @@ commands that @samp{tag} or @samp{diff} a file (which can be changed with the variable @code{cvs-invert-ignore-marks}). In addition, you may use the special prefix @code{cvs-mode-toggle-marks} -normally bound to @key{T} to toggle the use of marks for the following +normally bound to @kbd{T} to toggle the use of marks for the following command. This scheme might seem a little complicated, but once one gets used to diff --git a/doc/misc/reftex.texi b/doc/misc/reftex.texi index 3803cb0eb7..2ea98cf5df 100644 --- a/doc/misc/reftex.texi +++ b/doc/misc/reftex.texi @@ -1710,8 +1710,8 @@ customizing @code{reftex-ref-macro-prompt} and relying only on the selection facilities provided in the last step. In the last step, i.e., the label selection, two key bindings are -provided to set the reference macro. Type @key{v} in order to cycle -forward through the list of available macros or @key{V} to cycle +provided to set the reference macro. Type @kbd{v} in order to cycle +forward through the list of available macros or @kbd{V} to cycle backward. The mode line of the selection buffer shows the macro currently selected. diff --git a/doc/misc/sc.texi b/doc/misc/sc.texi index 03ca842cd0..453ccf2ec5 100644 --- a/doc/misc/sc.texi +++ b/doc/misc/sc.texi @@ -684,7 +684,7 @@ value of @code{sc-preferred-header-style}. Set the preferred reference header (i.e., @code{sc-preferred-header-style}) to the currently displayed header. -@item @code{sc-eref-exit} (@kbd{C-j}, @key{RET}, and @key{ESC C-c}) +@item @code{sc-eref-exit} (@kbd{C-j}, @key{RET}, and @kbd{@key{ESC} C-c}) @kindex RET @kindex C-j @kindex q diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index f4a1951cf3..f78124fdcd 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -3604,7 +3604,7 @@ Then specify a method and user name where needed. Examples: @end group @end example -In BBDB buffer, access an entry by pressing the key @key{F}. +In BBDB buffer, access an entry by pressing the key @kbd{F}. @end enumerate diff --git a/doc/misc/vip.texi b/doc/misc/vip.texi index 59df749231..92aea388af 100644 --- a/doc/misc/vip.texi +++ b/doc/misc/vip.texi @@ -1903,7 +1903,7 @@ by @kbd{o} or @kbd{O} command. @item vip-tags-file-name "TAGS" The name of the file used as the tags table. @item vip-help-in-insert-mode nil -If @code{t} then @key{C-h} is bound to @code{help-command} in insert mode, +If @code{t} then @kbd{C-h} is bound to @code{help-command} in insert mode, if @code{nil} then it sis bound to @code{delete-backward-char}. @end table @noindent diff --git a/doc/misc/viper.texi b/doc/misc/viper.texi index 2b300f6493..19d592f3e8 100644 --- a/doc/misc/viper.texi +++ b/doc/misc/viper.texi @@ -1743,7 +1743,7 @@ lines, etc. @xref{Movement and Markers}, for more info. @item viper-ex-style-editing t Set this to @code{nil}, if you want @kbd{C-h} and @key{DEL} to not stop -at the beginning of a line in Insert state, @key{X} and @key{x} to delete +at the beginning of a line in Insert state, @kbd{X} and @kbd{x} to delete characters across lines in Vi command state, etc. @item viper-ESC-moves-cursor-back t It @code{t}, cursor moves back 1 character when switching from insert state to vi commit 4e464fa98ae677451b4e4b722b0cf545a97ebbba Author: Michael Albinus Date: Thu Apr 19 11:04:01 2018 +0200 Handle chrooted environments in Tramp * doc/misc/tramp.texi (Frequently Asked Questions): New item, chrooted environments. * lisp/net/tramp.el (tramp-local-host-regexp): Make it a defcustom. Allow nil. (tramp-local-host-p): * lisp/net/tramp-sh.el (tramp-compute-multi-hops): Handle this. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index f0ea073ed0..7ae7150930 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -3294,6 +3294,7 @@ Keep the file @option{tramp-persistency-file-name}, which is where @value{tramp} caches remote information about hosts and files. Caching is enabled by default. Don't disable it. +@vindex remote-file-name-inhibit-cache Set @code{remote-file-name-inhibit-cache} to @code{nil} if remote files are not independently updated outside @value{tramp}'s control. That cache cleanup will be necessary if the remote directories or @@ -3427,6 +3428,16 @@ first saving to a temporary file. @end itemize +@item +@value{tramp} fails in a chrooted environment + +@vindex tramp-local-host-regexp +When connecting to a local host, @value{tramp} uses some internal +optimizations. They fail, when there is a chrooted environment. In +order to disable those optimizations, set user option +@option{tramp-local-host-regexp} to @code{nil}. + + @item @value{tramp} does not recognize if a @command{ssh} session hangs diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 3ba3d956ef..2fb5566a3b 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4634,7 +4634,7 @@ Goes through the list `tramp-inline-compress-commands'." ;; host name in their command template. In this case, the remote ;; file name must use either a local host name (first hop), or a ;; host name matching the previous hop. - (let ((previous-host tramp-local-host-regexp)) + (let ((previous-host (or tramp-local-host-regexp ""))) (setq choices target-alist) (while (setq item (pop choices)) (let ((host (tramp-file-name-host item))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 52ff021c50..5c785b16d8 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -428,13 +428,19 @@ host runs a registered shell, it shall be added to this list, too." :require 'tramp) ;;;###tramp-autoload -(defconst tramp-local-host-regexp +(defcustom tramp-local-host-regexp (concat "\\`" (regexp-opt (list "localhost" "localhost6" (system-name) "127.0.0.1" "::1") t) "\\'") - "Host names which are regarded as local host.") + "Host names which are regarded as local host. +If the local host runs a chrooted environment, set this to nil." + :version "27.1" + :group 'tramp + :type '(choice (const :tag "Chrooted environment" nil) + (regexp :tag "Host regexp")) + :require 'tramp) (defvar tramp-completion-function-alist nil "Alist of methods for remote files. @@ -4239,11 +4245,12 @@ be granted." ;;;###tramp-autoload (defun tramp-local-host-p (vec) - "Return t if this points to the local host, nil otherwise." + "Return t if this points to the local host, nil otherwise. +This handles also chrooted environments, which are not regarded as local." (let ((host (tramp-file-name-host vec)) (port (tramp-file-name-port vec))) (and - (stringp host) + (stringp tramp-local-host-regexp) (stringp host) (string-match tramp-local-host-regexp host) ;; A port is an indication for an ssh tunnel or alike. (null port) commit f4c989427b5fa0bb8507d14850fcbc35ff159e95 Author: Eli Zaretskii Date: Thu Apr 19 11:29:50 2018 +0300 Improve documentation of actual arglist * doc/lispref/functions.texi (Function Documentation): Advise against using '(fn ARGLIST)' method of advertising a calling convention when the old calling convention is deprecated. (Bug#31191) diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 78372a8a10..86181f1b49 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -498,6 +498,14 @@ derived from the actual arguments of the function. arguments written in a macro definition often do not correspond to the way users think of the parts of the macro call. + Do not use this feature if you want to deprecate the calling +convention and favor the one you advertise by the above specification. +Instead, use the @code{advertised-calling-convention} declaration +(@pxref{Declare Form}) or @code{set-advertised-calling-convention} +(@pxref{Obsolete Functions}), because these two will cause the byte +compiler emit a warning message when it compiles Lisp programs which +use the deprecated calling convention. + @node Function Names @section Naming a Function @cindex function definition commit 0ac64af1d4a9ff8af0f6418b81fc7ea6eed465db Author: Glenn Morris Date: Wed Apr 18 20:18:33 2018 -0400 * test/src/process-tests.el (make-process/mix-stderr): Use bash. Not all shells support ">&2". diff --git a/test/src/process-tests.el b/test/src/process-tests.el index 849676ea8f..e53fb58c09 100644 --- a/test/src/process-tests.el +++ b/test/src/process-tests.el @@ -182,12 +182,12 @@ (kill-process process))))) (ert-deftest make-process/mix-stderr () - "Check that ‘make-process’ mixes the output streams if STDERR is nil." - (skip-unless (executable-find shell-file-name)) + "Check that `make-process' mixes the output streams if STDERR is nil." + (skip-unless (executable-find "bash")) (with-temp-buffer (let ((process (make-process :name "mix-stderr" - :command (list shell-file-name shell-command-switch + :command (list "bash" "-c" "echo stdout && echo stderr >&2") :buffer (current-buffer) :sentinel #'ignore commit d21403505994ef098e6f1f93b8809c1c29beab2a Author: Paul Eggert Date: Wed Apr 18 17:12:56 2018 -0700 Fix botched merge of FQDNs in PROBLEMS This text was originally removed in 2014-12-30T04:42:26Z!eggert@cs.ucla.edu but then was mistakenly re-added in the merge in 2015-03-23T17:30:30Z!eggert@cs.ucla.edu. * etc/PROBLEMS: Omit obsolete mention of FQDNs. diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 0797176619..d19efaae68 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -555,17 +555,6 @@ And then rename the system's readline so that it won't be loaded: See for more details on installation. -*** Emacs startup on GNU/Linux systems (and possibly other systems) is slow. - -This can happen if the system is misconfigured and Emacs can't get the -full qualified domain name, FQDN. You should have your FQDN in the -/etc/hosts file, something like this: - -127.0.0.1 localhost -129.187.137.82 nuc04.t30.physik.tu-muenchen.de nuc04 - -The way to set this up may vary on non-GNU systems. - *** Visiting files in some auto-mounted directories causes Emacs to print 'Error reading dir-locals: (file-error "Read error" "is a directory" ...' commit 3d3923b79fe103ba66838db04aa9460cf990e565 Author: Paul Eggert Date: Wed Apr 18 13:08:36 2018 -0700 Tweak mark_object to avoid a conditional branch * src/alloc.c (LAST_MARKED_SIZE): Now an enum. Make it a power of 2. (mark_object): Take advantage of the power of 2. diff --git a/etc/DEBUG b/etc/DEBUG index c4774b06d3..a779295208 100644 --- a/etc/DEBUG +++ b/etc/DEBUG @@ -814,7 +814,7 @@ the machine where you started GDB and use the debugger from there. ** Debugging problems which happen in GC The array 'last_marked' (defined on alloc.c) can be used to display up -to 500 last objects marked by the garbage collection process. +to the 512 most-recent objects marked by the garbage collection process. Whenever the garbage collector marks a Lisp object, it records the pointer to that object in the 'last_marked' array, which is maintained as a circular buffer. The variable 'last_marked_index' holds the diff --git a/src/alloc.c b/src/alloc.c index 9fdcc7306a..8264e0623c 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -6188,11 +6188,7 @@ mark_glyph_matrix (struct glyph_matrix *matrix) } } -/* Mark reference to a Lisp_Object. - If the object referred to has not been seen yet, recursively mark - all the references contained in it. */ - -#define LAST_MARKED_SIZE 500 +enum { LAST_MARKED_SIZE = 1 << 9 }; /* Must be a power of 2. */ Lisp_Object last_marked[LAST_MARKED_SIZE] EXTERNALLY_VISIBLE; static int last_marked_index; @@ -6418,8 +6414,7 @@ mark_object (Lisp_Object arg) return; last_marked[last_marked_index++] = obj; - if (last_marked_index == LAST_MARKED_SIZE) - last_marked_index = 0; + last_marked_index &= LAST_MARKED_SIZE - 1; /* Perform some sanity checks on the objects marked here. Abort if we encounter an object we know is bogus. This increases GC time commit 53c29c4d3c636c7f02b563b3c683b13ae5863bcf Author: Stefan Monnier Date: Wed Apr 18 15:56:15 2018 -0400 * lisp/emacs-lisp/gv.el (gv-define-setter): Silence compiler warning Code placed in the `gv-expander` property will presumably only be used when gv is loaded (bug#14529). diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 01634d84ca..6bfc32c835 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -217,6 +217,8 @@ to be pure and copyable. Example use: (declare (indent 2) (debug (&define name sexp body))) `(gv-define-expander ,name (lambda (do &rest args) + (declare-function + gv--defsetter "gv" (name setter do args &optional vars)) (gv--defsetter ',name (lambda ,arglist ,@body) do args)))) ;;;###autoload commit 403f3d2c85b98a15609b3e52411c175b5294f940 Author: Paul Eggert Date: Wed Apr 18 12:38:19 2018 -0700 Tell user about read-integer-overflow-as-float * src/lread.c (string_to_number): Suggest read-integer-overflow-as-float in signal message. Suggested by Stefan Monnier (Bug#31118#58). diff --git a/src/lread.c b/src/lread.c index 6eda740540..9ddd8d5a7f 100644 --- a/src/lread.c +++ b/src/lread.c @@ -3797,7 +3797,12 @@ string_to_number (char const *string, int base, int flags) value = n; if (! (state & DOT_CHAR) && ! (flags & S2N_OVERFLOW_TO_FLOAT)) - xsignal1 (Qoverflow_error, build_string (string)); + { + AUTO_STRING (fmt, ("%s is out of fixnum range; " + "maybe set `read-integer-overflow-as-float'?")); + AUTO_STRING_WITH_LEN (arg, string, cp - string); + xsignal1 (Qoverflow_error, CALLN (Fformat_message, fmt, arg)); + } } /* Either the number uses float syntax, or it does not fit into a fixnum. commit ce0e253f482f8e522fbfa939f558ef8e1fa54163 Author: Martin Rudalics Date: Wed Apr 18 14:19:21 2018 +0200 ; * etc/NEWS: Improve last change as proposed by Phil Sainty diff --git a/etc/NEWS b/etc/NEWS index 2d179b9f42..122eebdd1d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1278,11 +1278,13 @@ passphrases, but it was also removed from other pinentry programs as the attack is unrealistic on modern computer systems which don't utilize swap memory usually. -** The function 'display-buffer-in-major-side-window' is now internal. -This hitherto undocumented function which existed since Emacs 24.1 has -been renamed to 'window--make-major-side-window' and its semantics -changed. Applications should use the now properly documented function -'display-buffer-in-side-window' with appropriate arguments instead. +** The function 'display-⁠buffer-⁠in-⁠major-⁠side-⁠window' no longer exists. +It has been renamed as internal function 'window--make-major-side-window', +however applications should instead call 'display-⁠buffer-⁠in-⁠side-⁠window' +(passing the SIDE and SLOT parameters as elements of ALIST). This approach +is backwards-⁠compatible with versions of Emacs in which the old function +exists. See the node "(elisp) Displaying Buffers in Side Windows" +in the ELisp manual for more details. * Lisp Changes in Emacs 26.1 commit b89ff0efdb65e9febe4c3ed2586a48a2b42233aa Author: Noam Postavsky Date: Tue Apr 17 19:17:18 2018 -0400 Don't assume term-current-row cache is valid (Bug#31193) * lisp/term.el (term-down): Call `term-current-row' instead of directly accessing the variable `term-current-row. Following a resize of the terminal's window, `term-current-row' is reset to nil, so it is not safe to assume it is a number. diff --git a/lisp/term.el b/lisp/term.el index 0a5efa4abc..6860ea6934 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -3764,7 +3764,7 @@ all pending output has been dealt with.")) (let ((start-column (term-horizontal-column))) (when (and check-for-scroll (or term-scroll-with-delete term-pager-count)) (setq down (term-handle-scroll down))) - (unless (and (= term-current-row 0) (< down 0)) + (unless (and (= (term-current-row) 0) (< down 0)) (term-adjust-current-row-cache down) (when (or (/= (point) (point-max)) (< down 0)) (setq down (- down (term-vertical-motion down))))) @@ -3774,7 +3774,7 @@ all pending output has been dealt with.")) (setq term-current-column 0) (setq term-start-line-column 0)) (t - (when (= term-current-row 0) + (when (= (term-current-row) 0) ;; Insert lines if at the beginning. (save-excursion (term-insert-char ?\n (- down))) (save-excursion commit 326a296fed986a01677d7c2a37557f5589f5f7d2 Author: Martin Rudalics Date: Wed Apr 18 09:10:03 2018 +0200 ; * etc/NEWS: Mention 'display-buffer-in-major-side-window' change (Bug#31194) diff --git a/etc/NEWS b/etc/NEWS index 4b1f673a7c..2d179b9f42 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1278,6 +1278,11 @@ passphrases, but it was also removed from other pinentry programs as the attack is unrealistic on modern computer systems which don't utilize swap memory usually. +** The function 'display-buffer-in-major-side-window' is now internal. +This hitherto undocumented function which existed since Emacs 24.1 has +been renamed to 'window--make-major-side-window' and its semantics +changed. Applications should use the now properly documented function +'display-buffer-in-side-window' with appropriate arguments instead. * Lisp Changes in Emacs 26.1 commit 3bdc9a1683d803d291586e83e7275936301d94cf Author: Eli Zaretskii Date: Tue Apr 17 20:45:51 2018 +0300 Fix flyspell-auto-correct-previous-word broken by recent change * lisp/textmodes/flyspell.el (flyspell-auto-correct-word): Keep flyspell-auto-correct-region also when repeatedly invoking flyspell-auto-correct-previous-word. (Bug#31188) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index e462669626..24e424c663 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -1945,8 +1945,9 @@ spell-check." (let ((pos (point)) (old-max (point-max))) ;; Flush a possibly stale cache from previous invocations of - ;; flyspell-auto-correct-word. - (if (not (eq last-command 'flyspell-auto-correct-word)) + ;; flyspell-auto-correct-word/flyspell-auto-correct-previous-word. + (if (not (memq last-command '(flyspell-auto-correct-word + flyspell-auto-correct-previous-word))) (setq flyspell-auto-correct-region nil)) ;; Use the correct dictionary. (flyspell-accept-buffer-local-defs) commit a539eb51acb0478f74325fee0080a05e76b795c6 Author: Eli Zaretskii Date: Tue Apr 17 18:40:41 2018 +0300 * test/src/lread-tests.el (lread-test-bug-31186): New test. diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el index 5c3fea7e68..eb212f3c95 100644 --- a/test/src/lread-tests.el +++ b/test/src/lread-tests.el @@ -170,4 +170,12 @@ literals (Bug#20852)." (lread--substitute-object-in-subtree x 1 t) (should (eq x (cdr x))))) +(ert-deftest lread-test-bug-31186 () + (with-temp-buffer + (insert ";; -*- -:*-") + (should-not + ;; This used to crash in lisp_file_lexically_bound_p before the + ;; bug was fixed. + (eval-buffer)))) + ;;; lread-tests.el ends here commit 3fa472b4873b395e6f9400884ee22b66c0a86966 Author: Andreas Schwab Date: Tue Apr 17 11:36:36 2018 +0200 Fix undefined behaviour while looking for lexical-binding file variable (bug 31186) * src/lread.c (lisp_file_lexically_bound_p): Reset beg_end_state before reading variable or value. diff --git a/src/lread.c b/src/lread.c index 3104c441ec..72523c057f 100644 --- a/src/lread.c +++ b/src/lread.c @@ -896,6 +896,7 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun) ch = READCHAR; i = 0; + beg_end_state = NOMINAL; while (ch != ':' && ch != '\n' && ch != EOF && in_file_vars) { if (i < sizeof var - 1) @@ -921,6 +922,7 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun) ch = READCHAR; i = 0; + beg_end_state = NOMINAL; while (ch != ';' && ch != '\n' && ch != EOF && in_file_vars) { if (i < sizeof val - 1) commit 4341aacd87912e7ba2c781fef9f1ff73d1a5bf0a Author: Eli Zaretskii Date: Sun Apr 15 20:34:44 2018 +0300 Minor wording improvement in "Bookmarks" * doc/emacs/regs.texi (Bookmarks): Improve wording. Suggested by "Siraphob (Ben) Phipathananunth" . diff --git a/doc/emacs/regs.texi b/doc/emacs/regs.texi index 8ff36ca554..7d16d53912 100644 --- a/doc/emacs/regs.texi +++ b/doc/emacs/regs.texi @@ -314,18 +314,18 @@ Save all the current bookmark values in the default bookmark file. @findex bookmark-set @kindex C-x r b @findex bookmark-jump - The prototypical use for bookmarks is to record one current position -in each of several files. So the command @kbd{C-x r m}, which sets a -bookmark, uses the visited file name as the default for the bookmark -name. If you name each bookmark after the file it points to, then you -can conveniently revisit any of those files with @kbd{C-x r b}, and move -to the position of the bookmark at the same time. + To record the current position in the visited file, use the command +@kbd{C-x r m}, which sets a bookmark using the visited file name as +the default for the bookmark name. If you name each bookmark after +the file it points to, then you can conveniently revisit any of those +files with @kbd{C-x r b}, and move to the position of the bookmark at +the same time. @kindex C-x r M @findex bookmark-set-no-overwrite The command @kbd{C-x r M} (@code{bookmark-set-no-overwrite}) works -like @kbd{C-x r m}, but it signals an error if the specified bookmark -already exists, instead of overwriting it. +like @w{@kbd{C-x r m}}, but it signals an error if the specified +bookmark already exists, instead of overwriting it. @kindex C-x r l @findex list-bookmarks