commit 4ec00b0ff0db19dea79f28772ebb17e4b30ee2d4 (HEAD, refs/remotes/origin/master) Author: Michael Albinus Date: Mon Sep 20 10:21:30 2021 +0200 Remove superfluous skip in auth-source-tests.el * test/lisp/auth-source-tests.el (auth-source-test-netrc-create-secret): Remove superfluous skip. diff --git a/test/lisp/auth-source-tests.el b/test/lisp/auth-source-tests.el index 08e8325e9f..226bb69c46 100644 --- a/test/lisp/auth-source-tests.el +++ b/test/lisp/auth-source-tests.el @@ -360,7 +360,6 @@ (format "%s@%s" (plist-get auth-info :user) (plist-get auth-info :host)))))) (ert-deftest auth-source-test-netrc-create-secret () - (skip-unless secrets-enabled) (let* ((netrc-file (make-temp-file "auth-source-test")) (auth-sources (list netrc-file)) (auth-source-save-behavior t) commit fc268ed4399724978b4c1c8385965e443da6ca2e Author: Mattias Engdegård Date: Sun Sep 19 20:07:11 2021 +0200 Dump with `lexical-binding` bound to nil * lisp/loadup.el (dump-mode): Temporarily bind `lexical-binding` to nil while dumping. Otherwise, it will be t in Emacs by default and that is not our intention (yet). diff --git a/lisp/loadup.el b/lisp/loadup.el index 1889ff562c..fce17bf113 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -541,7 +541,8 @@ lost after dumping"))) (let (success) (unwind-protect (let ((tmp-dump-mode dump-mode) - (dump-mode nil)) + (dump-mode nil) + (lexical-binding nil)) (if (member tmp-dump-mode '("pdump" "pbootstrap")) (dump-emacs-portable (expand-file-name output invocation-directory)) (dump-emacs output "temacs") commit b34dcd96e909cc73ae0ff50215ac2c3f18b5ab30 Author: Eli Zaretskii Date: Mon Sep 20 10:50:53 2021 +0300 ; * src/keyboard.c (Frecursive_edit): Minor fixes of the doc string. diff --git a/src/keyboard.c b/src/keyboard.c index 2d97429ade..bc6f97586d 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -754,16 +754,17 @@ DEFUN ("recursive-edit", Frecursive_edit, Srecursive_edit, 0, 0, "", To get out of the recursive edit, a command can throw to `exit' -- for instance (throw \\='exit nil). -The following values can be thrown to 'exit: +The following values (last argument to `throw') can be used when +throwing to \\='exit: - t causes `recursive-edit' to quit, so that control returns to the command loop one level up. -- A string causes `recursive-edit' to signal an error, printing this - string as the message. +- A string causes `recursive-edit' to signal an error, printing that + string as the error message. -- A function causes `recursive-edit' to call this function without - arguments before returning normally. +- A function causes `recursive-edit' to call that function with no + arguments, and then return normally. - Any other value causes `recursive-edit' to return normally to the function that called it. commit 9e9db94423c0573edf283a0fc11f56d8d8025bf5 Author: Juri Linkov Date: Mon Sep 20 10:20:32 2021 +0300 * lisp/tab-bar.el (tab-bar-new-tab): Add optional arg 'from-number'. (tab-bar-mouse-context-menu): Use tab-number as an arg for 'tab-bar-duplicate-tab'. (tab-bar-duplicate-tab): Add optional arg 'from-number'. diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 5abc25b203..4e59508f6d 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -310,8 +310,7 @@ that closes only when clicked on the close button." (define-key-after menu [duplicate-tab] `(menu-item "Duplicate" (lambda () (interactive) (tab-bar-duplicate-tab - nil ;; TODO: add ,tab-number - )) + nil ,tab-number)) :help "Duplicate the tab")) (define-key-after menu [close] `(menu-item "Close" (lambda () (interactive) @@ -1276,15 +1275,19 @@ After the tab is created, the hooks in (unless tab-bar-mode (message "Added new tab at %s" tab-bar-new-tab-to)))) -(defun tab-bar-new-tab (&optional arg) +(defun tab-bar-new-tab (&optional arg from-number) "Create a new tab ARG positions to the right. If a negative ARG, create a new tab ARG positions to the left. If ARG is zero, create a new tab in place of the current tab. If no ARG is specified, then add a new tab at the position specified by `tab-bar-new-tab-to'. Argument addressing is relative in contrast to `tab-bar-new-tab-to' -where argument addressing is absolute." +where argument addressing is absolute. +If FROM-NUMBER is a tab number, a new tab is created from that tab." (interactive "P") + (when from-number + (let ((inhibit-message t)) + (tab-bar-select-tab from-number))) (if arg (let* ((tabs (funcall tab-bar-tabs-function)) (from-index (or (tab-bar--current-tab-index tabs) 0)) @@ -1292,13 +1295,13 @@ where argument addressing is absolute." (tab-bar-new-tab-to (1+ to-index))) (tab-bar-new-tab-to))) -(defun tab-bar-duplicate-tab (&optional arg) +(defun tab-bar-duplicate-tab (&optional arg from-number) "Duplicate the current tab to ARG positions to the right. -ARG has the same meaning as in `tab-bar-new-tab'." +ARG and FROM-NUMBER have the same meaning as in `tab-bar-new-tab'." (interactive "P") (let ((tab-bar-new-tab-choice nil) (tab-bar-new-tab-group t)) - (tab-bar-new-tab arg))) + (tab-bar-new-tab arg from-number))) (defvar tab-bar-closed-tabs nil commit 644d0ba589b94b1a23702cf8bad86b70204196f8 Author: Juri Linkov Date: Mon Sep 20 10:16:09 2021 +0300 Add support for url-retrieve-synchronously to eww-retrieve-command (bug#50680) * doc/misc/eww.texi (Advanced): Mention url-retrieve-synchronously for eww-retrieve-command. * lisp/net/eww.el (eww-retrieve-command): Add choice 'sync' for url-retrieve-synchronously. (eww-retrieve): Use value 'sync' for url-retrieve-synchronously. (eww-isearch-next-buffer): Let-bind eww-retrieve-command to 'sync'. diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi index cc546a92d6..2543dc2ff5 100644 --- a/doc/misc/eww.texi +++ b/doc/misc/eww.texi @@ -228,7 +228,8 @@ in an external browser by customizing @findex eww-retrieve-command EWW normally uses @code{url-retrieve} to fetch the @acronym{HTML} -before rendering it. It can sometimes be convenient to use an +before rendering it, and @code{url-retrieve-synchronously} when +the value is @code{sync}. It can sometimes be convenient to use an external program to do this, and @code{eww-retrieve-command} should then be a list that specifies a command and the parameters. For instance, to use the Chromium browser, you could say something like diff --git a/etc/NEWS b/etc/NEWS index 971b716a3b..726c625957 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2302,7 +2302,8 @@ This is a regexp that can be set to alter how links are followed in eww. +++ *** New user option 'eww-retrieve-command'. This can be used to download data via an external command. If nil -(the default), then 'url-retrieve' is used. +(the default), then 'url-retrieve' is used. When 'sync', then +'url-retrieve-synchronously' is used. +++ *** New Emacs command line convenience command. diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 36c6db0661..701dc4fade 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -143,11 +143,13 @@ The string will be passed through `substitute-command-keys'." (defcustom eww-retrieve-command nil "Command to retrieve an URL via an external program. -If nil, `url-retrieve' is used to download the data. If non-nil, -this should be a list where the first item is the program, and -the rest are the arguments." +If nil, `url-retrieve' is used to download the data. +If `sync', `url-retrieve-synchronously' is used. +For other non-nil values, this should be a list where the first item +is the program, and the rest are the arguments." :version "28.1" :type '(choice (const :tag "Use `url-retrieve'" nil) + (const :tag "Use `url-retrieve-synchronously'" sync) (repeat string))) (defcustom eww-use-external-browser-for-content-type @@ -366,9 +368,16 @@ killed after rendering." (list url nil (current-buffer)))))) (defun eww-retrieve (url callback cbargs) - (if (null eww-retrieve-command) - (url-retrieve url #'eww-render - (list url nil (current-buffer))) + (cond + ((null eww-retrieve-command) + (url-retrieve url #'eww-render + (list url nil (current-buffer)))) + ((eq eww-retrieve-command 'sync) + (let ((orig-buffer (current-buffer)) + (data-buffer (url-retrieve-synchronously url))) + (with-current-buffer data-buffer + (eww-render nil url nil orig-buffer)))) + (t (let ((buffer (generate-new-buffer " *eww retrieve*")) (error-buffer (generate-new-buffer " *eww error*"))) (with-current-buffer buffer @@ -388,7 +397,7 @@ killed after rendering." (with-current-buffer buffer (goto-char (point-min)) (insert "Content-type: text/html; charset=utf-8\n\n") - (apply #'funcall callback nil cbargs)))))))))) + (apply #'funcall callback nil cbargs))))))))))) (function-put 'eww 'browse-url-browser-kind 'internal) @@ -2398,13 +2407,14 @@ Otherwise, the restored buffer will contain a prompt to do so by using (defun eww-isearch-next-buffer (&optional _buffer wrap) "Go to the next page to search using `rel' attribute for navigation." - (if wrap - (condition-case nil - (eww-top-url) - (error nil)) - (if isearch-forward - (eww-next-url) - (eww-previous-url))) + (let ((eww-retrieve-command 'sync)) + (if wrap + (condition-case nil + (eww-top-url) + (error nil)) + (if isearch-forward + (eww-next-url) + (eww-previous-url)))) (current-buffer)) (provide 'eww) commit 469b15f27c6527de83979312b1a5c905e364cb8d Author: Miha Rihtaršič Date: Mon Sep 20 08:00:08 2021 +0200 Improve documentation of exiting recursive editing * doc/lispref/commands.texi (Recursive Editing): Mention what happens when throwing a string or any other value to 'exit. * src/keyboard.c (Frecursive_edit): Document throwing a function to 'exit (bug#49700). diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index ddd74d1245..3425880fec 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -3585,17 +3585,19 @@ commands. @cindex exit recursive editing @cindex aborting To invoke a recursive editing level, call the function -@code{recursive-edit}. This function contains the command loop; it also -contains a call to @code{catch} with tag @code{exit}, which makes it -possible to exit the recursive editing level by throwing to @code{exit} -(@pxref{Catch and Throw}). If you throw a @code{nil} value, then -@code{recursive-edit} returns normally to the function that called it. -The command @kbd{C-M-c} (@code{exit-recursive-edit}) does this. -Throwing a @code{t} value causes @code{recursive-edit} to quit, so that -control returns to the command loop one level up. This is called -@dfn{aborting}, and is done by @kbd{C-]} (@code{abort-recursive-edit}). -You can also throw a function value. In that case, +@code{recursive-edit}. This function contains the command loop; it +also contains a call to @code{catch} with tag @code{exit}, which makes +it possible to exit the recursive editing level by throwing to +@code{exit} (@pxref{Catch and Throw}). Throwing a @code{t} value +causes @code{recursive-edit} to quit, so that control returns to the +command loop one level up. This is called @dfn{aborting}, and is done +by @kbd{C-]} (@code{abort-recursive-edit}). Similarly, you can throw +a string value to make @code{recursive-edit} signal an error, printing +this string as the message. If you throw a function, @code{recursive-edit} will call it without arguments before returning. +Throwing any other value, will make @code{recursive-edit} return +normally to the function that called it. The command @kbd{C-M-c} +(@code{exit-recursive-edit}) does this. Most applications should not use recursive editing, except as part of using the minibuffer. Usually it is more convenient for the user if you diff --git a/src/keyboard.c b/src/keyboard.c index 63bf29a948..2d97429ade 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -753,10 +753,20 @@ DEFUN ("recursive-edit", Frecursive_edit, Srecursive_edit, 0, 0, "", doc: /* Invoke the editor command loop recursively. To get out of the recursive edit, a command can throw to `exit' -- for instance (throw \\='exit nil). -If you throw a value other than t, `recursive-edit' returns normally -to the function that called it. Throwing a t value causes -`recursive-edit' to quit, so that control returns to the command loop -one level up. + +The following values can be thrown to 'exit: + +- t causes `recursive-edit' to quit, so that control returns to the + command loop one level up. + +- A string causes `recursive-edit' to signal an error, printing this + string as the message. + +- A function causes `recursive-edit' to call this function without + arguments before returning normally. + +- Any other value causes `recursive-edit' to return normally to the + function that called it. This function is called by the editor initialization to begin editing. */) (void) commit 31ba9bbf6c2d0a265c77de1c068400b750ecf34b Author: Miha Rihtaršič Date: Mon Sep 20 07:59:29 2021 +0200 Refactor minibuffer aborting * lisp/minibuffer.el (minibuffer-quit-recursive-edit): New optional argument to specify how many levels of recursion to quit. * src/eval.c (internal_catch): Remove special handling of 'exit tag (bug#49700). * src/minibuf.c (Fabort_minibuffers): Use minibuffer-quit-recursive-edit to quit multiple levels of minibuffer recursion. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 9668e7c732..b5c0054a3c 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2349,14 +2349,18 @@ that displays the \"*Completions*\" buffer." (add-hook 'minibuffer-exit-hook 'minibuffer-restore-windows) -(defun minibuffer-quit-recursive-edit () - "Quit the command that requested this recursive edit without error. -Like `abort-recursive-edit' without aborting keyboard macro -execution." - ;; See Info node `(elisp)Recursive Editing' for an explanation of - ;; throwing a function to `exit'. - (throw 'exit (lambda () - (signal 'minibuffer-quit nil)))) +(defun minibuffer-quit-recursive-edit (&optional levels) + "Quit the command that requested this recursive edit or minibuffer input. +Do so without terminating keyboard macro recording or execution. +LEVELS specifies the number of nested recursive edits to quit. +If nil, it defaults to 1." + (unless levels + (setq levels 1)) + (if (> levels 1) + ;; See Info node `(elisp)Recursive Editing' for an explanation + ;; of throwing a function to `exit'. + (throw 'exit (lambda () (minibuffer-quit-recursive-edit (1- levels)))) + (throw 'exit (lambda () (signal 'minibuffer-quit nil))))) (defun self-insert-and-exit () "Terminate minibuffer input." diff --git a/src/eval.c b/src/eval.c index 48104bd0f4..76fe671b6d 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1174,14 +1174,6 @@ usage: (catch TAG BODY...) */) FUNC should return a Lisp_Object. This is how catches are done from within C code. */ -/* MINIBUFFER_QUIT_LEVEL is to handle quitting from nested minibuffers by - throwing t to tag `exit'. - 0 means there is no (throw 'exit t) in progress, or it wasn't from - a minibuffer which isn't the most nested; - N > 0 means the `throw' was done from the minibuffer at level N which - wasn't the most nested. */ -EMACS_INT minibuffer_quit_level = 0; - Lisp_Object internal_catch (Lisp_Object tag, Lisp_Object (*func) (Lisp_Object), Lisp_Object arg) @@ -1189,9 +1181,6 @@ internal_catch (Lisp_Object tag, /* This structure is made part of the chain `catchlist'. */ struct handler *c = push_handler (tag, CATCHER); - if (EQ (tag, Qexit)) - minibuffer_quit_level = 0; - /* Call FUNC. */ if (! sys_setjmp (c->jmp)) { @@ -1205,17 +1194,6 @@ internal_catch (Lisp_Object tag, Lisp_Object val = handlerlist->val; clobbered_eassert (handlerlist == c); handlerlist = handlerlist->next; - if (EQ (tag, Qexit) && EQ (val, Qt) && minibuffer_quit_level > 0) - /* If we've thrown t to tag `exit' from within a minibuffer, we - exit all minibuffers more deeply nested than the current - one. */ - { - if (minibuf_level > minibuffer_quit_level - && !NILP (Fminibuffer_innermost_command_loop_p (Qnil))) - Fthrow (Qexit, Qt); - else - minibuffer_quit_level = 0; - } return val; } } diff --git a/src/lisp.h b/src/lisp.h index 9716b34bae..720e621d19 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4120,7 +4120,6 @@ intern_c_string (const char *str) } /* Defined in eval.c. */ -extern EMACS_INT minibuffer_quit_level; extern Lisp_Object Vautoload_queue; extern Lisp_Object Vrun_hooks; extern Lisp_Object Vsignaling_function; diff --git a/src/minibuf.c b/src/minibuf.c index 0e7baf30dc..a4219d2a63 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -491,8 +491,13 @@ confirm the aborting of the current minibuffer and all contained ones. */) array[1] = make_fixnum (minibuf_level - minibuf_depth + 1); if (!NILP (Fyes_or_no_p (Fformat (2, array)))) { - minibuffer_quit_level = minibuf_depth; - Fthrow (Qexit, Qt); + /* Due to the above check, the current minibuffer is in the + most nested command loop, which means that we don't have + to abort any extra non-minibuffer recursive edits. Thus, + the number of recursive edits we have to abort equals the + number of minibuffers we have to abort. */ + CALLN (Ffuncall, intern ("minibuffer-quit-recursive-edit"), + array[1]); } } else commit 995a623594de27d398f0d97fcab9277e37fe29d1 Author: Philip Kaludercic Date: Mon Jul 12 17:26:43 2021 +0200 Fix dolist-with-progress-reporter behaviour * subr.el (dolist-with-progress-reporter): Use the length of list argument as maximal value the reporter with reach diff --git a/lisp/subr.el b/lisp/subr.el index 5fac316e37..6bd9a018eb 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -5995,7 +5995,7 @@ print the reporter message followed by the word \"done\". (,count 0) (,list ,(cadr spec))) (when (stringp ,prep) - (setq ,prep (make-progress-reporter ,prep 0 (1- (length ,list))))) + (setq ,prep (make-progress-reporter ,prep 0 (length ,list)))) (dolist (,(car spec) ,list) ,@body (progress-reporter-update ,prep (setq ,count (1+ ,count)))) commit 3c513435369826e44a53dcb12ecc14657e03c73d Author: Stefan Kangas Date: Sun Sep 19 22:28:46 2021 +0200 Revert "Flag checkdoc-symbol-words as a :safe variable" There was no need for this change, as this variable was already marked as :safe. This reverts commit 222a7a1a8afdf6921e5981133c605c2d695e9281. diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 8650d62a77..07ae855191 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -320,7 +320,6 @@ with a universal argument.") These words are ignored when unquoted symbols are searched for. This should be set in an Emacs Lisp file's local variables." :type '(repeat (string :tag "Word")) - :safe #'listp :version "28.1") ;;;###autoload(put 'checkdoc-symbol-words 'safe-local-variable #'checkdoc-list-of-strings-p) commit 558ca61cbdba5315c058f70d1ba2232f1391739e Author: Eli Zaretskii Date: Sun Sep 19 21:39:18 2021 +0300 Avoid segfaults due to 'bug-reference-mode' * src/xdisp.c (handle_fontified_prop): Set the frame's inhibit_clear_image_cache flag around calls to 'fontification-functions', to avoid Lisp triggering the clearing of image and/or face caches behind redisplay's back. (Big#50571) diff --git a/src/xdisp.c b/src/xdisp.c index 2e72f6b591..b777d1b282 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -4288,12 +4288,17 @@ handle_fontified_prop (struct it *it) struct buffer *obuf = current_buffer; ptrdiff_t begv = BEGV, zv = ZV; bool old_clip_changed = current_buffer->clip_changed; + bool saved_inhibit_flag = it->f->inhibit_clear_image_cache; val = Vfontification_functions; specbind (Qfontification_functions, Qnil); eassert (it->end_charpos == ZV); + /* Don't allow Lisp that runs from 'fontification-functions' + clear our face and image caches behind our back. */ + it->f->inhibit_clear_image_cache = true; + if (!CONSP (val) || EQ (XCAR (val), Qlambda)) safe_call1 (val, pos); else @@ -4327,6 +4332,7 @@ handle_fontified_prop (struct it *it) } } + it->f->inhibit_clear_image_cache = saved_inhibit_flag; unbind_to (count, Qnil); /* Fontification functions routinely call `save-restriction'. commit 7e0af65d78afc7c6cf8e16206e0bf696dc7396bf Author: Eli Zaretskii Date: Sun Sep 19 21:33:02 2021 +0300 Fix blocks.awk wrt to Emoji characters * admin/unidata/blocks.awk: Fix emoji-data.txt processing for older Awks. diff --git a/admin/unidata/blocks.awk b/admin/unidata/blocks.awk index 575f7142f4..6e52b52f67 100755 --- a/admin/unidata/blocks.awk +++ b/admin/unidata/blocks.awk @@ -204,7 +204,7 @@ FILENAME ~ "Blocks.txt" && /^[0-9A-F]/ { # The space after 'Emoji' is significant in the next two rules. # This purposely and deliberately excludes codepoints <= 00FF -FILENAME ~ "emoji-data.txt" && /^00[0-9A-F]{2}.*; Emoji / { +FILENAME ~ "emoji-data.txt" && /^00[0-9A-F][0-9A-F].*; Emoji / { next } FILENAME ~ "emoji-data.txt" && /^[0-9A-F].*; Emoji / { commit 788a65862ed9b9bc0437a016cae7e3ba1282a1a7 Author: Michael Albinus Date: Sun Sep 19 19:59:05 2021 +0200 Do not save empty passwords in auth-source-search * lisp/auth-source.el (auth-source-netrc-create) (auth-source-secrets-create): Set :save-function only for non empty passwords. * lisp/net/tramp.el (tramp-read-passwd): Don't save empty passwords. * test/lisp/auth-source-tests.el (auth-source-test-secrets-create-secret): Adapt test. (auth-source-test-netrc-create-secret): New test. diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 8d6ebd39dc..d938522c80 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -1282,6 +1282,8 @@ See `auth-source-search' for details on SPEC." (required (append base-required create-extra)) (file (oref backend source)) (add "") + ;; Whether to set save-function. + save-function ;; `valist' is an alist valist ;; `artificial' will be returned if no creation is needed @@ -1411,6 +1413,8 @@ See `auth-source-search' for details on SPEC." ;; When r is not an empty string... (when (and (stringp data) (< 0 (length data))) + (when (eq r 'secret) + (setq save-function t)) ;; this function is not strictly necessary but I think it ;; makes the code clearer -tzz (let ((printer (lambda () @@ -1431,12 +1435,13 @@ See `auth-source-search' for details on SPEC." data))))) (setq add (concat add (funcall printer))))))) - (plist-put - artificial - :save-function - (let ((file file) - (add add)) - (lambda () (auth-source-netrc-saver file add)))) + (when save-function + (plist-put + artificial + :save-function + (let ((file file) + (add add)) + (lambda () (auth-source-netrc-saver file add))))) (list artificial))) @@ -1664,6 +1669,8 @@ authentication tokens: :port port))) (required (append base-required create-extra)) (collection (oref backend source)) + ;; Whether to set save-function. + save-function ;; `args' are the arguments for `secrets-create-item'. args ;; `valist' is an alist @@ -1778,21 +1785,24 @@ authentication tokens: ;; When r is not an empty string... (when (and (stringp data) - (< 0 (length data)) - (not (member r '(secret label)))) - ;; append the key (the symbol name of r) - ;; and the value in r - (setq args (append args (list (auth-source--symbol-keyword r) data)))))) - - (plist-put - artificial - :save-function - (let* ((collection collection) - (item (plist-get artificial :label)) - (secret (plist-get artificial :secret)) - (secret (if (functionp secret) (funcall secret) secret))) - (lambda () - (auth-source-secrets-saver collection item secret args)))) + (< 0 (length data))) + (if (eq r 'secret) + (setq save-function t) + (if (not (eq r 'label)) + ;; append the key (the symbol name of r) + ;; and the value in r + (setq args (append args (list (auth-source--symbol-keyword r) data)))))))) + + (when save-function + (plist-put + artificial + :save-function + (let* ((collection collection) + (item (plist-get artificial :label)) + (secret (plist-get artificial :secret)) + (secret (if (functionp secret) (funcall secret) secret))) + (lambda () + (auth-source-secrets-saver collection item secret args))))) (list artificial))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 93ec8d6934..8c9200093d 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -5677,6 +5677,10 @@ Invokes `password-read' if available, `read-passwd' else." ;; Else, get the password interactively w/o cache. (read-passwd pw-prompt)) + ;; Workaround. Prior Emacs 28.1, auth-source has saved + ;; empty passwords. See discussion in Bug#50399. + (when (zerop (length auth-passwd)) + (setq tramp-password-save-function nil)) (tramp-set-connection-property v "first-password-request" nil))) ;; Reenable the timers. diff --git a/test/lisp/auth-source-tests.el b/test/lisp/auth-source-tests.el index 45482e916e..08e8325e9f 100644 --- a/test/lisp/auth-source-tests.el +++ b/test/lisp/auth-source-tests.el @@ -312,39 +312,105 @@ ;; Emacs process. Therefore, we don't care to delete it. (let ((auth-sources '((:source (:secrets "session")))) (auth-source-save-behavior t) - (host (md5 (concat (prin1-to-string process-environment) - (current-time-string)))) - (passwd (md5 (concat (prin1-to-string process-environment) - (current-time-string) (current-time-string)))) - auth-info auth-passwd) - ;; Redefine `read-*' in order to avoid interactive input. - (cl-letf (((symbol-function 'read-passwd) (lambda (_) passwd)) - ((symbol-function 'read-string) - (lambda (_prompt &optional _initial _history default - _inherit-input-method) - default))) - (setq auth-info - (car (auth-source-search - :max 1 :host host :require '(:user :secret) :create t)))) - (should (functionp (plist-get auth-info :save-function))) - (funcall (plist-get auth-info :save-function)) - - ;; Check, that the item has been created indeed. - (auth-source-forget+ :host t) - (setq auth-info (car (auth-source-search :host host)) - auth-passwd (plist-get auth-info :secret) - auth-passwd (if (functionp auth-passwd) - (funcall auth-passwd) - auth-passwd)) - (should (string-equal (plist-get auth-info :user) (user-login-name))) - (should (string-equal (plist-get auth-info :host) host)) - (should (string-equal auth-passwd passwd)) - - ;; Cleanup. - ;; Should use `auth-source-delete' when implemented for :secrets backend. - (secrets-delete-item - "session" - (format "%s@%s" (plist-get auth-info :user) (plist-get auth-info :host))))) + host auth-info auth-passwd) + (dolist (passwd '("foo" "" nil)) + (unwind-protect + ;; Redefine `read-*' in order to avoid interactive input. + (cl-letf (((symbol-function 'read-passwd) (lambda (_) passwd)) + ((symbol-function 'read-string) + (lambda (_prompt &optional _initial _history default + _inherit-input-method) + default))) + (setq host + (md5 (concat (prin1-to-string process-environment) passwd)) + auth-info + (car (auth-source-search + :max 1 :host host :require '(:user :secret) :create t)) + auth-passwd (plist-get auth-info :secret) + auth-passwd (if (functionp auth-passwd) + (funcall auth-passwd) + auth-passwd)) + (should (string-equal (plist-get auth-info :user) (user-login-name))) + (should (string-equal (plist-get auth-info :host) host)) + (should (equal auth-passwd passwd)) + (when (functionp (plist-get auth-info :save-function)) + (funcall (plist-get auth-info :save-function))) + + ;; Check, that the item has been created indeed. + (auth-source-forget+ :host t) + (setq auth-info (car (auth-source-search :host host)) + auth-passwd (plist-get auth-info :secret) + auth-passwd (if (functionp auth-passwd) + (funcall auth-passwd) + auth-passwd)) + (if (zerop (length passwd)) + (progn + (should-not (plist-get auth-info :user)) + (should-not (plist-get auth-info :host)) + (should-not auth-passwd)) + (should + (string-equal (plist-get auth-info :user) (user-login-name))) + (should (string-equal (plist-get auth-info :host) host)) + (should (string-equal auth-passwd passwd))))) + + ;; Cleanup. + ;; Should use `auth-source-delete' when implemented for :secrets backend. + (secrets-delete-item + "session" + (format "%s@%s" (plist-get auth-info :user) (plist-get auth-info :host)))))) + +(ert-deftest auth-source-test-netrc-create-secret () + (skip-unless secrets-enabled) + (let* ((netrc-file (make-temp-file "auth-source-test")) + (auth-sources (list netrc-file)) + (auth-source-save-behavior t) + host auth-info auth-passwd) + (unwind-protect + (dolist (passwd '("foo" "" nil)) + ;; Redefine `read-*' in order to avoid interactive input. + (cl-letf (((symbol-function 'read-passwd) (lambda (_) passwd)) + ((symbol-function 'read-string) + (lambda (_prompt &optional _initial _history default + _inherit-input-method) + default))) + (setq host + (md5 (concat (prin1-to-string process-environment) passwd)) + auth-info + (car (auth-source-search + :max 1 :host host :require '(:user :secret) :create t)) + auth-passwd (plist-get auth-info :secret) + auth-passwd (if (functionp auth-passwd) + (funcall auth-passwd) + auth-passwd)) + (should (string-equal (plist-get auth-info :user) (user-login-name))) + (should (string-equal (plist-get auth-info :host) host)) + (should (equal auth-passwd passwd)) + (when (functionp (plist-get auth-info :save-function)) + (funcall (plist-get auth-info :save-function))) + + ;; Check, that the item has been created indeed. + (auth-source-forget+ :host t) + (setq auth-info (car (auth-source-search :host host)) + auth-passwd (plist-get auth-info :secret) + auth-passwd (if (functionp auth-passwd) + (funcall auth-passwd) + auth-passwd)) + (with-temp-buffer + (insert-file-contents netrc-file) + (if (zerop (length passwd)) + (progn + (should-not (plist-get auth-info :user)) + (should-not (plist-get auth-info :host)) + (should-not auth-passwd) + (should-not (search-forward host nil 'noerror))) + (should + (string-equal (plist-get auth-info :user) (user-login-name))) + (should (string-equal (plist-get auth-info :host) host)) + (should (string-equal auth-passwd passwd)) + (should (search-forward host nil 'noerror)))))) + + ;; Cleanup. + (delete-file netrc-file)))) (ert-deftest auth-source-delete () (let* ((netrc-file (make-temp-file "auth-source-test" nil nil "\ commit 7abbf3779cf88c59a9c20526464974213db63fdb Author: Stefan Kangas Date: Sun Sep 19 18:33:35 2021 +0200 Be explicit about missing sections in eshell manual * doc/misc/eshell.texi (Writing a module, Module testing) (Directory handling, Key rebinding, Smart scrolling) (Terminal emulation): Explicitly say that these sections remain to be written. (Bug#49306) diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index fc2e3f3b11..c01ceb5fb9 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -744,21 +744,33 @@ Eshell module.} You also need to load the following as shown: @node Writing a module @section Writing a module +This section is not yet written. + @node Module testing @section Module testing +This section is not yet written. + @node Directory handling @section Directory handling +This section is not yet written. + @node Key rebinding @section Key rebinding +This section is not yet written. + @node Smart scrolling @section Smart scrolling +This section is not yet written. + @node Terminal emulation @section Terminal emulation +This section is not yet written. + @node Bugs and ideas @chapter Bugs and ideas @cindex reporting bugs and ideas commit 4c3b6f297307f2774ccc50898783cda491f783ee Author: Juri Linkov Date: Sun Sep 19 19:21:27 2021 +0300 * lisp/progmodes/elisp-mode.el (elisp-context-menu): Improve menu items. diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 04311985c1..d082db5f02 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -169,9 +169,19 @@ All commands in `lisp-mode-shared-map' are inherited by this map.") (symbol (when (stringp string) (intern string))) (title (cond ((not (symbolp symbol)) nil) - ((fboundp symbol) "Function") - ((and (boundp symbol) (not (keywordp symbol))) "Variable") - ((facep symbol) "Face")))) + ((and (facep symbol) (not (fboundp symbol))) + "Face") + ((and (fboundp symbol) (boundp symbol) + (memq symbol minor-mode-list)) + "Mode") + ((and (fboundp symbol) + (not (or (boundp symbol) (facep symbol)))) + "Function") + ((and (boundp symbol) + (not (or (fboundp symbol) (facep symbol)))) + "Variable") + ((or (fboundp symbol) (boundp symbol) (facep symbol)) + "Symbol")))) (when title (define-key-after menu [describe-symbol] `(menu-item (format "Describe %s" ,title) commit 19e72564b25ed00001ee25995df6fa1f049d45ff Author: Ken Brown Date: Sat Sep 18 14:03:41 2021 -0400 Fix build with native compilation on Cygwin * src/Makefile.in (emacs$(EXEEXT)) [CYGWIN]: Rebase the *.eln files after they are all created, to avoid fork problems later in the build. (Bug#50666) diff --git a/src/Makefile.in b/src/Makefile.in index 732cd8f099..bb69a65707 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -547,6 +547,8 @@ ${charscript}: FORCE ${lispintdir}/characters.elc: ${charscript:.el=.elc} +SYSTEM_TYPE = @SYSTEM_TYPE@ + ## The dumped Emacs is as functional and more efficient than ## bootstrap-emacs, so we replace the latter with the former. ## Strictly speaking, emacs does not depend directly on all of $lisp, @@ -555,6 +557,9 @@ ${lispintdir}/characters.elc: ${charscript:.el=.elc} emacs$(EXEEXT): temacs$(EXEEXT) \ lisp.mk $(etc)/DOC $(lisp) \ $(lispsource)/international/charprop.el ${charsets} +ifeq ($(SYSTEM_TYPE),cygwin) + find ${top_builddir} -name '*.eln' | rebase -v -O -T - +endif ifeq ($(DUMPING),unexec) LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=dump ifneq ($(PAXCTL_dumped),) commit bbb9e97537233ae051e14dead31352d3bc0f32b6 Author: 王滋涵 Zephyr Wang Date: Sun Sep 19 17:39:26 2021 +0200 ; Fix typo in package.el doc string * lisp/emacs-lisp/package.el (package-archive-column-width): Fix copy-paste in doc string (bug#50678). Copyright-paperwork-exempt: yes diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 7418b580e8..a0829f118d 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -426,7 +426,7 @@ synchronously." :version "28.1") (defcustom package-archive-column-width 8 - "Column width for the Package status in the package menu." + "Column width for the Package archive in the package menu." :type 'number :version "28.1") commit 86837a87b7acc04814ec126d00cd3ef095de3012 Author: Stefan Kangas Date: Sun Sep 19 17:25:39 2021 +0200 Clarify docstring of pcase-exhaustive * lisp/emacs-lisp/pcase.el (pcase-exhaustive): Clarify docstring by contrasting with pcase. (Bug#44166) diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index c6173c710f..a3498d2da8 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -201,7 +201,11 @@ Emacs Lisp manual for more information and examples." ;;;###autoload (defmacro pcase-exhaustive (exp &rest cases) "The exhaustive version of `pcase' (which see). -If EXP fails to match any of the patterns in CASES, an error is signaled." +If EXP fails to match any of the patterns in CASES, an error is +signaled. + +In contrast, `pcase' will return nil if there is no match, but +not signal an error." (declare (indent 1) (debug pcase)) (let* ((x (gensym "x")) (pcase--dontwarn-upats (cons x pcase--dontwarn-upats))) commit 7b3f02de12112b32f9c51b08cb6a947f167a3b03 Author: Stefan Kangas Date: Sun Sep 19 16:55:10 2021 +0200 Make two unused variables obsolete * lisp/progmodes/idlw-help.el (idlwave-help-directory) (idlwave-help-use-hh): Make unused variables obsolete. diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el index ffa3d78b4d..df04a43d3f 100644 --- a/lisp/progmodes/idlw-help.el +++ b/lisp/progmodes/idlw-help.el @@ -66,9 +66,6 @@ is used in preference to the old `idlwave-html-help-location'." 6.2 or later (see `idlwave-html-system-help-location')." :type 'directory) -(defvar idlwave-help-use-hh nil - "Obsolete variable.") - (defcustom idlwave-help-use-assistant t "Whether to use the IDL Assistant as the help browser." :type 'boolean) @@ -98,9 +95,6 @@ must be explicitly set non-nil in order for the variable `idlwave-help-use-dedicated-frame' to function." :type 'boolean) -(defvar idlwave-help-directory "" - "Obsolete variable. See `idlwave-html-help-location'.") - (defcustom idlwave-help-use-dedicated-frame t "Non-nil means, use a separate frame for Online Help if possible." :type 'boolean) @@ -1348,8 +1342,15 @@ IDL assistant.") (setq idlwave-help-assistant-socket nil idlwave-help-assistant-process nil))) +;;; Obsolete + (defvar idlwave-help-browse-url-available t) (make-obsolete-variable 'idlwave-help-browse-url-available nil "28.1") +(defvar idlwave-help-use-hh nil "Obsolete variable.") +(make-obsolete-variable 'idlwave-help-use-hh nil "28.1") +(defvar idlwave-help-directory "" + "Obsolete variable. See `idlwave-html-help-location'.") +(make-obsolete-variable 'idlwave-help-directory nil "28.1") (provide 'idlw-help) (provide 'idlwave-help) commit 95f7f715604ff2fabf4a71c728672460d023f91e Author: Stefan Kangas Date: Sun Sep 19 16:54:38 2021 +0200 ; Delete a spurious comment diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el index bd494d87be..069364f5a2 100644 --- a/lisp/vc/ediff-init.el +++ b/lisp/vc/ediff-init.el @@ -74,12 +74,6 @@ that Ediff doesn't know about.") (boundp 'ediff-use-toolbar-p) ediff-use-toolbar-p)) ;Does the user want it ? -;; Defines VAR as an advertised local variable. -;; Performs a defvar, then executes `make-variable-buffer-local' on -;; the variable. Also sets the `permanent-local' property, -;; so that `kill-all-local-variables' (called by major-mode setting -;; commands) won't destroy Ediff control variables. -;; ;; Plagiarized from `emerge-defvar-local'. (defmacro ediff-defvar-local (symbol value &optional doc) "Define SYMBOL as an advertised buffer-local variable. commit 3eb480c8a425a6c563bb75b45911c3aa7169faee Author: Stefan Kangas Date: Sun Sep 19 16:48:35 2021 +0200 ; Stylistic docfixes in net/*.el found by checkdoc diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 25ae20702a..56a1d76d71 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -1357,7 +1357,7 @@ only return the directory part of FILE." (defun ange-ftp-parse-netrc () ;; We set this before actually doing it to avoid the possibility - ;; of an infinite loop if ange-ftp-netrc-filename is an FTP file. + ;; of an infinite loop if `ange-ftp-netrc-filename' is an FTP file. (interactive) (let (file attr) (let ((default-directory "/")) @@ -3591,11 +3591,11 @@ Value is (0 0) if the modification time cannot be determined." (ange-ftp-real-verify-visited-file-modtime buf)))) (defun ange-ftp-file-size (file &optional ascii-mode) - "Return the size of remote file FILE. Return -1 if can't get it. -If ascii-mode is non-nil, return the size with the extra octets that + "Return the size of remote file FILE. Return -1 if can't get it. +If ASCII-MODE is non-nil, return the size with the extra octets that need to be inserted, one at the end of each line, to provide correct -end-of-line semantics for a transfer using TYPE=A. The default is nil, -so return the size on the remote host exactly. See RFC 3659." +end-of-line semantics for a transfer using TYPE=A. The default is nil, +so return the size on the remote host exactly. See RFC 3659." (let* ((parsed (ange-ftp-ftp-name file)) (host (nth 0 parsed)) (user (nth 1 parsed)) diff --git a/lisp/net/eudc-bob.el b/lisp/net/eudc-bob.el index 1d7af7f5b5..7ad92b22af 100644 --- a/lisp/net/eudc-bob.el +++ b/lisp/net/eudc-bob.el @@ -252,17 +252,14 @@ display a button." ;; If the first arguments can be nil here, then these 3 can be ;; defconsts once more. -(easy-menu-define eudc-bob-generic-menu - eudc-bob-generic-keymap - "" +(easy-menu-define eudc-bob-generic-menu eudc-bob-generic-keymap + "EUDC Binary Object Menu." eudc-bob-generic-menu) -(easy-menu-define eudc-bob-image-menu - eudc-bob-image-keymap - "" +(easy-menu-define eudc-bob-image-menu eudc-bob-image-keymap + "EUDC Image Menu." eudc-bob-image-menu) -(easy-menu-define eudc-bob-sound-menu - eudc-bob-sound-keymap - "" +(easy-menu-define eudc-bob-sound-menu eudc-bob-sound-keymap + "EUDC Sound Menu." eudc-bob-sound-menu) ;;;###autoload diff --git a/lisp/net/eudc-hotlist.el b/lisp/net/eudc-hotlist.el index a737a99ce9..43c1a2886f 100644 --- a/lisp/net/eudc-hotlist.el +++ b/lisp/net/eudc-hotlist.el @@ -174,9 +174,8 @@ These are the special commands of this mode: ["Save and Quit" eudc-hotlist-quit-edit t] ["Exit without Saving" kill-this-buffer t])) -(easy-menu-define eudc-hotlist-emacs-menu - eudc-hotlist-mode-map - "" +(easy-menu-define eudc-hotlist-emacs-menu eudc-hotlist-mode-map + "EUDC hotlist Menu." eudc-hotlist-menu) ;;; eudc-hotlist.el ends here diff --git a/lisp/net/eudcb-ldap.el b/lisp/net/eudcb-ldap.el index 0aff276475..fc48656726 100644 --- a/lisp/net/eudcb-ldap.el +++ b/lisp/net/eudcb-ldap.el @@ -202,7 +202,7 @@ attribute names are returned. Default to `person'." "Check if the current LDAP server has a configured search base." (unless (or (eudc-ldap-get-host-parameter eudc-server 'base) ldap-default-base - (null (y-or-n-p "No search base defined. Configure it now? "))) + (null (y-or-n-p "No search base defined. Configure it now?"))) ;; If the server is not in ldap-host-parameters-alist we add it for the ;; user (if (null (assoc eudc-server ldap-host-parameters-alist)) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index c1202974f4..36c6db0661 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -57,7 +57,7 @@ :type 'string) (defcustom eww-use-browse-url "\\`mailto:" - "eww will use `browse-url' when following links that match this regexp. + "EWW will use `browse-url' when following links that match this regexp. The action to be taken can be further customized via `browse-url-handlers'." :version "28.1" diff --git a/lisp/net/hmac-def.el b/lisp/net/hmac-def.el index 5ea8839699..5af6d4324a 100644 --- a/lisp/net/hmac-def.el +++ b/lisp/net/hmac-def.el @@ -34,8 +34,8 @@ HMAC function is H(KEY XOR opad, H(KEY XOR ipad, TEXT)): H is a cryptographic hash function, such as SHA1 and MD5, which takes a string and return a digest of it (in binary form). -B is a byte-length of a block size of H. (B=64 for both SHA1 and MD5.) -L is a byte-length of hash outputs. (L=16 for MD5, L=20 for SHA1.) +B is a byte length of a block size of H. (B=64 for both SHA1 and MD5.) +L is a byte length of hash outputs. (L=16 for MD5, L=20 for SHA1.) If BIT is non-nil, truncate output to specified bits." `(defun ,name (text key) ,(concat "Compute " diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el index 8b63dce211..8b35a2d8e1 100644 --- a/lisp/net/ldap.el +++ b/lisp/net/ldap.el @@ -154,8 +154,7 @@ Valid properties include: (string :tag "Argument"))) (defcustom ldap-ldapsearch-password-prompt-regexp "Enter LDAP Password: " - "A regular expression used to recognize the `ldapsearch' -program's password prompt." + "Regexp used to recognize the `ldapsearch' program's password prompt." :type 'regexp :version "25.1") diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el index 90cca7d415..6f44d9844e 100644 --- a/lisp/net/net-utils.el +++ b/lisp/net/net-utils.el @@ -885,9 +885,9 @@ and `network-connection-service-alist', which see." :type '(repeat (cons string string))) (defcustom whois-guess-server t - "If non-nil then whois will try to deduce the appropriate whois -server from the query. If the query doesn't look like a domain or hostname -then the server named by `whois-server-name' is used." + "If non-nil, try to deduce the appropriate whois server from the query. +If the query doesn't look like a domain or hostname then the +server named by `whois-server-name' is used." :type 'boolean) (defun whois-get-tld (host) @@ -943,7 +943,7 @@ The port is deduced from `network-connection-service-alist'." ;; Using a derived mode gives us keymaps, hooks, etc. (define-derived-mode network-connection-mode comint-mode "Network-Connection" - "Major mode for interacting with the network-connection program.") + "Major mode for interacting with the `network-connection' program.") (defun network-connection-mode-setup (host service) (setq-local network-connection-host host) diff --git a/lisp/net/ntlm.el b/lisp/net/ntlm.el index 0450c80c2e..747a69fb5d 100644 --- a/lisp/net/ntlm.el +++ b/lisp/net/ntlm.el @@ -405,8 +405,8 @@ by PASSWORD-HASHES. PASSWORD-HASHES should be a return value of (ntlm-md4hash password))) (defun ntlm-ascii2unicode (str len) - "Convert an ASCII string into a NT Unicode string, which is -little-endian utf16." + "Convert an ASCII string STR of length LEN into a NT Unicode string. +NT Unicode strings are little-endian utf16." ;; FIXME: Can't we use encode-coding-string with a `utf-16le' coding system? (let ((utf (make-string (* 2 len) 0)) (i 0) @@ -428,25 +428,24 @@ little-endian utf16." buf)) (defun ntlm-smb-passwd-hash (passwd) - "Return the SMB password hash string of 16 bytes long for the given password -string PASSWD. PASSWD is truncated to 14 bytes if longer." + "Return SMB password hash string of 16 bytes long for password string PASSWD. +PASSWD is truncated to 14 bytes if longer." (let ((len (min (length passwd) 14))) (ntlm-smb-des-e-p16 (concat (substring (upcase passwd) 0 len) ;fill top 14 bytes with passwd (make-string (- 15 len) 0))))) (defun ntlm-smb-owf-encrypt (passwd c8) - "Return the response string of 24 bytes long for the given password -string PASSWD based on the DES encryption. PASSWD is of at most 14 -bytes long and the challenge string C8 of 8 bytes long." + "Return response string of 24 bytes long for password string PASSWD based on DES encryption. +PASSWD is of at most 14 bytes long and the challenge string C8 of +8 bytes long." (let* ((len (min (length passwd) 16)) (p22 (concat (substring passwd 0 len) ;Fill top 16 bytes with passwd. (make-string (- 22 len) 0)))) (ntlm-smb-des-e-p24 p22 c8))) (defun ntlm-smb-des-e-p24 (p22 c8) - "Return a 24 bytes hashed string for a 21 bytes string P22 and a 8 bytes -string C8." + "Return 24 bytes hashed string for a 21 bytes string P22 and a 8 bytes string C8." (concat (ntlm-smb-hash c8 p22 t) ;hash first 8 bytes of p22 (ntlm-smb-hash c8 (substring p22 7) t) (ntlm-smb-hash c8 (substring p22 14) t))) @@ -460,8 +459,8 @@ string C8." (substring p15 7) t))) (defun ntlm-smb-hash (in key forw) - "Return the hash string of length 8 for a string IN of length 8 and -a string KEY of length 8. FORW is t or nil." + "Return hash string of length 8 for a string IN of length 8 and a string KEY of length 8. +FORW is t or nil." (let ((out (make-string 8 0)) (inb (make-string 64 0)) (keyb (make-string 64 0)) @@ -603,8 +602,8 @@ a string KEY of length 8. FORW is t or nil." [ 2 1 14 7 4 10 8 13 15 12 9 0 3 5 6 11]]]) (defsubst ntlm-string-permute (in perm n) - "Return a string of length N for a string IN and a permutation vector -PERM of size N. The length of IN should be height of PERM." + "Return string of length N for string IN and permutation vector PERM of size N. +The length of IN should be height of PERM." (let ((i 0) (out (make-string n 0))) (while (< i n) (aset out i (aref in (- (aref perm i) 1))) @@ -701,8 +700,8 @@ backward." (ntlm-string-permute rl ntlm-smb-perm6 64))) (defun ntlm-md4hash (passwd) - "Return the 16 bytes MD4 hash of a string PASSWD after converting it -into a Unicode string. PASSWD is truncated to 128 bytes if longer." + "Return 16 bytes MD4 hash of string PASSWD after converting it to Unicode. +PASSWD is truncated to 128 bytes if longer." (let* ((len (min (length passwd) 128)) ;Pwd can't be > than 128 characters. ;; Password must be converted to NT Unicode. (wpwd (ntlm-ascii2unicode passwd len))) diff --git a/lisp/net/quickurl.el b/lisp/net/quickurl.el index 046953faf6..7f147fa0de 100644 --- a/lisp/net/quickurl.el +++ b/lisp/net/quickurl.el @@ -284,7 +284,7 @@ It also restores point after the `read'." "Return URL associated with key LOOKUP. The lookup is done by looking in the alist `quickurl-urls' and the `cons' -for the URL is returned. The actual method used to look into the alist +for the URL is returned. The actual method used to look into the alist depends on the setting of the variable `quickurl-assoc-function'." (funcall quickurl-assoc-function lookup quickurl-urls)) diff --git a/lisp/net/rlogin.el b/lisp/net/rlogin.el index 3136e53b80..a7001c1310 100644 --- a/lisp/net/rlogin.el +++ b/lisp/net/rlogin.el @@ -238,8 +238,8 @@ ange-ftp. If called as a function, give it no argument. If called with a negative prefix argument, disable directory tracking entirely. -If called with a positive, numeric prefix argument, e.g. -`\\[universal-argument] 1 M-x rlogin-directory-tracking-mode', +If called with a positive, numeric prefix argument, for example +\\[universal-argument] 1 \\[rlogin-directory-tracking-mode], then do directory tracking but assume the remote filesystem is the same as the local system. This only works in general if the remote machine and the local one share the same directories (e.g. through NFS)." diff --git a/lisp/net/sasl-ntlm.el b/lisp/net/sasl-ntlm.el index dfb7e71330..9a5bba5b29 100644 --- a/lisp/net/sasl-ntlm.el +++ b/lisp/net/sasl-ntlm.el @@ -37,8 +37,8 @@ '(ignore ;nothing to do before making sasl-ntlm-request ;authentication request sasl-ntlm-response) ;response to challenge - "A list of functions to be called in sequence for the NTLM -authentication steps. They are called by `sasl-next-step'.") + "List of functions to call in sequence for the NTLM authentication steps. +They are called by `sasl-next-step'.") (defun sasl-ntlm-request (client _step) "SASL step function to generate a NTLM authentication request to the server. diff --git a/lisp/net/socks.el b/lisp/net/socks.el index 7ac8bbbf1b..be299603a8 100644 --- a/lisp/net/socks.el +++ b/lisp/net/socks.el @@ -154,7 +154,7 @@ (defcustom socks-server (list "Default server" "socks" 1080 5) - "" + "Socks server." :type '(list (string :format "" :value "Default server") (string :tag "Server") diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el index 9aa5d50d6c..1716853923 100644 --- a/lisp/net/telnet.el +++ b/lisp/net/telnet.el @@ -73,8 +73,9 @@ LOGIN-NAME, which is optional, says what to log in as on that machine.") (defvar telnet-prompt-pattern "^[^#$%>\n]*[#$%>] *") (defvar telnet-replace-c-g nil) (defvar-local telnet-remote-echoes t - "True if the telnet process will echo input.") -(defvar-local telnet-interrupt-string "\C-c" "String sent by C-c.") + "Non-nil if the telnet process will echo input.") +(defvar-local telnet-interrupt-string "\C-c" + "String sent by C-c.") (defvar-local telnet-count 0 "Number of output strings from telnet process while looking for password.") @@ -123,7 +124,7 @@ rejecting one login and prompting again for a username and password.") ;;maybe should have a flag for when have found type (defun telnet-check-software-type-initialize (string) - "Tries to put correct initializations in. Needs work." + "Try to put correct initializations in. Needs work." (let ((case-fold-search t)) (cond ((string-match "unix" string) (setq telnet-prompt-pattern comint-prompt-regexp) @@ -246,7 +247,7 @@ Normally input is edited in Emacs and sent a line at a time." (define-derived-mode telnet-mode comint-mode "Telnet" "This mode is for using telnet (or rsh) from a buffer to another host. -It has most of the same commands as comint-mode. +It has most of the same commands as `comint-mode'. There is a variable `telnet-interrupt-string' which is the character sent to try to stop execution of a job on the remote host. Data is sent to the remote host when RET is typed." commit 775fc5312b8a5775e2089532f757c081d0fb9a80 Author: Stefan Kangas Date: Sun Sep 19 16:28:29 2021 +0200 * etc/NEWS: Add section on recent checkdoc changes. diff --git a/etc/NEWS b/etc/NEWS index fa240f68b4..971b716a3b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2767,6 +2767,36 @@ height of lines or width of chars. When non-nil, use a new xwidget webkit session after bookmark jump. Otherwise, it will use 'xwidget-webkit-last-session'. +** Checkdoc + +--- +*** No longer warns about command substitutions by default. +Checkdoc used to warn about "too many command substitutions" (as in +"\\[foo-command]"), even if you only used ten of them in a docstring. +On modern machines, you can have hundreds or thousands of command +substitutions before it becomes a performance issue, so this warning +is now disabled by default. To re-enable this warning, customize the +user option 'checkdoc-max-keyref-before-warn'. + +--- +*** New user option 'checkdoc-column-zero-backslash-before-paren'. +Checkdoc warns if there is a left parenthesis in column zero of a +documentation string. That warning can now be disabled by customizing +this new user option to nil. This is useful if you don't expect +your code to be edited with an Emacs older than version 27.1. + +--- +*** Now checks the prompt format for 'yes-or-no-p'. +In addition to verifying the format of the prompt for 'y-or-n-p', +checkdoc will now check the format of 'yes-or-no-p'. + +--- +*** No longer checks for "A-" modifiers. +Checkdoc recommends usage of command substitutions ("\\[foo-command]") +in favor of writing keybindings like "C-c f". It now no longer warns +about the "A-" modifier as it is not used very much in practice, and +this warning therefore mostly led to false positives. + ** Enriched mode --- @@ -2938,13 +2968,6 @@ after every monthly meeting which takes place on the third Thursday, or if you would like to attend a virtual meeting scheduled in a different timezone causing a difference in the date. ---- -*** New user option 'checkdoc-column-zero-backslash-before-paren'. -Checkdoc warns if there is a left parenthesis in column zero of a -documentation string. That warning can now be disabled by customizing -this new user option to nil. This can be useful if you don't expect -your code to be edited with an Emacs version older than 27.1. - --- *** The old non-SMIE indentation of 'sh-mode' has been removed. @@ -4165,8 +4188,9 @@ do not support the old calling conventions any longer. +++ ** 'yes-or-no-p' and 'y-or-n-p' PROMPT parameter no longer needs trailing space. -This has been the case since Emacs 24.4 but was not announced or -documented until now. +In other words, the prompt can now end with "?" instead of "? ". This +has been the case since Emacs 24.4 but was not announced or documented +until now. (Checkdoc has also been updated to accept this convention.) +++ ** The 'uniquify' argument in 'auto-save-file-name-transforms' can be a symbol. commit 5252c45850b3c4a3914f6c94dc163c2c23286bbf Author: Mattias Engdegård Date: Sun Sep 19 16:16:34 2021 +0200 Initialise unread buffer The reader has an extra 1-char unread buffer that was incorrectly initialised to 0, which means that the first character read would always be NUL. As this is often the code that looks for the lexical-binding cookie, the first loaded source module would be treated as dynamically bound. During bootstrapping this is loadup.el and so its local variables got dumped into the global environment. * src/lread.c (unread_char): Initialise to empty. (Fload): Initialise here too just in case. diff --git a/src/lread.c b/src/lread.c index a6c2db5d99..2abe2fd91a 100644 --- a/src/lread.c +++ b/src/lread.c @@ -192,7 +192,7 @@ static int readbyte_from_string (int, Lisp_Object); Qlambda, or a cons, we use this to keep an unread character because a file stream can't handle multibyte-char unreading. The value -1 means that there's no unread character. */ -static int unread_char; +static int unread_char = -1; static int readchar (Lisp_Object readcharfun, bool *multibyte) @@ -1507,6 +1507,7 @@ Return t if the file exists and loads successfully. */) input.stream = stream; input.lookahead = 0; infile = &input; + unread_char = -1; } if (! NILP (Vpurify_flag)) commit 83508013a8d55bc70dfb716c253c7c4ec8848ab4 Author: Stefan Kangas Date: Sun Sep 19 14:09:20 2021 +0200 checkdoc: Verify format of yes-or-no-p and format-message * lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-next-string): Check also for "yes-or-no-p" and "format-message". Convert regexps to use rx. diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 7b3c0689fb..8650d62a77 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -2463,10 +2463,18 @@ Return the message classification. Argument END is the maximum bounds to search in." (let ((return nil)) (while (and (not return) - (re-search-forward - "(\\s-*\\(\\(\\w\\|\\s_\\)*error\\|\ -\\(\\w\\|\\s_\\)*y-or-n-p\\(-with-timeout\\)?\ -\\|checkdoc-autofix-ask-replace\\)[ \t\n]+" end t)) + (re-search-forward + (rx "(" + (* (syntax whitespace)) + (group + (or (seq (* (group (or wordchar (syntax symbol)))) + "error") + (seq (* (group (or wordchar (syntax symbol)))) + (or "y-or-n-p" "yes-or-no-p") + (? (group "-with-timeout"))) + "checkdoc-autofix-ask-replace")) + (+ (any "\n\t "))) + end t)) (let* ((fn (match-string 1)) (type (cond ((string-match "error" fn) 'error) @@ -2475,7 +2483,7 @@ Argument END is the maximum bounds to search in." (progn (forward-sexp 2) (skip-chars-forward " \t\n"))) (if (and (eq type 'y-or-n-p) - (looking-at "(format[ \t\n]+")) + (looking-at (rx "(format" (? "-message") (+ (any " \t\n"))))) (goto-char (match-end 0))) (skip-chars-forward " \t\n") (if (not (looking-at "\"")) commit 8772d81966f0b1cec400fd638c5ab809cae91df4 Author: Stefan Kangas Date: Sun Sep 19 13:21:56 2021 +0200 ; Some more docfixes for erc/*.el diff --git a/lisp/erc/erc-autoaway.el b/lisp/erc/erc-autoaway.el index 857a686454..f7de61ce79 100644 --- a/lisp/erc/erc-autoaway.el +++ b/lisp/erc/erc-autoaway.el @@ -227,8 +227,7 @@ NONE-ALIVE-FUNC is the function to call if no ERC processes are alive." (when none-alive-func (funcall none-alive-func))))) (defun erc-autoaway-some-open-server-buffer () - "Return some ERC server buffer if its connection is alive and the -user is not away. + "Return some ERC server buffer if its connection is alive and user is not away. If none is found, return nil." (car (erc-buffer-list (lambda () (and (erc-open-server-buffer-p) diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 4040a7bcae..10be2965ad 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -444,7 +444,7 @@ Currently this is called by `erc-send-input'." (defun erc-forward-word () "Move forward one word, ignoring any subword settings. -If no subword-mode is active, then this is (forward-word)." +If no `subword-mode' is active, then this is (forward-word)." (skip-syntax-forward "^w") (> (skip-syntax-forward "w") 0)) @@ -458,7 +458,7 @@ If POS is out of range, the value is nil." (defun erc-bounds-of-word-at-point () "Return the bounds of word at point, or nil if we're not at a word. -If no subword-mode is active, then this is +If no `subword-mode' is active, then this is \(bounds-of-thing-at-point 'word)." (if (or (erc-word-at-arg-p (point)) (erc-word-at-arg-p (1- (point)))) diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index 60c722843b..147b90291a 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -81,7 +81,8 @@ IRC users." All values of the list must be uppercase strings.") (defvar erc-dcc-list nil - "List of DCC connections. Looks like: + "List of DCC connections. +Looks like: ((:nick \"nick!user@host\" :type GET :peer proc :parent proc :size size :file file) (:nick \"nick!user@host\" :type CHAT :peer proc :parent proc) @@ -163,8 +164,9 @@ All values of the list must be uppercase strings.") ;;; Misc macros and utility functions (defun erc-dcc-member (&rest args) - "Return the first matching entry in `erc-dcc-list' which satisfies the -constraints given as a plist in ARGS. Returns nil on no match. + "Return first matching entry in `erc-dcc-list' satisfying constraints in plist ARGS. + +Return nil on no match. The property :nick is treated specially, if it contains a `!' character, it is treated as a nick!user@host string, and compared with the :nick property @@ -205,8 +207,7 @@ compared with `erc-nick-equal-p' which is IRC case-insensitive." result)) (defun erc-pack-int (value) - "Convert an integer into a packed string in network byte order, -which is big-endian." + "Convert integer into a packed string in network byte order, which is big-endian." ;; make sure value is not negative (when (< value 0) (error "ERC-DCC (erc-pack-int): packet size is negative")) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index be0c411e62..ac0c08bd3a 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -2720,9 +2720,8 @@ displayed hostnames." :type 'alist) (defun erc-canonicalize-server-name (server) - "Return the canonical network name for SERVER if any, -otherwise `erc-server-announced-name'. SERVER is matched against -`erc-common-server-suffixes'." + "Return canonical network name for SERVER or `erc-server-announced-name'. +SERVER is matched against `erc-common-server-suffixes'." (when server (or (cdar (cl-remove-if-not (lambda (net) (string-match (car net) server)) commit 17e8c342737b01da892528bc76713db6225b41a3 Author: Stefan Kangas Date: Sun Sep 19 13:15:41 2021 +0200 ; Stylistic docfixes in language/*.el found by checkdoc diff --git a/lisp/language/burmese.el b/lisp/language/burmese.el index ade3566717..96ba775268 100644 --- a/lisp/language/burmese.el +++ b/lisp/language/burmese.el @@ -24,7 +24,7 @@ ;;; Commentary: ;; The murderous generals say to call it "Myanmar". -;; We will call it "Burma". -- rms, Chief GNUisance. +;; We will call it "Burma". -- rms, Chief GNUisance. ;;; Code: diff --git a/lisp/language/ethio-util.el b/lisp/language/ethio-util.el index dc385b07d3..2de6602ced 100644 --- a/lisp/language/ethio-util.el +++ b/lisp/language/ethio-util.el @@ -2098,6 +2098,10 @@ mark." ;; The ethiopic-tex package is not used for keyboard input, therefore ;; not registered with the register-input-method function. +;; Local Variables: +;; checkdoc-symbol-words: ("-->") +;; End: + (provide 'ethio-util) ;;; ethio-util.el ends here diff --git a/lisp/language/japan-util.el b/lisp/language/japan-util.el index feb75a198e..cad34e9904 100644 --- a/lisp/language/japan-util.el +++ b/lisp/language/japan-util.el @@ -108,7 +108,7 @@ HANKAKU-KATAKANA belongs to `japanese-jisx0201-kana'.") ;; cp932-2-byte (#x2015 ?-) (#xFF5E ?~) (#xFF0D ?-)) "Japanese JISX0208 and CP932 symbol character table. - Each element is of the form (SYMBOL ASCII HANKAKU), where SYMBOL +Each element is of the form (SYMBOL ASCII HANKAKU), where SYMBOL belongs to `japanese-jisx0208' or `cp932', ASCII belongs to `ascii', and HANKAKU belongs to `japanese-jisx0201-kana'.") diff --git a/lisp/language/khmer.el b/lisp/language/khmer.el index 471af40165..12737edc73 100644 --- a/lisp/language/khmer.el +++ b/lisp/language/khmer.el @@ -21,6 +21,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: (set-language-info-alist diff --git a/lisp/language/sinhala.el b/lisp/language/sinhala.el index 89392ad6c5..bf32050600 100644 --- a/lisp/language/sinhala.el +++ b/lisp/language/sinhala.el @@ -21,6 +21,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: (set-language-info-alist diff --git a/lisp/language/tibetan.el b/lisp/language/tibetan.el index 48c7638948..dc37fc90ac 100644 --- a/lisp/language/tibetan.el +++ b/lisp/language/tibetan.el @@ -593,8 +593,8 @@ from an input method is converted to the corresponding precomposed glyph.") (setq temp (concat temp "\\|" (car (car l)))) (setq l (cdr l))) (concat temp "\\)"))) - "Regexp string to match a sequence of Tibetan consonantic components, i.e., -one base consonant and one or more subjoined consonants. + "Regexp string to match a sequence of Tibetan consonantic components. +That is, one base consonant and one or more subjoined consonants. The result of matching is to be used for indexing alist when the component sequence is converted to the corresponding precomposed glyph. This also matches some punctuation characters which need conversion.") diff --git a/lisp/language/tv-util.el b/lisp/language/tv-util.el index d380630c0a..b0527060db 100644 --- a/lisp/language/tv-util.el +++ b/lisp/language/tv-util.el @@ -21,6 +21,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: (defconst tai-viet-re "[\xaa80-\xaac2\xaadb-\xaadf]+" commit 222a7a1a8afdf6921e5981133c605c2d695e9281 Author: Stefan Kangas Date: Sun Sep 19 13:13:56 2021 +0200 Flag checkdoc-symbol-words as a :safe variable * lisp/emacs-lisp/checkdoc.el (checkdoc-symbol-words): Flag as a safe file local variable. diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 23c9c97fa0..7b3c0689fb 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -320,6 +320,7 @@ with a universal argument.") These words are ignored when unquoted symbols are searched for. This should be set in an Emacs Lisp file's local variables." :type '(repeat (string :tag "Word")) + :safe #'listp :version "28.1") ;;;###autoload(put 'checkdoc-symbol-words 'safe-local-variable #'checkdoc-list-of-strings-p) commit 4fdb150769ccbe7ad758edbc7661751590564655 Author: Stefan Kangas Date: Sun Sep 19 12:59:01 2021 +0200 ; Stylistic docfixes in erc/*.el found by checkdoc diff --git a/lisp/erc/erc-autoaway.el b/lisp/erc/erc-autoaway.el index bbab37fd5d..857a686454 100644 --- a/lisp/erc/erc-autoaway.el +++ b/lisp/erc/erc-autoaway.el @@ -43,8 +43,7 @@ This is only used when `erc-autoaway-idle-method' is set to `emacs'.") "The last time the user sent something.") (defvar erc-autoaway-caused-away nil - "Indicates whether this module was responsible for setting the -user's away status.") + "Non-nil if this module was responsible for setting the user's away status.") (defvar erc-autoaway-idle-seconds) diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index ad9719380a..4040a7bcae 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -233,8 +233,7 @@ This is useful for detecting hung connections.") This variable is only set in a server buffer.") (defvar-local erc-server-filter-data nil - "The data that arrived from the server -but has not been processed yet.") + "The data that arrived from the server but has not been processed yet.") (defvar-local erc-server-duplicates (make-hash-table :test 'equal) "Internal variable used to track duplicate messages.") @@ -278,16 +277,15 @@ Reconnection will happen automatically for any unexpected disconnection." :type 'boolean) (defcustom erc-server-reconnect-attempts 2 - "The number of times that ERC will attempt to reestablish a -broken connection, or t to always attempt to reconnect. + "Number of times that ERC will attempt to reestablish a broken connection. +If t, always attempt to reconnect. This only has an effect if `erc-server-auto-reconnect' is non-nil." :type '(choice (const :tag "Always reconnect" t) integer)) (defcustom erc-server-reconnect-timeout 1 - "The amount of time, in seconds, that ERC will wait between -successive reconnect attempts. + "Number of seconds to wait between successive reconnect attempts. If a key is pressed while ERC is waiting, it will stop waiting." :type 'number) diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index b80f1832d7..60c722843b 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -760,8 +760,7 @@ the matching regexp, or nil if none found." :type 'integer) (defcustom erc-dcc-pump-bytes nil - "If set to an integer, keep sending until that number of bytes are -unconfirmed." + "If an integer, keep sending until that number of bytes are unconfirmed." :type '(choice (const nil) integer)) (define-inline erc-dcc-get-parent (proc) @@ -833,8 +832,7 @@ bytes sent." (defcustom erc-dcc-send-connect-hook '(erc-dcc-display-send erc-dcc-send-block) - "Hook run whenever the remote end of a DCC SEND offer connected to your -listening port." + "Hook run when remote end of a DCC SEND offer connected to your listening port." :type 'hook) (defun erc-dcc-nick (plist) @@ -865,7 +863,7 @@ listening port." (buffer-string))) (defun erc-dcc-send-file (nick file &optional pproc) - "Open a socket for incoming connections, and send a CTCP send request to the + "Open socket for incoming connections and send a CTCP send request to the other client." (interactive "sNick: \nfFile: ") (when (null pproc) (if (processp erc-server-process) @@ -1028,11 +1026,11 @@ transfer is complete." :type 'hook) (defcustom erc-dcc-chat-connect-hook nil - "" + "" ; FIXME :type 'hook) (defcustom erc-dcc-chat-exit-hook nil - "" + "" ; FIXME :type 'hook) (defun erc-cmd-CREQ (line &optional _force) diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index 41256682c0..9f29b9dad9 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el @@ -97,15 +97,15 @@ function is called." function)) (defcustom erc-fill-static-center 27 - "Column around which all statically filled messages will be -centered. This column denotes the point where the ` ' character -between and the entered text will be put, thus aligning -nick names right and text left." + "Column around which all statically filled messages will be centered. +This column denotes the point where the ` ' character between + and the entered text will be put, thus aligning nick +names right and text left." :type 'integer) (defcustom erc-fill-variable-maximum-indentation 17 - "If we indent a line after a long nick, don't indent more then this -characters. Set to nil to disable." + "Don't indent a line after a long nick more than this many characters. +Set to nil to disable." :type 'integer) (defcustom erc-fill-column 78 diff --git a/lisp/erc/erc-identd.el b/lisp/erc/erc-identd.el index 3821e298cd..8003900552 100644 --- a/lisp/erc/erc-identd.el +++ b/lisp/erc/erc-identd.el @@ -46,7 +46,8 @@ :group 'erc) (defcustom erc-identd-port 8113 - "Port to run the identd server on if not specified in the argument for + "Port to run the identd server on. +This can be overridden by specifying an argument for `erc-identd-start'. This can be either a string or a number." diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index a4986918b6..2ed8622b85 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el @@ -123,7 +123,7 @@ This is called from a timer set up by `erc-autojoin-channels'." (erc-autojoin-channels server nick)))) (defun erc-autojoin-server-match (candidate) - "Match the current network or server against CANDIDATE + "Match the current network or server against CANDIDATE. This should be a key from `erc-autojoin-channels-alist'." (or (eq candidate (erc-network)) (and (stringp candidate) diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index ddd00afd73..7c5c495f9e 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -180,8 +180,7 @@ If you set this to nil, you may want to enable both :type 'boolean) (defcustom erc-log-write-after-insert nil - "If non-nil, write to log file when new text is added to a -logged ERC buffer. + "If non-nil, write to log file when new text is added to a logged ERC buffer. If you set this to nil, you may want to enable both `erc-save-buffer-on-part' and `erc-save-queries-on-quit'." @@ -195,8 +194,7 @@ This should ideally, be a \"catch-all\" coding system, like :type 'coding-system) (defcustom erc-log-filter-function nil - "If non-nil, pass text through the given function before writing it to -a log file. + "If non-nil, pass text to this function before writing it to a log file. The function should take one argument, which is the text to filter." :type '(choice (function "Function") @@ -361,7 +359,7 @@ function is a possible value for (concat (buffer-name buffer) ".txt")) (defun erc-generate-log-file-name-long (_buffer target nick server port) - "Generates a log-file name in the way ERC always did it. + "Generate a log-file name in the way ERC always did it. This results in a file name of the form #channel!nick@server:port.txt. This function is a possible value for `erc-generate-log-file-name-function'." (let ((file (concat @@ -375,7 +373,7 @@ This function is a possible value for `erc-generate-log-file-name-function'." (declare-function erc-network-name "erc-networks" ()) (defun erc-generate-log-file-name-network (buffer target nick server _port) - "Generates a log-file name using the network name rather than server name. + "Generate a log-file name using the network name rather than server name. This results in a file name of the form #channel!nick@network.txt. This function is a possible value for `erc-generate-log-file-name-function'." (require 'erc-networks) diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index fb50e84f65..01d6e44d59 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el @@ -79,7 +79,7 @@ Useful to mark nicks from dangerous hosts." :type '(repeat regexp)) (defcustom erc-current-nick-highlight-type 'keyword - "Determines how to highlight text in which your current nickname appears + "Determine how to highlight text in which your current nickname appears \(does not apply to text sent by you). The following values are allowed: @@ -234,9 +234,9 @@ current-nick, keyword, pal, dangerous-host, fool." :type 'hook) (defcustom erc-match-exclude-server-buffer nil - "If true, don't perform match on the server buffer; this is -useful for excluding all the things like MOTDs from the server -and other miscellaneous functions." + "If true, don't perform match on the server buffer. +This is useful for excluding all the things like MOTDs from the +server and other miscellaneous functions." :version "24.3" :type 'boolean) diff --git a/lisp/erc/erc-menu.el b/lisp/erc/erc-menu.el index 1bee6ff2a6..2da1abb29a 100644 --- a/lisp/erc/erc-menu.el +++ b/lisp/erc/erc-menu.el @@ -103,8 +103,7 @@ "ERC menu definition.") (defvar erc-menu-defined nil - "Internal variable used to keep track of whether we've defined the -ERC menu yet.") + "Internal variable used to keep track of whether we've defined the ERC menu yet.") ;;;###autoload(autoload 'erc-menu-mode "erc-menu" nil t) (define-erc-module menu nil diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el index 1ed056c277..d4f22ca0f5 100644 --- a/lisp/erc/erc-notify.el +++ b/lisp/erc/erc-notify.el @@ -40,13 +40,11 @@ :group 'erc) (defcustom erc-notify-list nil - "List of nicknames you want to be notified about online/offline -status change." + "List of nicknames you want to be notified about online/offline status change." :type '(repeat string)) (defcustom erc-notify-interval 60 - "Time interval (in seconds) for checking online status of notified -people." + "Time interval (in seconds) for checking online status of notified people." :type 'integer) (defcustom erc-notify-signon-hook nil diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el index 43330755a8..c846a1f003 100644 --- a/lisp/erc/erc-pcomplete.el +++ b/lisp/erc/erc-pcomplete.el @@ -53,8 +53,7 @@ add this string to nicks completed." :type 'string) (defcustom erc-pcomplete-order-nickname-completions t - "If t, channel nickname completions will be ordered such that -the most recent speakers are listed first." + "If t, order nickname completions with the most recent speakers first." :type 'boolean) ;;;###autoload(autoload 'erc-completion-mode "erc-pcomplete" nil t) diff --git a/lisp/erc/erc-sound.el b/lisp/erc/erc-sound.el index e835c45af8..cb4c232aba 100644 --- a/lisp/erc/erc-sound.el +++ b/lisp/erc/erc-sound.el @@ -128,7 +128,7 @@ See also `play-sound-file'." (erc-log (format "Playing sound file %S" filepath)))) (defun erc-toggle-sound (&optional arg) - "Toggles playing sounds on and off. + "Toggle playing sounds on and off. With positive argument, turns them on. With any other argument turns sounds off." (interactive "P") diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index dde2556ddb..7d31bc971e 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -182,9 +182,9 @@ or `erc-send-modify-hook'." (erc-echo-timestamp dir ct)))))))) (defvar-local erc-timestamp-last-window-width nil - "Stores the width of the last window that showed the current -buffer. This is used by `erc-insert-timestamp-right' when the -current buffer is not shown in any window.") + "The width of the last window that showed the current buffer. +his is used by `erc-insert-timestamp-right' when the current +buffer is not shown in any window.") (defvar-local erc-timestamp-last-inserted nil "Last timestamp inserted into the buffer.") @@ -200,7 +200,7 @@ This is used when `erc-insert-timestamp-function' is set to `erc-timestamp-left-and-right'") (defcustom erc-timestamp-only-if-changed-flag t - "Insert timestamp only if its value changed since last insertion. + "Non-nil means insert timestamp only if its value changed since last insertion. If `erc-insert-timestamp-function' is `erc-insert-timestamp-left', a string of spaces which is the same size as the timestamp is added to the beginning of the line in its place. If you use @@ -316,10 +316,10 @@ printed just after each line's text (no alignment)." (erc-put-text-property from (1+ (point)) 'cursor-intangible t))))) (defun erc-insert-timestamp-left-and-right (_string) - "This is another function that can be assigned to -`erc-insert-timestamp-function'. If the date is changed, it will -print a blank line, the date, and another blank line. If the time is -changed, it will then print it off to the right." + "This is another function that can be used with `erc-insert-timestamp-function'. +If the date is changed, it will print a blank line, the date, and +another blank line. If the time is changed, it will then print +it off to the right." (let* ((ct (current-time)) (ts-left (erc-format-timestamp ct erc-timestamp-format-left)) (ts-right (erc-format-timestamp ct erc-timestamp-format-right))) diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index eb2a9712ac..5755384490 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -104,14 +104,13 @@ channel (353)." :type 'erc-message-type) (defcustom erc-track-exclude-server-buffer nil - "If true, don't perform tracking on the server buffer; this is -useful for excluding all the things like MOTDs from the server and -other miscellaneous functions." + "If true, don't perform tracking on the server buffer. +This is useful for excluding all the things like MOTDs from the +server and other miscellaneous functions." :type 'boolean) (defcustom erc-track-shorten-start 1 - "This number specifies the minimum number of characters a channel name in -the mode-line should be reduced to." + "Minimum number of characters for a channel name in the mode-line." :type 'number) (defcustom erc-track-shorten-cutoff 4 @@ -149,8 +148,7 @@ If nil instead of a function, shortening is disabled." function)) (defcustom erc-track-list-changed-hook nil - "Hook that is run whenever the contents of -`erc-modified-channels-alist' changes. + "Hook run when the contents of `erc-modified-channels-alist' changes. This is useful for people that don't use the default mode-line notification but instead use a separate mechanism to provide @@ -603,10 +601,9 @@ because the debugger also causes changes to the window-configuration.") (defun erc-modified-channels-update (&rest _args) - "This function updates the information in `erc-modified-channels-alist' -according to buffer visibility. It calls -`erc-modified-channels-display' at the end. This should usually be -called via `window-configuration-change-hook'. + "Update `erc-modified-channels-alist' according to buffer visibility. +It calls `erc-modified-channels-display' at the end. This should +usually be called via `window-configuration-change-hook'. ARGS are ignored." (interactive) (unless erc-modified-channels-update-inside @@ -675,8 +672,7 @@ is displayed according to `erc-track-mouse-face'." name)) (defun erc-modified-channels-display () - "Set `erc-modified-channels-object' -according to `erc-modified-channels-alist'. + "Set `erc-modified-channels-object' according to `erc-modified-channels-alist'. Use `erc-make-mode-line-buffer-name' to create buttons." (cond ((or (eq 'mostactive erc-track-switch-direction) (eq 'leastactive erc-track-switch-direction)) @@ -779,10 +775,10 @@ that face with highest priority in NEW-FACES is also a member of choice)))) (defun erc-track-modified-channels () - "Hook function for `erc-insert-post-hook' to check if the current -buffer should be added to the mode line as a hidden, modified -channel. Assumes it will only be called when current-buffer -is in `erc-mode'." + "Hook function for `erc-insert-post-hook'. +Check if the current buffer should be added to the mode line as a +hidden, modified channel. Assumes it will only be called when +the current buffer is in `erc-mode'." (let ((this-channel (or (erc-default-target) (buffer-name (current-buffer))))) (if (and (not (erc-buffer-visible (current-buffer))) @@ -858,8 +854,7 @@ is in `erc-mode'." ;;; Buffer switching (defvar erc-track-last-non-erc-buffer nil - "Stores the name of the last buffer you were in before activating -`erc-track-switch-buffer'.") + "Name of the last buffer before activating `erc-track-switch-buffer'.") (defun erc-track-sort-by-activest () "Sort erc-modified-channels-alist by activity. @@ -869,9 +864,8 @@ That means the number of unseen messages in a channel." (lambda (a b) (> (nth 1 a) (nth 1 b)))))) (defun erc-track-face-priority (face) - "Return a number indicating the priority of FACE in -`erc-track-faces-priority-list'. Lower number means higher -priority. + "Return priority (a number) of FACE in `erc-track-faces-priority-list'. +Lower number means higher priority. If face is not in `erc-track-faces-priority-list', it will have a higher number than any other face in that list." diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 5afe302daa..be0c411e62 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -158,9 +158,7 @@ parameters and authentication." :type 'string) (defcustom erc-try-new-nick-p t - "If the nickname you chose isn't available, and this option is non-nil, -ERC should automatically attempt to connect with another nickname. - + "Non-nil means attempt to connect with another nickname if nickname unavailable. You can manually set another nickname with the /NICK command." :group 'erc :type 'boolean) @@ -329,15 +327,15 @@ Functions are passed a buffer as the first argument." (defvar-local erc-channel-users nil - "A hash table of members in the current channel, which -associates nicknames with cons cells of the form: + "Hash table of members in the current channel. +It associates nicknames with cons cells of the form: \(USER . MEMBER-DATA) where USER is a pointer to an erc-server-user struct, and MEMBER-DATA is a pointer to an erc-channel-user struct.") (defvar-local erc-server-users nil - "A hash table of users on the current server, which associates -nicknames with erc-server-user struct instances.") + "Hash table of users on the current server. +It associates nicknames with `erc-server-user' struct instances.") (defun erc-downcase (string) "Convert STRING to IRC standard conforming downcase." @@ -381,13 +379,11 @@ If no server buffer exists, return nil." (last-message-time nil)) (define-inline erc-get-channel-user (nick) - "Find the (USER . CHANNEL-DATA) element corresponding to NICK -in the current buffer's `erc-channel-users' hash table." + "Find NICK in the current buffer's `erc-channel-users' hash table." (inline-quote (gethash (erc-downcase ,nick) erc-channel-users))) (define-inline erc-get-server-user (nick) - "Find the USER corresponding to NICK in the current server's -`erc-server-users' hash table." + "Find NICK in the current server's `erc-server-users' hash table." (inline-letevals (nick) (inline-quote (erc-with-server-buffer (gethash (erc-downcase ,nick) erc-server-users))))) @@ -1384,8 +1380,7 @@ If BUFFER is nil, the current buffer is used." (null (erc-default-target))))) (defun erc-open-server-buffer-p (&optional buffer) - "Return non-nil if argument BUFFER is an ERC server buffer that -has an open IRC process. + "Return non-nil if BUFFER is an ERC server buffer with an open IRC process. If BUFFER is nil, the current buffer is used." (and (erc-server-buffer-p buffer) @@ -3561,8 +3556,7 @@ just as you provided it. Use this command with care!" (put 'erc-cmd-QUOTE 'do-not-parse-args t) (defcustom erc-query-display 'window - "Indicates how to display query buffers when using the /QUERY -command to talk to someone. + "How to display query buffers when using the /QUERY command to talk to someone. The default behavior is to display the message in a new window and bring it to the front. See the documentation for @@ -4318,8 +4312,8 @@ disconnected, you should set this option to t." :type 'boolean) (defcustom erc-format-query-as-channel-p t - "If non-nil, format text from others in a query buffer like in a channel, -otherwise format like a private message." + "If non-nil, format text from others in a query buffer like in a channel. +Otherwise format like a private message." :group 'erc-query :type 'boolean) @@ -4561,8 +4555,8 @@ always returns t." t) (defun erc-echo-notice-in-user-buffers (s parsed _buffer sender) - "Echo a private notice in all of the buffers for which SENDER -is a member. This function is designed to be added to either + "Echo a private notice in all of the buffers for which SENDER is a member. +This function is designed to be added to either `erc-echo-notice-hook' or `erc-echo-notice-always-hook', and returns non-nil if there is at least one buffer for which the sender is a member. @@ -4575,12 +4569,11 @@ See also: `erc-echo-notice-in-first-user-buffer', nil))) (defun erc-echo-notice-in-user-and-target-buffers (s parsed buffer sender) - "Echo a private notice in BUFFER and in all of the buffers for -which SENDER is a member. This function is designed to be added -to either `erc-echo-notice-hook' or -`erc-echo-notice-always-hook', and returns non-nil if there is -at least one buffer for which the sender is a member or the -default target. + "Echo a private notice in BUFFER and in all buffers for which SENDER is a member. +This function is designed to be added to either +`erc-echo-notice-hook' or `erc-echo-notice-always-hook', and +returns non-nil if there is at least one buffer for which the +sender is a member or the default target. See also: `erc-echo-notice-in-user-buffers', `erc-buffer-list-with-nick'." @@ -4591,8 +4584,8 @@ See also: `erc-echo-notice-in-user-buffers', nil))) (defun erc-echo-notice-in-first-user-buffer (s parsed _buffer sender) - "Echo a private notice in one of the buffers for which SENDER -is a member. This function is designed to be added to either + "Echo a private notice in one of the buffers for which SENDER is a member. +This function is designed to be added to either `erc-echo-notice-hook' or `erc-echo-notice-always-hook', and returns non-nil if there is at least one buffer for which the sender is a member. @@ -5201,8 +5194,7 @@ See also: `erc-update-user' and `erc-update-channel-member'." (defun erc-update-channel-member (channel nick new-nick &optional add voice halfop op admin owner host login full-name info update-message-time) - "Update user and channel information for the user with -nickname NICK in channel CHANNEL. + "Update user and channel for user with nickname NICK in channel CHANNEL. See also: `erc-update-current-channel-member'." (erc-with-buffer @@ -5670,8 +5662,7 @@ Return non-nil only if we actually send anything." ;; (run-hooks 'erc-send-post-hook)))))) (defun erc-display-msg (line) - "Display LINE as a message of the user to the current target at the -current position." + "Display LINE as a message of the user to the current target at point." (when erc-insert-this (let ((insert-position (point))) (insert (erc-format-my-nick)) @@ -6403,8 +6394,8 @@ See `erc-mode-line-format' for which characters are can be used." :type 'boolean) (defcustom erc-header-line-uses-help-echo-p t - "Show the contents of the header line in the echo area or as a tooltip -when you move point into the header line." + "Show header line in echo area or as a tooltip +when point moves to the header line." :group 'erc-mode-line-and-header :type 'boolean) @@ -6493,8 +6484,7 @@ shortened server name instead." (t (buffer-name (current-buffer)))))) (defun erc-format-away-status () - "Return a formatted `erc-mode-line-away-status-format' -if `erc-away' is non-nil." + "Return a formatted `erc-mode-line-away-status-format' if `erc-away' is non-nil." (let ((a (erc-away-time))) (if a (format-time-string erc-mode-line-away-status-format a) commit 434c176e06e2e0e645814cd12feefe994c325565 Author: Stefan Kangas Date: Sun Sep 19 12:45:56 2021 +0200 ; Stylistic docfixes in eshell/*.el found by checkdoc diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el index 639098a9b9..75a803d3ad 100644 --- a/lisp/eshell/em-pred.el +++ b/lisp/eshell/em-pred.el @@ -553,7 +553,7 @@ that `ls -l' will show in the first column of its display." lst))))) (defun eshell-include-members (&optional invert-p) - "Include only lisp members matching a regexp." + "Include only Lisp members matching a regexp." (let ((delim (char-after)) regexp end) (forward-char) diff --git a/lisp/eshell/em-term.el b/lisp/eshell/em-term.el index d199a939a3..f9d8acccf2 100644 --- a/lisp/eshell/em-term.el +++ b/lisp/eshell/em-term.el @@ -92,13 +92,13 @@ See also `eshell-visual-commands' and `eshell-visual-options'." (defcustom eshell-visual-options nil - "An alist of the form + "An alist of commands that present their output in a visual fashion. +It has this form: ((COMMAND1 OPTION1 OPTION2...) (COMMAND2 OPTION1 ...)) -of commands with options that present their output in a visual -fashion. For example, a sensible entry would be +For example, a sensible entry would be (\"git\" \"--help\" \"--paginate\") diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 5b400c74fc..e71edaf476 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -165,7 +165,8 @@ Otherwise, Emacs will attempt to use rsh to invoke du on the remote machine." (put 'eshell/man 'eshell-no-numeric-conversions t) (defun eshell/info (&rest args) - "Run the info command in-frame with the same behavior as command-line `info', ie: + "Run the info command in-frame with the same behavior as command-line `info'. +For example: `info' => goes to top info window `info arg1' => IF arg1 is a file, then visits arg1 `info arg1' => OTHERWISE goes to top info window and then menu item arg1 diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index 1aac95e0b4..a2464ad4a9 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -116,9 +116,9 @@ (&optional form stub paring form-only)) (defgroup eshell-cmd nil - "Executing an Eshell command is as simple as typing it in and -pressing . There are several different kinds of commands, -however." + "Executing an Eshell command is as simple as typing it in and \ +pressing \\\\[eshell-send-input]. +There are several different kinds of commands, however." :tag "Command invocation" ;; :link '(info-link "(eshell)Command invocation") :group 'eshell) diff --git a/lisp/eshell/esh-module.el b/lisp/eshell/esh-module.el index 703179504c..97ffedae62 100644 --- a/lisp/eshell/esh-module.el +++ b/lisp/eshell/esh-module.el @@ -20,6 +20,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: (require 'esh-util) diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 5dc6a19305..fa9853ae00 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -45,7 +45,7 @@ ;; ;; $(lisp) ;; -;; Returns result of lisp evaluation. Note: Used alone like this, it +;; Returns result of Lisp evaluation. Note: Used alone like this, it ;; is identical to just saying (lisp); but with the variable expansion ;; form, the result may be interpolated a larger string, such as ;; '$(lisp)/other'. commit 68b190c8b40be4f89101541be9bdcb57e2561f89 Author: Phil Sainty Date: Sun Sep 19 22:25:37 2021 +1200 ; * lisp/subr.el (setq-local): Fix docstring quotes (bug#50646) diff --git a/lisp/subr.el b/lisp/subr.el index c2cfc18bd7..5fac316e37 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -166,8 +166,8 @@ variables are literal symbols and should not be quoted. The second VALUE is not computed until after the first VARIABLE is set, and so on; each VALUE can use the new value of variables -set earlier in the ‘setq-local’. The return value of the -‘setq-local’ form is the value of the last VALUE. +set earlier in the `setq-local'. The return value of the +`setq-local' form is the value of the last VALUE. \(fn [VARIABLE VALUE]...)" (declare (debug setq)) commit fe4a26d896aaff1f40f27bc75087fe0e4406b155 Author: Eli Zaretskii Date: Sun Sep 19 11:44:22 2021 +0300 Teach Mail mode to request Disposition Notifications * lisp/mail/sendmail.el (mail-insert-disposition-notification-to): New function. (mail-mode-map): Add it to key bindings and menu bar. diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index fee11c06aa..312805f6d8 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -277,6 +277,7 @@ The default value matches citations like `foo-bar>' plus whitespace." (define-key map "\C-c\C-f\C-r" 'mail-reply-to) (define-key map "\C-c\C-f\C-a" 'mail-mail-reply-to) ; author (define-key map "\C-c\C-f\C-l" 'mail-mail-followup-to) ; list + (define-key map "\C-c\C-f\C-d" 'mail-insert-disposition-notification-to) (define-key map "\C-c\C-t" 'mail-text) (define-key map "\C-c\C-y" 'mail-yank-original) (define-key map "\C-c\C-r" 'mail-yank-region) @@ -325,6 +326,9 @@ The default value matches citations like `foo-bar>' plus whitespace." (define-key map [menu-bar headers expand-aliases] '("Expand Aliases" . expand-mail-aliases)) + (define-key map [menu-bar headers disposition-notification] + '("Disposition-Notification-To" . mail-insert-disposition-notification-to)) + (define-key map [menu-bar headers mail-reply-to] '("Mail-Reply-To" . mail-mail-reply-to)) @@ -1598,6 +1602,25 @@ Returns non-nil if FIELD was originally present." (interactive) (expand-abbrev) (goto-char (mail-text-start))) + +(defun mail-insert-disposition-notification-to () + "Insert a Disposition-Notification-To header, if it doesn't already exist." + (interactive) + (expand-abbrev) + (save-excursion + (or (mail-position-on-field "Disposition-Notification-To") + (insert + (format + "%s" + (save-excursion + (save-restriction + (message-narrow-to-headers) + (or (mail-fetch-field "Reply-To") + (mail-fetch-field "From") + (with-temp-buffer + (mail-insert-from-field) + (substring (buffer-string) (length "From: ") -1)))))))))) + (defun mail-signature (&optional atpoint) "Sign letter with signature. commit 7880d3079d0de5844b519652d7a54adf98f658e1 Author: Mattias Engdegård Date: Sun Sep 19 09:29:33 2021 +0200 ; * lisp/cedet/semantic/symref/grep.el: Use grep quoting, not egrep. Kindly noticed by Dmitry Gutov. diff --git a/lisp/cedet/semantic/symref/grep.el b/lisp/cedet/semantic/symref/grep.el index 1e282c3052..077a2d4861 100644 --- a/lisp/cedet/semantic/symref/grep.el +++ b/lisp/cedet/semantic/symref/grep.el @@ -133,9 +133,9 @@ This shell should support pipe redirect syntax." :group 'semantic :type 'string) -(defun semantic-symref-grep--quote-extended (string) - "Quote STRING as an extended-syntax regexp." - (replace-regexp-in-string (rx (in ".^$*+?|{}[]()|\\")) +(defun semantic-symref-grep--quote-grep (string) + "Quote STRING as a grep-syntax regexp." + (replace-regexp-in-string (rx (in ".^$*[\\")) (lambda (s) (concat "\\" s)) string nil t)) @@ -160,7 +160,7 @@ This shell should support pipe redirect syntax." (searchfor (oref tool searchfor)) (greppat (if (eq (oref tool searchtype) 'regexp) searchfor - (semantic-symref-grep--quote-extended searchfor))) + (semantic-symref-grep--quote-grep searchfor))) ;; Misc (b (get-buffer-create "*Semantic SymRef*")) (ans nil) commit bc59c98f096f7d01cbccf98d4fdd9c3f0385e896 Author: Amin Bandali Date: Sat Sep 18 23:29:44 2021 -0400 Add new '/opme' and '/deopme' convenience ERC commands * lisp/erc/erc.el (erc-cmd-OPME, erc-cmd-DEOPME): Add convenience commands for setting and unsetting the operator status on the current nick in the current channel. 'erc-cmd-OPME' relies on ChanServ for obtaining the operator status (see doc string for more details). * etc/NEWS: Announce the addition of the commands. diff --git a/etc/NEWS b/etc/NEWS index afeeeb0ba2..fa240f68b4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2736,6 +2736,11 @@ declared obsolete and rewritten as 'erc-track-select-mode-line-face', with different expected arguments (the current and old faces are now separated) and clearer documentation. +*** Add '/opme' and '/deopme' convenience commands. +The new '/opme' convenience command asks ChanServ to set the operator +status for the current nick in the current channel, and '/deopme' +unsets it. + ** xwidget-webkit mode --- diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 1f39644f75..5afe302daa 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -3803,6 +3803,24 @@ the message given by REASON." (mapconcat #'identity people " "))) t)) +(defun erc-cmd-OPME () + "Ask ChanServ to op the current nick in the current channel. + +This command assumes a ChanServ (channel service) available on +the IRC network which accepts an \"op\" command that takes the +channel name and the user's nick, and that the current nick is +allowed to become an operator in the current channel (typically +means that the user has a +o flag in the channel's access list)." + (erc-message "PRIVMSG" + (format "ChanServ op %s %s" + (erc-default-target) + (erc-current-nick)) + nil)) + +(defun erc-cmd-DEOPME () + "Deop the current nick in the current channel." + (erc-cmd-DEOP (erc-current-nick))) + (defun erc-cmd-TIME (&optional line) "Request the current time and date from the current server." (cond commit fc8df2561b8e37089463d0d4d008d73e23cb2dc5 Author: Stefan Kangas Date: Sun Sep 19 01:08:30 2021 +0200 Revert previous mode-line-modes change to unbreak bootstrap * lisp/bindings.el (mode-line-modes): Revert previous change to unbreak bootstrap. diff --git a/lisp/bindings.el b/lisp/bindings.el index 5156637065..5c1adef9b5 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -382,8 +382,7 @@ Keymap to display on minor modes.") (defvar mode-line-modes (let ((recursive-edit-help-echo - (substitute-command-keys - "Recursive edit, type \\[exit-recursive-edit] to get out"))) + "Recursive edit, type M-C-c to get out")) (list (propertize "%[" 'help-echo recursive-edit-help-echo) "(" `(:propertize ("" mode-name) commit 252d06dd5d177ad3d6d0464eb3e65dd6ce4cce79 Author: Lars Ingebrigtsen Date: Sun Sep 19 00:14:42 2021 +0200 Viper doc string fix * lisp/emulation/viper-keym.el (viper-want-ctl-h-help): Fold over-long first line. diff --git a/lisp/emulation/viper-keym.el b/lisp/emulation/viper-keym.el index 7e14a56556..2bb24f662f 100644 --- a/lisp/emulation/viper-keym.el +++ b/lisp/emulation/viper-keym.el @@ -69,7 +69,8 @@ major mode in effect." :group 'viper) (defcustom viper-want-ctl-h-help nil - "If non-nil, bind C-h to `help-command'; otherwise, C-h gets the usual Vi bindings." + "If non-nil, bind C-h to `help-command'. +If nil, C-h gets the usual Vi bindings." :type 'boolean :group 'viper) commit 155dba943263236ba2c41926bae3cc45229b15bc Author: Lars Ingebrigtsen Date: Sun Sep 19 00:13:21 2021 +0200 Fix viper-util compilation warning * lisp/emulation/viper-util.el (cl-lib): Require for cl-subseq. diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index b92f60d6a5..0f6dceb13c 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el @@ -25,6 +25,7 @@ ;;; Code: (require 'seq) +(require 'cl-lib) ;; Compiler pacifier (defvar viper-minibuffer-current-face) commit a602d548dfaa1dcd44c3af017ccbbcd3586ca023 Author: Stefan Kangas Date: Sat Sep 18 23:39:01 2021 +0200 ; Stylistic docfixes in emulation/*.el found by checkdoc diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el index b662049960..3976c1ea06 100644 --- a/lisp/emulation/cua-base.el +++ b/lisp/emulation/cua-base.el @@ -330,9 +330,9 @@ See `cua-set-mark' for details." "If non-nil, registers are supported via numeric prefix arg. If the value is t, any numeric prefix arg in the range 0 to 9 will be interpreted as a register number. -If the value is `not-ctrl-u', using C-u to enter a numeric prefix is not +If the value is `not-ctrl-u', using \\[universal-argument] to enter a numeric prefix is not interpreted as a register number. -If the value is `ctrl-u-only', only numeric prefix entered with C-u is +If the value is `ctrl-u-only', only numeric prefix entered with \\[universal-argument] is interpreted as a register number." :type '(choice (const :tag "Disabled" nil) (const :tag "Enabled, but C-u arg is not a register" not-ctrl-u) diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index 0039092fd6..65ae2f192f 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -710,9 +710,11 @@ Mark is kept if keep-clear is 'keep and cleared if keep-clear is 'clear." (nreverse rect))) (defun cua--insert-rectangle (rect &optional below paste-column line-count) - "Insert rectangle as insert-rectangle, but don't set mark and exit with + "Insert rectangle RECT similarly to `insert-rectangle'. +In contrast to `insert-rectangle', don't set mark and exit with point at either next to top right or below bottom left corner -Notice: In overwrite mode, the rectangle is inserted as separate text lines." + +Note: In overwrite mode, the rectangle is inserted as separate text lines." (if (eq below 'auto) (setq below (and (bolp) (or (eolp) (eobp) (= (1+ (point)) (point-max)))))) diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index e93666956c..b1cbcc5a6d 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el @@ -1798,7 +1798,7 @@ reversed." set-cmd var auto-cmd-label))) (if (and ask-if-save - (y-or-n-p (format "Do you want to save this setting in %s " + (y-or-n-p (format "Do you want to save this setting in %s?" viper-custom-file-name))) (progn (viper-save-string-in-file diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el index 8188971c0d..730ca0b5a2 100644 --- a/lisp/emulation/viper-init.el +++ b/lisp/emulation/viper-init.el @@ -246,19 +246,19 @@ that deletes a file.") ;; Some common error messages -(defconst viper-SpuriousText "Spurious text after command" "") -(defconst viper-BadExCommand "Not an editor command" "") -(defconst viper-InvalidCommandArgument "Invalid command argument" "") -(defconst viper-NoPrevSearch "No previous search string" "") -(defconst viper-EmptyRegister "`%c': Nothing in this register" "") -(defconst viper-InvalidRegister "`%c': Invalid register" "") -(defconst viper-EmptyTextmarker "`%c': Text marker doesn't point anywhere" "") -(defconst viper-InvalidTextmarker "`%c': Invalid text marker" "") -(defconst viper-InvalidViCommand "Invalid command" "") -(defconst viper-BadAddress "Ill-formed address" "") -(defconst viper-FirstAddrExceedsSecond "First address exceeds second" "") -(defconst viper-NoFileSpecified "No file specified" "") -(defconst viper-ViperBell "Viper bell" "") +(defconst viper-SpuriousText "Spurious text after command") +(defconst viper-BadExCommand "Not an editor command") +(defconst viper-InvalidCommandArgument "Invalid command argument") +(defconst viper-NoPrevSearch "No previous search string") +(defconst viper-EmptyRegister "`%c': Nothing in this register") +(defconst viper-InvalidRegister "`%c': Invalid register") +(defconst viper-EmptyTextmarker "`%c': Text marker doesn't point anywhere") +(defconst viper-InvalidTextmarker "`%c': Invalid text marker") +(defconst viper-InvalidViCommand "Invalid command") +(defconst viper-BadAddress "Ill-formed address") +(defconst viper-FirstAddrExceedsSecond "First address exceeds second") +(defconst viper-NoFileSpecified "No file specified") +(defconst viper-ViperBell "Viper bell") ;; Is t until viper-mode executes for the very first time. ;; Prevents recursive descend into startup messages. @@ -282,7 +282,7 @@ Use `\\[viper-set-expert-level]' to change this.") ;; If non-nil, ISO accents will be turned on in insert/replace emacs states and ;; turned off in vi-state. For some users, this behavior may be too ;; primitive. In this case, use insert/emacs/vi state hooks. -(defvar-local viper-automatic-iso-accents nil "") +(defvar-local viper-automatic-iso-accents nil) ;; Set iso-accents-mode to ARG. Check if it is bound first (defsubst viper-set-iso-accents-mode (arg) (if (boundp 'iso-accents-mode) @@ -292,7 +292,7 @@ Use `\\[viper-set-expert-level]' to change this.") ;; Don't change this! (defvar viper-mule-hook-flag t) ;; If non-nil, the default intl. input method is turned on. -(defvar-local viper-special-input-method nil "") +(defvar-local viper-special-input-method nil) ;; viper hook to run on input-method activation (defun viper-activate-input-method-action () @@ -355,7 +355,7 @@ it better fits your working style." ;; Replace mode and changing text ;; Hack used to pass global states around for short period of time -(defvar-local viper-intermediate-command nil "") +(defvar-local viper-intermediate-command nil) ;; This is used to pass the right Vi command key sequence to ;; viper-set-destructive-command whenever (this-command-keys) doesn't give the @@ -365,7 +365,7 @@ it better fits your working style." (defconst viper-this-command-keys nil) ;; Indicates that the current destructive command has started in replace mode. -(defvar-local viper-began-as-replace nil "") +(defvar-local viper-began-as-replace nil) (defcustom viper-allow-multiline-replace-regions t "If non-nil, Viper will allow multi-line replace regions. @@ -396,7 +396,7 @@ delete the text being replaced, as in standard Vi." ;; internal var, used to remember the default cursor color of emacs frames (defvar viper-vi-state-cursor-color nil) -(defvar-local viper-replace-overlay nil "") +(defvar-local viper-replace-overlay nil) (put 'viper-replace-overlay 'permanent-local t) (defcustom viper-replace-region-end-delimiter "$" @@ -434,18 +434,18 @@ color displays. By default, the delimiters are used only on TTYs." (put 'viper-last-posn-in-replace-region 'permanent-local t) (put 'viper-last-posn-while-in-insert-state 'permanent-local t) -(defvar-local viper-sitting-in-replace nil "") +(defvar-local viper-sitting-in-replace nil) (put 'viper-sitting-in-replace 'permanent-local t) ;; Remember the number of characters that have to be deleted in replace ;; mode to compensate for the inserted characters. -(defvar-local viper-replace-chars-to-delete 0 "") +(defvar-local viper-replace-chars-to-delete 0) ;; This variable is used internally by the before/after changed functions to ;; determine how many chars were deleted by the change. This can't be ;; determined inside after-change-functions because those get the length of the ;; deleted region, not the number of chars deleted (which are two different ;; things under MULE). -(defvar-local viper-replace-region-chars-deleted 0 "") +(defvar-local viper-replace-region-chars-deleted 0) ;; Insertion ring and command ring (defcustom viper-insertion-ring-size 14 @@ -494,7 +494,7 @@ will make it hard to use Vi-style timeout macros." ;; Autoindent in insert ;; Variable that keeps track of whether C-t has been pressed. -(defvar-local viper-cted nil "") +(defvar-local viper-cted nil) ;; Preserve the indent value, used by C-d in insert mode. (defvar-local viper-current-indent 0) @@ -502,14 +502,14 @@ will make it hard to use Vi-style timeout macros." ;; Whether to preserve the indent, used by C-d in insert mode. (defvar-local viper-preserve-indent nil) -(defvar-local viper-auto-indent nil "") +(defvar-local viper-auto-indent nil) (defcustom viper-auto-indent nil "Enable autoindent, if t. This is a buffer-local variable." :type 'boolean :group 'viper) -(defvar-local viper-electric-mode t "") +(defvar-local viper-electric-mode t) (defcustom viper-electric-mode t "If t, electrify Viper. Currently, this only electrifies auto-indentation, making it appropriate to the @@ -595,7 +595,7 @@ to a new place after repeating previous Vi command." ;;; Variables for Moves and Searches (defgroup viper-search nil - "Variables that define the search and query-replace behavior of Viper." + "Variables that define the search and `query-replace' behavior of Viper." :prefix "viper-" :group 'viper) @@ -658,14 +658,14 @@ negative number." :type 'boolean :group 'viper) -(defvar-local viper-ex-style-motion t "") +(defvar-local viper-ex-style-motion t) (defcustom viper-ex-style-motion t "If t, the commands l,h do not cross lines, etc (Ex-style). If nil, these commands cross line boundaries." :type 'boolean :group 'viper) -(defvar-local viper-ex-style-editing t "") +(defvar-local viper-ex-style-editing t) (defcustom viper-ex-style-editing t "If t, Ex-style behavior while editing in Vi command and insert states. `Backspace' and `Delete' don't cross line boundaries in insert. @@ -677,14 +677,14 @@ If nil, the above commands can work across lines." :type 'boolean :group 'viper) -(defvar-local viper-ESC-moves-cursor-back viper-ex-style-editing "") +(defvar-local viper-ESC-moves-cursor-back viper-ex-style-editing) (defcustom viper-ESC-moves-cursor-back nil "If t, ESC moves cursor back when changing from insert to vi state. If nil, the cursor stays where it was when ESC was hit." :type 'boolean :group 'viper) -(defvar-local viper-delete-backwards-in-replace nil "") +(defvar-local viper-delete-backwards-in-replace nil) (defcustom viper-delete-backwards-in-replace nil "If t, DEL key will delete characters while moving the cursor backwards. If nil, the cursor will move backwards without deleting anything." @@ -702,7 +702,7 @@ If nil, the cursor will move backwards without deleting anything." :tag "Search Wraps Around" :group 'viper-search) -(defvar-local viper-related-files-and-buffers-ring nil "") +(defvar-local viper-related-files-and-buffers-ring nil) (defcustom viper-related-files-and-buffers-ring nil "List of file and buffer names to consider related to the current buffer. Related buffers can be cycled through via :R and :P commands." @@ -839,8 +839,7 @@ to customize the actual face object `viper-minibuffer-vi' this variable represents.") ;; the current face to be used in the minibuffer -(defvar-local - viper-minibuffer-current-face viper-minibuffer-emacs-face "") +(defvar-local viper-minibuffer-current-face viper-minibuffer-emacs-face) ;;; Miscellaneous diff --git a/lisp/emulation/viper-keym.el b/lisp/emulation/viper-keym.el index 75b627ea6a..7e14a56556 100644 --- a/lisp/emulation/viper-keym.el +++ b/lisp/emulation/viper-keym.el @@ -69,7 +69,7 @@ major mode in effect." :group 'viper) (defcustom viper-want-ctl-h-help nil - "If non-nil, bind C-h to help-command; otherwise, C-h gets the usual Vi bindings." + "If non-nil, bind C-h to `help-command'; otherwise, C-h gets the usual Vi bindings." :type 'boolean :group 'viper) @@ -211,17 +211,17 @@ In insert mode, this key also functions as Meta." ;; Tells viper-add-local-keys to create a new viper-vi-local-user-map for new ;; buffers. Not a user option. -(defvar-local viper-need-new-vi-local-map t "") +(defvar-local viper-need-new-vi-local-map t) (put 'viper-need-new-vi-local-map 'permanent-local t) ;; Tells viper-add-local-keys to create a new viper-insert-local-user-map for ;; new buffers. Not a user option. -(defvar-local viper-need-new-insert-local-map t "") +(defvar-local viper-need-new-insert-local-map t) (put 'viper-need-new-insert-local-map 'permanent-local t) ;; Tells viper-add-local-keys to create a new viper-emacs-local-user-map for ;; new buffers. Not a user option. -(defvar-local viper-need-new-emacs-local-map t "") +(defvar-local viper-need-new-emacs-local-map t) (put 'viper-need-new-emacs-local-map 'permanent-local t) diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el index 98b123a7f4..02db39f1cb 100644 --- a/lisp/emulation/viper-mous.el +++ b/lisp/emulation/viper-mous.el @@ -65,8 +65,7 @@ or a triple-click." (defcustom viper-multiclick-timeout (if (viper-window-display-p) double-click-time 500) - "Time interval in millisecond within which successive mouse clicks are -considered related." + "Time interval in milliseconds for mouse clicks to be considered related." :type 'integer) ;; Local variable used to toggle wraparound search on click. diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index 8ff1cf91c0..b92f60d6a5 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el @@ -1091,14 +1091,11 @@ In addition, the symbol `_' may be considered alphanumeric if `viper-syntax-preference' is `strict-vi' or `reformed-vi'.") (defconst viper-strict-ALPHA-chars "a-zA-Z0-9_" - "Regexp matching the set of alphanumeric characters acceptable to strict -Vi.") + "Regexp matching the set of alphanumeric characters acceptable to strict Vi.") (defconst viper-strict-SEP-chars " \t\n" - "Regexp matching the set of alphanumeric characters acceptable to strict -Vi.") + "Regexp matching the set of alphanumeric characters acceptable to strict Vi.") (defconst viper-strict-SEP-chars-sans-newline " \t" - "Regexp matching the set of alphanumeric characters acceptable to strict -Vi.") + "Regexp matching the set of alphanumeric characters acceptable to strict Vi.") (defconst viper-SEP-char-class " -" "String of syntax classes for Vi separators. commit dd3f6b13f673433e590c55b24232cf0a7e70de6e Author: Stefan Kangas Date: Sat Sep 18 19:09:35 2021 +0200 * etc/NEWS: Shorten entry on move to Libera.Chat. diff --git a/etc/NEWS b/etc/NEWS index 5c78189738..afeeeb0ba2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -827,16 +827,10 @@ Emacs now supports 256 color display on the 'st' terminal emulator. +++ *** Update IRC-related references to point to Libera.Chat. -In June 2021, the Free Software Foundation and the GNU Project moved -their official IRC channels from the Freenode network to Libera.Chat -in the aftermath of the changes in Freenode's governance structure and -policies in May and June 2021. The decision-making process took into -account the feedback received from the community against a set of -criteria devised by a working group drawn from both GNU and the FSF -to gauge a chat network's acceptability to software freedom activists. - -For the original announcement and the follow-up update, including more -details, see: +The Free Software Foundation and the GNU Project have moved their +official IRC channels from the Freenode network to Libera.Chat. For the +original announcement and the follow-up update, including more details, +see: https://lists.gnu.org/archive/html/info-gnu/2021-06/msg00005.html https://lists.gnu.org/archive/html/info-gnu/2021-06/msg00007.html commit c1e45419c7ad9679771718e91205502d30da6f2d Author: Stefan Kangas Date: Sat Sep 18 15:38:36 2021 +0200 Use command substitution in checkdoc-recursive-edit * lisp/emacs-lisp/checkdoc.el (checkdoc-recursive-edit): Use command substitution. (checkdoc--help-buffer): New variable. Use it instead of hard-coded string. diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 099b158553..23c9c97fa0 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -457,6 +457,9 @@ be re-created.") st) "Syntax table used by checkdoc in document strings.") +(defconst checkdoc--help-buffer "*Checkdoc Help*" + "Name of buffer used for Checkdoc Help.") + ;;; User level commands ;; ;;;###autoload @@ -704,31 +707,30 @@ style." begin (point))) ;; Goofy stuff (t - (if (get-buffer-window "*Checkdoc Help*") + (if (get-buffer-window checkdoc--help-buffer) (progn - (delete-window (get-buffer-window "*Checkdoc Help*")) - (kill-buffer "*Checkdoc Help*")) - (with-output-to-temp-buffer "*Checkdoc Help*" + (delete-window (get-buffer-window checkdoc--help-buffer)) + (kill-buffer checkdoc--help-buffer)) + (with-output-to-temp-buffer checkdoc--help-buffer (with-current-buffer standard-output (insert "Checkdoc Keyboard Summary:\n" (if (checkdoc-error-unfixable (car (car err-list))) "" (concat - "f, y - auto Fix this warning without asking (if\ - available.)\n" - " Very complex operations will still query.\n") - ) + "f, y - auto Fix this warning without asking" + " (if available.)\n" + " Very complex operations will still query.\n")) "e - Enter recursive Edit. Press C-M-c to exit.\n" "SPC, n - skip to the Next error.\n" "DEL, p - skip to the Previous error.\n" "q - Quit checkdoc.\n" "C-h - Toggle this help buffer."))) (shrink-window-if-larger-than-buffer - (get-buffer-window "*Checkdoc Help*")))))) + (get-buffer-window checkdoc--help-buffer)))))) (if cdo (delete-overlay cdo))))) (goto-char begin) - (if (get-buffer "*Checkdoc Help*") (kill-buffer "*Checkdoc Help*")) + (if (get-buffer checkdoc--help-buffer) (kill-buffer checkdoc--help-buffer)) (message "Checkdoc: Done.") returnme)) @@ -822,20 +824,21 @@ assumes that the cursor is already positioned to perform the fix." (defun checkdoc-recursive-edit (msg) "Enter recursive edit to permit a user to fix some error checkdoc has found. MSG is the error that was found, which is displayed in a help buffer." - (with-output-to-temp-buffer "*Checkdoc Help*" - (mapc #'princ - (list "Error message:\n " msg - "\n\nEdit to fix this problem, and press C-M-c to continue."))) + (with-output-to-temp-buffer checkdoc--help-buffer + (with-current-buffer standard-output + (insert "Error message:\n " msg "\n\n" + (substitute-command-keys + "Edit to fix this problem, and press \\[exit-recursive-edit] to continue.")))) (shrink-window-if-larger-than-buffer - (get-buffer-window "*Checkdoc Help*")) + (get-buffer-window checkdoc--help-buffer)) (message (substitute-command-keys "When you're done editing press \\[exit-recursive-edit] to continue.")) (unwind-protect (recursive-edit) - (if (get-buffer-window "*Checkdoc Help*") + (if (get-buffer-window checkdoc--help-buffer) (progn - (delete-window (get-buffer-window "*Checkdoc Help*")) - (kill-buffer "*Checkdoc Help*"))))) + (delete-window (get-buffer-window checkdoc--help-buffer)) + (kill-buffer checkdoc--help-buffer))))) ;;;###autoload (defun checkdoc-eval-current-buffer () commit ec0527d8e9a7f12898c8fe9fdb6daec21c1d2ba8 Author: Stefan Kangas Date: Sat Sep 18 14:54:04 2021 +0200 Use command substitution for exit-recursive-edit * lisp/bindings.el (mode-line-modes): * lisp/emacs-lisp/checkdoc.el (checkdoc-recursive-edit): Use command substitution for 'exit-recursive-edit'. diff --git a/lisp/bindings.el b/lisp/bindings.el index 4dfc9a908c..5156637065 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -381,7 +381,9 @@ Keymap to display on major mode.") Keymap to display on minor modes.") (defvar mode-line-modes - (let ((recursive-edit-help-echo "Recursive edit, type C-M-c to get out")) + (let ((recursive-edit-help-echo + (substitute-command-keys + "Recursive edit, type \\[exit-recursive-edit] to get out"))) (list (propertize "%[" 'help-echo recursive-edit-help-echo) "(" `(:propertize ("" mode-name) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 9a37941313..099b158553 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -828,7 +828,8 @@ MSG is the error that was found, which is displayed in a help buffer." "\n\nEdit to fix this problem, and press C-M-c to continue."))) (shrink-window-if-larger-than-buffer (get-buffer-window "*Checkdoc Help*")) - (message "When you're done editing press C-M-c to continue.") + (message (substitute-command-keys + "When you're done editing press \\[exit-recursive-edit] to continue.")) (unwind-protect (recursive-edit) (if (get-buffer-window "*Checkdoc Help*") commit 4b3dc7a139c426bad52d3aa145b4868c9b44a325 Author: Juri Linkov Date: Sat Sep 18 21:42:17 2021 +0300 * lisp/subr.el (string-replace): Add dashes to arg names (bug#50644) * lisp/net/tramp-compat.el (tramp-compat-string-replace): Idem. * doc/lispref/searching.texi (Search and Replace): Idem. diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 68061f0b09..0dcf3889a5 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -2620,9 +2620,9 @@ replacement string. The match data at this point are the result of matching @var{regexp} against a substring of @var{string}. @end defun -@defun string-replace fromstring tostring instring -This function replaces all occurrences of @var{fromstring} with -@var{tostring} in @var{instring} and returns the result. It may +@defun string-replace from-string to-string in-string +This function replaces all occurrences of @var{from-string} with +@var{to-string} in @var{in-string} and returns the result. It may return one of its arguments unchanged, a constant string or a new string. Case is significant, and text properties are ignored. @end defun diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 125f82592f..e6f1d9df70 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -359,10 +359,10 @@ CONDITION can also be a list of error conditions." (defalias 'tramp-compat-string-replace (if (fboundp 'string-replace) #'string-replace - (lambda (fromstring tostring instring) + (lambda (from-string to-string in-string) (let ((case-fold-search nil)) (replace-regexp-in-string - (regexp-quote fromstring) tostring instring t t))))) + (regexp-quote from-string) to-string in-string t t))))) ;; Function `string-search' is new in Emacs 28.1. (defalias 'tramp-compat-string-search diff --git a/lisp/subr.el b/lisp/subr.el index a2266b1d57..c2cfc18bd7 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4937,25 +4937,25 @@ Unless optional argument INPLACE is non-nil, return a new string." (aset newstr i tochar))) newstr)) -(defun string-replace (fromstring tostring instring) - "Replace FROMSTRING with TOSTRING in INSTRING each time it occurs." +(defun string-replace (from-string to-string in-string) + "Replace FROM-STRING with TO-STRING in IN-STRING each time it occurs." (declare (pure t) (side-effect-free t)) - (when (equal fromstring "") + (when (equal from-string "") (signal 'wrong-length-argument '(0))) (let ((start 0) (result nil) pos) - (while (setq pos (string-search fromstring instring start)) + (while (setq pos (string-search from-string in-string start)) (unless (= start pos) - (push (substring instring start pos) result)) - (push tostring result) - (setq start (+ pos (length fromstring)))) + (push (substring in-string start pos) result)) + (push to-string result) + (setq start (+ pos (length from-string)))) (if (null result) ;; No replacements were done, so just return the original string. - instring + in-string ;; Get any remaining bit. - (unless (= start (length instring)) - (push (substring instring start) result)) + (unless (= start (length in-string)) + (push (substring in-string start) result)) (apply #'concat (nreverse result))))) (defun replace-regexp-in-string (regexp rep string &optional commit acba74a39542099bc6cc68bf60d52bb14005c2d3 Author: Eli Zaretskii Date: Sat Sep 18 21:04:07 2021 +0300 ; Clarify recently added documentation * etc/NEWS: * doc/emacs/help.texi (Name Help): Clarify documentation of 'help-enable-symbol-autoload'. diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index f7fcd207ee..9f6009b321 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi @@ -279,11 +279,13 @@ name is defined as a Lisp function. Type @kbd{C-g} to cancel the documentation. @vindex help-enable-symbol-autoload - If you request help for an autoloaded function that doesn't have a -doc string, the @file{*Help*} buffer won't have any doc string to -display. If @code{help-enable-symbol-autoload} is non-@code{nil}, -Emacs will try to load the file the function is defined in to see -whether there's a doc string there. + If you request help for an autoloaded function whose @code{autoload} +form (@pxref{Autoload,,, elisp, The Emacs Lisp Reference Manual}) +doesn't provide a doc string, the @file{*Help*} buffer won't have any +doc string to display. In that case, if +@code{help-enable-symbol-autoload} is non-@code{nil}, Emacs will try +to load the file in which the function is defined to see whether +there's a doc string there. @findex shortdoc-display-group You can get an overview of functions relevant for a particular topic diff --git a/etc/NEWS b/etc/NEWS index a0da78a1f6..5c78189738 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -586,10 +586,12 @@ be assumed to be a propertized string. Note that the new face will also be used in tooltips. When using the GTK toolkit, this is only true if 'x-gtk-use-system-tooltips' is t. ++++ *** New user option 'help-enable-symbol-autoload'. -If non-nil, displaying help for an autoloaded function that has no -documentation string will try to load the file it's from. This will -give more extensive help for these functions. +If non-nil, displaying help for an autoloaded function whose +'autoload' form provides no documentation string will try to load the +file it's from. This will give more extensive help for such +functions. --- *** The 'help-for-help' ('C-h C-h') screen has been redesigned. commit c53aff5de71d7c558c222c35fd1cda0298d834b1 Author: Arthur Miller Date: Sat Sep 18 19:51:47 2021 +0200 Add new help-enable-symbol-autoload user option * lisp/help-fns.el (help-fns--analyze-function): Use it. * lisp/help-fns.el (help-enable-symbol-autoload): New user option. * doc/emacs/help.texi (Name Help): Document it. diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index 0caab681d3..f7fcd207ee 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi @@ -278,6 +278,13 @@ name is defined as a Lisp function. Type @kbd{C-g} to cancel the @kbd{C-h f} command if you don't really want to view the documentation. +@vindex help-enable-symbol-autoload + If you request help for an autoloaded function that doesn't have a +doc string, the @file{*Help*} buffer won't have any doc string to +display. If @code{help-enable-symbol-autoload} is non-@code{nil}, +Emacs will try to load the file the function is defined in to see +whether there's a doc string there. + @findex shortdoc-display-group You can get an overview of functions relevant for a particular topic by using the @kbd{M-x shortdoc-display-group} command. This will diff --git a/etc/NEWS b/etc/NEWS index fd2408d793..a0da78a1f6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -586,6 +586,11 @@ be assumed to be a propertized string. Note that the new face will also be used in tooltips. When using the GTK toolkit, this is only true if 'x-gtk-use-system-tooltips' is t. +*** New user option 'help-enable-symbol-autoload'. +If non-nil, displaying help for an autoloaded function that has no +documentation string will try to load the file it's from. This will +give more extensive help for these functions. + --- *** The 'help-for-help' ('C-h C-h') screen has been redesigned. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index ffbead3398..63d3905a94 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -132,6 +132,12 @@ with the current prefix. The files are chosen according to :group 'help :version "26.3") +(defcustom help-enable-symbol-autoload nil + "Perform autoload if docs are missing from autoload objects." + :type 'boolean + :group 'help + :version "28.1") + (defun help--symbol-class (s) "Return symbol class characters for symbol S." (when (stringp s) @@ -227,7 +233,10 @@ interactive command." ;;;###autoload (defun describe-function (function) "Display the full documentation of FUNCTION (a symbol). -When called from Lisp, FUNCTION may also be a function object." +When called from Lisp, FUNCTION may also be a function object. + +See the `help-enable-symbol-autoload' variable for special +handling of autoloaded functions." (interactive (help-fns--describe-function-or-command-prompt)) ;; We save describe-function-orig-buffer on the help xref stack, so @@ -823,6 +832,16 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." f)) ((subrp def) (intern (subr-name def))) (t def)))) + + ;; If we don't have a doc string, then try to load the file. + (when (and help-enable-symbol-autoload + (autoloadp real-def) + ;; Empty documentation slot. + (not (nth 2 real-def))) + (condition-case err + (autoload-do-load real-def) + (error (message "Error while autoloading: %S" err)))) + (list real-function def aliased real-def))) (defun help-fns-function-description-header (function) commit 32d85f7b89e21986bcfc7b9caa67ed2dc39f886a Author: Lars Ingebrigtsen Date: Sat Sep 18 18:32:22 2021 +0200 Mention xref-quit-and-pop-marker-stack in the manual * doc/emacs/maintaining.texi (Xref Commands): Mention xref-quit-and-pop-marker-stack in the manual. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 4ee0f32bd5..b692c99551 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -2280,6 +2280,11 @@ the match with @var{replacement}. @xref{Identifier Search}. Refresh the contents of the @file{*xref*} buffer (@code{xref-revert-buffer}. +@item M-, +@findex xref-quit-and-pop-marker-stack +Quit the window showing the @file{*xref*} buffer, and then jump to the +previous Xref stack location (@code{xref-quit-and-pop-marker-stack}. + @item q @findex xref-quit Quit the window showing the @file{*xref*} buffer (@code{xref-quit}). diff --git a/etc/NEWS b/etc/NEWS index e99b119e4f..fd2408d793 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2436,10 +2436,12 @@ have been renamed to have "proper" public names and documented ('xref-show-definitions-buffer' and 'xref-show-definitions-buffer-at-bottom'). -*** New command 'xref-quit-and-pop-marker-stack' and a binding for it -in "*xref*" buffers ('M-,'). This combination is easy to press -semi-accidentally if the user wants to go back in the middle of -choosing the exact definition to go to, and this should do TRT. ++++ +*** New command 'xref-quit-and-pop-marker-stack'. +This command is bound to 'M-,' in "*xref*" buffers. This combination +is easy to press semi-accidentally if the user wants to go back in the +middle of choosing the exact definition to go to, and this should do +TRT. --- *** New value 'project-relative' for 'xref-file-name-display'. @@ -2458,6 +2460,7 @@ binding in 'xref--xref-buffer-mode-map'. When non-nil, matches for identifiers in the file visited by the current buffer will be shown first in the "*xref*" buffer. ++++ *** The etags Xref backend now honors 'tags-apropos-additional-actions'. You can customize it to augment the output of 'xref-find-apropos', like it affected the output of 'tags-apropos', which is obsolete since @@ -2710,6 +2713,7 @@ The 'erc-current-nick-highlight-type', 'erc-pal-highlight-type', 'erc-dangerous-host-highlight-type' variables now support a 'message' type for highlighting the entire message but not the sender's nick. +--- *** erc-status-sidebar.el is now part of ERC. The 'erc-status-sidebar' package which provides a HexChat-like activity overview sidebar for joined IRC channels is now part of ERC. commit bd6dca038e9dfc4ad5b0bc07fcc16244e7073b28 Author: Lars Ingebrigtsen Date: Sat Sep 18 18:18:02 2021 +0200 Do some xwidget NEWS markup (and adjust doc string) * lisp/xwidget.el (xwidget-webkit-bookmark-make-record): Mention `xwidget-webkit-bookmark-jump-new-session' in the doc string. diff --git a/etc/NEWS b/etc/NEWS index cfa0c33e45..e99b119e4f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2733,22 +2733,26 @@ separated) and clearer documentation. ** xwidget-webkit mode +--- *** New xwidget commands. 'xwidget-webkit-uri' (return the current URL), 'xwidget-webkit-title' (return the current title), and 'xwidget-webkit-goto-history' (goto a point in history). +--- *** Pixel-based scrolling. The 'xwidget-webkit-scroll-up', 'xwidget-webkit-scroll-down' commands now supports scrolling arbitrary pixel values. It now treats the optional 2nd argument as the pixel values to scroll. +--- *** New commands for scrolling. The new commands 'xwidget-webkit-scroll-up-line', 'xwidget-webkit-scroll-down-line', 'xwidget-webkit-scroll-forward', 'xwidget-webkit-scroll-backward' can be used to scroll webkit by the height of lines or width of chars. +--- *** New user option 'xwidget-webkit-bookmark-jump-new-session'. When non-nil, use a new xwidget webkit session after bookmark jump. Otherwise, it will use 'xwidget-webkit-last-session'. @@ -2937,6 +2941,7 @@ your code to be edited with an Emacs version older than 27.1. --- *** 'mspools-show' is now autoloaded. +--- *** Loading dunnet.el in batch mode doesn't start the game any more. Instead you need to do "emacs -f dun-batch" to start the game in batch mode. @@ -2980,6 +2985,7 @@ direction with e.g. 'C-x o M-- o o'. Also it can help to set a new step with e.g. 'C-x { C-5 { { {', which will set the window resizing step to 5 columns. +--- ** New themes 'modus-vivendi' and 'modus-operandi'. These themes are designed to conform with the highest standard for color-contrast accessibility (WCAG AAA). You can load either of them diff --git a/lisp/xwidget.el b/lisp/xwidget.el index f8cb7a7add..8c593abea8 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -352,7 +352,9 @@ When you set this variable to nil, consider further customization with :type 'boolean) (defun xwidget-webkit-bookmark-make-record () - "Create bookmark record in webkit xwidget." + "Create bookmark record in webkit xwidget. +See `xwidget-webkit-bookmark-jump-new-session' for whether this +should create a new session or not." (nconc (bookmark-make-record-default t t) `((page . ,(xwidget-webkit-uri (xwidget-webkit-current-session))) (handler . (lambda (bmk) commit c19576759f3468b5653241633b0ea85469f6bb06 Author: Lars Ingebrigtsen Date: Sat Sep 18 16:12:56 2021 +0200 Make argument optional in pulse-momentary-highlight-one-line * lisp/cedet/pulse.el (pulse-momentary-highlight-one-line): Make POINT optional (bug#50642) so that the function can be used more easily from some hook functions. diff --git a/lisp/cedet/pulse.el b/lisp/cedet/pulse.el index 7928fa1bf4..b026944029 100644 --- a/lisp/cedet/pulse.el +++ b/lisp/cedet/pulse.el @@ -195,11 +195,13 @@ Optional argument FACE specifies the face to do the highlighting." (remove-hook 'pre-command-hook #'pulse-momentary-unhighlight)) ;;;###autoload -(defun pulse-momentary-highlight-one-line (point &optional face) +(defun pulse-momentary-highlight-one-line (&optional point face) "Highlight the line around POINT, unhighlighting before next command. +If POINT is nil or missing, the current point is used instead. + Optional argument FACE specifies the face to do the highlighting." (save-excursion - (goto-char point) + (goto-char (or point (point))) (let ((start (point-at-bol)) (end (save-excursion (end-of-line) commit 045a4fe94c18cd36ef297e62a80cdff449af3aa5 Author: Phil Sainty Date: Thu Sep 9 19:53:25 2021 +1200 ; * lisp/so-long.el (so-long-mode): Use `so-long-mode-line-active' face diff --git a/lisp/so-long.el b/lisp/so-long.el index 800a68e9c6..e271ff6be3 100644 --- a/lisp/so-long.el +++ b/lisp/so-long.el @@ -8,7 +8,7 @@ ;; Keywords: convenience ;; Created: 23 Dec 2015 ;; Package-Requires: ((emacs "24.4")) -;; Version: 1.1.1 +;; Version: 1.1.2 ;; This file is part of GNU Emacs. @@ -410,6 +410,7 @@ ;; * Change Log: ;; +;; 1.1.2 - Use `so-long-mode-line-active' face on `mode-name' in `so-long-mode'. ;; 1.1.1 - Identical to 1.1, but fixing an incorrect GNU ELPA release. ;; 1.1 - Utilise `buffer-line-statistics' in Emacs 28+, with the new ;; `so-long-predicate' function `so-long-statistics-excessive-p'. @@ -477,7 +478,7 @@ '(so-long ("1.0" . "27.1") ("1.1" . "28.1"))) -(defconst so-long--latest-version "1.1") +(defconst so-long--latest-version "1.1.2") (declare-function buffer-line-statistics "fns.c" t t) ;; Emacs 28+ (declare-function longlines-mode "longlines") @@ -969,7 +970,12 @@ If nil, no mode line indicator will be displayed." (defface so-long-mode-line-active '((t :inherit mode-line-emphasis)) - "Face for `so-long-mode-line-info' when mitigations are active." + "Face for the mode line construct when mitigations are active. + +Applied to `mode-name' in the `so-long-mode' major mode, and to +`so-long-mode-line-label' otherwise (for non-major-mode actions). + +See also `so-long-mode-line-info'." :package-version '(so-long . "1.0")) (defface so-long-mode-line-inactive @@ -1355,7 +1361,8 @@ This minor mode is a standard `so-long-action' option." "Major mode keymap and menu for `so-long-mode'.") ;;;###autoload -(define-derived-mode so-long-mode nil "So Long" +(define-derived-mode so-long-mode nil + (propertize "So Long" 'face 'so-long-mode-line-active) "This major mode is the default `so-long-action' option. The normal reason for this mode being active is that `global-so-long-mode' is commit bda9abb68081e45c5c46e662a4997254cb74f0ef Author: Phil Sainty Date: Sat Sep 18 14:16:13 2021 +1200 ; * lisp/so-long.el: Documentation Clarify things which are only relevant to 'global-so-long-mode', and not when the 'so-long' command, or one of its actions, is invoked directly. Use the new "customization group" hyperlink syntax. Only quote 'so-long' as a symbol when it specifically refers to the command (or will otherwise generate a hyperlink which is appropriate to the context). When referring to the library more generally, leave it unquoted. Changes from commit 63f419f1339cbd0a7d1e64586854a4f01b3f80d1 are reverted or improved. diff --git a/lisp/so-long.el b/lisp/so-long.el index 0cc6e884b8..800a68e9c6 100644 --- a/lisp/so-long.el +++ b/lisp/so-long.el @@ -447,7 +447,7 @@ ;; 0.7.5 - Documentation. ;; - Added sgml-mode and nxml-mode to `so-long-target-modes'. ;; 0.7.4 - Refactored the handling of `whitespace-mode'. -;; 0.7.3 - Added customize group `so-long' with user options. +;; 0.7.3 - Added customization group `so-long' with user options. ;; - Added `so-long-original-values' to generalise the storage and ;; restoration of values from the original mode upon `so-long-revert'. ;; - Added `so-long-revert-hook'. @@ -491,7 +491,7 @@ ;; considered internal-use only (with `global-so-long-mode' the interface ;; for enabling or disabling the automated behaviour). FIXME: Establish a ;; way to support the original use-case, or rename to `so-long--enabled'. - "Internal use. Non-nil when any `so-long' functionality has been used.") + "Internal use. Non-nil when any so-long functionality has been used.") (defvar-local so-long--active nil ; internal use "Non-nil when `so-long' mitigations are in effect.") @@ -568,7 +568,7 @@ See `so-long-detected-long-line-p' for details." (defcustom so-long-target-modes '(prog-mode css-mode sgml-mode nxml-mode fundamental-mode) - "`so-long' affects only these modes and their derivatives. + "`global-so-long-mode' affects only these modes and their derivatives. Our primary use-case is minified programming code, so `prog-mode' covers most cases, but there are some exceptions to this. @@ -615,7 +615,9 @@ the mentioned options might interfere with some intended processing." (defcustom so-long-predicate (if (fboundp 'buffer-line-statistics) 'so-long-statistics-excessive-p 'so-long-detected-long-line-p) - "Function, called after `set-auto-mode' to decide whether action is needed. + "Function called after `set-auto-mode' to decide whether action is needed. + +This affects the behaviour of `global-so-long-mode'. Only called if the major mode is a member of `so-long-target-modes'. @@ -750,6 +752,8 @@ If ACTION-ARG is provided, it is used in place of `so-long-action'." (defcustom so-long-file-local-mode-function 'so-long-mode-downgrade "Function to call during `set-auto-mode' when a file-local mode is set. +This affects the behaviour of `global-so-long-mode'. + The specified function will be called with a single argument, being the file-local mode which was established. @@ -761,8 +765,8 @@ place of `so-long-mode' -- therefore respecting the file-local mode value, yet still overriding minor modes and variables (as if `so-long-action' had been set to `so-long-minor-mode'). -The value `so-long-inhibit' means that `so-long' will not take any action at all -for this file. +The value `so-long-inhibit' means that `global-so-long-mode' will not take any +action at all for this file. If nil, then do not treat files with file-local modes any differently to other files. @@ -1090,7 +1094,7 @@ This command calls `so-long' with the selected action as an argument.") ;;;###autoload (defun so-long-commentary () - "View the `so-long' documentation in `outline-mode'." + "View the so-long library's documentation in `outline-mode'." (interactive) (let ((buf "*So Long: Commentary*")) (when (buffer-live-p (get-buffer buf)) @@ -1130,7 +1134,7 @@ This command calls `so-long' with the selected action as an argument.") ;;;###autoload (defun so-long-customize () - "Open the `so-long' customize group." + "Open the customization group `so-long'." (interactive) (customize-group 'so-long)) @@ -1375,7 +1379,8 @@ values), despite potential performance issues, type \\[so-long-revert]. Use \\[so-long-commentary] for more information. -Use \\[so-long-customize] to configure the behaviour." +Use \\[so-long-customize] to open the customization group `so-long' to +configure the behaviour." ;; Housekeeping. `so-long-mode' might be invoked directly rather than via ;; `so-long', so replicate the necessary behaviours. We could use this same ;; test in `so-long-after-change-major-mode' to run `so-long-hook', but that's @@ -1583,7 +1588,7 @@ because we do not want to downgrade the major mode in that scenario." so-long-revert-function 'turn-off-so-long-minor-mode)))) (defun so-long-inhibit (&optional _mode) - "Prevent `so-long' from having any effect at all. + "Prevent `global-so-long-mode' from having any effect. This is a `so-long-file-local-mode-function' option." (setq so-long--inhibited t)) @@ -1642,12 +1647,13 @@ function defined by `so-long-file-local-mode-function'." "-mode")) modes)))) - ;; `so-long' now processes the resulting mode list. If any modes were - ;; listed, we assume that one of them is a major mode. It's possible that - ;; this isn't true, but the buffer would remain in fundamental-mode if that - ;; were the case, so it is very unlikely. For the purposes of passing a - ;; value to `so-long-handle-file-local-mode' we assume the major mode was - ;; the first mode specified (in which case it is the last in the list). + ;; Now process the resulting mode list for `so-long--set-auto-mode'. + ;; If any modes were listed, we assume that one of them is a major mode. + ;; It's possible that this isn't true, but the buffer would remain in + ;; fundamental-mode if that were the case, so it is very unlikely. + ;; For the purposes of passing a value to `so-long-handle-file-local-mode' + ;; we assume the major mode was the first mode specified (in which case it + ;; is the last in the list). (when modes (so-long-handle-file-local-mode (car (last modes)))))) @@ -1661,7 +1667,7 @@ function defined by `so-long-file-local-mode-function'." ;; (advice-add 'hack-local-variables :around #'so-long--hack-local-variables) ;; ;; See also "Files with a file-local 'mode'" in the Commentary. - "Ensure that `so-long' defers to file-local mode declarations if necessary. + "Enable `global-so-long-mode' to defer to file-local mode declarations. If a file-local mode is detected, then we call the function defined by `so-long-file-local-mode-function'. @@ -1685,7 +1691,8 @@ File-local header comments are currently an exception, and are processed by ;; (advice-add 'set-auto-mode :around #'so-long--set-auto-mode) "Maybe call `so-long' for files with very long lines. -This advice acts after `set-auto-mode' has set the buffer's major mode. +This advice acts after `set-auto-mode' has set the buffer's major mode, if +`global-so-long-mode' is enabled. We can't act before this point, because some major modes must be exempt \(binary file modes, for example). Instead, we act only when the selected @@ -1848,14 +1855,14 @@ invoked." ;;;###autoload (defun so-long-enable () - "Enable the `so-long' library's functionality. + "Enable the so-long library's functionality. Equivalent to calling (global-so-long-mode 1)" (interactive) (global-so-long-mode 1)) (defun so-long-disable () - "Disable the `so-long' library's functionality. + "Disable the so-long library's functionality. Equivalent to calling (global-so-long-mode 0)" (interactive) @@ -1880,7 +1887,8 @@ When such files are detected by `so-long-predicate', we invoke the selected Use \\[so-long-commentary] for more information. -Use \\[so-long-customize] to configure the behaviour." +Use \\[so-long-customize] to open the customization group `so-long' to +configure the behaviour." :global t :group 'so-long (if global-so-long-mode @@ -2065,13 +2073,13 @@ If it appears in `%s', you should remove it." ;; M-x ispell-buffer (using aspell). ; LocalWords: LocalWords british ispell aspell hunspell emacs elisp el init dir -; LocalWords: customize customized customizing Customization globalized amongst +; LocalWords: customize customized customizing customization Customization prog ; LocalWords: initialized profiler boolean minified pre redisplay config keymap ; LocalWords: noerror selectable mapc sgml nxml hl flydiff defs arg Phil Sainty ; LocalWords: defadvice nadvice whitespace ie bos eos eobp origmode un Un setq ; LocalWords: docstring auf Wiedersehen longlines alist autoload Refactored Inc ; LocalWords: MERCHANTABILITY RET REGEXP VAR ELPA WS mitigations EmacsWiki eval -; LocalWords: rx filename filenames js defun bidi bpa prog FIXME +; LocalWords: rx filename filenames js defun bidi bpa FIXME globalized amongst ;; So long, farewell, auf Wiedersehen, goodbye ;; You have to go, this code is minified commit 5444f607a64c223489f6aa70b1f4bbce1c32ba63 Author: Dan Ports Date: Sat Sep 18 16:04:38 2021 +0200 Use the newest gcc installed by Macports * configure.ac: There may be more than one gcc version installed in Macports (bug#50649). Use the newest. Copyright-paperwork-exempt: yes diff --git a/configure.ac b/configure.ac index 1146b581cd..f151dd551d 100644 --- a/configure.ac +++ b/configure.ac @@ -3838,9 +3838,13 @@ if test "${with_native_compilation}" != "no"; then if test -n "$HAVE_MACPORTS"; then # Determine which gcc version has been installed (gcc11, for - # instance). + # instance). Use the latest version, if more than one is + # available. (We filter out the gcc4 packages, because they + # don't support jit, and they have names like "gcc49" that + # sort later than "gcc11".) PORT_PACKAGE=$(port installed active | grep '^ *gcc@<:@0-9@:>@* ' | \ - awk '{ print $1; }') + awk '{ print $1; }' | grep -v 'gcc4@<:@0-9@:>@' | \ + sort -V | tail -n 1) if test -n "$PORT_PACKAGE"; then MAC_CFLAGS="-I$(dirname $(port contents $PORT_PACKAGE | \ grep libgccjit.h))" commit 1b623d0fbf5e69910379a8f1e23006419b046e23 Author: Basil L. Contovounesios Date: Sat Sep 18 11:49:07 2021 +0100 Fontify Libtool macros in autoconf-mode * lisp/progmodes/autoconf.el (autoconf-font-lock-keywords): Apply font-lock-keyword-face also to Libtool's LT_* macros (bug#50659). diff --git a/lisp/progmodes/autoconf.el b/lisp/progmodes/autoconf.el index 73cf290f43..78148ccf85 100644 --- a/lisp/progmodes/autoconf.el +++ b/lisp/progmodes/autoconf.el @@ -44,7 +44,7 @@ "A\\(?:H_TEMPLATE\\|C_\\(?:SUBST\\|DEFINE\\(?:_UNQUOTED\\)?\\)\\)(\\[*\\(\\(?:\\sw\\|\\s_\\)+\\)\\]*") (defvar autoconf-font-lock-keywords - `(("\\_ Date: Sat Sep 18 14:56:55 2021 +0300 Improve doc strings of a recent commit * lisp/emacs-lisp/generator.el (iter-defun): * lisp/emacs-lisp/comp.el (comp-clean-up-stale-eln): * lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode): * lisp/emacs-lisp/autoload.el (autoload-insert-section-header): Include description of arguments in the doc string's first line. diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 38512e04e7..f620cdbb33 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -432,8 +432,10 @@ FILE's name." file) (defun autoload-insert-section-header (outbuf autoloads load-name file time) - "Insert the section-header line. -This lists the file name and which functions are in it, etc." + "Insert into buffer OUTBUF the section-header line for FILE. +The header line lists the file name, its \"load name\", its autoloads, +and the time the FILE was last updated (the time is inserted only +if `autoload-timestamps' is non-nil, otherwise a fixed fake time is inserted)." ;; (cl-assert ;Make sure we don't insert it in the middle of another section. ;; (save-excursion ;; (or (not (re-search-backward diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 8a730618ec..614aa856f6 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -915,7 +915,7 @@ CONST2 may be evaluated multiple times." ,bytes ,pc)) (defun byte-compile-lapcode (lap) - "Turn lapcode into bytecode. The lapcode is destroyed." + "Turn lapcode LAP into bytecode. The lapcode is destroyed." ;; Lapcode modifications: changes the ID of a tag to be the tag's PC. (let ((pc 0) ; Program counter op off ; Operation & offset diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index ab36b8aa90..31cae734cc 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3804,8 +3804,9 @@ Return the trampoline if found or nil otherwise." ;;;###autoload (defun comp-clean-up-stale-eln (file) - "Given FILE remove all its *.eln files in `native-comp-eln-load-path'. -sharing the original source filename (including FILE)." + "Remove all FILE*.eln* files found in `native-comp-eln-load-path'. +The files to be removed are those produced from the original source +filename (including FILE)." (when (string-match (rx "-" (group-n 1 (1+ hex)) "-" (1+ hex) ".eln" eos) file) (cl-loop diff --git a/lisp/emacs-lisp/generator.el b/lisp/emacs-lisp/generator.el index 7801fc9070..2075ac472d 100644 --- a/lisp/emacs-lisp/generator.el +++ b/lisp/emacs-lisp/generator.el @@ -668,7 +668,7 @@ sub-iterator function returns via `iter-end-of-sequence'." (iter-close ,valsym))))) (defmacro iter-defun (name arglist &rest body) - "Create a generator NAME. + "Create a generator NAME that accepts ARGLIST as its arguments. When called as a function, NAME returns an iterator value that encapsulates the state of a computation that produces a sequence of values. Callers can retrieve each value using `iter-next'." commit 031e1c28f9ee3971b1376f30f1c8a010432e529b Author: Mattias Engdegård Date: Sat Sep 18 13:39:09 2021 +0200 Regexp-quote literal symbols when grepping `xref-find-references` was unable to find symbols like `backquote-list*-macro`. * lisp/cedet/semantic/symref/grep.el (semantic-symref-grep--quote-extended): New function. (semantic-symref-perform-search): Call it. diff --git a/lisp/cedet/semantic/symref/grep.el b/lisp/cedet/semantic/symref/grep.el index 53745b429a..1e282c3052 100644 --- a/lisp/cedet/semantic/symref/grep.el +++ b/lisp/cedet/semantic/symref/grep.el @@ -133,6 +133,12 @@ This shell should support pipe redirect syntax." :group 'semantic :type 'string) +(defun semantic-symref-grep--quote-extended (string) + "Quote STRING as an extended-syntax regexp." + (replace-regexp-in-string (rx (in ".^$*+?|{}[]()|\\")) + (lambda (s) (concat "\\" s)) + string nil t)) + (cl-defmethod semantic-symref-perform-search ((tool semantic-symref-tool-grep)) "Perform a search with Grep." ;; Grep doesn't support some types of searches. @@ -151,7 +157,10 @@ This shell should support pipe redirect syntax." ((eq (oref tool searchtype) 'regexp) "-nE ") (t "-nw "))) - (greppat (oref tool searchfor)) + (searchfor (oref tool searchfor)) + (greppat (if (eq (oref tool searchtype) 'regexp) + searchfor + (semantic-symref-grep--quote-extended searchfor))) ;; Misc (b (get-buffer-create "*Semantic SymRef*")) (ans nil) commit dd1220b96972d77e5bbe1094586514bae63fe1eb Author: Stefan Kangas Date: Sat Sep 18 13:12:41 2021 +0200 ; More stylistic docfixes in emacs-lisp/*.el found by checkdoc diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index 1f276c7f7a..15e413e0e8 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -1033,7 +1033,7 @@ ;; ;; To make sure a certain piece of advice gets executed even if some error or ;; non-local exit occurred in any preceding code, we can protect it by using -;; the `protect' keyword. (if any of the around advices is protected then the +;; the `protect' keyword (if any of the around advices is protected then the ;; whole around advice onion will be protected): ;; ;; (defadvice foo (after fg-cleanup prot act) @@ -3105,7 +3105,7 @@ The syntax of `defadvice' is as follows: FUNCTION ::= Name of the function to be advised. CLASS ::= `before' | `around' | `after' | `activation' | `deactivation'. NAME ::= Non-nil symbol that names this piece of advice. -POSITION ::= `first' | `last' | NUMBER. Optional, defaults to `first', +POSITION ::= `first' | `last' | NUMBER. Optional, defaults to `first', see also `ad-add-advice'. ARGLIST ::= An optional argument list to be used for the advised function instead of the argument list of the original. The first one found in diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index e9a20634af..38512e04e7 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -25,7 +25,7 @@ ;; This code helps GNU Emacs maintainers keep the loaddefs.el file up to ;; date. It interprets magic cookies of the form ";;;###autoload" in -;; lisp source files in various useful ways. To learn more, read the +;; Lisp source files in various useful ways. To learn more, read the ;; source; if you're going to use this, you'd better be able to. ;;; Code: @@ -432,8 +432,8 @@ FILE's name." file) (defun autoload-insert-section-header (outbuf autoloads load-name file time) - "Insert the section-header line, -which lists the file name and which functions are in it, etc." + "Insert the section-header line. +This lists the file name and which functions are in it, etc." ;; (cl-assert ;Make sure we don't insert it in the middle of another section. ;; (save-excursion ;; (or (not (re-search-backward diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el index ea70baa953..a5721aa319 100644 --- a/lisp/emacs-lisp/backtrace.el +++ b/lisp/emacs-lisp/backtrace.el @@ -868,7 +868,7 @@ commands. \\{backtrace-mode-map} A mode which inherits from Backtrace mode, or a command which -creates a backtrace-mode buffer, should usually do the following: +creates a `backtrace-mode' buffer, should usually do the following: - Set `backtrace-revert-hook', if the buffer contents need to be specially recomputed prior to `revert-buffer'. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 966ef266b9..c15814afa0 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -202,7 +202,7 @@ (intern (substring (symbol-name arg) 5)) arg) (if (integerp (setq c (car arg))) - (error "non-symbolic byte-op %s" c)) + (error "Non-symbolic byte-op %s" c)) (if (eq c 'TAG) (setq c arg) (setq a (cond ((memq c byte-goto-ops) @@ -1753,7 +1753,7 @@ See Info node `(elisp) Integer Basics'." (setq tags (delq tmp tags)) (setq rest (cdr rest)))) (setq rest (cdr rest)))) - (if tags (error "optimizer error: missed tags %s" tags)) + (if tags (error "Optimizer error: missed tags %s" tags)) ;; Remove addrs, lap = ( [ (op . arg) | (TAG tagno) ]* ) (mapcar (lambda (elt) (if (numberp elt) diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 6d698ffb6f..35c80e524c 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -529,11 +529,11 @@ is enabled." (list 'quote (eval (cons 'progn body) lexical-binding))) (defmacro eval-and-compile (&rest body) - "Like `progn', but evaluates the body at compile time and at -load time. In interpreted code, this is entirely equivalent to -`progn', except that the value of the expression may be (but is -not necessarily) computed at load time if eager macro expansion -is enabled." + "Like `progn', but evaluates the body at compile time and at load time. +In interpreted code, this is entirely equivalent to `progn', +except that the value of the expression may be (but is not +necessarily) computed at load time if eager macro expansion is +enabled." (declare (debug (&rest def-form)) (indent 0)) ;; When the byte-compiler expands code, this macro is not used, so we're ;; either about to run `body' (plain interpretation) or we're doing eager diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 776e84dfeb..8a730618ec 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -915,7 +915,7 @@ CONST2 may be evaluated multiple times." ,bytes ,pc)) (defun byte-compile-lapcode (lap) - "Turns lapcode into bytecode. The lapcode is destroyed." + "Turn lapcode into bytecode. The lapcode is destroyed." ;; Lapcode modifications: changes the ID of a tag to be the tag's PC. (let ((pc 0) ; Program counter op off ; Operation & offset @@ -1899,7 +1899,7 @@ also be compiled." "Non-nil to prevent byte-compiling of Emacs Lisp code. This is normally set in local file variables at the end of the elisp file: -\;; Local Variables:\n;; no-byte-compile: t\n;; End: ") ;Backslash for compile-main. +\;; Local Variables:\n;; no-byte-compile: t\n;; End:") ;Backslash for compile-main. ;;;###autoload(put 'no-byte-compile 'safe-local-variable 'booleanp) (defun byte-recompile-file (filename &optional force arg load) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 3ed489f32e..9a37941313 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -2081,7 +2081,7 @@ If the offending word is in a piece of quoted text, then it is skipped." (not (thing-at-point-looking-at help-xref-url-regexp))) (if (checkdoc-autofix-ask-replace - b e (format "Text %s should be capitalized. Fix? " + b e (format "Text %s should be capitalized. Fix?" text) (capitalize text) t) nil diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el index 4a69df15bc..1640975b84 100644 --- a/lisp/emacs-lisp/cl-generic.el +++ b/lisp/emacs-lisp/cl-generic.el @@ -960,7 +960,7 @@ Can only be used from within the lexical body of a primary or around method." ;;; Add support for describe-function (defun cl--generic-search-method (met-name) - "For `find-function-regexp-alist'. Searches for a cl-defmethod. + "For `find-function-regexp-alist'. Search for a `cl-defmethod'. MET-NAME is as returned by `cl--generic-load-hist-format'." (let ((base-re (concat "(\\(?:cl-\\)?defmethod[ \t]+" (regexp-quote (format "%s" (car met-name))) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index bb135457e2..ab36b8aa90 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3804,7 +3804,7 @@ Return the trampoline if found or nil otherwise." ;;;###autoload (defun comp-clean-up-stale-eln (file) - "Given FILE remove all its *.eln files in `native-comp-eln-load-path' + "Given FILE remove all its *.eln files in `native-comp-eln-load-path'. sharing the original source filename (including FILE)." (when (string-match (rx "-" (group-n 1 (1+ hex)) "-" (1+ hex) ".eln" eos) file) diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 8da9fb7682..0592db85df 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -119,7 +119,7 @@ This is to optimize `debugger-make-xrefs'.") (defvar debugger-jumping-flag nil "Non-nil means that `debug-on-entry' is disabled. This variable is used by `debugger-jump', `debugger-step-through', -and `debugger-reenable' to temporarily disable debug-on-entry.") +and `debugger-reenable' to temporarily disable `debug-on-entry'.") (defvar inhibit-trace) ;Not yet implemented. @@ -128,7 +128,7 @@ and `debugger-reenable' to temporarily disable debug-on-entry.") It is a list expected to take the form (CAUSE . REST) where CAUSE can be: - debug: called for entry to a flagged function. -- t: called because of debug-on-next-call. +- t: called because of `debug-on-next-call'. - lambda: same thing but via `funcall'. - exit: called because of exit of a flagged function. - error: called because of `debug-on-error'.") @@ -335,7 +335,7 @@ Make functions into cross-reference buttons if DO-XREFS is non-nil." (defun debugger-setup-buffer (args) "Initialize the `*Backtrace*' buffer for entry to the debugger. -That buffer should be current already and in debugger-mode." +That buffer should be current already and in `debugger-mode'." (setq backtrace-frames (nthcdr ;; Remove debug--implement-debug-on-entry and the ;; advice's `apply' frame. @@ -454,7 +454,7 @@ will be used, such as in a debug on exit from a frame." (exit-recursive-edit)) (defun debugger-jump () - "Continue to exit from this frame, with all debug-on-entry suspended." + "Continue to exit from this frame, with all `debug-on-entry' suspended." (interactive) (debugger-frame) (setq debugger-jumping-flag t) @@ -464,7 +464,7 @@ will be used, such as in a debug on exit from a frame." (exit-recursive-edit)) (defun debugger-reenable () - "Turn all debug-on-entry functions back on. + "Turn all `debug-on-entry' functions back on. This function is put on `post-command-hook' by `debugger-jump' and removes itself from that hook." (setq debugger-jumping-flag nil) @@ -695,7 +695,7 @@ Redefining FUNCTION also cancels it." ;;;###autoload (defun cancel-debug-on-entry (&optional function) "Undo effect of \\[debug-on-entry] on FUNCTION. -If FUNCTION is nil, cancel debug-on-entry for all functions. +If FUNCTION is nil, cancel `debug-on-entry' for all functions. When called interactively, prompt for FUNCTION in the minibuffer. To specify a nil argument interactively, exit with an empty minibuffer." (interactive @@ -798,7 +798,7 @@ another symbol also cancels it." ;;;###autoload (defun cancel-debug-on-variable-change (&optional variable) "Undo effect of \\[debug-on-variable-change] on VARIABLE. -If VARIABLE is nil, cancel debug-on-variable-change for all variables. +If VARIABLE is nil, cancel `debug-on-variable-change' for all variables. When called interactively, prompt for VARIABLE in the minibuffer. To specify a nil argument interactively, exit with an empty minibuffer." (interactive diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el index 43d6dfd3c8..5e9644d823 100644 --- a/lisp/emacs-lisp/derived.el +++ b/lisp/emacs-lisp/derived.el @@ -139,7 +139,7 @@ KEYWORD-ARGS: A nil value means to simply use the same abbrev-table as the parent. :after-hook FORM - A single lisp form which is evaluated after the mode + A single Lisp form which is evaluated after the mode hooks have been run. It should not be quoted. :interactive BOOLEAN Whether the derived mode should be `interactive' or not. diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 7def9ff96a..4f3c05baa9 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -3571,7 +3571,7 @@ This is useful for exiting even if `unwind-protect' code may be executed." (defun edebug-set-initial-mode () "Set the initial execution mode of Edebug. The mode is requested via the key that would be used to set the mode in -edebug-mode." +`edebug-mode'." (interactive) (let* ((old-mode edebug-initial-mode) (key (read-key-sequence @@ -4468,7 +4468,7 @@ With prefix argument, make it a temporary breakpoint." 'read-expression-history))))))) (edebug-modify-breakpoint t condition arg)) -(easy-menu-define edebug-menu edebug-mode-map "Edebug menus" edebug-mode-menus) +(easy-menu-define edebug-menu edebug-mode-map "Edebug menus." edebug-mode-menus) ;;; Finalize Loading diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el index ec7c899bdd..5414c32c34 100644 --- a/lisp/emacs-lisp/eieio-base.el +++ b/lisp/emacs-lisp/eieio-base.el @@ -252,7 +252,7 @@ This is used with the `object-write' method.") :documentation "Saving this object should make backup files. Setting to nil will mean no backups are made.")) - "This special class enables persistence through save files + "This special class enables persistence through save files. Use the `object-write' method to write this object to disk. The save format is Emacs Lisp code which calls the constructor for the saved object. For this reason, only slots which do not have an `:initarg' diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el index 0fba5938f3..32b2cbdb45 100644 --- a/lisp/emacs-lisp/elint.el +++ b/lisp/emacs-lisp/elint.el @@ -1035,7 +1035,7 @@ Insert HEADER followed by a blank line if non-nil." (sit-for 0))) (defun elint-set-mode-line (&optional on) - "Set the mode-line-process of the Elint log buffer." + "Set the `mode-line-process' of the Elint log buffer." (with-current-buffer (elint-get-log-buffer) (and (eq major-mode 'compilation-mode) (setq mode-line-process diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 92acfe7246..d4d8510064 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -1958,9 +1958,9 @@ non-nil, returns the face for expected results.." nil) (defun ert--results-font-lock-function (enabledp) - "Redraw the ERT results buffer after font-lock-mode was switched on or off. + "Redraw the ERT results buffer after `font-lock-mode' was switched on or off. -ENABLEDP is true if font-lock-mode is switched on, false +ENABLEDP is true if `font-lock-mode' is switched on, false otherwise." (ert--results-update-ewoc-hf ert--results-ewoc ert--results-stats) (ewoc-refresh ert--results-ewoc) diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el index ca29b6d8c9..68f94edafd 100644 --- a/lisp/emacs-lisp/ewoc.el +++ b/lisp/emacs-lisp/ewoc.el @@ -147,7 +147,7 @@ and (ewoc--node-nth dll -1) returns the last node." buffer pretty-printer header footer dll last-node hf-pp) (defmacro ewoc--set-buffer-bind-dll-let* (ewoc varlist &rest forms) - "Execute FORMS with ewoc--buffer selected as current buffer, + "Execute FORMS with `ewoc--buffer' selected as current buffer, `dll' bound to the dll, and VARLIST bound as in a let*. `dll' will be bound when VARLIST is initialized, but the current buffer will *not* have been changed. diff --git a/lisp/emacs-lisp/generator.el b/lisp/emacs-lisp/generator.el index 2acf939bed..7801fc9070 100644 --- a/lisp/emacs-lisp/generator.el +++ b/lisp/emacs-lisp/generator.el @@ -668,7 +668,7 @@ sub-iterator function returns via `iter-end-of-sequence'." (iter-close ,valsym))))) (defmacro iter-defun (name arglist &rest body) - "Creates a generator NAME. + "Create a generator NAME. When called as a function, NAME returns an iterator value that encapsulates the state of a computation that produces a sequence of values. Callers can retrieve each value using `iter-next'." diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index b3b1efc8d2..eac3c03cd1 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -627,7 +627,7 @@ Value for `adaptive-fill-function'." ;; encouraged to use 'lisp-data-mode' instead. (defun lisp-mode-variables (&optional lisp-syntax keywords-case-insensitive elisp) - "Common initialization routine for lisp modes. + "Common initialization routine for Lisp modes. The LISP-SYNTAX argument is used by code in inf-lisp.el and is \(uselessly) passed from pp.el, chistory.el, gnus-kill.el and score-mode.el. KEYWORDS-CASE-INSENSITIVE non-nil means that for diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index a2a5aaed04..8fc2986ab4 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el @@ -160,7 +160,7 @@ Each element has the form (WHERE BYTECODE STACK) where: (t (eval spec)))) (defun advice--interactive-form (function) - ;; Like `interactive-form' but tries to avoid autoloading functions. + "Like `interactive-form' but tries to avoid autoloading functions." (when (commandp function) (if (not (and (symbolp function) (autoloadp (indirect-function function)))) (interactive-form function) diff --git a/lisp/emacs-lisp/testcover.el b/lisp/emacs-lisp/testcover.el index f5a624bb61..cdd966e51c 100644 --- a/lisp/emacs-lisp/testcover.el +++ b/lisp/emacs-lisp/testcover.el @@ -333,7 +333,7 @@ vectors as well as conses." ;;;========================================================================= (defun testcover-mark (def) - "Marks one DEF (a function or macro symbol) to highlight its contained forms + "Mark one DEF (a function or macro symbol) to highlight its contained forms that did not get completely tested during coverage tests. A marking with the face `testcover-nohits' (default = red) indicates that the form was never evaluated. A marking using the `testcover-1value' face commit 11d6d6c3ea8d3f131b0b21db6e51a66d8b20d40e Author: Eli Zaretskii Date: Sat Sep 18 13:23:48 2021 +0300 Fix performance degradation in commands that describe key bindings * src/keymap.c (syms_of_keymap) : New variable. (describe_vector): Check shadowing of consecutive keys only if 'describe-bindings-check-shadowing-in-ranges' is non-nil. Remove redundant second loop when VECTOR is a char-table. Improve comments. Patch by Stefan Kangas . (Bug#45379) * test/src/keymap-tests.el (help--describe-vector/bug-9293-one-shadowed-in-range): Adapt the test case for the new variable. diff --git a/src/keymap.c b/src/keymap.c index fb8eceaec1..be45d2be1e 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -2935,7 +2935,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, Lisp_Object suppress = Qnil; bool first = true; /* Range of elements to be handled. */ - int from, to, stop; + int to, stop; if (!keymap_p) { @@ -2955,17 +2955,19 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, if (partial) suppress = intern ("suppress-keymap"); - from = 0; + /* STOP is a boundary between normal characters (-#x3FFF7F) and + 8-bit characters (#x3FFF80-), used below when VECTOR is a + char-table. */ if (CHAR_TABLE_P (vector)) stop = MAX_5_BYTE_CHAR + 1, to = MAX_CHAR + 1; else stop = to = ASIZE (vector); - for (int i = from; ; i++) + for (int i = 0; ; i++) { bool this_shadowed = false; Lisp_Object shadowed_by = Qnil; - int range_beg, range_end; + int range_beg; Lisp_Object val, tem2; maybe_quit (); @@ -2981,6 +2983,10 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, if (CHAR_TABLE_P (vector)) { + /* Find the value in VECTOR for the first character in the + range [RANGE_BEG..STOP), and update the range to include + only the characters whose value is the same as that of + the first in the range. */ range_beg = i; i = stop - 1; val = char_table_ref_and_range (vector, range_beg, &range_beg, &i); @@ -3039,33 +3045,26 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, insert1 (describe_key_maybe_fontify (kludge, prefix, keymap_p)); /* Find all consecutive characters or rows that have the same - definition. But, if VECTOR is a char-table, we had better - put a boundary between normal characters (-#x3FFF7F) and - 8-bit characters (#x3FFF80-). */ - if (CHAR_TABLE_P (vector)) + definition. */ + if (!CHAR_TABLE_P (vector)) { while (i + 1 < stop - && (range_beg = i + 1, range_end = stop - 1, - val = char_table_ref_and_range (vector, range_beg, - &range_beg, &range_end), - tem2 = get_keyelt (val, 0), - !NILP (tem2)) + && (tem2 = get_keyelt (AREF (vector, i + 1), 0), + !NILP (tem2)) && !NILP (Fequal (tem2, definition))) - i = range_end; + i++; } - else - while (i + 1 < stop - && (tem2 = get_keyelt (AREF (vector, i + 1), 0), - !NILP (tem2)) - && !NILP (Fequal (tem2, definition))) - i++; /* Make sure found consecutive keys are either not shadowed or, if they are, that they are shadowed by the same command. */ - if (CHAR_TABLE_P (vector) && i != starting_i) + if (!NILP (Vdescribe_bindings_check_shadowing_in_ranges) + && CHAR_TABLE_P (vector) && i != starting_i + && (!EQ (Vdescribe_bindings_check_shadowing_in_ranges, + Qignore_self_insert) + || !EQ (definition, Qself_insert_command))) { Lisp_Object key = make_nil_vector (1); - for (int j = starting_i + 1; j <= i; j++) + for (int j = range_beg + 1; j <= i; j++) { ASET (key, 0, make_fixnum (j)); Lisp_Object tem = shadow_lookup (shadow, key, Qt, 0); @@ -3181,6 +3180,24 @@ be preferred. */); Vwhere_is_preferred_modifier = Qnil; where_is_preferred_modifier = 0; + DEFVAR_LISP ("describe-bindings-check-shadowing-in-ranges", + Vdescribe_bindings_check_shadowing_in_ranges, + doc: /* If non-nil, consider command shadowing when describing ranges of keys. +If the value is t, describing bindings of consecutive keys will not +report them as a single range if they are shadowed by different +minor-mode commands. +If the value is `ignore-self-insert', assume that consecutive keys +bound to `self-insert-command' are not all shadowed; this speeds up +commands such as \\[describe-bindings] and \\[describe-mode], but could miss some shadowing. +Any other non-nil value is treated is t. + +Beware: setting this non-nil could potentially slow down commands +that describe key bindings. That is why the default is nil. */); + Vdescribe_bindings_check_shadowing_in_ranges = Qnil; + + DEFSYM (Qself_insert_command, "self-insert-command"); + DEFSYM (Qignore_self_insert, "ignore-self-insert"); + DEFSYM (Qmenu_bar, "menu-bar"); DEFSYM (Qmode_line, "mode-line"); diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el index a9b0cb502d..68b42c346c 100644 --- a/test/src/keymap-tests.el +++ b/test/src/keymap-tests.el @@ -269,7 +269,8 @@ commit 86c19714b097aa477d339ed99ffb5136c755a046." (shadow-map (let ((map (make-keymap))) (define-key map "f" 'bar) map)) - (text-quoting-style 'grave)) + (text-quoting-style 'grave) + (describe-bindings-check-shadowing-in-ranges 'ignore-self-insert)) (with-temp-buffer (help--describe-vector (cadr orig-map) nil #'help--describe-command t shadow-map orig-map t) commit c1356d3a05a789555c327dd4cb0f444fdf7be205 Author: Stefan Kangas Date: Sat Sep 18 11:24:22 2021 +0200 * lisp/emacs-lisp/checkdoc.el: Doc fix; mention flymake. diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 4c8117ccf3..3ed489f32e 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -29,11 +29,12 @@ ;; to forget. The main checkdoc engine will perform the stylistic ;; checks needed to make sure these styles are remembered. ;; -;; There are two ways to use checkdoc: -;; 1) Periodically use `checkdoc' or `checkdoc-current-buffer'. +;; There are three ways to use checkdoc: +;; 1) Use `flymake-mode'. +;; 2) Periodically use `checkdoc' or `checkdoc-current-buffer'. ;; `checkdoc' is a more interactive version of ;; `checkdoc-current-buffer' -;; 2) Use `checkdoc-minor-mode' to automatically check your +;; 3) Use `checkdoc-minor-mode' to automatically check your ;; documentation whenever you evaluate Lisp code with C-M-x ;; or [menu-bar emacs-lisp eval-buffer]. Additional key-bindings ;; are also provided under C-c ? KEY commit 00b6a56f0a04110105977027f1af0f7410650c47 Author: Stefan Kangas Date: Sat Sep 18 11:21:32 2021 +0200 Do interactive mode tagging for checkdoc.el diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 2c30815d85..4c8117ccf3 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -463,7 +463,7 @@ be re-created.") "Interactively check the entire buffer for style errors. The current status of the check will be displayed in a buffer which the users will view as each check is completed." - (interactive) + (interactive nil emacs-lisp-mode) (let ((status (list "Checking..." "-" "-" "-")) (checkdoc-spellcheck-documentation-flag (car (memq checkdoc-spellcheck-documentation-flag @@ -530,7 +530,7 @@ buffer. Allows navigation forward and backwards through document errors. Does not check for comment or space warnings. Optional argument SHOWSTATUS indicates that we should update the checkdoc status window instead of the usual behavior." - (interactive "P") + (interactive "P" emacs-lisp-mode) (let ((checkdoc-spellcheck-documentation-flag (car (memq checkdoc-spellcheck-documentation-flag '(interactive t))))) @@ -551,7 +551,7 @@ buffer. Allows navigation forward and backwards through document errors. Does not check for comment or space warnings. Optional argument SHOWSTATUS indicates that we should update the checkdoc status window instead of the usual behavior." - (interactive "P") + (interactive "P" emacs-lisp-mode) (let ((checkdoc-spellcheck-documentation-flag (car (memq checkdoc-spellcheck-documentation-flag '(interactive t))))) @@ -851,7 +851,7 @@ spacing are all verified." With a prefix argument (in Lisp, the argument TAKE-NOTES), store all errors found in a warnings buffer, otherwise stop after the first error." - (interactive "P") + (interactive "P" emacs-lisp-mode) (if (called-interactively-p 'interactive) (message "Checking buffer for style...")) ;; Assign a flag to spellcheck flag @@ -890,7 +890,7 @@ Only documentation strings are checked. Use `checkdoc-continue' to continue checking if an error cannot be fixed. Prefix argument TAKE-NOTES means to collect all the warning messages into a separate buffer." - (interactive "P") + (interactive "P" emacs-lisp-mode) (let ((p (point))) (goto-char (point-min)) (if (and take-notes (called-interactively-p 'interactive)) @@ -905,7 +905,7 @@ a separate buffer." "Find the next doc string in the current buffer which has a style error. Prefix argument TAKE-NOTES means to continue through the whole buffer and save warnings in a separate buffer." - (interactive "P") + (interactive "P" emacs-lisp-mode) (let ((wrong nil) (msg nil) ;; Assign a flag to spellcheck flag (checkdoc-spellcheck-documentation-flag @@ -974,7 +974,7 @@ don't move point." Prefix argument TAKE-NOTES non-nil means to save warnings in a separate buffer. Otherwise print a message. This returns the error if there is one." - (interactive "P") + (interactive "P" emacs-lisp-mode) (if take-notes (checkdoc-start-section "checkdoc-comments")) (if (not buffer-file-name) (error "Can only check comments for a file buffer")) @@ -996,7 +996,7 @@ Prefix argument TAKE-NOTES non-nil means to save warnings in a separate buffer. Otherwise print a message. This returns the error if there is one. Optional argument INTERACT permits more interactive fixing." - (interactive "P") + (interactive "P" emacs-lisp-mode) (if take-notes (checkdoc-start-section "checkdoc-rogue-spaces")) (let* ((checkdoc-autofix-flag (if take-notes 'never checkdoc-autofix-flag)) (e (checkdoc-rogue-space-check-engine nil nil interact)) @@ -1013,7 +1013,7 @@ Optional argument INTERACT permits more interactive fixing." (defun checkdoc-message-text (&optional take-notes) "Scan the buffer for occurrences of the error function, and verify text. Optional argument TAKE-NOTES causes all errors to be logged." - (interactive "P") + (interactive "P" emacs-lisp-mode) (if take-notes (checkdoc-start-section "checkdoc-message-text")) (let* ((p (point)) e (checkdoc-autofix-flag (if take-notes 'never checkdoc-autofix-flag)) commit 6084c7e0f401b5a68836ebc305c14b9a0feb3c43 Author: Stefan Kangas Date: Sat Sep 18 10:39:35 2021 +0200 checkdoc: Only look for commonly used modifier keys * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): Search for the modifier key "s-", but not the modifier key "A-". The latter is very uncommon and leads to false positives. diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index f8df223ce9..2c30815d85 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -1545,7 +1545,9 @@ may require more formatting") ;; Instead, use the `\\[...]' construct to stand for them. (save-excursion (let ((f nil) (m nil) (start (point)) - (re "[^`‘A-Za-z0-9_]\\([CMA]-[a-zA-Z]\\|\\(\\([CMA]-\\)?\ + ;; Ignore the "A-" modifier: it is uncommon in practice, + ;; and leads to false positives in regexp ranges. + (re "[^`‘A-Za-z0-9_]\\([CMs]-[a-zA-Z]\\|\\(\\([CMs]-\\)?\ mouse-[0-3]\\)\\)\\>")) ;; Find the first key sequence not in a sample (while (and (not f) (setq m (re-search-forward re e t)))