commit b7dfae3a8168977013e8de1df0916c51e76e7326 (HEAD, refs/remotes/origin/master) Author: Lars Ingebrigtsen Date: Sun Oct 18 10:18:57 2020 +0200 Fix a misleading comment in Freplace_match * src/search.c (Freplace_match): Fix a misleading comment (bug#42424). diff --git a/src/search.c b/src/search.c index 6fb3716cd4..e7f9094946 100644 --- a/src/search.c +++ b/src/search.c @@ -2748,7 +2748,7 @@ since only regular expressions have distinguished subexpressions. */) /* Put point back where it was in the text, if possible. */ TEMP_SET_PT (clip_to_bounds (BEGV, opoint + (opoint <= 0 ? ZV : 0), ZV)); - /* Now move point "officially" to the start of the inserted replacement. */ + /* Now move point "officially" to the end of the inserted replacement. */ move_if_not_intangible (newpoint); return Qnil; commit a10a3d48e8cb6ff4e52838ccfb2a0d270ec7b470 Author: Lars Ingebrigtsen Date: Sun Oct 18 09:45:09 2020 +0200 Document the new smiley value * doc/misc/gnus.texi (Smileys): Document the emoji smiley value. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 3f893e93c8..69ac05d5aa 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -23919,10 +23919,10 @@ The following variables customize the appearance of the smileys: @item smiley-style @vindex smiley-style Specifies the smiley style. Predefined smiley styles include -@code{low-color} (small 13x14 pixel, three-color images), @code{medium} -(more colorful images, 16x16 pixel), and @code{grayscale} (grayscale -images, 14x14 pixel). The default depends on the height of the default -face. +@code{emoji} (use emoji characters), @code{low-color} (small 13x14 +pixel, three-color images), @code{medium} (more colorful images, 16x16 +pixel), and @code{grayscale} (grayscale images, 14x14 pixel). The +default depends on the height of the default face. @item smiley-data-directory @vindex smiley-data-directory diff --git a/etc/NEWS b/etc/NEWS index d525ace671..27661e647a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -434,6 +434,7 @@ tags to be considered as well. ** Gnus ++++ *** New value for user option 'smiley-style' Smileys can now be rendered with emojis instead of small images when using the new 'emoji' value in 'smiley-style'. commit d96734729d0ed1fb854231c1ede3895c04c5b8ea Author: Lars Ingebrigtsen Date: Sun Oct 18 09:42:25 2020 +0200 Fix up smiley emoji application to make it reversible * lisp/gnus/smiley.el (smiley-region): Use text properties for the emojis instead of rewriting the message. diff --git a/lisp/gnus/smiley.el b/lisp/gnus/smiley.el index 7d6efacfe0..3edae04fcc 100644 --- a/lisp/gnus/smiley.el +++ b/lisp/gnus/smiley.el @@ -227,7 +227,11 @@ A list of images is returned." (progn (gnus-add-image 'smiley image) (gnus-put-image image string 'smiley)) - (insert image))))) + ;; This is a string, but mark the property for + ;; deletion if the washing method is switched off. + (insert (propertize string + 'display image + 'gnus-image-category 'smiley)))))) images)))) ;;;###autoload commit 990791262433923748047d3bec0161cbcfca5b59 Author: Adam Sjรธgren Date: Sun Oct 18 09:36:43 2020 +0200 Add support for emojis i smiley.el * lisp/gnus/smiley.el (smiley-style): Add emoji tag. (smiley-emoji-regexp-alist): New defcustom. (smiley-update-cache, smiley-region): Support emoji (non-image) replacement (bug#43889). diff --git a/etc/NEWS b/etc/NEWS index bae4cb3963..d525ace671 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -434,6 +434,10 @@ tags to be considered as well. ** Gnus +*** New value for user option 'smiley-style' +Smileys can now be rendered with emojis instead of small images when +using the new 'emoji' value in 'smiley-style'. + +++ *** New user option 'gnus-agent-eagerly-store-articles'. If non-nil (which is the default), the Gnus Agent will store all read diff --git a/lisp/gnus/smiley.el b/lisp/gnus/smiley.el index 5504a52078..7d6efacfe0 100644 --- a/lisp/gnus/smiley.el +++ b/lisp/gnus/smiley.el @@ -44,6 +44,7 @@ ;; cry ;-( ;; dead X-) ;; grin :-D +;; halo O:-) ;;; Code: @@ -64,7 +65,8 @@ "Smiley style." :type '(choice (const :tag "small, 3 colors" low-color) ;; 13x14 (const :tag "medium, ~10 colors" medium) ;; 16x16 - (const :tag "dull, grayscale" grayscale)) ;; 14x14 + (const :tag "dull, grayscale" grayscale) ;; 14x14 + (const :tag "emoji, full color" emoji)) :set (lambda (symbol value) (set-default symbol value) (setq smiley-data-directory (smiley-directory)) @@ -96,6 +98,35 @@ is nil, use `smiley-style'." :type 'directory :group 'smiley) +(defcustom smiley-emoji-regexp-alist + '(("\\(;-)\\)\\W" 1 "๐Ÿ˜‰") + ("[^;]\\(;)\\)\\W" 1 "๐Ÿ˜‰") + ("\\(:-]\\)\\W" 1 "๐Ÿ˜ฌ") + ("\\(8-)\\)\\W" 1 "๐Ÿฅด") + ("\\(:-|\\)\\W" 1 "๐Ÿ˜") + ("\\(:-[/\\]\\)\\W" 1 "๐Ÿ˜•") + ("\\(:-(\\)\\W" 1 "๐Ÿ˜ ") + ("\\(X-)\\)\\W" 1 "๐Ÿ˜ต") ; ๐Ÿ’€ + ("\\(:-{\\)\\W" 1 "๐Ÿ˜ฆ") + ("\\(>:-)\\)\\W" 1 "๐Ÿ˜ˆ") + ("\\(;-(\\)\\W" 1 "๐Ÿ˜ข") + ("\\(:-D\\)\\W" 1 "๐Ÿ˜€") + ("\\(O:-)\\)\\W" 1 "๐Ÿ˜‡") + ;; "smile" must be come after "evil" + ("\\(\\^?:-?)\\)\\W" 1 "๐Ÿ™‚")) + "A list of regexps to map smilies to emoji. +The elements are (REGEXP MATCH EMOJI), where MATCH is the submatch in +regexp to replace with EMOJI." + :version "28.1" + :type '(repeat (list regexp + (integer :tag "Regexp match number") + (string :tag "Emoji"))) + :set (lambda (symbol value) + (set-default symbol value) + (smiley-update-cache)) + :initialize 'custom-initialize-default + :group 'smiley) + ;; The XEmacs version has a baroque, if not rococo, set of these. (defcustom smiley-regexp-alist '(("\\(;-)\\)\\W" 1 "blink") @@ -142,23 +173,25 @@ regexp to replace with IMAGE. IMAGE is the name of an image file in (defun smiley-update-cache () (setq smiley-cached-regexp-alist nil) - (dolist (elt (if (symbolp smiley-regexp-alist) - (symbol-value smiley-regexp-alist) - smiley-regexp-alist)) - (let ((types gnus-smiley-file-types) - file type) - (while (and (not file) - (setq type (pop types))) - (unless (file-exists-p - (setq file (expand-file-name (concat (nth 2 elt) "." type) - smiley-data-directory))) - (setq file nil))) - (when type - (let ((image (gnus-create-image file (intern type) nil - :ascent 'center))) - (when image - (push (list (car elt) (cadr elt) image) - smiley-cached-regexp-alist))))))) + (if (eq smiley-style 'emoji) + (setq smiley-cached-regexp-alist smiley-emoji-regexp-alist) + (dolist (elt (if (symbolp smiley-regexp-alist) + (symbol-value smiley-regexp-alist) + smiley-regexp-alist)) + (let ((types gnus-smiley-file-types) + file type) + (while (and (not file) + (setq type (pop types))) + (unless (file-exists-p + (setq file (expand-file-name (concat (nth 2 elt) "." type) + smiley-data-directory))) + (setq file nil))) + (when type + (let ((image (gnus-create-image file (intern type) nil + :ascent 'center))) + (when image + (push (list (car elt) (cadr elt) image) + smiley-cached-regexp-alist)))))))) ;; Not implemented: ;; (defvar smiley-mouse-map @@ -190,8 +223,11 @@ A list of images is returned." (when image (push image images) (gnus-add-wash-type 'smiley) - (gnus-add-image 'smiley image) - (gnus-put-image image string 'smiley)))) + (if (symbolp image) + (progn + (gnus-add-image 'smiley image) + (gnus-put-image image string 'smiley)) + (insert image))))) images)))) ;;;###autoload commit a67fed2e0c836658ac6bf9658bb8769c5c216b9b Author: Stefan Kangas Date: Sun Oct 18 03:17:58 2020 +0200 Make nxml-newline-and-indent argument optional * lisp/nxml/nxml-mode.el (nxml-newline-and-indent): Make argument optional to conform to 'comment-line-break-function'. (Bug#40193) diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index 644de03cf4..5bb904e691 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -2230,7 +2230,7 @@ ENDP is t in the former case, nil in the latter." (skip-line-prefix fill-prefix) fill-prefix)) -(defun nxml-newline-and-indent (soft) +(defun nxml-newline-and-indent (&optional soft) (delete-horizontal-space) (if soft (insert-and-inherit ?\n) (newline 1)) (nxml-indent-line)) commit 8299126521e4c166fe43aa7ac8eadf0ff1e41457 Author: Stefan Kangas Date: Sun Oct 18 02:46:31 2020 +0200 Minor improvements to emacsclient man page * doc/man/emacsclient.1: Make flag descriptions into full sentences to be more consistent. diff --git a/doc/man/emacsclient.1 b/doc/man/emacsclient.1 index 62f5489653..ba64efa282 100644 --- a/doc/man/emacsclient.1 +++ b/doc/man/emacsclient.1 @@ -1,5 +1,5 @@ .\" See section COPYING for conditions for redistribution. -.TH EMACSCLIENT 1 "2020-10-15" "GNU Emacs" "GNU" +.TH EMACSCLIENT 1 "2020-10-18" "GNU Emacs" "GNU" .\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection .\" other params are allowed: see man(7), man(1) .SH NAME @@ -61,45 +61,45 @@ is treated as column 1. This option applies only to the next file specified. .TP .B \-a, \-\-alternate-editor=COMMAND -if the Emacs server is not running, run the specified shell command instead. +If the Emacs server is not running, run the specified shell command instead. This can also be specified via the ALTERNATE_EDITOR environment variable. If the value of ALTERNATE_EDITOR is the empty string, run "emacs \-\-daemon" to start Emacs in daemon mode, and try to connect to it. .TP .B -c, \-\-create-frame -create a new frame instead of trying to use the current Emacs frame +Create a new frame instead of trying to use the current Emacs frame. .TP .B \-F, \-\-frame-parameters=ALIST -set the parameters of a newly-created frame. +Set the parameters of a newly-created frame. .TP .B \-d, \-\-display=DISPLAY -tell the server to display the files on the given display. +Tell the server to display the files on the given display. .TP .B \-e, \-\-eval -do not visit files but instead evaluate the arguments as Emacs +Do not visit files but instead evaluate the arguments as Emacs Lisp expressions. .TP .B \-f, \-\-server-file=FILENAME -use TCP configuration file FILENAME for communication. +Use TCP configuration file FILENAME for communication. This can also be specified via the EMACS_SERVER_FILE environment variable. .TP .B \-n, \-\-no-wait -returns +Return immediately without waiting for you to "finish" the buffer in Emacs. If combined with --eval, this option is ignored. .TP .B \-nw, \-t, \-\-tty -open a new Emacs frame on the current terminal +Open a new Emacs frame on the current terminal. .TP .B \-s, \-\-socket-name=FILENAME -use socket named FILENAME for communication. +Use socket named FILENAME for communication. This can also be specified via the EMACS_SOCKET_NAME environment variable. .TP .B \-V, \-\-version -print version information and exit +Print version information and exit. .TP .B \-H, \-\-help -print this usage information message and exit +Print this usage information message and exit. .SH "EXIT STATUS" Normally, the exit status is 0. If emacsclient shuts down due to Emacs signaling an error, the exit status is 1. commit 335e3cf89f28b38ac0f5c9396ad6a49ca0261180 Author: Stefan Kangas Date: Sun Oct 18 02:28:22 2020 +0200 Convert manual js indent tests to unit tests * test/lisp/progmodes/js-tests.el (ert-x): Require. (js-deftest-indent): New macro. Use it to define tests for indenting the below files. * test/manual/indent/js-chain.js: * test/manual/indent/js-indent-align-list-continuation-nil.js: * test/manual/indent/js-indent-init-dynamic.js: * test/manual/indent/js-indent-init-t.js: * test/manual/indent/js.js: * test/manual/indent/jsx-align-gt-with-lt.jsx: * test/manual/indent/jsx-comment-string.jsx: * test/manual/indent/jsx-indent-level.jsx: * test/manual/indent/jsx-quote.jsx: * test/manual/indent/jsx-self-closing.jsx: * test/manual/indent/jsx-unclosed-1.jsx: * test/manual/indent/jsx-unclosed-2.jsx: * test/manual/indent/jsx.jsx: Move from here... * test/lisp/progmodes/js-resources/js-chain.js: * test/lisp/progmodes/js-resources/js-indent-align-list-continuation-nil.js: * test/lisp/progmodes/js-resources/js-indent-init-dynamic.js: * test/lisp/progmodes/js-resources/js-indent-init-t.js: * test/lisp/progmodes/js-resources/js.js: * test/lisp/progmodes/js-resources/jsx-align-gt-with-lt.jsx: * test/lisp/progmodes/js-resources/jsx-comment-string.jsx: * test/lisp/progmodes/js-resources/jsx-indent-level.jsx: * test/lisp/progmodes/js-resources/jsx-quote.jsx: * test/lisp/progmodes/js-resources/jsx-self-closing.jsx: * test/lisp/progmodes/js-resources/jsx-unclosed-1.jsx: * test/lisp/progmodes/js-resources/jsx-unclosed-2.jsx: * test/lisp/progmodes/js-resources/jsx.jsx: ...to here. diff --git a/test/manual/indent/js-chain.js b/test/lisp/progmodes/js-resources/js-chain.js similarity index 100% rename from test/manual/indent/js-chain.js rename to test/lisp/progmodes/js-resources/js-chain.js diff --git a/test/manual/indent/js-indent-align-list-continuation-nil.js b/test/lisp/progmodes/js-resources/js-indent-align-list-continuation-nil.js similarity index 100% rename from test/manual/indent/js-indent-align-list-continuation-nil.js rename to test/lisp/progmodes/js-resources/js-indent-align-list-continuation-nil.js diff --git a/test/manual/indent/js-indent-init-dynamic.js b/test/lisp/progmodes/js-resources/js-indent-init-dynamic.js similarity index 100% rename from test/manual/indent/js-indent-init-dynamic.js rename to test/lisp/progmodes/js-resources/js-indent-init-dynamic.js diff --git a/test/manual/indent/js-indent-init-t.js b/test/lisp/progmodes/js-resources/js-indent-init-t.js similarity index 100% rename from test/manual/indent/js-indent-init-t.js rename to test/lisp/progmodes/js-resources/js-indent-init-t.js diff --git a/test/manual/indent/js.js b/test/lisp/progmodes/js-resources/js.js similarity index 100% rename from test/manual/indent/js.js rename to test/lisp/progmodes/js-resources/js.js diff --git a/test/manual/indent/jsx-align-gt-with-lt.jsx b/test/lisp/progmodes/js-resources/jsx-align-gt-with-lt.jsx similarity index 100% rename from test/manual/indent/jsx-align-gt-with-lt.jsx rename to test/lisp/progmodes/js-resources/jsx-align-gt-with-lt.jsx diff --git a/test/manual/indent/jsx-comment-string.jsx b/test/lisp/progmodes/js-resources/jsx-comment-string.jsx similarity index 100% rename from test/manual/indent/jsx-comment-string.jsx rename to test/lisp/progmodes/js-resources/jsx-comment-string.jsx diff --git a/test/manual/indent/jsx-indent-level.jsx b/test/lisp/progmodes/js-resources/jsx-indent-level.jsx similarity index 100% rename from test/manual/indent/jsx-indent-level.jsx rename to test/lisp/progmodes/js-resources/jsx-indent-level.jsx diff --git a/test/manual/indent/jsx-quote.jsx b/test/lisp/progmodes/js-resources/jsx-quote.jsx similarity index 100% rename from test/manual/indent/jsx-quote.jsx rename to test/lisp/progmodes/js-resources/jsx-quote.jsx diff --git a/test/manual/indent/jsx-self-closing.jsx b/test/lisp/progmodes/js-resources/jsx-self-closing.jsx similarity index 100% rename from test/manual/indent/jsx-self-closing.jsx rename to test/lisp/progmodes/js-resources/jsx-self-closing.jsx diff --git a/test/manual/indent/jsx-unclosed-1.jsx b/test/lisp/progmodes/js-resources/jsx-unclosed-1.jsx similarity index 100% rename from test/manual/indent/jsx-unclosed-1.jsx rename to test/lisp/progmodes/js-resources/jsx-unclosed-1.jsx diff --git a/test/manual/indent/jsx-unclosed-2.jsx b/test/lisp/progmodes/js-resources/jsx-unclosed-2.jsx similarity index 100% rename from test/manual/indent/jsx-unclosed-2.jsx rename to test/lisp/progmodes/js-resources/jsx-unclosed-2.jsx diff --git a/test/manual/indent/jsx.jsx b/test/lisp/progmodes/js-resources/jsx.jsx similarity index 100% rename from test/manual/indent/jsx.jsx rename to test/lisp/progmodes/js-resources/jsx.jsx diff --git a/test/lisp/progmodes/js-tests.el b/test/lisp/progmodes/js-tests.el index 681e51de0e..1de2df0e85 100644 --- a/test/lisp/progmodes/js-tests.el +++ b/test/lisp/progmodes/js-tests.el @@ -22,6 +22,7 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'js) (require 'syntax) @@ -196,6 +197,33 @@ if (!/[ (:,='\"]/.test(value)) { ;; The bug was a hang. (should t))) +;;;; Indentation tests. + +(defmacro js-deftest-indent (file) + `(ert-deftest ,(intern (format "js-indent-test/%s" file)) () + :tags '(:expensive-test) + (let ((buf (find-file-noselect (ert-resource-file ,file)))) + (unwind-protect + (with-current-buffer buf + (let ((orig (buffer-string))) + (indent-region (point-min) (point-max)) + (should (equal (buffer-string) orig)))) + (kill-buffer buf))))) + +(js-deftest-indent "js-chain.js") +(js-deftest-indent "js-indent-align-list-continuation-nil.js") +(js-deftest-indent "js-indent-init-dynamic.js") +(js-deftest-indent "js-indent-init-t.js") +(js-deftest-indent "js.js") +(js-deftest-indent "jsx-align-gt-with-lt.jsx") +(js-deftest-indent "jsx-comment-string.jsx") +(js-deftest-indent "jsx-indent-level.jsx") +(js-deftest-indent "jsx-quote.jsx") +(js-deftest-indent "jsx-self-closing.jsx") +(js-deftest-indent "jsx-unclosed-1.jsx") +(js-deftest-indent "jsx-unclosed-2.jsx") +(js-deftest-indent "jsx.jsx") + (provide 'js-tests) ;;; js-tests.el ends here commit f287fb45f574604f4e5cce1031cc6b73ddcccc3d Author: Stefan Kangas Date: Sun Oct 18 02:09:27 2020 +0200 * lisp/progmodes/ld-script.el: Use lexical-binding. diff --git a/lisp/progmodes/ld-script.el b/lisp/progmodes/ld-script.el index 442c230977..b17f255ba6 100644 --- a/lisp/progmodes/ld-script.el +++ b/lisp/progmodes/ld-script.el @@ -1,4 +1,4 @@ -;;; ld-script.el --- GNU linker script editing mode for Emacs +;;; ld-script.el --- GNU linker script editing mode for Emacs -*- lexical-binding:t -*- ;; Copyright (C) 2001-2020 Free Software Foundation, Inc. commit 073e72e484ac1892f41b054182ab0d335bdb0d15 Author: Stefan Kangas Date: Sun Oct 18 00:57:29 2020 +0200 * lisp/progmodes/mixal-mode.el: Fix typos. diff --git a/lisp/progmodes/mixal-mode.el b/lisp/progmodes/mixal-mode.el index 948cd4b4f9..b9f60598f6 100644 --- a/lisp/progmodes/mixal-mode.el +++ b/lisp/progmodes/mixal-mode.el @@ -24,6 +24,7 @@ ;; along with GNU Emacs. If not, see . ;;; Commentary: + ;; Major mode for the mix asm language. ;; The mix asm language is described in "The Art Of Computer Programming". ;; @@ -34,8 +35,9 @@ ;; ;; To use this mode, place the following in your init file: ;; `(load-file "/PATH-TO-FILE/mixal-mode.el")'. +;; ;; When you load a file with the extension .mixal the mode will be started -;; automatic. If you want to start the mode manual, use `M-x mixal-mode'. +;; automatically. If you want to start the mode manually, use `M-x mixal-mode'. ;; Font locking will work, the behavior of tabs is the same as Emacs's ;; default behavior. You can compile a source file with `C-c c' you can ;; run a compiled file with `C-c r' or run it in debug mode with `C-c d'. commit 3b5a43f3d732ab83208ec013dbfd431a8985159d Author: Jose A Ortega Ruiz Date: Sat Oct 17 22:58:21 2020 +0100 Set jao@gnu.org as maintainer of mixal-mode.el * lisp/progmodes/mixal-mode.el: Set jao@gnu.org as maintainer of mixal-mode.el. (Bug#44037) diff --git a/lisp/progmodes/mixal-mode.el b/lisp/progmodes/mixal-mode.el index 42d34e75a5..948cd4b4f9 100644 --- a/lisp/progmodes/mixal-mode.el +++ b/lisp/progmodes/mixal-mode.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2003-2020 Free Software Foundation, Inc. ;; Author: Pieter E.J. Pareit -;; Maintainer: emacs-devel@gnu.org +;; Maintainer: Jose A Ortega Ruiz ;; Created: 09 Nov 2002 ;; Version: 0.4 ;; Keywords: languages, Knuth, mix, mixal, asm, mixvm, The Art Of Computer Programming commit 20728195b6db9867ca5e79a7691520ff8be07ec3 Author: Stefan Kangas Date: Sat Oct 17 15:52:01 2020 +0200 Use lexical-binding in mixal-mode.el * lisp/progmodes/mixal-mode.el: Use lexical-binding. (Bug#44037) diff --git a/lisp/progmodes/mixal-mode.el b/lisp/progmodes/mixal-mode.el index 9354af2085..42d34e75a5 100644 --- a/lisp/progmodes/mixal-mode.el +++ b/lisp/progmodes/mixal-mode.el @@ -1,4 +1,4 @@ -;;; mixal-mode.el --- Major mode for the mix asm language. +;;; mixal-mode.el --- Major mode for the mix asm language. -*- lexical-binding:t -*- ;; Copyright (C) 2003-2020 Free Software Foundation, Inc. commit 06933245c609069f4af5a32422a1f353ad063b7a Author: Juri Linkov Date: Sat Oct 17 23:23:10 2020 +0300 Extend next-error-message face to the edge of the window (bug#32676) * lisp/simple.el (next-error-message): Add ':extend t' to this face. (next-error-message-highlight): Put overlay over the newline as well. diff --git a/lisp/simple.el b/lisp/simple.el index bd19969341..d6fce922c4 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -125,7 +125,7 @@ If non-nil, the value is passed directly to `recenter'." :version "28.1") (defface next-error-message - '((t (:inherit highlight))) + '((t (:inherit highlight :extend t))) "Face used to highlight the current error message in the `next-error' buffer." :group 'next-error :version "28.1") @@ -484,7 +484,7 @@ buffer causes automatic display of the corresponding source code location." (with-current-buffer error-buffer (when next-error--message-highlight-overlay (delete-overlay next-error--message-highlight-overlay)) - (let ((ol (make-overlay (line-beginning-position) (line-end-position)))) + (let ((ol (make-overlay (line-beginning-position) (1+ (line-end-position))))) ;; do not override region highlighting (overlay-put ol 'priority -50) (overlay-put ol 'face 'next-error-message) commit 2c0cd900837e06a78402c05addf41838bd34b783 Author: J. Scott Berg Date: Sat Oct 17 20:30:56 2020 +0300 Fix bad dimensions of initial frame on VcXsrv * src/xterm.c (handle_one_xevent) [USE_GTK]: Don't obey ConfigureNotify events if the frame is not visible. (Bug#44002) Copyright-paperwork-exempt: yes diff --git a/src/xterm.c b/src/xterm.c index 2e0407aff4..98bb0ea891 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -8949,8 +8949,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, #endif #ifdef USE_GTK if (!f - && (f = any) - && configureEvent.xconfigure.window == FRAME_X_WINDOW (f)) + && (f = any) + && configureEvent.xconfigure.window == FRAME_X_WINDOW (f) + && FRAME_VISIBLE_P(f)) { block_input (); if (FRAME_X_DOUBLE_BUFFERED_P (f)) @@ -8963,10 +8964,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, configureEvent.xconfigure.height); #endif f = 0; - } + } #endif - if (f) - { + if (f && FRAME_VISIBLE_P(f)) + { #ifdef USE_GTK /* For GTK+ don't call x_net_wm_state for the scroll bar window. (Bug#24963, Bug#25887) */ @@ -9056,7 +9057,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, xic_set_statusarea (f); #endif - } + } goto OTHER; case ButtonRelease: commit 7dd52bfd8e503316b4aa9c5767850d3985626b26 Merge: ffd201c47e 18c0e20bea Author: Glenn Morris Date: Sat Oct 17 09:48:54 2020 -0700 Merge from origin/emacs-27 18c0e20bea (origin/emacs-27) Improve documentation of 'Info-hide-note... commit ffd201c47e8e32b10961d5679f48860fba411fde Merge: 3ac3a6503e 47b8a1c767 Author: Glenn Morris Date: Sat Oct 17 09:48:54 2020 -0700 ; Merge from origin/emacs-27 The following commit was skipped: 47b8a1c767 * admin/release-process: Add note to update files from ups... commit 3ac3a6503ebcf40ae6e179d92e1d168a4d440ea1 Merge: 2f45054208 65078e0a76 Author: Glenn Morris Date: Sat Oct 17 09:48:54 2020 -0700 Merge from origin/emacs-27 65078e0a76 * lisp/info.el (Info-hide-note-references): Doc fix. (Bug... 30305b543d Make lisp/progmodes/js.el dependent on CC Mode in the Make... c37b2a9b42 Yet another fix for 'set-minibuffer-message' 72dd911981 Fix posn-at-x-y in builds --without-x ace25f2066 Clarify the seq-reduce documentation 7d598e281d Make tramp-completion-reread-directory-timeout obsolete (B... 2c31ce18ea Fix 'message' when there's active minibuffer on another frame # Conflicts: # doc/misc/tramp.texi # etc/NEWS commit 2f45054208ccc3fbd53b7f4d6bbaba92afa075c1 Merge: e569efb15f f539ee9042 Author: Glenn Morris Date: Sat Oct 17 09:45:25 2020 -0700 ; Merge from origin/emacs-27 The following commit was skipped: f539ee9042 * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Doc t... commit e569efb15f3a642376c5d45afb449a302d99da47 Author: Mattias Engdegรฅrd Date: Sat Oct 17 18:33:04 2020 +0200 * etc/NEWS: Mention new lexical binding conversion aid. diff --git a/etc/NEWS b/etc/NEWS index 218c03ab3d..bae4cb3963 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1721,6 +1721,13 @@ personalize the uniquified buffer name. +++ ** 'inhibit-nul-byte-detection' is renamed to 'inhibit-null-byte-detection'. ++++ +** New byte-compiler check for missing dynamic variable declarations. +It is meant as an (experimental) aid for converting Emacs Lisp code +to lexical binding, where dynamic (special) variables bound in one +file can affect code in another. For details, see the manual section +'(Elisp) Converting to Lexical Binding'. + * Changes in Emacs 28.1 on Non-Free Operating Systems commit 00c4d982e8033379912ddc28772a2e30a4031503 Author: Protesilaos Stavrou Date: Sat Oct 17 09:50:48 2020 +0300 Update Modus themes' NEWS entry * etc/NEWS: Reword entry about new 'modus-operandi' and 'modus-vivendi' themes. Include reference to their manual. diff --git a/etc/NEWS b/etc/NEWS index 07d0835959..218c03ab3d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1420,9 +1420,11 @@ mode, as are other data files produced by Emacs. It's a library to create, query, navigate and display hierarchy structures. ** New themes 'modus-vivendi' and 'modus-operandi'. -These themes are designed for colour-contrast accessibility. You can -load the new themes using 'M-x customize-themes' or 'load-theme' from -your init file. +These themes are designed to conform with the highest standard for +color-contrast accessibility (WCAG AAA). You can load either of them +using 'M-x customize-themes' or 'load-theme' from your init file. +Consult the Modus Themes Info manual for more information on the user +options they provide. * Incompatible Editing Changes in Emacs 28.1 commit 9513aa8f48dce2b0ecc4b0f40a0b9211d978b056 Author: Jose A. Ortega Ruiz Date: Fri Oct 16 18:56:46 2020 +0100 mixal-mode: add missed instructions Synchronises with latest released GNU MDK 1.2.11 * mixal-mode.el (mixal-operation-codes-alist): Add missed instructions: SLB,SRB,JAE,JAO,JXE,JXO diff --git a/lisp/progmodes/mixal-mode.el b/lisp/progmodes/mixal-mode.el index 468c116b67..9354af2085 100644 --- a/lisp/progmodes/mixal-mode.el +++ b/lisp/progmodes/mixal-mode.el @@ -5,7 +5,7 @@ ;; Author: Pieter E.J. Pareit ;; Maintainer: emacs-devel@gnu.org ;; Created: 09 Nov 2002 -;; Version: 0.1 +;; Version: 0.4 ;; Keywords: languages, Knuth, mix, mixal, asm, mixvm, The Art Of Computer Programming ;; This file is part of GNU Emacs. @@ -45,6 +45,9 @@ ;; Have fun. ;;; History: +;; Version 0.4: +;; 16/10/20: Jose A Ortega Ruiz +;; Add missed instructions: SLB,SRB,JAE,JAO,JXE,JXO ;; Version 0.3: ;; 12/10/05: Stefan Monnier ;; Use font-lock-syntactic-keywords to detect/mark comments. @@ -683,6 +686,18 @@ Register J is set to the value of the next instruction that would have been executed when there was no jump." 1) + (JAE jump "jump A even" 40 + "Jump if the content of rA is even. +Register J is set to the value of the next instruction that would have +been executed when there was no jump." + 1) + + (JAO jump "jump A odd" 40 + "Jump if the content of rA is odd. +Register J is set to the value of the next instruction that would have +been executed when there was no jump." + 1) + (JXN jump "jump X negative" 47 "Jump if the content of rX is negative. Register J is set to the value of the next instruction that would have @@ -719,12 +734,24 @@ Register J is set to the value of the next instruction that would have been executed when there was no jump." 1) - (J1N jump "jump I1 negative" 41 - "Jump if the content of rI1 is negative. + (JXE jump "jump X even" 47 + "Jump if the content of rX is even. +Register J is set to the value of the next instruction that would have +been executed when there was no jump." + 1) + + (JXO jump "jump X odd" 47 + "Jump if the content of rX is odd. Register J is set to the value of the next instruction that would have been executed when there was no jump." 1) + (J1N jump "jump I1 negative" 41 + "Jump if the content of rI1 is negative. +Register J is set to the value of the next instruction that would have +been executed when there was no jump." + 1) + (J1Z jump "jump I1 zero" 41 "Jump if the content of rI1 is zero. Register J is set to the value of the next instruction that would have @@ -950,7 +977,6 @@ Zeros will be added to the left." Zeros will be added to the right." 2) - (SRAX miscellaneous "shift right AX" 6 "Shift AX, M bytes right. Zeros will be added to the left." @@ -966,6 +992,14 @@ The bytes that fall off to the left will be added to the right." The bytes that fall off to the right will be added to the left." 2) + (SLB miscellaneous "shift left AX binary" 6 + "Shift AX, M binary places left." + 2) + + (SRB miscellaneous "shift right AX binary" 6 + "Shift AX, M binary places right." + 2) + (MOVE miscellaneous "move" 7 number "Move MOD words from M to the location stored in rI1." (+ 1 (* 2 number))) commit 61e51fee9ca353c1cea4b68ef7225f374fee9839 Author: Stefan Kangas Date: Sat Oct 17 17:56:44 2020 +0200 Base bookmark-bmenu-mode on tabulated-list-mode (Bug#39293) Rewriting bookmark-bmenu-mode to be based on 'tabulated-list-mode' allows us to greatly simplify the code in several cases. In addition, we get some features for free, such as sorting by column. The only functional step backwards is that we no longer support the optional "inline" header line, a bookmark.el-specific feature to have a header without using 'header-line-format'. This feature is believed to be not very useful or widely used. * lisp/bookmark.el (tabulated-list): Require. (bookmark-bmenu-mode): Inherit from 'tabulated-list-mode' instead of 'special-mode' and make the necessary changes to support that. (bookmark-bmenu-mode-map): Inherit from 'tabulated-list-mode-map' instead of 'special-mode-map'. Remove now duplicate key bindings. (bookmark-bmenu--revert): New function to show the bookmark list using 'tabulated-list-mode'. (bookmark-bmenu-list): Simplify by using above new function. (bookmark-bmenu-bookmark): Adapt to 'tabulated-list-mode'. (bookmark-bmenu--name-predicate) (bookmark-bmenu--file-predicate): New functions used by 'tabulated-list-mode' to sort. (bookmark-bmenu-set-header): Redefine as obsolete function alias for 'tabulated-list-init-header'. (bookmark-bmenu-toggle-filenames, bookmark-bmenu-show-filenames) (bookmark-bmenu-hide-filenames, bookmark-bmenu-mark) (bookmark-bmenu-mark-all, bookmark-bmenu-unmark-all) (bookmark-bmenu-delete-all, bookmark-bmenu-unmark) (bookmark-bmenu-delete, bookmark-bmenu-delete-backwards): Simplify now that we can depend on 'tabulated-list-mode' to do more work. (bookmark-bmenu-use-header-line) (bookmark-bmenu-inline-header-height): Declare variables relating to the now unsupported "inline" header obsolete. (bookmark-bmenu-ensure-position) (bookmark-bmenu-execute-deletions): Remove code to handle "inline" header. * test/lisp/bookmark-tests.el (bookmark-test-bmenu-edit-annotation/show-annotation) (bookmark-test-bmenu-unmark, bookmark-test-bmenu-mark): Update tests for minor changes when using 'tabulated-list-mode'. diff --git a/etc/NEWS b/etc/NEWS index 6ec7ecfd52..07d0835959 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -607,6 +607,16 @@ defaulting to active region when used interactively. --- ** The old non-SMIE indentation of 'sh-mode' has been removed. +--- +** The 'list-bookmark' menu is now based on 'tabulated-list-mode'. +The interactive bookmark list will now benefit from features in +'tabulated-list-mode' like sorting columns or changing column width. + +Support for the optional "inline" header line, allowing for a header +without using 'header-line-format', has been dropped. Consequently, +the variables 'bookmark-bmenu-use-header-line' and +'bookmark-bmenu-inline-header-height' are now declared obsolete. + --- ** The sb-image.el library is now marked obsolete. This file was a compatibility kludge which is no longer needed. diff --git a/lisp/bookmark.el b/lisp/bookmark.el index dcb03adadd..ab7b04ddfe 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -32,6 +32,7 @@ ;;; Code: (require 'pp) +(require 'tabulated-list) (require 'text-property-search) (eval-when-compile (require 'cl-lib)) @@ -126,16 +127,16 @@ recently set ones come first, oldest ones come last)." (defconst bookmark-bmenu-buffer "*Bookmark List*" "Name of buffer used for Bookmark List.") -(defcustom bookmark-bmenu-use-header-line t +(defvar bookmark-bmenu-use-header-line t "Non-nil means to use an immovable header line. -This is as opposed to inline text at the top of the buffer." - :version "24.4" - :type 'boolean) +This is as opposed to inline text at the top of the buffer.") +(make-obsolete-variable 'bookmark-bmenu-use-header-line "no longer used." "28.1") (defconst bookmark-bmenu-inline-header-height 2 "Number of lines used for the *Bookmark List* header. \(This is only significant when `bookmark-bmenu-use-header-line' is nil.)") +(make-obsolete-variable 'bookmark-bmenu-inline-header-height "no longer used." "28.1") (defconst bookmark-bmenu-marks-width 2 "Number of columns (chars) used for the *Bookmark List* marks column. @@ -165,6 +166,7 @@ A non-nil value may result in truncated bookmark names." "Time before `bookmark-bmenu-search' updates the display." :type 'number) +;; FIXME: No longer used. Should be declared obsolete or removed. (defface bookmark-menu-heading '((t (:inherit font-lock-type-face))) "Face used to highlight the heading in bookmark menu buffers." @@ -976,7 +978,7 @@ Lines beginning with `#' are ignored." (when from-bookmark-list (pop-to-buffer (get-buffer bookmark-bmenu-buffer)) (goto-char (point-min)) - (text-property-search-forward 'bookmark-name-prop bookmark-name)) + (bookmark-bmenu-bookmark)) (kill-buffer old-buffer))) @@ -1587,7 +1589,7 @@ unique numeric suffixes \"<2>\", \"<3>\", etc." (defvar bookmark-bmenu-mode-map (let ((map (make-keymap))) - (set-keymap-parent map special-mode-map) + (set-keymap-parent map tabulated-list-mode-map) (define-key map "v" 'bookmark-bmenu-select) (define-key map "w" 'bookmark-bmenu-locate) (define-key map "5" 'bookmark-bmenu-other-frame) @@ -1607,8 +1609,6 @@ unique numeric suffixes \"<2>\", \"<3>\", etc." (define-key map "d" 'bookmark-bmenu-delete) (define-key map "D" 'bookmark-bmenu-delete-all) (define-key map " " 'next-line) - (define-key map "n" 'next-line) - (define-key map "p" 'previous-line) (define-key map "\177" 'bookmark-bmenu-backup-unmark) (define-key map "u" 'bookmark-bmenu-unmark) (define-key map "U" 'bookmark-bmenu-unmark-all) @@ -1676,6 +1676,30 @@ Don't affect the buffer ring order." (save-window-excursion (bookmark-bmenu-list))))) +(defun bookmark-bmenu--revert () + "Re-populate `tabulated-list-entries'." + (let (entries) + (dolist (full-record (bookmark-maybe-sort-alist)) + (let* ((name (bookmark-name-from-full-record full-record)) + (annotation (bookmark-get-annotation full-record)) + (location (bookmark-location full-record))) + (push (list + full-record + `[,(if (and annotation (not (string-equal annotation ""))) + "*" "") + ,(if (display-mouse-p) + (propertize name + 'font-lock-face 'bookmark-menu-bookmark + 'mouse-face 'highlight + 'follow-link t + 'help-echo "mouse-2: go to this bookmark in other window") + name) + ,@(if bookmark-bmenu-toggle-filenames + (list location))]) + entries))) + (tabulated-list-init-header) + (setq tabulated-list-entries entries)) + (tabulated-list-print t)) ;;;###autoload (defun bookmark-bmenu-get-buffer () @@ -1702,70 +1726,18 @@ deletion, or > if it is flagged for displaying." (if (called-interactively-p 'interactive) (switch-to-buffer buf) (set-buffer buf))) - (let ((inhibit-read-only t)) - (erase-buffer) - (if (not bookmark-bmenu-use-header-line) - (insert "% Bookmark\n- --------\n")) - (add-text-properties (point-min) (point) - '(font-lock-face bookmark-menu-heading)) - (dolist (full-record (bookmark-maybe-sort-alist)) - (let ((name (bookmark-name-from-full-record full-record)) - (annotation (bookmark-get-annotation full-record)) - (start (point)) - end) - ;; if a bookmark has an annotation, prepend a "*" - ;; in the list of bookmarks. - (insert (if (and annotation (not (string-equal annotation ""))) - " *" " ") - name) - (setq end (point)) - (put-text-property - (+ bookmark-bmenu-marks-width start) end 'bookmark-name-prop name) - (when (display-mouse-p) - (add-text-properties - (+ bookmark-bmenu-marks-width start) end - '(font-lock-face bookmark-menu-bookmark - mouse-face highlight - follow-link t - help-echo "mouse-2: go to this bookmark in other window"))) - (insert "\n"))) - (set-buffer-modified-p (not (= bookmark-alist-modification-count 0))) - (goto-char (point-min)) - (bookmark-bmenu-mode) - (if bookmark-bmenu-use-header-line - (bookmark-bmenu-set-header) - (forward-line bookmark-bmenu-inline-header-height)) - (when (and bookmark-alist bookmark-bmenu-toggle-filenames) - (bookmark-bmenu-toggle-filenames t)))) + (bookmark-bmenu-mode) + (bookmark-bmenu--revert)) ;;;###autoload (defalias 'list-bookmarks 'bookmark-bmenu-list) ;;;###autoload (defalias 'edit-bookmarks 'bookmark-bmenu-list) -;; FIXME: This could also display the current default bookmark file -;; according to `bookmark-bookmarks-timestamp'. -(defun bookmark-bmenu-set-header () - "Set the immutable header line." - (let ((header (copy-sequence "%% Bookmark"))) - (when bookmark-bmenu-toggle-filenames - (setq header (concat header - (make-string (- bookmark-bmenu-file-column - (- (length header) 3)) ?\s) - "File"))) - (let ((pos 0)) - (while (string-match "[ \t\n]+" header pos) - (setq pos (match-end 0)) - (put-text-property (match-beginning 0) pos 'display - (list 'space :align-to (- pos 1)) - header))) - (put-text-property 0 2 'face 'fixed-pitch header) - (setq header (concat (propertize " " 'display '(space :align-to 0)) - header)) - ;; Code derived from `buff-menu.el'. - (setq header-line-format header))) - -(define-derived-mode bookmark-bmenu-mode special-mode "Bookmark Menu" +(define-obsolete-function-alias 'bookmark-bmenu-set-header + #'tabulated-list-init-header "28.1") + +(define-derived-mode bookmark-bmenu-mode tabulated-list-mode "Bookmark Menu" "Major mode for editing a list of bookmarks. Each line describes one of the bookmarks in Emacs. Letters do not insert themselves; instead, they are commands. @@ -1804,7 +1776,31 @@ Bookmark names preceded by a \"*\" have annotations. \\[bookmark-bmenu-edit-annotation] -- edit the annotation for the current bookmark. \\[bookmark-bmenu-search] -- incrementally search for bookmarks." (setq truncate-lines t) - (setq buffer-read-only t)) + (setq buffer-read-only t) + ;; FIXME: The header could also display the current default bookmark file + ;; according to `bookmark-bookmarks-timestamp'. + (setq tabulated-list-format + `[("" 1) ;; Space to add "*" for bookmark with annotation + ("Bookmark" ,bookmark-bmenu-file-column bookmark-bmenu--name-predicate) + ,@(if bookmark-bmenu-toggle-filenames + '(("File" 0 bookmark-bmenu--file-predicate)))]) + (setq tabulated-list-padding bookmark-bmenu-marks-width) + (setq tabulated-list-sort-key '("Bookmark" . nil)) + (add-hook 'tabulated-list-revert-hook #'bookmark-bmenu--revert nil t)' + (setq revert-buffer-function 'bookmark-bmenu--revert) + (tabulated-list-init-header)) + + +(defun bookmark-bmenu--name-predicate (a b) + "Predicate to sort \"*Bookmark List*\" buffer by the name column. +This is used for `tabulated-list-format' in `bookmark-bmenu-mode'." + (string< (caar a) (caar b))) + + +(defun bookmark-bmenu--file-predicate (a b) + "Predicate to sort \"*Bookmark List*\" buffer by the file column. +This is used for `tabulated-list-format' in `bookmark-bmenu-mode'." + (string< (bookmark-location (car a)) (bookmark-location (car b)))) (defun bookmark-bmenu-toggle-filenames (&optional show) @@ -1813,100 +1809,42 @@ Optional argument SHOW means show them unconditionally." (interactive) (cond (show - (setq bookmark-bmenu-toggle-filenames nil) - (bookmark-bmenu-show-filenames) (setq bookmark-bmenu-toggle-filenames t)) (bookmark-bmenu-toggle-filenames - (bookmark-bmenu-hide-filenames) (setq bookmark-bmenu-toggle-filenames nil)) (t - (bookmark-bmenu-show-filenames) (setq bookmark-bmenu-toggle-filenames t))) - (when bookmark-bmenu-use-header-line - (bookmark-bmenu-set-header))) - - -(defun bookmark-bmenu-show-filenames (&optional force) - "In an interactive bookmark list, show filenames along with bookmarks. -Non-nil FORCE forces a redisplay showing the filenames. FORCE is used -mainly for debugging, and should not be necessary in normal use." - (if (and (not force) bookmark-bmenu-toggle-filenames) - nil ;already shown, so do nothing - (with-buffer-modified-unmodified - (save-excursion - (save-window-excursion - (goto-char (point-min)) - (if (not bookmark-bmenu-use-header-line) - (forward-line bookmark-bmenu-inline-header-height)) - (setq bookmark-bmenu-hidden-bookmarks ()) - (let ((inhibit-read-only t)) - (while (< (point) (point-max)) - (let ((bmrk (bookmark-bmenu-bookmark))) - (push bmrk bookmark-bmenu-hidden-bookmarks) - (let ((start (line-end-position))) - (move-to-column bookmark-bmenu-file-column t) - ;; Strip off `mouse-face' from the white spaces region. - (if (display-mouse-p) - (remove-text-properties start (point) - '(mouse-face nil help-echo nil)))) - (delete-region (point) (progn (end-of-line) (point))) - (insert " ") - ;; Pass the NO-HISTORY arg: - (bookmark-insert-location bmrk t) - (forward-line 1))))))))) - - -(defun bookmark-bmenu-hide-filenames (&optional force) - "In an interactive bookmark list, hide the filenames of the bookmarks. -Non-nil FORCE forces a redisplay showing the filenames. FORCE is used -mainly for debugging, and should not be necessary in normal use." - (when (and (not force) bookmark-bmenu-toggle-filenames) - ;; nothing to hide if above is nil - (with-buffer-modified-unmodified - (save-excursion - (goto-char (point-min)) - (if (not bookmark-bmenu-use-header-line) - (forward-line bookmark-bmenu-inline-header-height)) - (setq bookmark-bmenu-hidden-bookmarks - (nreverse bookmark-bmenu-hidden-bookmarks)) - (let ((inhibit-read-only t)) - (while bookmark-bmenu-hidden-bookmarks - (move-to-column bookmark-bmenu-marks-width t) - (bookmark-kill-line) - (let ((name (pop bookmark-bmenu-hidden-bookmarks)) - (start (point))) - (insert name) - (put-text-property start (point) 'bookmark-name-prop name) - (if (display-mouse-p) - (add-text-properties - start (point) - '(font-lock-face bookmark-menu-bookmark - mouse-face highlight - follow-link t help-echo - "mouse-2: go to this bookmark in other window")))) - (forward-line 1))))))) + (bookmark-bmenu-surreptitiously-rebuild-list)) + + +(defun bookmark-bmenu-show-filenames (&optional _) + "In an interactive bookmark list, show filenames along with bookmarks." + (setq bookmark-bmenu-toggle-filenames t) + (bookmark-bmenu-surreptitiously-rebuild-list)) + + +(defun bookmark-bmenu-hide-filenames (&optional _) + "In an interactive bookmark list, hide the filenames of the bookmarks." + (setq bookmark-bmenu-toggle-filenames nil) + (bookmark-bmenu-surreptitiously-rebuild-list)) (defun bookmark-bmenu-ensure-position () "If point is not on a bookmark line, move it to one. -If before the first bookmark line, move to the first; if after the -last full line, move to the last full line. The return value is undefined." - (cond ((and (not bookmark-bmenu-use-header-line) - (< (count-lines (point-min) (point)) - bookmark-bmenu-inline-header-height)) - (goto-char (point-min)) - (forward-line bookmark-bmenu-inline-header-height)) - ((and (bolp) (eobp)) +If after the last full line, move to the last full line. The +return value is undefined." + (cond ((and (bolp) (eobp)) (beginning-of-line 0)))) (defun bookmark-bmenu-bookmark () "Return the bookmark for this line in an interactive bookmark list buffer." (bookmark-bmenu-ensure-position) - (save-excursion - (beginning-of-line) - (forward-char bookmark-bmenu-marks-width) - (get-text-property (point) 'bookmark-name-prop))) + (let* ((id (tabulated-list-get-id)) + (entry (and id (assoc id tabulated-list-entries)))) + (if entry + (caar entry) + ""))) (defun bookmark-show-annotation (bookmark-name-or-record) @@ -1954,14 +1892,8 @@ If the annotation does not exist, do nothing." (defun bookmark-bmenu-mark () "Mark bookmark on this line to be displayed by \\\\[bookmark-bmenu-select]." (interactive) - (beginning-of-line) (bookmark-bmenu-ensure-position) - (with-buffer-modified-unmodified - (let ((inhibit-read-only t)) - (delete-char 1) - (insert ?>) - (forward-line 1) - (bookmark-bmenu-ensure-position)))) + (tabulated-list-put-tag ">" t)) (defun bookmark-bmenu-mark-all () @@ -1970,12 +1902,8 @@ If the annotation does not exist, do nothing." (save-excursion (goto-char (point-min)) (bookmark-bmenu-ensure-position) - (with-buffer-modified-unmodified - (let ((inhibit-read-only t)) - (while (not (eobp)) - (delete-char 1) - (insert ?>) - (forward-line 1)))))) + (while (not (eobp)) + (tabulated-list-put-tag ">" t)))) (defun bookmark-bmenu-select () @@ -2126,17 +2054,12 @@ bookmark menu visible." "Cancel all requested operations on bookmark on this line and move down. Optional BACKUP means move up." (interactive "P") - (beginning-of-line) + ;; any flags to reset according to circumstances? How about a + ;; flag indicating whether this bookmark is being visited? + ;; well, we don't have this now, so maybe later. (bookmark-bmenu-ensure-position) - (with-buffer-modified-unmodified - (let ((inhibit-read-only t)) - (delete-char 1) - ;; any flags to reset according to circumstances? How about a - ;; flag indicating whether this bookmark is being visited? - ;; well, we don't have this now, so maybe later. - (insert " ")) - (forward-line (if backup -1 1)) - (bookmark-bmenu-ensure-position))) + (tabulated-list-put-tag " ") + (forward-line (if backup -1 1))) (defun bookmark-bmenu-backup-unmark () @@ -2155,26 +2078,16 @@ Optional BACKUP means move up." (save-excursion (goto-char (point-min)) (bookmark-bmenu-ensure-position) - (with-buffer-modified-unmodified - (let ((inhibit-read-only t)) - (while (not (eobp)) - (delete-char 1) - (insert " ") - (forward-line 1)))))) + (while (not (eobp)) + (tabulated-list-put-tag " " t)))) (defun bookmark-bmenu-delete () "Mark bookmark on this line to be deleted. To carry out the deletions that you've marked, use \\\\[bookmark-bmenu-execute-deletions]." (interactive) - (beginning-of-line) (bookmark-bmenu-ensure-position) - (with-buffer-modified-unmodified - (let ((inhibit-read-only t)) - (delete-char 1) - (insert ?D) - (forward-line 1) - (bookmark-bmenu-ensure-position)))) + (tabulated-list-put-tag "D" t)) (defun bookmark-bmenu-delete-backwards () @@ -2182,10 +2095,7 @@ To carry out the deletions that you've marked, use \\\\ To carry out the deletions that you've marked, use \\\\[bookmark-bmenu-execute-deletions]." (interactive) (bookmark-bmenu-delete) - (forward-line -2) - (bookmark-bmenu-ensure-position) - (forward-line 1) - (bookmark-bmenu-ensure-position)) + (forward-line -2)) (defun bookmark-bmenu-delete-all () @@ -2196,12 +2106,8 @@ To carry out the deletions that you've marked, use \\\\ (save-excursion (goto-char (point-min)) (bookmark-bmenu-ensure-position) - (with-buffer-modified-unmodified - (let ((inhibit-read-only t)) - (while (not (eobp)) - (delete-char 1) - (insert ?D) - (forward-line 1)))))) + (while (not (eobp)) + (tabulated-list-put-tag "D" t)))) (defun bookmark-bmenu-execute-deletions () @@ -2217,8 +2123,6 @@ To carry out the deletions that you've marked, use \\\\ (progn (end-of-line) (point)))))) (o-col (current-column))) (goto-char (point-min)) - (unless bookmark-bmenu-use-header-line - (forward-line 1)) (while (re-search-forward "^D" (point-max) t) (bookmark-delete (bookmark-bmenu-bookmark) t)) ; pass BATCH arg (bookmark-bmenu-list) diff --git a/test/lisp/bookmark-tests.el b/test/lisp/bookmark-tests.el index 7cfd4ac14f..d0162889a8 100644 --- a/test/lisp/bookmark-tests.el +++ b/test/lisp/bookmark-tests.el @@ -471,6 +471,8 @@ testing `bookmark-bmenu-list'." (insert "foo") (bookmark-send-edited-annotation) (should (equal (buffer-name (current-buffer)) bookmark-bmenu-buffer)) + (beginning-of-line) + (forward-char 4) (should (looking-at "name")))) (ert-deftest bookmark-test-bmenu-toggle-filenames () @@ -503,6 +505,7 @@ testing `bookmark-bmenu-list'." (ert-deftest bookmark-test-bmenu-mark () (with-bookmark-bmenu-test (bookmark-bmenu-mark) + (forward-line -1) (beginning-of-line) (should (looking-at "^>")))) @@ -563,6 +566,7 @@ testing `bookmark-bmenu-list'." (bookmark-bmenu-mark) (goto-char (point-min)) (bookmark-bmenu-unmark) + (forward-line -1) (beginning-of-line) (should (looking-at "^ ")))) commit f532e0c32ac379700c36ec23e2d33085152d0b3d Author: Eli Zaretskii Date: Sat Oct 17 18:26:52 2020 +0300 ; * etc/NEWS: Move 'narrow-to-prompt' entry to "Shell" section. diff --git a/etc/NEWS b/etc/NEWS index 0519451e96..6ec7ecfd52 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -658,6 +658,13 @@ by the ElDoc library itself. Functions in 'eldoc-documentation-functions' don't need to worry about consulting it when producing a doc string. +** Shell + +--- +*** New command in 'shell-mode': 'narrow-to-prompt'. +This is bound to 'C-x n d' in 'shell-mode' buffers, and narrows to the +command line under point (and any following output). + ** Eshell --- @@ -1143,11 +1150,6 @@ window after starting). This variable defaults to nil. ** Miscellaneous ---- -*** New command in 'shell-mode': 'narrow-to-prompt'. -This is bound to 'C-x n d' in 'shell-mode' buffers, and narrows to the -command line under point (and any following output). - --- *** New user option 'compilation-search-all-directories'. When doing parallel builds, directories and compilation errors may commit 3217ae6e05c5d99f5d2d364b8f631001ee1d29c9 Author: Mattias Engdegรฅrd Date: Fri Oct 16 19:02:25 2020 +0200 Add aid for finding missing dynamic variable declarations Find lexical use of variables that are dynamically declared in other files by recording 'defvar' declarations in files that can be read in by the compiler in a second compilation. This is particularly useful when converting code to use lexical-binding. The facility is controlled by setting environment variables: EMACS_GENERATE_DYNVARS -- set to non-empty to generate a .dynvars file corresponding to each .elc. EMACS_DYNVARS_FILE -- set to the name of a .dynvars file to use as defvar information during compilation, enabling the new warnings. * lisp/emacs-lisp/bytecomp.el (byte-compile--known-dynamic-vars) (byte-compile--seen-defvars): New variables. (byte-compile-warning-types): Add lexical-dynamic warning. (byte-compile--load-dynvars, byte-compile--warn-lexical-dynamic): New functions. * lisp/emacs-lisp/bytecomp.el (byte-compile-file, byte-compile--declare-var) (byte-compile-lambda, byte-compile-bind): Add dynamic variable loads, dumps and checks. * doc/lispref/variables.texi (Converting to Lexical Binding): Document. diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index acbc8df6ea..6c0b3b5be1 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1283,6 +1283,45 @@ you can also add a leading underscore to the variable's name to indicate to the compiler that this is a variable known not to be used.) +@subsubheading Cross-file variable checking + +@strong{Note:} This is an experimental feature that may change or +disappear without prior notice. + +The byte-compiler can also warn about lexical variables that are +special in other Emacs Lisp files, often indicating a missing +@code{defvar} declaration. This useful but somewhat specialised check +requires three steps: + +@enumerate +@item +Byte-compile all files whose special variable declarations may be of +interest, with the environment variable @env{EMACS_GENERATE_DYNVARS} +set to a nonempty string. These are typically all the files in the +same package or related packages or Emacs subsystems. The process +will generate a file whose name ends in @file{.dynvars} for each +compiled Emacs Lisp file. + +@item +Concatenate the @file{.dynvars} files into a single file. + +@item +Byte-compile the files that need to be checked, this time with +the environment variable @env{EMACS_DYNVARS_FILE} set to the name +of the aggregated file created in step 2. +@end enumerate + +Here is an example illustrating how this could be done, assuming that +a Unix shell and @command{make} are used for byte-compilation: + +@example +$ rm *.elc # force recompilation +$ EMACS_GENERATE_DYNVARS=1 make # generate .dynvars +$ cat *.dynvars > ~/my.dynvars # combine .dynvars +$ rm *.elc # force recompilation +$ EMACS_DYNVARS_FILE=~/my.dynvars make # perform checks +@end example + @node Buffer-Local Variables @section Buffer-Local Variables @cindex variable, buffer-local diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index f4b9139ef1..90809a929b 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -268,6 +268,13 @@ This option is enabled by default because it reduces Emacs memory usage." (defconst byte-compile-log-buffer "*Compile-Log*" "Name of the byte-compiler's log buffer.") +(defvar byte-compile--known-dynamic-vars nil + "Variables known to be declared as dynamic, for warning purposes. +Each element is (VAR . FILE), indicating that VAR is declared in FILE.") + +(defvar byte-compile--seen-defvars nil + "All dynamic variable declarations seen so far.") + (defcustom byte-optimize-log nil "If non-nil, the byte-compiler will log its optimizations. If this is `source', then only source-level optimizations will be logged. @@ -290,7 +297,7 @@ The information is logged to `byte-compile-log-buffer'." (defconst byte-compile-warning-types '(redefine callargs free-vars unresolved obsolete noruntime cl-functions interactive-only - make-local mapcar constants suspicious lexical) + make-local mapcar constants suspicious lexical lexical-dynamic) "The list of warning types used when `byte-compile-warnings' is t.") (defcustom byte-compile-warnings t "List of warnings that the byte-compiler should issue (t for all). @@ -310,6 +317,8 @@ Elements of the list may be: interactive-only commands that normally shouldn't be called from Lisp code. lexical global/dynamic variables lacking a prefix. + lexical-dynamic + lexically bound variable declared dynamic elsewhere make-local calls to make-variable-buffer-local that may be incorrect. mapcar mapcar called for effect. constants let-binding of, or assignment to, constants/nonvariables. @@ -1873,6 +1882,17 @@ If compilation is needed, this functions returns the result of (load (if (file-exists-p dest) dest filename))) 'no-byte-compile))) +(defun byte-compile--load-dynvars (file) + (and file (not (equal file "")) + (with-temp-buffer + (insert-file-contents file) + (goto-char (point-min)) + (let ((vars nil) + var) + (while (ignore-errors (setq var (read (current-buffer)))) + (push var vars)) + vars)))) + (defvar byte-compile-level 0 ; bug#13787 "Depth of a recursive byte compilation.") @@ -1911,6 +1931,9 @@ The value is non-nil if there were no errors, nil if errors." (let ((byte-compile-current-file filename) (byte-compile-current-group nil) (set-auto-coding-for-load t) + (byte-compile--seen-defvars nil) + (byte-compile--known-dynamic-vars + (byte-compile--load-dynvars (getenv "EMACS_DYNVARS_FILE"))) target-file input-buffer output-buffer byte-compile-dest-file) (setq target-file (byte-compile-dest-file filename)) @@ -2035,6 +2058,15 @@ The value is non-nil if there were no errors, nil if errors." filename)))) (save-excursion (display-call-tree filename))) + (let ((gen-dynvars (getenv "EMACS_GENERATE_DYNVARS"))) + (when (and gen-dynvars (not (equal gen-dynvars "")) + byte-compile--seen-defvars) + (let ((dynvar-file (concat target-file ".dynvars"))) + (message "Generating %s" dynvar-file) + (with-temp-buffer + (dolist (var (delete-dups byte-compile--seen-defvars)) + (insert (format "%S\n" (cons var filename)))) + (write-region (point-min) (point-max) dynvar-file))))) (if load (load target-file)) t)))) @@ -2425,7 +2457,8 @@ list that represents a doc string reference. (setq byte-compile-lexical-variables (delq sym byte-compile-lexical-variables)) (byte-compile-warn "Variable `%S' declared after its first use" sym)) - (push sym byte-compile-bound-variables)) + (push sym byte-compile-bound-variables) + (push sym byte-compile--seen-defvars)) (defun byte-compile-file-form-defvar (form) (let ((sym (nth 1 form))) @@ -2831,6 +2864,16 @@ If FORM is a lambda or a macro, byte-compile it as a function." (ash nonrest 8) (ash rest 7))))) +(defun byte-compile--warn-lexical-dynamic (var context) + (when (byte-compile-warning-enabled-p 'lexical-dynamic var) + (byte-compile-warn + "`%s' lexically bound in %s here but declared dynamic in: %s" + var context + (mapconcat #'identity + (mapcan (lambda (v) (and (eq var (car v)) + (list (cdr v)))) + byte-compile--known-dynamic-vars) + ", ")))) (defun byte-compile-lambda (fun &optional add-lambda reserved-csts) "Byte-compile a lambda-expression and return a valid function. @@ -2859,6 +2902,10 @@ for symbols generated by the byte compiler itself." (if (cdr body) (setq body (cdr body)))))) (int (assq 'interactive body))) + (when lexical-binding + (dolist (var arglistvars) + (when (assq var byte-compile--known-dynamic-vars) + (byte-compile--warn-lexical-dynamic var 'lambda)))) ;; Process the interactive spec. (when int (byte-compile-set-symbol-position 'interactive) @@ -4379,6 +4426,8 @@ Return non-nil if the TOS value was popped." ;; VAR is a simple stack-allocated lexical variable. (progn (push (assq var init-lexenv) byte-compile--lexical-environment) + (when (assq var byte-compile--known-dynamic-vars) + (byte-compile--warn-lexical-dynamic var 'let)) nil) ;; VAR should be dynamically bound. (while (assq var byte-compile--lexical-environment) commit 39a001451fba253bf9480d1a0347ae054760f8e2 Author: Stefan Kangas Date: Sat Oct 17 15:37:37 2020 +0200 * test/lisp/mail/rfc822-tests.el: New file. diff --git a/test/lisp/mail/rfc822-tests.el b/test/lisp/mail/rfc822-tests.el new file mode 100644 index 0000000000..d13966c59c --- /dev/null +++ b/test/lisp/mail/rfc822-tests.el @@ -0,0 +1,83 @@ +;;; rfc822-tests.el --- Tests for rfc822.el -*- lexical-binding:t -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;;; Code: + +(require 'ert) +(require 'rfc822) + +(defmacro rfc822-tests-deftest (email desc &optional valid) + `(ert-deftest ,(intern (format "rfc822-email-%s-%s" + (if valid "valid" "invalid") + desc)) () + (if ,valid + (should (equal (rfc822-addresses ,email) (list ,email))) + (let ((addresses (rfc822-addresses ,email))) + ;; `rfc822-addresses' returns a string if parsing fails. + (while (and (consp addresses) + (not (eq (string-to-char (car addresses)) ?\())) + (setq addresses (cdr addresses))) + ;; Found saved error. + (should (= (length addresses) 1)))))) + +;;;; Valid emails + +(rfc822-tests-deftest "email@example.org" "email" t) +(rfc822-tests-deftest "firstname.lastname@example.org" "dot-in-address" t) +(rfc822-tests-deftest "email@subdomain.example.org" "dot-in-subdomain" t) +(rfc822-tests-deftest "firstname+lastname@example.org" "contains-plus-sign" t) +(rfc822-tests-deftest "email@123.123.123.123" "domain-valid-ip" t) +(rfc822-tests-deftest "email@[123.123.123.123]" "domain-valid-ip-square-bracket" t) +(rfc822-tests-deftest "\"email\"@example.org" "quotes-around-email" t) +(rfc822-tests-deftest "1234567890@example.org" "digits-in-address" t) +(rfc822-tests-deftest "email@example-one.com" "dash-in-domain-name" t) +(rfc822-tests-deftest "_______@example.org" "underscore-in-address" t) +(rfc822-tests-deftest "email@example.name" "dotname-tld" t) +(rfc822-tests-deftest "email@example.co.jp" "dot-in-tld" t) +(rfc822-tests-deftest "firstname-lastname@example.org" "dash-in-address" t) +(rfc822-tests-deftest "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghiklm@example.org" "address-long" t) + +;;;; Invalid emails + +(rfc822-tests-deftest "#@%^%#$@#$@#.com" "garbage") +(rfc822-tests-deftest "@example.org" "missing-username") +(rfc822-tests-deftest "email@example@example.org" "two-at-signs") +(rfc822-tests-deftest ".email@example.org" "address-leading-dot") +(rfc822-tests-deftest "email.@example.org" "address-trailing-dot") +(rfc822-tests-deftest "email..email@example.org" "address-multiple-dots") +(rfc822-tests-deftest "email@example..org" "domain-multiple-dots") +(rfc822-tests-deftest "email@example.org." "domain-trailing-dot") +(rfc822-tests-deftest "email@.example.org" "domain-leading-dot") +(rfc822-tests-deftest "test\\@test@example.org" "address-escaped-at-sign") + +;; FIXME: Should these fail? +;; (rfc822-tests-deftest "plainaddress" "missing-at-sign-and-domain") +;; (rfc822-tests-deftest "email@example.org (J. Random Hacker)" "text-following-email") +;; (rfc822-tests-deftest "email@-example.org" "leading-dash-in-domain-is-invalid") +;; (rfc822-tests-deftest "email@example-.org" "trailing-dash-in-domain-is-invalid") +;; (rfc822-tests-deftest "ใ‚ใ„ใ†ใˆใŠ@example.org" "address-unicode-chars") +;; (rfc822-tests-deftest "email.example.org" "missing-at") +;; (rfc822-tests-deftest "email@111.222.333.44444" "invalid-IP-format") +;; (rfc822-tests-deftest "email@domain" "missing-top-level-domain") +;; (rfc822-tests-deftest "email@domain.web" ".web-is-not-a-valid-top-level-domain") + +(provide 'rfc822-tests) +;;; rfc822-tests.el ends here commit 8b6b4176f6f89e697c16cbee06a05298987edf2e Author: Stefan Kangas Date: Sat Oct 17 02:57:30 2020 +0200 * lisp/url/url-vars.el: Use lexical-binding. diff --git a/lisp/url/url-vars.el b/lisp/url/url-vars.el index e35823ab9a..f9dce2418f 100644 --- a/lisp/url/url-vars.el +++ b/lisp/url/url-vars.el @@ -1,4 +1,4 @@ -;;; url-vars.el --- Variables for Uniform Resource Locator tool +;;; url-vars.el --- Variables for Uniform Resource Locator tool -*- lexical-binding:t -*- ;; Copyright (C) 1996-1999, 2001, 2004-2020 Free Software Foundation, ;; Inc. commit 18c0e20bea07cf4591b45800205cf25a927045f6 (refs/remotes/origin/emacs-27) Author: Eli Zaretskii Date: Sat Oct 17 14:43:25 2020 +0300 Improve documentation of 'Info-hide-note-references' in info.texi * doc/misc/info.texi (Help-Xref): Improve the wording. (Emacs Info Variables): Update the documentation of 'Info-hide-note-references'. (Bug#44043) diff --git a/doc/misc/info.texi b/doc/misc/info.texi index f3ab305e35..85e04a9960 100644 --- a/doc/misc/info.texi +++ b/doc/misc/info.texi @@ -798,17 +798,17 @@ in cross references and node names if it differs from the current file, so you can always know that you are going to be switching to another manual and which one. -However, Emacs normally hides some other text in cross-references. -If you put your mouse over the cross reference, then the information -appearing in a separate box (tool tip) or in the echo area will show -the full cross-reference including the file name and the node name of -the cross reference. If you have a mouse, just leave it over the -cross reference @xref{Top,, Overview of Texinfo, texinfo, Texinfo: -The GNU Documentation Format}, and watch what happens. If you -always like to have that information visible without having to move -your mouse over the cross reference, use @kbd{M-x visible-mode}, or -set @code{Info-hide-note-references} to a value other than @code{t} -(@pxref{Emacs Info Variables}). +Emacs normally hides some text in cross references. If you put your +mouse over the cross reference, then the information appearing in a +separate box (tool tip) or in the echo area will show the full +cross reference, including the file name and the node name of the +cross reference if it leads to another file. If you have a mouse, +just leave it over the next cross reference: @xref{Top,, Overview of +Texinfo, texinfo, Texinfo: The GNU Documentation Format}, and watch +what happens. If you always like to have that information visible +without having to move your mouse over the cross reference, use +@kbd{M-x visible-mode}, or set @code{Info-hide-note-references} to a +value other than @code{t} (@pxref{Emacs Info Variables}). @format >> Now type @kbd{n} to learn more commands. @@ -1227,12 +1227,20 @@ not scroll with the rest of the buffer, making these links always visible. @item Info-hide-note-references -As explained in earlier nodes, the Emacs version of Info normally -hides some text in menus and cross-references. You can completely -disable this feature, by setting this option to @code{nil}. Setting -it to a value that is neither @code{nil} nor @code{t} produces an -intermediate behavior, hiding a limited amount of text, but showing -all text that could potentially be useful. +As explained in earlier sections, the Emacs version of Info normally +hides some text in menus and cross references. It also replaces the +@samp{*note} prefix of each cross reference with a more grammatically +correct @samp{see}. This is the effect of the default value of this +option, @code{t}. Setting this option to @code{nil} disables both +hiding and replacing of the original cross reference text, and Emacs +will then display them as they are in the Info file. If you set it to +the value @code{hide}, Emacs will do the same as with @code{t}, but +will also remove @samp{*note} without replacing it with anything. +Setting it to any other non-@code{nil} value produces an intermediate +behavior, hiding a limited amount of text, but showing all text that +could potentially be useful, including the name of the node that is +the target of the cross reference and its file if it is different from +the current file. @item Info-scroll-prefer-subnodes If set to a non-@code{nil} value, @key{SPC} and @key{BACKSPACE} (or commit 9eb61be2dafcb4159888e90449091927cbad508a Author: Pierre Neidhardt Date: Sat Oct 17 13:16:24 2020 +0200 New shell-mode command to narrow to the command under point * lisp/shell.el (shell--prompt-end-position) (shell--prompt-begin-position): Helper functions. * lisp/shell.el (shell-narrow-to-prompt): New command and keystroke (bug#41784). diff --git a/etc/NEWS b/etc/NEWS index 1838b6b38a..0519451e96 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1143,6 +1143,11 @@ window after starting). This variable defaults to nil. ** Miscellaneous +--- +*** New command in 'shell-mode': 'narrow-to-prompt'. +This is bound to 'C-x n d' in 'shell-mode' buffers, and narrows to the +command line under point (and any following output). + --- *** New user option 'compilation-search-all-directories'. When doing parallel builds, directories and compilation errors may diff --git a/lisp/shell.el b/lisp/shell.el index 226bdf4d91..43ad58774b 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -334,6 +334,7 @@ Thus, this does not include the shell's current directory.") (define-key map "\t" 'completion-at-point) (define-key map (kbd "M-RET") 'shell-resync-dirs) (define-key map "\M-?" 'comint-dynamic-list-filename-completions) + (define-key map (kbd "C-x n d") 'shell-narrow-to-prompt) (define-key map [menu-bar completion] (cons "Complete" (copy-keymap (lookup-key comint-mode-map [menu-bar completion])))) @@ -1366,6 +1367,48 @@ Returns t if successful." (let ((f (shell-c-a-p-replace-by-expanded-directory))) (if f (funcall f)))) +(defun shell--prompt-begin-position () + ;; We need this convoluted function because `looking-at-p' does not work on + ;; multiline regexps _and_ `re-search-backward' skips the current line. + (save-excursion + (let ((old-point (point))) + (max + (save-excursion + ;; Right result if not on prompt. + (call-interactively #'comint-previous-prompt) + (re-search-backward comint-prompt-regexp) + (point)) + (save-excursion + ;; Right result if on first char after prompt. + (re-search-backward comint-prompt-regexp) + (point)) + (save-excursion + ;; Right result if on prompt. + (call-interactively #'comint-next-prompt) + (re-search-backward comint-prompt-regexp) + (if (<= (point) old-point) + (point) + (point-min))))))) + +(defun shell--prompt-end-position () + (save-excursion + (goto-char (shell--prompt-begin-position)) + (comint-next-prompt 1) + (point))) + +(defun shell-narrow-to-prompt () + "Narrow buffer to the command line (and any following command output) at point." + (interactive) + (let ((begin (shell--prompt-begin-position))) + (narrow-to-region + begin + (save-excursion + (goto-char (shell--prompt-end-position)) + (call-interactively #'comint-next-prompt) + (if (= begin (shell--prompt-begin-position)) + (point-max) + (shell--prompt-begin-position)))))) + (provide 'shell) ;;; shell.el ends here commit bee50664ae33deba3fe2284748f1e5a1622a1bb6 Author: Lars Ingebrigtsen Date: Sat Oct 17 12:17:10 2020 +0200 Make woman ignore the new groff kerning operators * lisp/woman.el (woman-decode-region): Ignore the new groff kerning operators (bug#42219). diff --git a/lisp/woman.el b/lisp/woman.el index eeacceadc2..52f610b569 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -2289,6 +2289,12 @@ Currently set only from \\='\\\" t in the first line of the source file.") (setq fill-column woman-fill-column tab-width woman-tab-width) + ;; Ignore the \, and \/ kerning operators. See + ;; https://www.gnu.org/software/groff/manual/groff.html#Ligatures-and-Kerning + (goto-char (point-min)) + (while (re-search-forward "\\\\,\\|\\\\/" nil t) + (replace-match "" t t)) + ;; Hide unpaddable and digit-width spaces \(space) and \0: (goto-char from) (while (re-search-forward "\\\\[ 0]" nil t) commit ea47bcc431ee7e3fbb545ad05b12ed921923c468 Author: Lars Ingebrigtsen Date: Sat Oct 17 11:24:03 2020 +0200 Fix `browse-url-of-dired' * lisp/net/browse-url.el (browse-url-emacs): Make the `browse-url-of-dired' command work again after the browse-emacs changes (bug#42429). diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index e7dad48cf4..8b245b0106 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -134,6 +134,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Code: +(require 'url) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Variables @@ -1374,10 +1376,16 @@ Optional argument SAME-WINDOW non-nil means show the URL in the currently selected window instead." (interactive (browse-url-interactive-arg "URL: ")) (require 'url-handlers) - (let ((file-name-handler-alist - (cons (cons url-handler-regexp 'url-file-handler) - file-name-handler-alist))) - (if same-window (find-file url) (find-file-other-window url)))) + (let ((parsed (url-generic-parse-url url)) + (func (if same-window 'find-file 'find-file-other-window))) + (if (and (equal (url-type parsed) "file") + (file-directory-p (url-filename parsed))) + ;; It's a directory; just open it. + (funcall func (url-filename parsed)) + (let ((file-name-handler-alist + (cons (cons url-handler-regexp 'url-file-handler) + file-name-handler-alist))) + (funcall func url))))) (function-put 'browse-url-emacs 'browse-url-browser-kind 'internal) commit 0a3d584ce4167b0241bf2cdcf5c670fdea49f46f Author: Lars Ingebrigtsen Date: Sat Oct 17 10:29:15 2020 +0200 Avoid infloop in which-function-mode when a vc file has changed * lisp/vc/diff-mode.el (diff-find-source-location): Avoid warnings when called from which-function-mode and the file has changed (bug#42818). diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index d586afb97b..7c9ad25eb3 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -1860,7 +1860,10 @@ SWITCHED is non-nil if the patch is already applied." (buf (if revision (let ((vc-find-revision-no-save t)) (vc-find-revision (expand-file-name file) revision diff-vc-backend)) - (find-file-noselect file)))) + ;; NOPROMPT is only non-nil when called from + ;; `which-function-mode', so avoid "File x changed + ;; on disk. Reread from disk?" warnings. + (find-file-noselect file noprompt)))) ;; Update the user preference if he so wished. (when (> (prefix-numeric-value other-file) 8) (setq diff-jump-to-old-file other)) commit 47b8a1c7672608f220c3e0d7f6cedc63e6f63386 Author: Stefan Kangas Date: Sat Oct 17 02:06:26 2020 +0200 * admin/release-process: Add note to update files from upstream. (cherry picked from commit 86dd9d12aa5a273da2efd4ce8c6e35ae343f1494) diff --git a/admin/release-process b/admin/release-process index c3728b582f..a1f42f0507 100644 --- a/admin/release-process +++ b/admin/release-process @@ -195,6 +195,17 @@ pt-br Rodrigo Real ru Alex Ott sk Miroslav Vaลกko +** Update some files from their upstream. + +Some files in Emacs are copies of data files maintained elsewhere. +Make sure that they are reasonably up-to-date. + +- etc/publicsuffix.txt +https://publicsuffix.org/list/public_suffix_list.dat + +- leim/SKK-DIC/SKK-JISYO.L +https://raw.githubusercontent.com/skk-dev/dict/master/SKK-JISYO.L + * BUGS ** Check for modes which bind M-s that conflicts with a new global binding M-s commit 65078e0a760950783e56f6765465a59bd642e8e4 Author: Eli Zaretskii Date: Sat Oct 17 10:32:26 2020 +0300 * lisp/info.el (Info-hide-note-references): Doc fix. (Bug#44043) diff --git a/lisp/info.el b/lisp/info.el index 033a7a5cbb..13c57bdcd1 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -305,10 +305,11 @@ when you hit the end of the current node." (defcustom Info-hide-note-references t "If non-nil, hide the tag and section reference in *note and * menu items. -If value is non-nil but not `hide', also replaces the \"*note\" with \"see\". -If value is non-nil but not t or `hide', the reference section is still shown. -nil completely disables this feature. If this is non-nil, you might -want to set `Info-refill-paragraphs'." +If the value is t, the default, replace \"*note\" with \"see\". +If the value is `hide', remove \"*note\" without replacing it with anything. +If value is non-nil, but not t or `hide', the reference section is still shown. +nil completely disables this feature, leaving the original \"*note\" visible. +If this is non-nil, you may wish setting `Info-refill-paragraphs' non-nil." :version "22.1" :type '(choice (const :tag "No hiding" nil) (const :tag "Replace tag and hide reference" t) commit 30305b543d04f5d888c6d63e314d596ca0f3baa8 Author: Alan Mackenzie Date: Fri Oct 16 16:25:19 2020 +0000 Make lisp/progmodes/js.el dependent on CC Mode in the Makefile. This will prevent version mismatches between compile time and runtime versions. This fixes bug #43037. * lisp/Makefile.in: Make js.el dependent on cc-{defs,engine,mode}.elc. diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 57527bb5af..dac62cedec 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -525,4 +525,10 @@ $(lisp)/progmodes/cc-mode.elc: $(lisp)/progmodes/cc-langs.elc \ $(lisp)/progmodes/cc-styles.elc: $(lisp)/progmodes/cc-vars.elc \ $(lisp)/progmodes/cc-align.elc +# https://debbugs.gnu.org/43037 +# js.elc (like all modes using CC Mode's compile time macros) needs to +# be compiled under the same version of CC Mode it will run with. +$(lisp)/progmodes/js.elc: $(lisp)/progmodes/cc-defs.elc \ + $(lisp)/progmodes/cc-engine.elc $(lisp)/progmodes/cc-mode.elc + # Makefile ends here. commit c37b2a9b425a8f347015fb9404b512334b5a1f57 Author: Eli Zaretskii Date: Fri Oct 16 10:17:42 2020 +0300 Yet another fix for 'set-minibuffer-message' * lisp/minibuffer.el (set-minibuffer-message): Handle the case of separate minibuffer-only frame. Suggested by Gregory Heytings . diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 10cfca8d58..942fb019fe 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -783,45 +783,50 @@ The text is displayed for `minibuffer-message-clear-timeout' seconds whichever comes first. Unlike `minibuffer-message', this function is called automatically via `set-message-function'." - (when (and (not noninteractive) - (window-live-p (active-minibuffer-window)) - (eq (window-frame) (window-frame (active-minibuffer-window)))) - (with-current-buffer (window-buffer (active-minibuffer-window)) - (setq message (if (string-match-p "\\` *\\[.+\\]\\'" message) - ;; Make sure we can put-text-property. - (copy-sequence message) - (concat " [" message "]"))) - (unless (or (null minibuffer-message-properties) - ;; Don't overwrite the face properties the caller has set - (text-properties-at 0 message)) - (setq message (apply #'propertize message minibuffer-message-properties))) - - (clear-minibuffer-message) - - (let ((ovpos (minibuffer--message-overlay-pos))) - (setq minibuffer-message-overlay - (make-overlay ovpos ovpos nil t t))) - (unless (zerop (length message)) - ;; The current C cursor code doesn't know to use the overlay's - ;; marker's stickiness to figure out whether to place the cursor - ;; before or after the string, so let's spoon-feed it the pos. - (put-text-property 0 1 'cursor 1 message)) - (overlay-put minibuffer-message-overlay 'after-string message) - ;; Make sure the overlay with the message is displayed before - ;; any other overlays in that position, in case they have - ;; resize-mini-windows set to nil and the other overlay strings - ;; are too long for the mini-window width. This makes sure the - ;; temporary message will always be visible. - (overlay-put minibuffer-message-overlay 'priority 1100) - - (when (numberp minibuffer-message-clear-timeout) - (setq minibuffer-message-timer - (run-with-timer minibuffer-message-clear-timeout nil - #'clear-minibuffer-message))) - - ;; Return `t' telling the caller that the message - ;; was handled specially by this function. - t))) + (let* ((minibuf-window (active-minibuffer-window)) + (minibuf-frame (and (window-live-p minibuf-window) + (window-frame minibuf-window)))) + (when (and (not noninteractive) + (window-live-p minibuf-window) + (or (eq (window-frame) minibuf-frame) + (eq (frame-parameter minibuf-frame 'minibuffer) 'only))) + (with-current-buffer (window-buffer minibuf-window) + (setq message (if (string-match-p "\\` *\\[.+\\]\\'" message) + ;; Make sure we can put-text-property. + (copy-sequence message) + (concat " [" message "]"))) + (unless (or (null minibuffer-message-properties) + ;; Don't overwrite the face properties the caller has set + (text-properties-at 0 message)) + (setq message + (apply #'propertize message minibuffer-message-properties))) + + (clear-minibuffer-message) + + (let ((ovpos (minibuffer--message-overlay-pos))) + (setq minibuffer-message-overlay + (make-overlay ovpos ovpos nil t t))) + (unless (zerop (length message)) + ;; The current C cursor code doesn't know to use the overlay's + ;; marker's stickiness to figure out whether to place the cursor + ;; before or after the string, so let's spoon-feed it the pos. + (put-text-property 0 1 'cursor 1 message)) + (overlay-put minibuffer-message-overlay 'after-string message) + ;; Make sure the overlay with the message is displayed before + ;; any other overlays in that position, in case they have + ;; resize-mini-windows set to nil and the other overlay strings + ;; are too long for the mini-window width. This makes sure the + ;; temporary message will always be visible. + (overlay-put minibuffer-message-overlay 'priority 1100) + + (when (numberp minibuffer-message-clear-timeout) + (setq minibuffer-message-timer + (run-with-timer minibuffer-message-clear-timeout nil + #'clear-minibuffer-message))) + + ;; Return `t' telling the caller that the message + ;; was handled specially by this function. + t)))) (setq set-message-function 'set-minibuffer-message) commit 72dd9119819eea5d8b1138e14a6010759f38366b Author: Eli Zaretskii Date: Fri Oct 16 10:02:50 2020 +0300 Fix posn-at-x-y in builds --without-x * src/keyboard.c (make_lispy_position): Don't exclude the window_or_frame = frame case from TTY-only builds. Reported by Jared Finder . * doc/lispref/commands.texi (Click Events): Document the format of POSITION in click events on the frame's internal border. diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 25f657404f..aabaec256b 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -1346,10 +1346,11 @@ button. @xref{Repeat Events}. To access the contents of a mouse position list in the @var{position} slot of a click event, you should typically use the -functions documented in @ref{Accessing Mouse}. The explicit format of -the list depends on where the click occurred. For clicks in the text -area, mode line, header line, tab line, or in the fringe or marginal -areas, the mouse position list has the form +functions documented in @ref{Accessing Mouse}. + +The explicit format of the list depends on where the click occurred. +For clicks in the text area, mode line, header line, tab line, or in +the fringe or marginal areas, the mouse position list has the form @example (@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp} @@ -1479,6 +1480,45 @@ handle), @code{up} (the up arrow at one end of the scroll bar), or @c The 'top', 'bottom', and 'end-scroll' codes don't seem to be used. @end table +For clicks on the frame's internal border (@pxref{Frame Layout}), +@var{position} has this form: + +@example + (@var{frame} @var{part} (@var{X} . @var{Y}) @var{timestamp}) +@end example + +@table @asis +@item @var{frame} +The frame whose internal border was clicked on. + +@item @var{part} +The part of the internal border which was clicked on. This can be one +of the following: + +@table @code +@item nil +The frame does not have an internal border. This usually happens on +text-mode frames. This can also happen on GUI frames with internal +border if the frame doesn't have its @code{drag-internal-border} +parameter (@pxref{Mouse Dragging Parameters}) set to a non-@code{nil} +value. + +@item left-edge +@itemx top-edge +@itemx right-edge +@itemx bottom-edge +The click was on the corresponding border at an offset of at least one +canonical character from the border's nearest corner. + +@item top-left-corner +@itemx top-right-corner +@itemx bottom-right-corner +@itemx bottom-left-corner +The click was on the corresponding corner of the internal border. +@end table + +@end table + @node Drag Events @subsection Drag Events diff --git a/src/keyboard.c b/src/keyboard.c index 5f136f03ec..fca71985b9 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5246,7 +5246,6 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, extra_info))); } -#ifdef HAVE_WINDOW_SYSTEM else if (f) { /* Return mouse pixel coordinates here. */ @@ -5254,7 +5253,9 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, xret = XFIXNUM (x); yret = XFIXNUM (y); - if (FRAME_LIVE_P (f) +#ifdef HAVE_WINDOW_SYSTEM + if (FRAME_WINDOW_P (f) + && FRAME_LIVE_P (f) && FRAME_INTERNAL_BORDER_WIDTH (f) > 0 && !NILP (get_frame_param (f, Qdrag_internal_border))) { @@ -5263,8 +5264,8 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, posn = builtin_lisp_symbol (internal_border_parts[part]); } - } #endif + } else window_or_frame = Qnil; commit ace25f206640b94d876d7d0966fcd9e512f81fc9 Author: Lars Ingebrigtsen Date: Thu Oct 15 09:37:44 2020 +0200 Clarify the seq-reduce documentation * doc/lispref/sequences.texi (Sequence Functions): Ditto. * lisp/emacs-lisp/seq.el (seq-reduce): Clarify the order of the arguments (bug#43995). diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index ca52369bd0..952834bd4e 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi @@ -658,8 +658,13 @@ for which @var{predicate} returns @code{nil}. @var{initial-value} and the first element of @var{sequence}, then calling @var{function} with that result and the second element of @var{sequence}, then with that result and the third element of @var{sequence}, etc. -@var{function} should be a function of two arguments. If -@var{sequence} is empty, this returns @var{initial-value} without +@var{function} should be a function of two arguments. + +@var{function} is called with two arguments. @var{intial-value} +(and then the accumulated value) is used as the first argument, and +the elements in @var{sequence} are used for the second argument. + +If @var{sequence} is empty, this returns @var{initial-value} without calling @var{function}. @example diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index e3037a7190..42b145da2f 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -336,9 +336,11 @@ list." "Reduce the function FUNCTION across SEQUENCE, starting with INITIAL-VALUE. Return the result of calling FUNCTION with INITIAL-VALUE and the -first element of SEQUENCE, then calling FUNCTION with that result and -the second element of SEQUENCE, then with that result and the third -element of SEQUENCE, etc. +first element of SEQUENCE, then calling FUNCTION with that result +and the second element of SEQUENCE, then with that result and the +third element of SEQUENCE, etc. FUNCTION will be called with +INITIAL-VALUE (and then the accumulated value) as the first +argument, and the elements from SEQUENCE as the second argument. If SEQUENCE is empty, return INITIAL-VALUE and FUNCTION is not called." (if (seq-empty-p sequence) commit 7d598e281d15522b64a8807e6805e715c581f12f Author: Michael Albinus Date: Mon Oct 12 13:06:16 2020 +0200 Make tramp-completion-reread-directory-timeout obsolete (Bug#43932) * doc/misc/tramp.texi (File name completion, Frequently Asked Questions): Remove `tramp-completion-reread-directory-timeout'. (Bug#43932) * etc/NEWS: Mention tramp-completion-reread-directory-timeout as obsolete. * lisp/net/tramp.el (tramp-completion-reread-directory-timeout): Make it obsolete. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index f990819cf5..cae0abfbf3 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -2943,19 +2943,6 @@ Example: @end group @end example -During file name completion, remote directory contents are re-read -regularly to account for any changes in the filesystem that may affect -the completion candidates. Such re-reads can account for changes to -the file system by applications outside Emacs (@pxref{Connection -caching}). - -@defopt tramp-completion-reread-directory-timeout -The timeout is number of seconds since last remote command for -rereading remote directory contents. A value of 0 re-reads -immediately during file name completion, @code{nil} uses cached -directory contents. -@end defopt - @node Ad-hoc multi-hops @section Declaring multiple hops in the file name @@ -3909,9 +3896,6 @@ files are not independently updated outside @value{tramp}'s control. That cache cleanup will be necessary if the remote directories or files are updated independent of @value{tramp}. -Set @code{tramp-completion-reread-directory-timeout} to @code{nil} to -speed up completions, @ref{File name completion}. - Disable version control to avoid delays: @lisp diff --git a/etc/NEWS b/etc/NEWS index 33e7ebec83..c3ee1cdd6a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -38,6 +38,10 @@ This is a bug-fix release with no new features. * Changes in Specialized Modes and Packages in Emacs 27.2 +** Tramp + +*** The user option 'tramp-completion-reread-directory-timeout' is made obsolete. + * New Modes and Packages in Emacs 27.2 @@ -231,7 +235,7 @@ it won't work right without some adjustment: Units that are ordered after 'emacs.service' will only be started after Emacs has finished initialization and is ready for use, and Emacs needs to be built with systemd support. (If your Emacs is -installed in a non-standard location and you copied the emacs.service +installed in a non-standard location and you copied the "emacs.service" file to e.g. "~/.config/systemd/user/", you will need to copy the new version of the file again.) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 2e6fbe1c76..e7432f2aa0 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1224,6 +1224,8 @@ have been gone since last remote command execution. A value of t would require an immediate reread during filename completion, nil means to use always cached values for the directory contents." :type '(choice (const nil) (const t) integer)) +(make-obsolete-variable + 'tramp-completion-reread-directory-timeout 'remote-file-name-inhibit-cache "27.2") ;;; Internal Variables: commit 2c31ce18eaa4710e6ff1d73c82432f218ded7c45 Author: Gregory Heytings Date: Sun Oct 11 17:36:44 2020 +0300 Fix 'message' when there's active minibuffer on another frame * lisp/minibuffer.el (set-minibuffer-message): Don't reuse the active minibuffer for displaying messages unless the active minibuffer is on the same frame as the selected window. Copyright-paperwork-exempt: yes diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index f6e2b236f3..10cfca8d58 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -784,7 +784,8 @@ whichever comes first. Unlike `minibuffer-message', this function is called automatically via `set-message-function'." (when (and (not noninteractive) - (window-live-p (active-minibuffer-window))) + (window-live-p (active-minibuffer-window)) + (eq (window-frame) (window-frame (active-minibuffer-window)))) (with-current-buffer (window-buffer (active-minibuffer-window)) (setq message (if (string-match-p "\\` *\\[.+\\]\\'" message) ;; Make sure we can put-text-property. commit f539ee9042f6eb30eecf928effab715396144744 Author: Stefan Monnier Date: Sat Oct 10 11:07:28 2020 -0400 * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Doc tweak Try and clarify the meaning of `init-value`. (cherry picked from commit 46c0f28c0e4e212687e90ec0ecb239d994105a19) diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 59e2e2e08f..ad4f2d6c9e 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -134,6 +134,10 @@ appear in DOC, a paragraph is added to DOC explaining usage of the mode argument. Optional INIT-VALUE is the initial value of the mode's variable. + Note that the minor mode function won't be called by setting + this option, so the value *reflects* the minor mode's natural + initial state, rather than *setting* it. + In the vast majority of cases it should be nil. Optional LIGHTER is displayed in the mode line when the mode is on. Optional KEYMAP is the default keymap bound to the mode keymap. If non-nil, it should be a variable name (whose value is a keymap),