commit 3f835ad5806e246ec671e0b4f5c29fbdd32e2440 (HEAD, refs/remotes/origin/master) Author: Juri Linkov Date: Tue Sep 14 09:42:11 2021 +0300 * lisp/tab-bar.el: Close tab only on mouse-1, not down-mouse-1 (bug#41343) * lisp/tab-bar.el (tab-bar-mouse-select-tab): Don't close the tab when clicked on the close button. (tab-bar-mouse-close-tab-from-button): New function. (tab-bar-map): Bind [mouse-1] to 'tab-bar-mouse-close-tab-from-button'. (tab-bar-mouse-move-tab): Do nothing on non-tab events. diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index e0eb62c887..72bce6e80d 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -227,11 +227,13 @@ a list of frames to update." ;;; Key bindings (defun tab-bar--key-to-number (key) - (unless (eq key 'current-tab) - (let ((key-name (format "%S" key))) - (if (string-prefix-p "tab-" key-name) - (string-to-number (string-replace "tab-" "" key-name)) - t)))) + (cond + ((null key) t) + ((eq key 'current-tab) nil) + ((let ((key-name (format "%S" key))) + (when (string-prefix-p "tab-" key-name) + (string-to-number (string-replace "tab-" "" key-name))))) + (t t))) (defun tab-bar--event-to-item (posn) (if (posn-window posn) @@ -261,15 +263,27 @@ a list of frames to update." (interactive "e") (let* ((item (tab-bar--event-to-item (event-start event))) (tab-number (tab-bar--key-to-number (nth 0 item)))) - (if (nth 2 item) - (unless (eq tab-number t) - (tab-bar-close-tab tab-number)) + ;; Don't close the tab when clicked on the close button. + ;; Let `tab-bar-mouse-close-tab-from-button' do this. + (unless (nth 2 item) (if (functionp (nth 1 item)) (call-interactively (nth 1 item)) (unless (eq tab-number t) (tab-bar-select-tab tab-number)))))) +(defun tab-bar-mouse-close-tab-from-button (event) + "Close the tab only when clicked on the close button." + (interactive "e") + (let* ((item (tab-bar--event-to-item (event-start event))) + (tab-number (tab-bar--key-to-number (nth 0 item)))) + (when (nth 2 item) + (unless (eq tab-number t) + (tab-bar-close-tab tab-number))))) + (defun tab-bar-mouse-close-tab (event) + "Close the tab when clicked anywhere on the tab. +This is in contrast with `tab-bar-mouse-close-tab-from-button' +that closes only when clicked on the close button." (interactive "e") (let* ((item (tab-bar--event-to-item (event-start event))) (tab-number (tab-bar--key-to-number (nth 0 item)))) @@ -314,13 +328,14 @@ a list of frames to update." (to (tab-bar--key-to-number (nth 0 (tab-bar--event-to-item (event-end event)))))) - (tab-bar-move-tab-to to from))) + (unless (or (eq from t) (eq to t)) + (tab-bar-move-tab-to to from)))) (defvar tab-bar-map (let ((map (make-sparse-keymap))) (define-key map [down-mouse-1] 'tab-bar-mouse-select-tab) (define-key map [drag-mouse-1] 'tab-bar-mouse-move-tab) - (define-key map [mouse-1] 'ignore) + (define-key map [mouse-1] 'tab-bar-mouse-close-tab-from-button) (define-key map [down-mouse-2] 'tab-bar-mouse-close-tab) (define-key map [mouse-2] 'ignore) (define-key map [down-mouse-3] 'tab-bar-mouse-context-menu) commit 5cd5cc5dd8d016d635bffbefe9d0227e84b18871 Author: Stefan Kangas Date: Tue Sep 14 08:15:15 2021 +0200 ; * lisp/emacs-lisp/checkdoc.el: Fix typo in previous commit. diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 3150ea605f..c91645568c 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -314,7 +314,7 @@ This should be set in an Emacs Lisp file's local variables." (defcustom checkdoc-column-zero-backslash-before-paren t "Non-nil means to warn if there is no '\\' before '(' in column zero. -This backslash is no longer needed on Emacs 27.1 later. +This backslash is no longer needed on Emacs 27.1 or later. See Info node `(elisp) Documentation Tips' for background." :type 'boolean commit 25ebb9374bdadf66153727831fc7ff131c8cf299 Author: Stefan Kangas Date: Tue Sep 14 07:55:56 2021 +0200 ; More minor docfixes found by checkdoc diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index 8e8d0e2265..1f276c7f7a 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -36,12 +36,12 @@ ;; @ Introduction: ;; =============== ;; This package implements a full-fledged Lisp-style advice mechanism -;; for Emacs Lisp. Advice is a clean and efficient way to modify the +;; for Emacs Lisp. Advice is a clean and efficient way to modify the ;; behavior of Emacs Lisp functions without having to keep personal -;; modified copies of such functions around. A great number of such +;; modified copies of such functions around. A great number of such ;; modifications can be achieved by treating the original function as a ;; black box and specifying a different execution environment for it -;; with a piece of advice. Think of a piece of advice as a kind of fancy +;; with a piece of advice. Think of a piece of advice as a kind of fancy ;; hook that you can attach to any function/macro/subr. ;; @ Highlights: @@ -95,7 +95,7 @@ ;; @ Restrictions: ;; =============== ;; - Advised functions/macros/subrs will only exhibit their advised behavior -;; when they are invoked via their function cell. This means that advice will +;; when they are invoked via their function cell. This means that advice will ;; not work for the following: ;; + advised subrs that are called directly from other subrs or C-code ;; + advised subrs that got replaced with their byte-code during @@ -107,7 +107,7 @@ ;; ========== ;; This package is an extension and generalization of packages such as ;; insert-hooks.el written by Noah S. Friedman, and advise.el written by -;; Raul J. Acevedo. Some ideas used in here come from these packages, +;; Raul J. Acevedo. Some ideas used in here come from these packages, ;; others come from the various Lisp advice mechanisms I've come across ;; so far, and a few are simply mine. @@ -235,10 +235,10 @@ ;; found in the list of before/around/after advices will be used. ;; is a list of symbols that specify further information about the -;; advice. All flags can be specified with unambiguous initial substrings. +;; advice. All flags can be specified with unambiguous initial substrings. ;; `activate': Specifies that the advice information of the advised ;; function should be activated right after this advice has been -;; defined. In forward advices `activate' will be ignored. +;; defined. In forward advices `activate' will be ignored. ;; `protect': Specifies that this advice should be protected against ;; non-local exits and errors in preceding code/advices. ;; `compile': Specifies that the advised function should be byte-compiled. @@ -347,7 +347,7 @@ ;; argument list redefinition given in a piece of advice. While this simple ;; method might be sufficient in many cases, it has the disadvantage that it ;; is not very portable because it hardcodes the argument names into the -;; advice. If the definition of the original function changes the advice +;; advice. If the definition of the original function changes the advice ;; might break even though the code might still be correct. Situations like ;; that arise, for example, if one advises a subr like `eval-region' which ;; gets redefined in a non-advice style into a function by the edebug @@ -443,7 +443,7 @@ ;; of the advised function we need a mapping mechanism that maps this ;; argument list onto that of the original function. Hence SYM and ;; NEWDEF have to be properly mapped onto the &rest variable when the -;; original definition is called. Advice automatically takes care of +;; original definition is called. Advice automatically takes care of ;; that mapping, hence, the advice programmer can specify an argument ;; list without having to know about the exact structure of the ;; original argument list as long as the new argument list takes a @@ -467,7 +467,7 @@ ;; The advised definition will get compiled either if `ad-activate' was called ;; interactively with a prefix argument, or called explicitly with its second ;; argument as t, or, if `ad-default-compilation-action' justifies it according -;; to the current system state. If the advised definition was +;; to the current system state. If the advised definition was ;; constructed during "preactivation" (see below) then that definition will ;; be already compiled because it was constructed during byte-compilation of ;; the file that contained the `defadvice' with the `preactivate' flag. @@ -707,7 +707,7 @@ ;; @@ Adding a piece of advice with `ad-add-advice': ;; ================================================= ;; The non-interactive function `ad-add-advice' can be used to add a piece of -;; advice to some function without using `defadvice'. This is useful if advice +;; advice to some function without using `defadvice'. This is useful if advice ;; has to be added somewhere by a function (also look at `ad-make-advice'). ;; @@ Activation/deactivation advices, file load hooks: @@ -739,7 +739,7 @@ ;; A piece of advice gets defined with `defadvice' and added to the ;; `advice-info' property of a function. ;; - Enablement: -;; Every piece of advice has an enablement flag associated with it. Only +;; Every piece of advice has an enablement flag associated with it. Only ;; enabled advices are considered during construction of an advised ;; definition. ;; - Activation: @@ -808,9 +808,9 @@ ;; argument access text macros to get/set the values of ;; actual arguments at a certain position ;; ad-arg-bindings text macro that returns the actual names, values -;; and types of the arguments as a list of bindings. The +;; and types of the arguments as a list of bindings. The ;; order of the bindings corresponds to the order of the -;; arguments. The individual fields of every binding (name, +;; arguments. The individual fields of every binding (name, ;; value and type) can be accessed with the function ;; `ad-arg-binding-field' (see example above). ;; ad-do-it text macro that identifies the place where the original @@ -839,20 +839,20 @@ ;; use the macro `defadvice' which takes a function name, a list of advice ;; specifiers and a list of body forms as arguments. The first element of ;; the advice specifiers is the class of the advice, the second is its name, -;; the third its position and the rest are some flags. The class of our +;; the third its position and the rest are some flags. The class of our ;; first advice is `before', its name is `fg-add2', its position among the ;; currently defined before advices (none so far) is `first', and the advice -;; will be `activate'ed immediately. Advice names are global symbols, hence, -;; the name space conventions used for function names should be applied. All +;; will be `activate'ed immediately. Advice names are global symbols, hence, +;; the name space conventions used for function names should be applied. All ;; advice names in this tutorial will be prefixed with `fg' for `Foo Games' ;; (because everybody has the right to be inconsistent all the function names ;; used in this tutorial do NOT follow this convention). ;; ;; In the body of an advice we can refer to the argument variables of the -;; original function by name. Here we add 1 to X so the effect of calling +;; original function by name. Here we add 1 to X so the effect of calling ;; `foo' will be to actually add 2. All of the advice definitions below only ;; have one body form for simplicity, but there is no restriction to that -;; extent. Every piece of advice can have a documentation string which will +;; extent. Every piece of advice can have a documentation string which will ;; be combined with the documentation of the original function. ;; ;; (defadvice foo (before fg-add2 first activate) @@ -866,11 +866,11 @@ ;; @@ Specifying the position of an advice: ;; ======================================== ;; Now we define the second before advice which will cancel the effect of -;; the previous advice. This time we specify the position as 0 which is -;; equivalent to `first'. A number can be used to specify the zero-based -;; position of an advice among the list of advices in the same class. This +;; the previous advice. This time we specify the position as 0 which is +;; equivalent to `first'. A number can be used to specify the zero-based +;; position of an advice among the list of advices in the same class. This ;; time we already have one before advice hence the position specification -;; actually has an effect. So, after the following definition the position +;; actually has an effect. So, after the following definition the position ;; of the previous advice will be 1 even though we specified it with `first' ;; above, the reason for this is that the position argument is relative to ;; the currently defined pieces of advice which by now has changed. @@ -886,7 +886,7 @@ ;; @@ Redefining a piece of advice: ;; ================================ ;; Now we define an advice with the same class and same name but with a -;; different position. Defining an advice in a class in which an advice with +;; different position. Defining an advice in a class in which an advice with ;; that name already exists is interpreted as a redefinition of that ;; particular advice, in which case the position argument will be ignored ;; and the previous position of the redefined piece of advice is used. @@ -919,7 +919,7 @@ ;; ================================= ;; We can make a function interactive (or change its interactive behavior) ;; by specifying an interactive form in one of the before or around -;; advices (there could also be body forms in this advice). The particular +;; advices (there could also be body forms in this advice). The particular ;; definition always assigns 5 as an argument to X which gives us 6 as a ;; result when we call foo interactively: ;; @@ -945,13 +945,13 @@ ;; ;; @@ Around advices: ;; ================== -;; Now we'll try some `around' advices. An around advice is a wrapper around -;; the original definition. It can shadow or establish bindings for the +;; Now we'll try some `around' advices. An around advice is a wrapper around +;; the original definition. It can shadow or establish bindings for the ;; original definition, and it can look at and manipulate the value returned -;; by the original function. The position of the special keyword `ad-do-it' -;; specifies where the code of the original function will be executed. The +;; by the original function. The position of the special keyword `ad-do-it' +;; specifies where the code of the original function will be executed. The ;; keyword can appear multiple times which will result in multiple calls of -;; the original function in the resulting advised code. Note, that if we don't +;; the original function in the resulting advised code. Note, that if we don't ;; specify a position argument (i.e., `first', `last' or a number), then ;; `first' (or 0) is the default): ;; @@ -967,7 +967,7 @@ ;; Around advices are assembled like onion skins where the around advice ;; with position 0 is the outermost skin and the advice at the last position ;; is the innermost skin which is directly wrapped around the call of the -;; original definition of the function. Hence, after the next `defadvice' we +;; original definition of the function. Hence, after the next `defadvice' we ;; will first multiply X by 2 then add 1 and then call the original ;; definition (i.e., add 1 again): ;; @@ -984,8 +984,8 @@ ;; ================================= ;; In every `defadvice' so far we have used the flag `activate' to activate ;; the advice immediately after its definition, and that's what we want in -;; most cases. However, if we define multiple pieces of advice for a single -;; function then activating every advice immediately is inefficient. A +;; most cases. However, if we define multiple pieces of advice for a single +;; function then activating every advice immediately is inefficient. A ;; better way to do this is to only activate the last defined advice. ;; For example: ;; @@ -1077,7 +1077,7 @@ ;; neutralize the effect of the advice of one of the packages. ;; ;; The following disables the after advice `fg-times-x' in the function `foo'. -;; All that does is to change a flag for this particular advice. All the +;; All that does is to change a flag for this particular advice. All the ;; other information defining it will be left unchanged (e.g., its relative ;; position in this advice class, etc.). ;; @@ -1094,9 +1094,9 @@ ;; 24 ;; ;; If we want to disable all multiplication advices in `foo' we can use a -;; regular expression that matches the names of such advices. Actually, any +;; regular expression that matches the names of such advices. Actually, any ;; advice name that contains a match for the regular expression will be -;; called a match. A special advice class `any' can be used to consider +;; called a match. A special advice class `any' can be used to consider ;; all advice classes: ;; ;; (ad-disable-advice 'foo 'any "^fg-.*times") @@ -1122,7 +1122,7 @@ ;; 9 ;; ;; The following will activate all currently active advised functions that -;; contain some advice matched by the regular expression. This is a save +;; contain some advice matched by the regular expression. This is a save ;; way to update the activation of advised functions whose advice changed ;; in some way or other without accidentally also activating currently ;; inactive functions: @@ -1136,7 +1136,7 @@ ;; ;; Another use for the dis/enablement mechanism is to define a piece of advice ;; and keep it "dormant" until a particular condition is satisfied, i.e., until -;; then the advice will not be used during activation. The `disable' flag lets +;; then the advice will not be used during activation. The `disable' flag lets ;; one do that with `defadvice': ;; ;; (defadvice foo (before fg-1-more dis) @@ -1165,7 +1165,7 @@ ;; =========== ;; Advised definitions get cached to allow efficient activation/deactivation ;; without having to reconstruct them if nothing in the advice-info of a -;; function has changed. The following idiom can be used to temporarily +;; function has changed. The following idiom can be used to temporarily ;; deactivate functions that have a piece of advice defined by a certain ;; package (we save the old definition to check out caching): ;; @@ -1350,9 +1350,9 @@ ;; @@ Portable argument access: ;; ============================ ;; So far, we always used the actual argument variable names to access an -;; argument in a piece of advice. For many advice applications this is -;; perfectly ok and keeps advices simple. However, it decreases portability -;; of advices because it assumes specific argument variable names. For example, +;; argument in a piece of advice. For many advice applications this is +;; perfectly ok and keeps advices simple. However, it decreases portability +;; of advices because it assumes specific argument variable names. For example, ;; if one advises a subr such as `eval-region' which then gets redefined by ;; some package (e.g., edebug) into a function with different argument names, ;; then a piece of advice written for `eval-region' that was written with @@ -1360,7 +1360,7 @@ ;; ;; Argument access text macros allow one to access arguments of an advised ;; function in a portable way without having to worry about all these -;; possibilities. These macros will be translated into the proper access forms +;; possibilities. These macros will be translated into the proper access forms ;; at activation time, hence, argument access will be as efficient as if ;; the arguments had been used directly in the definition of the advice. ;; @@ -1386,7 +1386,7 @@ ;; (fuu 1 1 1) ;; 6 ;; -;; Now suppose somebody redefines `fuu' with a rest argument. Our advice +;; Now suppose somebody redefines `fuu' with a rest argument. Our advice ;; will still work because we used access macros (note, that automatic ;; advice activation is still in effect, hence, the redefinition of `fuu' ;; will automatically activate all its advice): @@ -1444,9 +1444,9 @@ ;; give it an extra argument that controls the advised code, for example, one ;; might want to make an interactive function sensitive to a prefix argument. ;; For such cases `defadvice' allows the specification of an argument list -;; for the advised function. Similar to the redefinition of interactive +;; for the advised function. Similar to the redefinition of interactive ;; behavior, the first argument list specification found in the list of before/ -;; around/after advices will be used. Of course, the specified argument list +;; around/after advices will be used. Of course, the specified argument list ;; should be downward compatible with the original argument list, otherwise ;; functions that call the advised function with the original argument list ;; in mind will break. @@ -1457,9 +1457,9 @@ ;; fii ;; ;; Now we advise `fii' to use an optional second argument that controls the -;; amount of incrementing. A list following the (optional) position +;; amount of incrementing. A list following the (optional) position ;; argument of the advice will be interpreted as an argument list -;; specification. This means you cannot specify an empty argument list, and +;; specification. This means you cannot specify an empty argument list, and ;; why would you want to anyway? ;; ;; (defadvice fii (before fg-inc-x (x &optional incr) act) @@ -1476,22 +1476,22 @@ ;; @@ Advising interactive subrs: ;; ============================== ;; For the most part there is no difference between advising functions and -;; advising subrs. There is one situation though where one might have to write -;; slightly different advice code for subrs than for functions. This case +;; advising subrs. There is one situation though where one might have to write +;; slightly different advice code for subrs than for functions. This case ;; arises when one wants to access subr arguments in a before/around advice ;; when the arguments were determined by an interactive call to the subr. ;; Advice cannot determine what `interactive' form determines the interactive ;; behavior of the subr, hence, when it calls the original definition in an ;; interactive subr invocation it has to use `call-interactively' to generate -;; the proper interactive behavior. Thus up to that call the arguments of the -;; interactive subr will be nil. For example, the following advice for +;; the proper interactive behavior. Thus up to that call the arguments of the +;; interactive subr will be nil. For example, the following advice for ;; `kill-buffer' will not work in an interactive invocation... ;; ;; (defadvice kill-buffer (before fg-kill-buffer-hook first act preact comp) ;; (my-before-kill-buffer-hook (ad-get-arg 0))) ;; kill-buffer ;; -;; ...because the buffer argument will be nil in that case. The way out of +;; ...because the buffer argument will be nil in that case. The way out of ;; this dilemma is to provide an `interactive' specification that mirrors ;; the interactive behavior of the unadvised subr, for example, the following ;; will do the right thing even when `kill-buffer' is called interactively: @@ -1508,10 +1508,10 @@ ;; For an advised macro instead of evaluating the original definition we ;; use `macroexpand', that is, changing argument values and binding ;; environments by pieces of advice has an affect during macro expansion -;; but not necessarily during evaluation. In particular, any side effects +;; but not necessarily during evaluation. In particular, any side effects ;; of pieces of advice will occur during macro expansion. To also affect ;; the behavior during evaluation time one has to change the value of -;; `ad-return-value' in a piece of after advice. For example: +;; `ad-return-value' in a piece of after advice. For example: ;; ;; (defmacro foom (x) ;; `(list ,x)) @@ -1562,7 +1562,7 @@ ;; because it allows one to influence macro expansion as well as evaluation. ;; In general, advising macros should be a rather rare activity anyway, in ;; particular, because compile-time macro expansion takes away a lot of the -;; flexibility and effectiveness of the advice mechanism. Macros that were +;; flexibility and effectiveness of the advice mechanism. Macros that were ;; compile-time expanded before the advice was activated will of course never ;; exhibit the advised behavior. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 47b3c82456..776e84dfeb 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -26,7 +26,7 @@ ;;; Commentary: -;; The Emacs Lisp byte compiler. This crunches lisp source into a sort +;; The Emacs Lisp byte compiler. This crunches Lisp source into a sort ;; of p-code (`lapcode') which takes up less space and can be interpreted ;; faster. [`LAP' == `Lisp Assembly Program'.] ;; The user entry points are byte-compile-file and byte-recompile-directory. @@ -319,7 +319,7 @@ Elements of the list may be: lexical global/dynamic variables lacking a prefix. lexical-dynamic lexically bound variable declared dynamic elsewhere - make-local calls to make-variable-buffer-local that may be incorrect. + make-local calls to `make-variable-buffer-local' that may be incorrect. mapcar mapcar called for effect. constants let-binding of, or assignment to, constants/nonvariables. docstrings docstrings that are too wide (longer than @@ -3562,7 +3562,7 @@ for symbols generated by the byte compiler itself." "Warn if symbol VAR refers to a free variable. VAR must not be lexically bound. If optional argument ASSIGNMENT is non-nil, this is treated as an -assignment (i.e. `setq'). " +assignment (i.e. `setq')." (unless (or (not (byte-compile-warning-enabled-p 'free-vars var)) (boundp var) (memq var byte-compile-bound-variables) @@ -4335,7 +4335,7 @@ that suppresses all warnings during execution of BODY." (and (symbolp obj2) (macroexp-const-p obj1) (cons obj2 (eval obj1))))) (defun byte-compile--common-test (test-1 test-2) - "Most specific common test of `eq', `eql' and `equal'" + "Most specific common test of `eq', `eql' and `equal'." (cond ((or (eq test-1 'equal) (eq test-2 'equal)) 'equal) ((or (eq test-1 'eql) (eq test-2 'eql)) 'eql) (t 'eq))) diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el index 3abbf71687..ba29e4ec85 100644 --- a/lisp/emacs-lisp/cconv.el +++ b/lisp/emacs-lisp/cconv.el @@ -32,7 +32,7 @@ ;; Here is a brief explanation how this code works. ;; Firstly, we analyze the tree by calling cconv-analyze-form. ;; This function finds all mutated variables, all functions that are suitable -;; for lambda lifting and all variables captured by closure. It passes the tree +;; for lambda lifting and all variables captured by closure. It passes the tree ;; once, returning a list of three lists. ;; ;; Then we calculate the intersection of the first and third lists returned by diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el index bec4ad9250..83a9d3ea6a 100644 --- a/lisp/emacs-lisp/check-declare.el +++ b/lisp/emacs-lisp/check-declare.el @@ -119,7 +119,7 @@ don't know how to recognize (e.g. some macros)." (autoload 'byte-compile-arglist-signature "bytecomp") (defgroup check-declare nil - "Check declare-function statements." + "Check `declare-function' statements." :group 'tools) (defcustom check-declare-ext-errors nil @@ -230,8 +230,8 @@ fset\\|\\(?:cl-\\)?defmethod\\)\\>" type) errlist)) (defun check-declare-sort (alist) - "Sort a list with elements FILE (FNFILE ...). -Returned list has elements FNFILE (FILE ...)." + "Sort list ALIST with elements FILE (FNFILE ...). +Return list with elements FNFILE (FILE ...)." (let (file fnfile rest sort a) (dolist (e alist) (setq file (car e)) diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el index c88e15d5a8..9d8aae2844 100644 --- a/lisp/emacs-lisp/cl-indent.el +++ b/lisp/emacs-lisp/cl-indent.el @@ -162,9 +162,9 @@ is set to `defun'.") (error t))) (defun lisp-indent-find-method (symbol &optional no-compat) - "Find the lisp indentation function for SYMBOL. + "Find the Lisp indentation function for SYMBOL. If NO-COMPAT is non-nil, do not retrieve indenters intended for -the standard lisp indent package." +the standard Lisp indent package." (or (and (derived-mode-p 'emacs-lisp-mode) (get symbol 'common-lisp-indent-function-for-elisp)) (get symbol 'common-lisp-indent-function) diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index d2e4891ace..9da370a725 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -120,7 +120,7 @@ When this is `function', only ask when called non-interactively." (re-search-forward regexp bound noerror count))) (defun copyright-start-point () - "Return point-min or point-max, depending on `copyright-at-end-flag'." + "Return `point-min' or `point-max', depending on `copyright-at-end-flag'." (if copyright-at-end-flag (point-max) (point-min))) @@ -135,7 +135,7 @@ When this is `function', only ask when called non-interactively." (defun copyright-find-copyright () "Return non-nil if a copyright header suitable for updating is found. The header must match `copyright-regexp' and `copyright-names-regexp', if set. -This function sets the match-data that `copyright-update-year' uses." +This function sets the match data that `copyright-update-year' uses." (widen) (goto-char (copyright-start-point)) ;; In case the regexp is rejected. This is useful because diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index f76ae3fe69..8da9fb7682 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -390,7 +390,7 @@ Include the reason for debugger entry from ARGS." (`(set ,buffer) (format "setting %s in buffer %s to %s" symbol buffer (backtrace-print-to-string newval))) - (_ (error "unrecognized watchpoint triggered %S" (cdr args)))) + (_ (error "Unrecognized watchpoint triggered %S" (cdr args)))) ": ") (insert ?\n)) ;; Debugger entered for an error. diff --git a/lisp/emacs-lisp/disass.el b/lisp/emacs-lisp/disass.el index 712fa51170..6c019e7387 100644 --- a/lisp/emacs-lisp/disass.el +++ b/lisp/emacs-lisp/disass.el @@ -114,7 +114,7 @@ redefine OBJECT if it is a symbol." (if (eq (car-safe obj) 'byte-code) (setq obj `(lambda () ,obj))) (when (consp obj) - (unless (functionp obj) (error "not a function")) + (unless (functionp obj) (error "Not a function")) (if (assq 'byte-code obj) nil (if interactive-p (message (if name @@ -183,7 +183,7 @@ redefine OBJECT if it is a symbol." (defun disassemble-1 (obj indent) - "Prints the byte-code call OBJ in the current buffer. + "Print the byte-code call OBJ in the current buffer. OBJ should be a call to BYTE-CODE generated by the byte compiler." (let (bytes constvec) (if (consp obj) diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index d9b5ea74f6..dfbae746cc 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -32,7 +32,7 @@ ;; natural for the minor-mode end-users. ;; For each mode, easy-mmode defines the following: -;; : The minor mode predicate. A buffer-local variable. +;; : The minor mode predicate. A buffer-local variable. ;; -map : The keymap possibly associated to . ;; see `define-minor-mode' documentation ;; @@ -182,7 +182,7 @@ BODY contains code to execute each time the mode is enabled or disabled. be assigned to PLACE. If you specify a :variable, this function does not define a MODE variable (nor any of the terms used in :variable). -:after-hook A single lisp form which is evaluated after the mode hooks +:after-hook A single Lisp form which is evaluated after the mode hooks have been run. It should not be quoted. For example, you could write diff --git a/lisp/emacs-lisp/eieio-custom.el b/lisp/emacs-lisp/eieio-custom.el index d7d078b2d9..4813ce8c33 100644 --- a/lisp/emacs-lisp/eieio-custom.el +++ b/lisp/emacs-lisp/eieio-custom.el @@ -333,7 +333,7 @@ Optional argument GROUP is the sub-group of slots to display." (let ((map (make-sparse-keymap))) (set-keymap-parent map widget-keymap) map) - "Keymap for EIEIO Custom mode") + "Keymap for EIEIO Custom mode.") (define-derived-mode eieio-custom-mode fundamental-mode "EIEIO Custom" "Major mode for customizing EIEIO objects. diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index cec89cf3bc..21f262adc6 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -437,7 +437,7 @@ return any documentation.") (defvar eldoc-display-functions '(eldoc-display-in-echo-area eldoc-display-in-buffer) "Hook of functions tasked with displaying ElDoc results. -Each function is passed two arguments: DOCS and INTERACTIVE. DOCS +Each function is passed two arguments: DOCS and INTERACTIVE. DOCS is a list (DOC ...) where DOC looks like (STRING :KEY VALUE :KEY2 VALUE2 ...). STRING is a string containing the documentation's text and the remainder of DOC is an optional list of diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el index c2b026dc82..8c33b7c994 100644 --- a/lisp/emacs-lisp/elp.el +++ b/lisp/emacs-lisp/elp.el @@ -407,11 +407,11 @@ original definition, use \\[elp-restore-function] or \\[elp-restore-all]." (>= (aref vec1 0) (aref vec2 0))) (defun elp-sort-by-total-time (vec1 vec2) - "Predicate to sort by highest total time spent in function. See `sort'." + "Predicate to sort by highest total time spent in function. See `sort'." (>= (aref vec1 1) (aref vec2 1))) (defun elp-sort-by-average-time (vec1 vec2) - "Predicate to sort by highest average time spent in function. See `sort'." + "Predicate to sort by highest average time spent in function. See `sort'." (>= (aref vec1 2) (aref vec2 2))) (defsubst elp-pack-number (number width) diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el index d3ace97945..ca29b6d8c9 100644 --- a/lisp/emacs-lisp/ewoc.el +++ b/lisp/emacs-lisp/ewoc.el @@ -55,7 +55,7 @@ ;; ;; Ewoc can be considered as the `view' part of a model-view-controller. ;; -;; A `element' can be any lisp object. When you use the ewoc +;; An `element' can be any Lisp object. When you use the ewoc ;; package you specify a pretty-printer, a function that inserts ;; a printable representation of the element in the buffer. (The ;; pretty-printer should use "insert" and not @@ -67,7 +67,7 @@ ;; fixed when the ewoc is created). The header and the footer ;; are constant strings. They appear before and after the elements. ;; -;; Ewoc does not affect the mode of the buffer in any way. It +;; Ewoc does not affect the mode of the buffer in any way. It ;; merely makes it easy to connect an underlying data representation ;; to the buffer contents. ;; @@ -117,7 +117,7 @@ (unless (eq dll L) L))) (defun ewoc--node-nth (dll n) - "Return the Nth node from the doubly linked list `dll'. + "Return the Nth node from the doubly linked list DLL. N counts from zero. If N is negative, return the -(N+1)th last element. If N is out of range, return nil. Thus, (ewoc--node-nth dll 0) returns the first node, diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 7bc3e6b25f..4bbcf45356 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -765,7 +765,7 @@ See `find-function-on-key'." ;;;###autoload (defun find-function-setup-keys () - "Define some key bindings for the find-function family of functions." + "Define some key bindings for the `find-function' family of functions." (define-key ctl-x-map "F" 'find-function) (define-key ctl-x-4-map "F" 'find-function-other-window) (define-key ctl-x-5-map "F" 'find-function-other-frame) diff --git a/lisp/emacs-lisp/generator.el b/lisp/emacs-lisp/generator.el index 4ae20ba420..2acf939bed 100644 --- a/lisp/emacs-lisp/generator.el +++ b/lisp/emacs-lisp/generator.el @@ -467,7 +467,7 @@ DYNAMIC-VAR bound to STATIC-VAR." (guard (cps--special-form-p name)) (guard (not (memq name cps-standard-special-forms)))) name ; Shut up byte compiler - (error "special form %S incorrect or not supported" form)) + (error "Special form %S incorrect or not supported" form)) ;; Process regular function applications with nontrivial ;; parameters, converting them to applications of trivial @@ -633,7 +633,7 @@ modified copy." ;; If we're exiting non-locally (error, quit, ;; etc.) close the iterator. ,(cps--make-close-iterator-form terminal-state))))) - (t (error "unknown iterator operation %S" op)))))) + (t (error "Unknown iterator operation %S" op)))))) ,(when finalizer-symbol '(funcall iterator :stash-finalizer @@ -711,7 +711,7 @@ iterator cannot supply more values." (defun iter-close (iterator) "Terminate an iterator early. -Run any unwind-protect handlers in scope at the point ITERATOR +Run any `unwind-protect' handlers in scope at the point ITERATOR is blocked." (funcall iterator :close nil)) diff --git a/lisp/emacs-lisp/let-alist.el b/lisp/emacs-lisp/let-alist.el index 433b37d792..2d634b7b03 100644 --- a/lisp/emacs-lisp/let-alist.el +++ b/lisp/emacs-lisp/let-alist.el @@ -57,7 +57,7 @@ ;; .site.contents)) ;; ;; If you nest `let-alist' invocations, the inner one can't access -;; the variables of the outer one. You can, however, access alists +;; the variables of the outer one. You can, however, access alists ;; inside the original alist by using dots inside the symbol, as ;; displayed in the example above by the `.site.contents'. ;; @@ -137,7 +137,7 @@ essentially expands to .site.contents)) If you nest `let-alist' invocations, the inner one can't access -the variables of the outer one. You can, however, access alists +the variables of the outer one. You can, however, access alists inside the original alist by using dots inside the symbol, as displayed in the example above." (declare (indent 1) (debug t)) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 9bbc7f8bba..42e943a60d 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -824,7 +824,7 @@ function is `common-lisp-indent-function'." "Return Parse-Partial-Sexp State at POS, defaulting to point. Like `syntax-ppss' but includes the character address of the last complete sexp in the innermost containing list at position -2 (counting from 0). This is important for lisp indentation." +2 (counting from 0). This is important for Lisp indentation." (unless pos (setq pos (point))) (let ((pss (syntax-ppss pos))) (if (nth 9 pss) diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 61c1ea490f..1e4fdd126c 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -243,19 +243,19 @@ is executed without being compiled first." (while arglist (cond ((eq (car arglist) '&optional) ;; ok, I'll let this slide because funcall_lambda() does... - ;; (if optionalp (error "multiple &optional keywords in %s" name)) + ;; (if optionalp (error "Multiple &optional keywords in %s" name)) (if restp (error "&optional found after &rest in %s" name)) (if (null (cdr arglist)) - (error "nothing after &optional in %s" name)) + (error "Nothing after &optional in %s" name)) (setq optionalp t)) ((eq (car arglist) '&rest) ;; ...but it is by no stretch of the imagination a reasonable ;; thing that funcall_lambda() allows (&rest x y) and ;; (&rest x &optional y) in arglists. (if (null (cdr arglist)) - (error "nothing after &rest in %s" name)) + (error "Nothing after &rest in %s" name)) (if (cdr (cdr arglist)) - (error "multiple vars after &rest in %s" name)) + (error "Multiple vars after &rest in %s" name)) (setq restp t)) (restp (setq bindings (cons (list (car arglist) diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index 41a9c7242b..a2a5aaed04 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el @@ -245,7 +245,7 @@ WHERE is a symbol to select an entry in `advice--where-alist'." (list (advice--remove-function rest function))))))) (defvar advice--buffer-local-function-sample nil - "keeps an example of the special \"run the default value\" functions. + "Keeps an example of the special \"run the default value\" functions. These functions play the same role as t in buffer-local hooks, and to recognize them, we keep a sample here against which to compare. Each instance is different, but `function-equal' will hopefully ignore those differences.") diff --git a/lisp/emacs-lisp/package-x.el b/lisp/emacs-lisp/package-x.el index 2e327d16de..0175857b7f 100644 --- a/lisp/emacs-lisp/package-x.el +++ b/lisp/emacs-lisp/package-x.el @@ -34,7 +34,7 @@ ;; (possibly one on a remote machine, accessed via Tramp). ;; Then call M-x package-upload-file, which prompts for a file to -;; upload. Alternatively, M-x package-upload-buffer uploads the +;; upload. Alternatively, M-x package-upload-buffer uploads the ;; current buffer, if it's visiting a package file. ;; Once a package is uploaded, users can access it via the Package diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 63b187be02..c6173c710f 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -86,7 +86,7 @@ (funcall pf (and me (symbolp me) (edebug-get-spec me)))))) (defun pcase--get-macroexpander (s) - "Return the macroexpander for pcase pattern head S, or nil" + "Return the macroexpander for pcase pattern head S, or nil." (get s 'pcase-macroexpander)) ;;;###autoload diff --git a/lisp/emacs-lisp/shadow.el b/lisp/emacs-lisp/shadow.el index 02f2ad3d81..e2a24e9949 100644 --- a/lisp/emacs-lisp/shadow.el +++ b/lisp/emacs-lisp/shadow.el @@ -31,13 +31,13 @@ ;; a file with the same name in a later load-path directory. When ;; this is unintentional, it may result in problems that could have ;; been easily avoided. This occurs often (to me) when installing a -;; new version of emacs and something in the site-lisp directory -;; has been updated and added to the emacs distribution. The old -;; version, now outdated, shadows the new one. This is obviously +;; new version of Emacs and something in the site-lisp directory +;; has been updated and added to the Emacs distribution. The old +;; version, now outdated, shadows the new one. This is obviously ;; undesirable. ;; ;; The `list-load-path-shadows' function was run when you installed -;; this version of emacs. To run it by hand in emacs: +;; this version of Emacs. To run it by hand in emacs: ;; ;; M-x list-load-path-shadows ;; @@ -181,7 +181,7 @@ See the documentation for `list-load-path-shadows' for further information." "Keywords to highlight in `load-path-shadows-mode'.") (define-derived-mode load-path-shadows-mode fundamental-mode "LP-Shadows" - "Major mode for load-path shadows buffer." + "Major mode for `load-path' shadows buffer." (setq-local font-lock-defaults '((load-path-shadows-font-lock-keywords))) (setq buffer-undo-list t diff --git a/lisp/emacs-lisp/testcover.el b/lisp/emacs-lisp/testcover.el index e75f15140a..f5a624bb61 100644 --- a/lisp/emacs-lisp/testcover.el +++ b/lisp/emacs-lisp/testcover.el @@ -20,7 +20,6 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . - ;;; Commentary: ;; * Use `testcover-start' to instrument a Lisp file for coverage testing. @@ -62,6 +61,8 @@ ;; error if these "potentially" 1-valued forms actually return differing ;; values. +;;; Code: + (eval-when-compile (require 'cl-lib)) (require 'edebug) (provide 'testcover) @@ -80,8 +81,9 @@ (defcustom testcover-constants '(nil t emacs-build-time emacs-version emacs-major-version emacs-minor-version) - "Variables whose values never change. No brown splotch is shown for -these. This list is quite incomplete!" + "Variables whose values never change. +No brown splotch is shown for these. This list is quite +incomplete!" :group 'testcover :type '(repeat variable)) @@ -103,8 +105,8 @@ incomplete! Notes: Nobody ever changes the current global map." (defcustom testcover-noreturn-functions '(error noreturn throw signal) - "Subset of `testcover-1value-functions' -- these never return. We mark -them as having returned nil just before calling them." + "Subset of `testcover-1value-functions' -- these never return. +We mark them as having returned nil just before calling them." :group 'testcover :type '(repeat symbol)) @@ -126,25 +128,26 @@ side-effect-free functions should be here." set set-default set-marker-insertion-type setq setq-default with-current-buffer with-output-to-temp-buffer with-syntax-table with-temp-buffer with-temp-file with-temp-message with-timeout) - "Functions whose return value is the same as their last argument. No -brown splotch is shown for these if the last argument is a constant or a -call to one of the `testcover-1value-functions'. This list is probably -incomplete!" + "Functions whose return value is the same as their last argument. +No brown splotch is shown for these if the last argument is a +constant or a call to one of the `testcover-1value-functions'. +This list is probably incomplete!" :group 'testcover :type '(repeat symbol)) (defcustom testcover-prog1-functions '(prog1 unwind-protect) - "Functions whose return value is the same as their first argument. No -brown splotch is shown for these if the first argument is a constant or a -call to one of the `testcover-1value-functions'." + "Functions whose return value is the same as their first argument. +No brown splotch is shown for these if the first argument is a +constant or a call to one of the `testcover-1value-functions'." :group 'testcover :type '(repeat symbol)) (defcustom testcover-potentially-1value-functions '(add-hook and beep or remove-hook unless when) - "Functions that are potentially 1-valued. No brown splotch if actually -1-valued, no error if actually multi-valued." + "Functions that are potentially 1-valued. +No brown splotch if actually 1-valued, no error if actually +multi-valued." :group 'testcover :type '(repeat symbol)) @@ -164,8 +167,7 @@ call to one of the `testcover-1value-functions'." ;;;========================================================================= (defvar testcover-module-constants nil - "Symbols declared with defconst in the last file processed by -`testcover-start'.") + "Symbols declared with defconst in the last file processed by `testcover-start'.") (defvar testcover-module-1value-functions nil "Symbols declared with defun in the last file processed by @@ -388,7 +390,7 @@ coverage tests. This function creates many overlays." (error nil))) ;Ignore "No such buffer" errors (defun testcover-next-mark () - "Moves point to next line in current buffer that has a splotch." + "Move point to next line in current buffer that has a splotch." (interactive) (goto-char (next-overlay-change (point))) (end-of-line)) diff --git a/lisp/emacs-lisp/thunk.el b/lisp/emacs-lisp/thunk.el index 7e349d22a4..6f2e42af50 100644 --- a/lisp/emacs-lisp/thunk.el +++ b/lisp/emacs-lisp/thunk.el @@ -30,7 +30,7 @@ ;; forms. ;; ;; Use `thunk-delay' to delay the evaluation of a form (requires -;; lexical-binding), and `thunk-force' to evaluate it. The result of +;; lexical-binding), and `thunk-force' to evaluate it. The result of ;; the evaluation is cached, and only happens once. ;; ;; Here is an example of a form which evaluation is delayed: diff --git a/lisp/eshell/em-basic.el b/lisp/eshell/em-basic.el index 64fc7e7f03..af5550b11d 100644 --- a/lisp/eshell/em-basic.el +++ b/lisp/eshell/em-basic.el @@ -164,7 +164,7 @@ or `eshell-printn' for display." (set-default-file-modes (- 511 (car (read-from-string (concat "?\\" (number-to-string (car args))))))) - (error "setting umask symbolically is not yet implemented")) + (error "Setting umask symbolically is not yet implemented")) (eshell-print "Warning: umask changed for all new files created by Emacs.\n")) nil)) diff --git a/lisp/eshell/em-glob.el b/lisp/eshell/em-glob.el index e36f2d0c7f..ba12e43a3c 100644 --- a/lisp/eshell/em-glob.el +++ b/lisp/eshell/em-glob.el @@ -91,7 +91,7 @@ This option slows down recursive glob processing by quite a bit." (defcustom eshell-error-if-no-glob nil "If non-nil, it is an error for a glob pattern not to match. - This mimics the behavior of zsh if non-nil, but bash if nil." +This mimics the behavior of zsh if non-nil, but bash if nil." :type 'boolean :group 'eshell-glob) @@ -266,7 +266,7 @@ the form: ;; FIXME does this really need to abuse eshell-glob-matches, message-shown? (defun eshell-glob-entries (path globs &optional recurse-p) - "Glob the entries in PATHS, possibly recursing if RECURSE-P is non-nil." + "Glob the entries in PATH, possibly recursing if RECURSE-P is non-nil." (let* ((entries (ignore-errors (file-name-all-completions "" path))) (case-fold-search eshell-glob-case-insensitive) diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index d82946add0..aa158fa24c 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el @@ -402,7 +402,7 @@ variable `eshell-input-filter' returns non-nil when called on the command. This function is supposed to be called from the minibuffer, presumably -as a minibuffer-exit-hook." +as a `minibuffer-exit-hook'." (eshell-add-input-to-history (buffer-substring (minibuffer-prompt-end) (point-max)))) diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el index 3d7c43b404..57146bb126 100644 --- a/lisp/eshell/em-ls.el +++ b/lisp/eshell/em-ls.el @@ -35,10 +35,10 @@ ;;;###autoload (progn (defgroup eshell-ls nil - "This module implements the \"ls\" utility fully in Lisp. If it is -passed any unrecognized command switches, it will revert to the -operating system's version. This version of \"ls\" uses text -properties to colorize its output based on the setting of + "This module implements the \"ls\" utility fully in Lisp. +If it is passed any unrecognized command switches, it will revert +to the operating system's version. This version of \"ls\" uses +text properties to colorize its output based on the setting of `eshell-ls-use-colors'." :tag "Implementation of `ls' in Lisp" :group 'eshell-module)) @@ -476,9 +476,9 @@ name should be displayed as, etc. Think of it as cooking a FILEINFO." fileinfo) (defun eshell-ls-file (fileinfo &optional size-width copy-fileinfo) - "Output FILE in long format. -FILE may be a string, or a cons cell whose car is the filename and -whose cdr is the list of file attributes." + "Output FILEINFO in long format. +FILEINFO may be a string, or a cons cell whose car is the +filename and whose cdr is the list of file attributes." (if (not (cdr fileinfo)) (funcall error-func (format "%s: No such file or directory\n" (car fileinfo))) diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el index def52f42e5..639098a9b9 100644 --- a/lisp/eshell/em-pred.el +++ b/lisp/eshell/em-pred.el @@ -258,7 +258,7 @@ EXAMPLES: (eshell-pred-mode)) (defun eshell-apply-modifiers (lst predicates modifiers) - "Apply to LIST a series of PREDICATES and MODIFIERS." + "Apply to list LST a series of PREDICATES and MODIFIERS." (let (stringified) (if (stringp lst) (setq lst (list lst) diff --git a/lisp/eshell/em-rebind.el b/lisp/eshell/em-rebind.el index fa61fffaec..d70444ea10 100644 --- a/lisp/eshell/em-rebind.el +++ b/lisp/eshell/em-rebind.el @@ -168,7 +168,7 @@ This is default behavior of shells like bash." (defun eshell-lock-local-map (&optional arg) "Lock or unlock the current local keymap. -Within a prefix arg, set the local keymap to its normal value, and +With prefix ARG, set the local keymap to its normal value, and lock it at that." (interactive "P") (if (or arg (not eshell-lock-keymap)) diff --git a/lisp/eshell/em-smart.el b/lisp/eshell/em-smart.el index d1c83db188..dffc8f804b 100644 --- a/lisp/eshell/em-smart.el +++ b/lisp/eshell/em-smart.el @@ -131,7 +131,7 @@ only if that output can be presented in its entirely in the Eshell window." :group 'eshell-smart) (defcustom eshell-smart-space-goes-to-end t - "If non-nil, space will go to end of buffer when point-max is visible. + "If non-nil, space will go to end of buffer when `point-max' is visible. That is, if a command is running and the user presses SPACE at a time when the end of the buffer is visible, point will go to the end of the buffer and smart-display will be turned off (that is, subsequently @@ -195,7 +195,7 @@ The options are `begin', `after' or `end'." ;; This is called by window-scroll-functions with two arguments. (defun eshell-smart-scroll-window (wind _start) - "Scroll the given Eshell window accordingly." + "Scroll the given Eshell window WIND accordingly." (unless eshell-currently-handling-window (let ((inhibit-point-motion-hooks t) (eshell-currently-handling-window t)) diff --git a/lisp/eshell/esh-arg.el b/lisp/eshell/esh-arg.el index 3cf80e4518..1990c0cfa5 100644 --- a/lisp/eshell/esh-arg.el +++ b/lisp/eshell/esh-arg.el @@ -203,7 +203,7 @@ treated as a literal character." (setq eshell-current-modifiers nil)) (defun eshell-finish-arg (&optional argument) - "Finish the current argument being processed." + "Finish the current ARGUMENT being processed." (if argument (setq eshell-current-argument argument)) (throw 'eshell-arg-done t)) diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index 90a8f85665..1aac95e0b4 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -1236,10 +1236,10 @@ or an external command." (eshell-external-command command args)))) (defun eshell-exec-lisp (printer errprint func-or-form args form-p) - "Execute a lisp FUNC-OR-FORM, maybe passing ARGS. + "Execute a Lisp FUNC-OR-FORM, maybe passing ARGS. PRINTER and ERRPRINT are functions to use for printing regular messages, and errors. FORM-P should be non-nil if FUNC-OR-FORM -represent a lisp form; ARGS will be ignored in that case." +represent a Lisp form; ARGS will be ignored in that case." (eshell-condition-case err (let ((result (save-current-buffer diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el index 9930e0884c..fa149dd46e 100644 --- a/lisp/eshell/esh-ext.el +++ b/lisp/eshell/esh-ext.el @@ -110,7 +110,7 @@ wholly ignored." (autoload 'eshell-parse-command "esh-cmd") (defsubst eshell-invoke-batch-file (&rest args) - "Invoke a .BAT or .CMD file on DOS/Windows systems." + "Invoke a .BAT or .CMD file on MS-DOS/MS-Windows systems." ;; since CMD.EXE can't handle forward slashes in the initial ;; argument... (setcar args (subst-char-in-string ?/ ?\\ (car args))) diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el index 0e98aa0049..0e6121031d 100644 --- a/lisp/eshell/esh-io.el +++ b/lisp/eshell/esh-io.el @@ -34,7 +34,7 @@ ;;;_* Redirect to a Buffer or Process ;; ;; Buffers and processes can be named with '#' and -;; '#', respectively. As a shorthand, +;; '#', respectively. As a shorthand, ;; '#' without the explicit "buffer" arg is equivalent to ;; '#'. ;; diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index f9dbce9770..a9775b7c56 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -499,7 +499,7 @@ and the hook `eshell-exit-hook'." (yank))) (defun eshell-bol () - "Goes to the beginning of line, then skips past the prompt, if any." + "Go to the beginning of line, then skip past the prompt, if any." (interactive) (beginning-of-line) (and eshell-skip-prompt-function diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el index 101ac86034..35153675fa 100644 --- a/lisp/eshell/eshell.el +++ b/lisp/eshell/eshell.el @@ -33,15 +33,15 @@ ;; @ A high degree of configurability ;; ;; @ The ability to have the same shell on every system Emacs has been -;; ported to. Since Eshell imposes no external requirements, and +;; ported to. Since Eshell imposes no external requirements, and ;; relies upon only the Lisp functions exposed by Emacs, it is quite -;; operating system independent. Several of the common UNIX +;; operating system independent. Several of the common UNIX ;; commands, such as ls, mv, rm, ln, etc., have been implemented in ;; Lisp in order to provide a more consistent work environment. ;; ;; For those who might be using an older version of Eshell, version -;; 2.1 represents an entirely new, module-based architecture. It -;; supports most of the features offered by modern shells. Here is a +;; 2.1 represents an entirely new, module-based architecture. It +;; supports most of the features offered by modern shells. Here is a ;; brief list of some of its more visible features: ;; ;; @ Command argument completion (tcsh, zsh) @@ -136,7 +136,7 @@ ;; errors, such as 'dri' for `dir'. Since executing non-existent ;; programs is rarely the intention of the user, eshell could prompt ;; for the replacement string, and then record that in a database of -;; known misspellings. (Note: The typo at the beginning of this +;; known misspellings. (Note: The typo at the beginning of this ;; paragraph wasn't discovered until two months after I wrote the ;; text; it was not intentional). ;; diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index ef89e6e9fc..863b6aa44e 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -33,7 +33,7 @@ (require 'gnus-util) (defcustom gnus-post-method 'current - "Preferred method for posting USENET news. + "Preferred method for posting Usenet news. If this variable is `current' (which is the default), Gnus will use the \"current\" select method when posting. If it is `native', Gnus diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index bff1b2a60d..4a754b9856 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -3841,7 +3841,7 @@ text was killed." "Caesar rotate all letters in the current buffer by 13 places. Used to encode/decode possibly offensive messages (commonly in rec.humor). With prefix arg, specifies the number of places to rotate each letter forward. -Mail and USENET news headers are not rotated unless WIDE is non-nil." +Mail and Usenet news headers are not rotated unless WIDE is non-nil." (interactive (if current-prefix-arg (list (prefix-numeric-value current-prefix-arg)) (list nil)) diff --git a/lisp/info-xref.el b/lisp/info-xref.el index e2e3e30ca2..f791927ee1 100644 --- a/lisp/info-xref.el +++ b/lisp/info-xref.el @@ -242,18 +242,18 @@ buffer's line and column of point." node t t)) (if (not (string-match "\\`([^)]*)" node)) - (info-xref-output-error "no `(file)' part at start of node: %s\n" node) + (info-xref-output-error "No `(file)' part at start of node: %s\n" node) (let ((file (match-string 0 node))) (if (string-equal "()" file) - (info-xref-output-error "empty filename part: %s" node) + (info-xref-output-error "Empty filename part: %s" node) ;; see if the file exists, if haven't looked before (unless (assoc file info-xref-xfile-alist) (let ((found (info-xref-goto-node-p file))) (push (cons file found) info-xref-xfile-alist) (unless found - (info-xref-output-error "not available to check: %s\n (this reported once per file)" file)))) + (info-xref-output-error "Not available to check: %s\n (this reported once per file)" file)))) ;; if the file exists, try the node (cond ((not (cdr (assoc file info-xref-xfile-alist))) @@ -262,7 +262,7 @@ buffer's line and column of point." (cl-incf info-xref-good)) (t (cl-incf info-xref-bad) - (info-xref-output-error "no such node: %s" node))))))) + (info-xref-output-error "No such node: %s" node))))))) ;;----------------------------------------------------------------------------- diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index 5a6f3b555d..9353b4d375 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -25,9 +25,9 @@ ;; dictionary allows you to interact with dictionary servers. ;; Use M-x customize-group dictionary to modify user settings. ;; -;; Main functions for interaction are: -;; dictionary - opens a new dictionary buffer -;; dictionary-search - search for the definition of a word +;; Main commands for interaction are: +;; M-x dictionary - opens a new dictionary buffer +;; M-x dictionary-search - search for the definition of a word ;; ;; You can find more information in the README file of the GitHub ;; repository https://github.com/myrkr/dictionary-el @@ -58,11 +58,11 @@ the existing connection." (set-default name value)) (defgroup dictionary nil - "Client for accessing the dictd server based dictionaries" + "Client for accessing the dictd server based dictionaries." :group 'hypermedia) (defgroup dictionary-proxy nil - "Proxy configuration options for the dictionary client" + "Proxy configuration options for the dictionary client." :group 'dictionary) (defcustom dictionary-server @@ -943,7 +943,6 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"." (defun dictionary-set-dictionary (param &optional more) "Select the dictionary which is the car of PARAM as new default." - (if more (dictionary-display-more-info param) (let ((dictionary (car param))) @@ -1051,7 +1050,6 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"." (defun dictionary-do-matching (word dictionary strategy function) "Find matches for WORD with STRATEGY in DICTIONARY and display them with FUNCTION." - (message "Lookup matching words for %s in %s using %s" word dictionary strategy) (dictionary-send-command diff --git a/lisp/org/ol.el b/lisp/org/ol.el index 38e2dd6a02..4b7f2081a8 100644 --- a/lisp/org/ol.el +++ b/lisp/org/ol.el @@ -444,7 +444,7 @@ negates this setting for the duration of the command." :safe (lambda (val) (or (booleanp val) (integerp val)))) (defcustom org-link-email-description-format "Email %c: %s" - "Format of the description part of a link to an email or usenet message. + "Format of the description part of a link to an email or Usenet message. The following %-escapes will be replaced by corresponding information: %F full \"From\" field diff --git a/lisp/so-long.el b/lisp/so-long.el index 7bf15e85da..c39c3ecaf3 100644 --- a/lisp/so-long.el +++ b/lisp/so-long.el @@ -1532,7 +1532,7 @@ This is the `so-long-revert-function' for `so-long-mode'." (interactive) (let ((so-long-original-mode (so-long-original 'major-mode))) (unless so-long-original-mode - (error "Original mode unknown.")) + (error "Original mode unknown")) (funcall so-long-original-mode) ;; Emacs 26+ has already called `hack-local-variables' (during ;; `run-mode-hooks'; provided there was a `buffer-file-name'), but for older diff --git a/lisp/svg.el b/lisp/svg.el index 05accf4f13..3c7f055031 100644 --- a/lisp/svg.el +++ b/lisp/svg.el @@ -188,7 +188,7 @@ otherwise. IMAGE-TYPE should be a MIME image type, like "Insert image placed at RELATIVE-FILENAME into the SVG structure. RELATIVE-FILENAME will be searched in `file-name-directory' of the image's `:base-uri' property. If `:base-uri' is not specified for the -image, then embedding won't work. Embedding large images using this +image, then embedding won't work. Embedding large images using this function is much faster than `svg-embed'." (svg--append svg diff --git a/lisp/vc/compare-w.el b/lisp/vc/compare-w.el index 4c1d9eaad5..7c2e125831 100644 --- a/lisp/vc/compare-w.el +++ b/lisp/vc/compare-w.el @@ -113,7 +113,7 @@ and the value `((4) (4))' for horizontally split windows." :version "22.1") (defcustom compare-windows-highlight t - "Non-nil means compare-windows highlights the differences. + "Non-nil means `compare-windows' highlights the differences. The value t removes highlighting immediately after invoking a command other than `compare-windows'. The value `persistent' leaves all highlighted differences. You can clear diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index eeb32f8fe5..0852f8790e 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -1479,7 +1479,7 @@ Supports unified and context diffs as well as (to a lesser extent) normal diffs. When the buffer is read-only, the ESC prefix is not necessary. -If you edit the buffer manually, diff-mode will try to update the hunk +If you edit the buffer manually, `diff-mode' will try to update the hunk headers for you on-the-fly. You can also switch between context diff and unified diff with \\[diff-context->unified], diff --git a/lisp/vc/ediff-diff.el b/lisp/vc/ediff-diff.el index 0965e888f0..0f90bef2c5 100644 --- a/lisp/vc/ediff-diff.el +++ b/lisp/vc/ediff-diff.el @@ -24,7 +24,6 @@ ;;; Code: - (require 'ediff-init) (require 'ediff-util) @@ -78,14 +77,14 @@ are `-I REGEXP', to ignore changes whose lines match the REGEXP." "Options to pass to `ediff-diff-program'. If Unix diff is used as `ediff-diff-program', then a useful option is `-w', to ignore space. -Options `-c', `-u', and `-i' are not allowed. Case sensitivity can be +Options `-c', `-u', and `-i' are not allowed. Case sensitivity can be toggled interactively using \\[ediff-toggle-ignore-case]. -Do not remove the default options. If you need to change this variable, add new +Do not remove the default options. If you need to change this variable, add new options after the default ones. This variable is not for customizing the look of the differences produced by -the command \\[ediff-show-diff-output]. Use the variable +the command \\[ediff-show-diff-output]. Use the variable `ediff-custom-diff-options' for that." :set #'ediff-set-diff-options :type 'string) diff --git a/lisp/vc/ediff-help.el b/lisp/vc/ediff-help.el index a5bb953b6d..2f8f596ed1 100644 --- a/lisp/vc/ediff-help.el +++ b/lisp/vc/ediff-help.el @@ -24,7 +24,6 @@ ;;; Code: - ;; Compiler pacifier start (defvar ediff-multiframe) ;; end pacifier diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el index 96fa0633e8..5afc83d9e2 100644 --- a/lisp/vc/ediff-init.el +++ b/lisp/vc/ediff-init.el @@ -248,7 +248,7 @@ It needs to be killed when we quit the session.") ;; Doesn't save the point and mark. ;; This is `with-current-buffer' with the added test for live buffers." (defmacro ediff-with-current-buffer (buffer &rest body) - "Evaluates BODY in BUFFER." + "Evaluate BODY in BUFFER." (declare (indent 1) (debug (form body))) `(if (ediff-buffer-live-p ,buffer) (save-current-buffer @@ -615,7 +615,7 @@ highlighted using ASCII flags." Actually, Ediff restores the scope of visibility that existed at startup.") (defcustom ediff-keep-variants t - "nil means prompt to remove unmodified buffers A/B/C at session end. + "Nil means prompt to remove unmodified buffers A/B/C at session end. Supplying a prefix argument to the quit command `q' temporarily reverses the meaning of this variable." :type 'boolean @@ -680,10 +680,10 @@ shown in brighter colors." (ediff-defvar-local ediff-custom-diff-buffer nil "") ;; Buffer used for diff-style fine differences between regions. (ediff-defvar-local ediff-fine-diff-buffer nil "") -;; Temporary buffer used for computing fine differences. -(defconst ediff-tmp-buffer " *ediff-tmp*" "") -;; Buffer used for messages -(defconst ediff-msg-buffer " *ediff-message*" "") +(defconst ediff-tmp-buffer " *ediff-tmp*" + "Temporary buffer used for computing fine differences.") +(defconst ediff-msg-buffer " *ediff-message*" + "Buffer used for messages.") ;; Buffer containing the output of diff when diff returns errors. (ediff-defvar-local ediff-error-buffer nil "") ;; Buffer to display debug info @@ -835,7 +835,7 @@ this variable represents.") ;; this variable is set to nil, then again to the appropriate face. (defvar ediff-current-diff-face-B 'ediff-current-diff-B "Face for highlighting the selected difference in buffer B. - this variable. Instead, use the customization +DO NOT CHANGE this variable. Instead, use the customization widget to customize the actual face `ediff-current-diff-B' this variable represents.") diff --git a/lisp/vc/ediff-merg.el b/lisp/vc/ediff-merg.el index ad4ef473f8..2bdce9e33c 100644 --- a/lisp/vc/ediff-merg.el +++ b/lisp/vc/ediff-merg.el @@ -53,7 +53,7 @@ Valid values are the symbols `default-A', `default-B', and `combined'." "Pattern to be used for combining difference regions in buffers A and B. The value must be a list of the form \(STRING1 bufspec1 STRING2 bufspec2 STRING3 bufspec3 STRING4) -where bufspec is the symbol A, B, or Ancestor. For instance, if the value is +where bufspec is the symbol A, B, or Ancestor. For instance, if the value is '(STRING1 A STRING2 Ancestor STRING3 B STRING4) then the combined text will look like this: @@ -63,8 +63,7 @@ STRING2 diff region from the ancestor STRING3 diff region from variant B -STRING4 -" +STRING4" :type '(choice (list string symbol string symbol string) (list string symbol string symbol string symbol string)) :group 'ediff-merge) diff --git a/lisp/vc/ediff-mult.el b/lisp/vc/ediff-mult.el index 8e88b60a0b..20ff8f9f04 100644 --- a/lisp/vc/ediff-mult.el +++ b/lisp/vc/ediff-mult.el @@ -47,7 +47,7 @@ ;; explanation of the two nil placeholders in such elements. ;; ;; There is API for extracting the components of the members of the -;; above list. Search for `API for ediff-meta-list' for details. +;; above list. Search for `API for ediff-meta-list' for details. ;; ;; HEADER must be a list of SIX elements (nil or string): ;; (regexp metaobj1 metaobj2 metaobj3 merge-save-buffer @@ -157,8 +157,7 @@ Useful commands (type ? to hide them and free up screen): (define-key map [delete] #'previous-line) (define-key map [backspace] #'previous-line) map) - "The keymap to be installed in the buffer showing differences between -directories.") + "Keymap for buffer showing differences between directories.") ;; Variable specifying the action to take when the use invokes ediff in the ;; meta buffer. This is usually ediff-registry-action or ediff-filegroup-action diff --git a/lisp/vc/ediff.el b/lisp/vc/ediff.el index 3536cbf738..e884ed8c51 100644 --- a/lisp/vc/ediff.el +++ b/lisp/vc/ediff.el @@ -6,7 +6,7 @@ ;; Created: February 2, 1994 ;; Keywords: comparing, merging, patching, vc, tools, unix ;; Version: 2.81.6 -(defconst ediff-version "2.81.6" "The current version of Ediff") +(defconst ediff-version "2.81.6" "The current version of Ediff.") ;; Yoni Rabkin contacted the maintainer of this ;; file on 20/3/2008, and the maintainer agreed that when a bug is diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index 46e9c97eb0..e0a87ba941 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -98,7 +98,7 @@ (defcustom log-edit-confirm 'changed "If non-nil, `log-edit-done' will request confirmation. If `changed', only request confirmation if the list of files has - changed since the beginning of the log-edit session." + changed since the beginning of the `log-edit' session." :group 'log-edit :type '(choice (const changed) (const t) (const nil))) @@ -497,7 +497,7 @@ When done editing the log entry, type \\[log-edit-done], which will trigger the actual commit of the file(s). Several other handy support commands are provided, and the package from which this is used might also provide additional commands (under -the \"C-x v\" prefix for VC commands, for example). +the \\[vc-prefix-map] prefix for VC commands, for example). \\{log-edit-mode-map}" (setq-local font-lock-defaults '(log-edit-font-lock-keywords t)) diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el index e8930979b5..bc66191f33 100644 --- a/lisp/vc/log-view.el +++ b/lisp/vc/log-view.el @@ -156,7 +156,7 @@ :group 'log-view) (easy-menu-define log-view-mode-menu log-view-mode-map - "Log-View Display Menu" + "Log-View Display Menu." '("Log-View" ;; XXX Do we need menu entries for these? ;; ["Quit" quit-window] diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el index 42f531e4f7..23f0902b38 100644 --- a/lisp/vc/pcvs.el +++ b/lisp/vc/pcvs.el @@ -247,7 +247,7 @@ If -CVS-MODE!-FUN is provided, it is executed *cvs* being the current buffer (let* ((-cvs-mode!-buf (current-buffer)) (cvsbuf (cond ((cvs-buffer-p) (current-buffer)) ((and cvs-buffer (cvs-buffer-p cvs-buffer)) cvs-buffer) - (t (error "can't find the *cvs* buffer")))) + (t (error "Can't find the *cvs* buffer")))) (-cvs-mode!-wrapper cvs-minor-wrap-function) (-cvs-mode!-cont (lambda () (save-current-buffer diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el index 07b2800c2d..82531f742e 100644 --- a/lisp/vc/vc-annotate.el +++ b/lisp/vc/vc-annotate.el @@ -277,7 +277,7 @@ cover the range from the oldest annotation to the newest." ;; Menu -- Using easymenu.el (easy-menu-define vc-annotate-mode-menu vc-annotate-mode-map - "VC Annotate Display Menu" + "VC Annotate Display Menu." `("VC-Annotate" ["By Color Map Range" (unless (null vc-annotate-display-mode) (setq vc-annotate-display-mode nil) diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index 5144b5d0bb..bfe3293e45 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -634,7 +634,7 @@ Returns nil if unable to find this information." (error "Don't know how to compute the next revision of %s" rev))) (defun vc-bzr-register (files &optional _comment) - "Register FILES under bzr. COMMENT is ignored." + "Register FILES under bzr. COMMENT is ignored." (vc-bzr-command "add" nil 0 files)) ;; Could run `bzr status' in the directory and see if it succeeds, but diff --git a/lisp/vc/vc-dav.el b/lisp/vc/vc-dav.el index 5fd8d8e503..1785440d53 100644 --- a/lisp/vc/vc-dav.el +++ b/lisp/vc/vc-dav.el @@ -136,7 +136,7 @@ It should return a status of either 0 (no differences found), or ;; This should use url-dav-get-properties with a depth of `1' to get ;; all the properties. (defun vc-dav-dir-state (_url) - "find the version control state of all files in DIR in a fast way." + "Find the version control state of all files in DIR in a fast way." ) (defun vc-dav-responsible-p (_url) diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index eb8cf8192c..26cea0001c 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -1113,33 +1113,33 @@ If it is a file, return the corresponding cons for the file itself." (define-derived-mode vc-dir-mode special-mode "VC dir" "Major mode for VC directory buffers. -Marking/Unmarking key bindings and actions: -m - mark a file/directory +Marking/Unmarking key bindings and actions: \\ +\\[vc-dir-mark] - mark a file/directory - if the region is active, mark all the files in region. Restrictions: - a file cannot be marked if any parent directory is marked - a directory cannot be marked if any child file or directory is marked -u - unmark a file/directory +\\[vc-dir-unmark] - unmark a file/directory - if the region is active, unmark all the files in region. -M - if the cursor is on a file: mark all the files with the same state as +\\[vc-dir-mark-all-files] - if the cursor is on a file: mark all the files with the same state as the current file - if the cursor is on a directory: mark all child files - with a prefix argument: mark all files -U - if the cursor is on a file: unmark all the files with the same state +\\[vc-dir-unmark-all-files] - if the cursor is on a file: unmark all the files with the same state as the current file - if the cursor is on a directory: unmark all child files - with a prefix argument: unmark all files VC commands -VC commands in the `C-x v' prefix can be used. +VC commands in the \\[vc-prefix-map] prefix can be used. VC commands act on the marked entries. If nothing is marked, VC commands act on the current entry. Search & Replace -S - searches the marked files -Q - does a query replace on the marked files -M-s a C-s - does an isearch on the marked files -M-s a C-M-s - does a regexp isearch on the marked files +\\[vc-dir-search] - searches the marked files +\\[vc-dir-query-replace-regexp] - does a query replace on the marked files +\\[vc-dir-isearch] - does an isearch on the marked files +\\[vc-dir-isearch-regexp] - does a regexp isearch on the marked files If nothing is marked, these commands act on the current entry. When a directory is current or marked, the Search & Replace commands act on the child files of that directory that are displayed in diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index c29458620e..cd23bcce94 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -104,12 +104,13 @@ ;; will be called with the buffer file name as argument whenever the ;; dispatcher resyncs the buffer. -;; To do: -;; +;;; Code: + +;; TODO: ;; - log buffers need font-locking. -;; ;; General customization + (defcustom vc-logentry-check-hook nil "Normal hook run by `vc-finish-logentry'. Use this to impose your own rules on the entry in addition to any the @@ -662,7 +663,7 @@ contents of the log entry buffer. If COMMENT is a string and INITIAL-CONTENTS is nil, do action immediately as if the user had entered COMMENT. If COMMENT is t, also do action immediately with an empty comment. Remember the file's buffer in `vc-parent-buffer' -\(current one if no file). Puts the log-entry buffer in major-mode +\(current one if no file). Puts the log-entry buffer in major mode MODE, defaulting to `log-edit-mode' if MODE is nil. AFTER-HOOK specifies the local value for `vc-log-after-operation-hook'. BACKEND, if non-nil, specifies a VC backend for the Log Edit buffer." diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 4b309c338a..ec572e96a5 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -408,7 +408,7 @@ in the order given by `git status'." orig-name) ;; Original name for renames or copies. (defun vc-git-escape-file-name (name) - "Escape a file name if necessary." + "Escape filename NAME if necessary." (if (string-match "[\n\t\"\\]" name) (concat "\"" (mapconcat (lambda (c) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 8a9a6b8583..1e8d673852 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -271,9 +271,9 @@ If `ask', you will be prompted for a branch type." (defcustom vc-hg-symbolic-revision-styles '(builtin-active-bookmark "{if(bookmarks,sub(' ',',',bookmarks),if(phabdiff,phabdiff,shortest(node,6)))}") - "List of ways to present versions symbolically. The version -that we use is the first one that successfully produces a -non-empty string. + "List of ways to present versions symbolically. +The version that we use is the first one that successfully +produces a non-empty string. Each entry in the list can be either: @@ -811,7 +811,7 @@ if we don't understand a construct, we signal (push c parts) (cond ((eq c ?\\) (setf state 'charclass-backslash)) ((eq c ?\]) (setf state 'normal)))) - (t (error "invalid state"))) + (t (error "Invalid state"))) (setf i (1+ i)))) (unless (eq state 'normal) (signal 'vc-hg-unsupported-syntax (list pcre))) @@ -1151,7 +1151,7 @@ hg binary." (expand-file-name old))) (defun vc-hg-register (files &optional _comment) - "Register FILES under hg. COMMENT is ignored." + "Register FILES under hg. COMMENT is ignored." (vc-hg-command nil 0 files "add")) (defun vc-hg-create-repo () diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index 4b3c829a2c..0612310640 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -483,7 +483,7 @@ status of this file. Otherwise, the value returned is one of: (vc-call-backend backend 'state file))) (defsubst vc-up-to-date-p (file) - "Convenience function that checks whether `vc-state' of FILE is `up-to-date'." + "Convenience function to check whether `vc-state' of FILE is `up-to-date'." (eq (vc-state file) 'up-to-date)) (defun vc-working-revision (file &optional backend) @@ -627,7 +627,7 @@ Before doing that, check if there are any old backups and get rid of them." (declare-function vc-dir-resynch-file "vc-dir" (&optional fname)) -(defvar vc-dir-buffers nil "List of vc-dir buffers.") +(defvar vc-dir-buffers nil "List of `vc-dir' buffers.") (defun vc-after-save () "Function to be called by `basic-save-buffer' (in files.el)." diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el index 0b0c71b1ff..e38469ba9f 100644 --- a/lisp/vc/vc-rcs.el +++ b/lisp/vc/vc-rcs.el @@ -242,7 +242,7 @@ When VERSION is given, perform check for that version." (autoload 'vc-switches "vc") (defun vc-rcs-register (files &optional comment) - "Register FILES into the RCS version-control system. + "Register FILES into the RCS version control system. Automatically retrieve a read-only version of the file with keywords expanded. COMMENT can be used to provide an initial description for each FILES. Passes either `vc-rcs-register-switches' or `vc-register-switches' @@ -382,8 +382,9 @@ whether to remove it." (vc-switches 'RCS 'checkout))) (defun vc-rcs-checkout (file &optional rev) - "Retrieve a copy of a saved version of FILE. If FILE is a directory, -attempt the checkout for all registered files beneath it." + "Retrieve a copy of a saved version of FILE. +If FILE is a directory, attempt the checkout for all registered +files beneath it." (if (file-directory-p file) (mapc #'vc-rcs-checkout (vc-expand-dirs (list file) 'RCS)) (let ((file-buffer (get-file-buffer file)) @@ -448,8 +449,8 @@ attempt the checkout for all registered files beneath it." (message "Checking out %s...done" file)))))) (defun vc-rcs-revert (file &optional _contents-done) - "Revert FILE to the version it was based on. If FILE is a directory, -revert all registered files beneath it." + "Revert FILE to the version it was based on. +If FILE is a directory, revert all registered files beneath it." (if (file-directory-p file) (mapc #'vc-rcs-revert (vc-expand-dirs (list file) 'RCS)) (vc-do-command "*vc*" 0 "co" (vc-master-name file) "-f" @@ -516,8 +517,9 @@ Needs RCS 5.6.2 or later for -M." (kill-buffer filename))))) (defun vc-rcs-modify-change-comment (files rev comment) - "Modify the change comments change on FILES on a specified REV. If FILE is a -directory the operation is applied to all registered files beneath it." + "Modify the change comments change on FILES on a specified REV. +If FILE is a directory the operation is applied to all registered +files beneath it." (dolist (file (vc-expand-dirs files 'RCS)) (vc-do-command "*vc*" 0 "rcs" (vc-master-name file) (concat "-m" rev ":" comment)))) diff --git a/lisp/vc/vc-sccs.el b/lisp/vc/vc-sccs.el index 92cce5f13a..bcbb87eba8 100644 --- a/lisp/vc/vc-sccs.el +++ b/lisp/vc/vc-sccs.el @@ -191,7 +191,7 @@ Optional string REV is a revision." (autoload 'vc-switches "vc") (defun vc-sccs-register (files &optional comment) - "Register FILES into the SCCS version-control system. + "Register FILES into the SCCS version control system. Automatically retrieve a read-only version of the files with keywords expanded. COMMENT can be used to provide an initial description of FILES. Passes either `vc-sccs-register-switches' or `vc-register-switches' @@ -270,8 +270,8 @@ locked. REV is the revision to check out." (message "Checking out %s...done" file)))) (defun vc-sccs-revert (file &optional _contents-done) - "Revert FILE to the version it was based on. If FILE is a directory, -revert all subfiles." + "Revert FILE to the version it was based on. +If FILE is a directory, revert all subfiles." (if (file-directory-p file) (mapc #'vc-sccs-revert (vc-expand-dirs (list file) 'SCCS)) (vc-sccs-do-command nil 0 "unget" (vc-master-name file)) diff --git a/lisp/vc/vc-src.el b/lisp/vc/vc-src.el index faba5bce2b..b408b7de76 100644 --- a/lisp/vc/vc-src.el +++ b/lisp/vc/vc-src.el @@ -238,7 +238,7 @@ This function differs from vc-do-command in that it invokes `vc-src-program'." (autoload 'vc-switches "vc") (defun vc-src-register (files &optional _comment) - "Register FILES under src. COMMENT is ignored." + "Register FILES under src. COMMENT is ignored." (vc-src-command nil files "add")) (defun vc-src-responsible-p (file) @@ -268,15 +268,16 @@ REV is the revision to check out into WORKFILE." (vc-src-command nil file "co"))) (defun vc-src-revert (file &optional _contents-done) - "Revert FILE to the version it was based on. If FILE is a directory, -revert all registered files beneath it." + "Revert FILE to the version it was based on. +If FILE is a directory, revert all registered files beneath it." (if (file-directory-p file) (mapc #'vc-src-revert (vc-expand-dirs (list file) 'SRC)) (vc-src-command nil file "co"))) (defun vc-src-modify-change-comment (files rev comment) - "Modify the change comments change on FILES on a specified REV. If FILE is a -directory the operation is applied to all registered files beneath it." + "Modify the change comments change on FILES on a specified REV. +If FILE is a directory the operation is applied to all registered +files beneath it." (dolist (file (vc-expand-dirs files 'SRC)) (vc-src-command nil file "amend" "-m" comment rev))) diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 544a6c769f..e14519cc20 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -295,7 +295,7 @@ RESULT is a list of conses (FILE . STATE) for directory DIR." (autoload 'vc-switches "vc") (defun vc-svn-register (files &optional _comment) - "Register FILES into the SVN version-control system. + "Register FILES into the SVN version control system. The COMMENT argument is ignored This does an add but not a commit. Passes either `vc-svn-register-switches' or `vc-register-switches' to the SVN command." diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 4fcba65ab4..512f07d2f6 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1012,7 +1012,7 @@ responsible for the given file." (error "No VC backend is responsible for %s" file)))) (defun vc-expand-dirs (file-or-dir-list backend) - "Expands directories in a file list specification. + "Expand directories in a file list specification. Within directories, only files already under version control are noticed." (let ((flattened '())) (dolist (node file-or-dir-list) @@ -1152,7 +1152,7 @@ BEWARE: this function may change the current buffer." (memq (vc-state file) '(edited needs-merge conflict)))))) (defun vc-compatible-state (p q) - "Controls which states can be in the same commit." + "Control which states can be in the same commit." (or (eq p q) (and (member p '(edited added removed)) (member q '(edited added removed))))) diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el index 23e8001c01..2819c6163d 100644 --- a/lisp/x-dnd.el +++ b/lisp/x-dnd.el @@ -377,7 +377,7 @@ Currently XDND, Motif and old KDE 1.x protocols are recognized." ("XdndActionMove" . move) ("XdndActionLink" . link) ("XdndActionAsk" . ask)) - "Mapping from XDND action types to lisp symbols.") + "Mapping from XDND action types to Lisp symbols.") (declare-function x-change-window-property "xfns.c" (prop value &optional frame type format outer-P)) commit cf2fa6c87f4da4665ff8a9e8e220bba0b5bccefc Author: Stefan Kangas Date: Mon Sep 13 21:57:13 2021 +0200 Add user option to avoid checkdoc warning for unescaped left paren * lisp/emacs-lisp/checkdoc.el (checkdoc-column-zero-backslash-before-paren): New user option to avoid warning on unescaped left parenthesis in column zero. (checkdoc-this-string-valid-engine): Respect above new option. diff --git a/etc/NEWS b/etc/NEWS index 76cfb43efc..d4f4c81f89 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2825,6 +2825,13 @@ 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. diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index bc568f10fc..3150ea605f 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -312,6 +312,14 @@ This should be set in an Emacs Lisp file's local variables." :version "28.1") ;;;###autoload(put 'checkdoc-symbol-words 'safe-local-variable #'checkdoc-list-of-strings-p) +(defcustom checkdoc-column-zero-backslash-before-paren t + "Non-nil means to warn if there is no '\\' before '(' in column zero. +This backslash is no longer needed on Emacs 27.1 later. + +See Info node `(elisp) Documentation Tips' for background." + :type 'boolean + :version "28.1") + ;;;###autoload (defun checkdoc-list-of-strings-p (obj) "Return t when OBJ is a list of strings." @@ -1403,16 +1411,17 @@ buffer, otherwise stop after the first error." (match-beginning 1) (match-end 1))))) ;; * Check for '(' in column 0. - (save-excursion - (when (re-search-forward "^(" e t) - (if (checkdoc-autofix-ask-replace (match-beginning 0) - (match-end 0) - (format-message "Escape this `('? ") - "\\(") - nil - (checkdoc-create-error - "Open parenthesis in column 0 should be escaped" - (match-beginning 0) (match-end 0))))) + (when checkdoc-column-zero-backslash-before-paren + (save-excursion + (when (re-search-forward "^(" e t) + (if (checkdoc-autofix-ask-replace (match-beginning 0) + (match-end 0) + (format-message "Escape this `('? ") + "\\(") + nil + (checkdoc-create-error + "Open parenthesis in column 0 should be escaped" + (match-beginning 0) (match-end 0)))))) ;; * Do not start or end a documentation string with whitespace. (let (start end) (if (or (if (looking-at "\"\\([ \t\n]+\\)") commit 269c8a0b633ac22472772a7d4cce99228a5357ba Author: Stefan Kangas Date: Mon Sep 13 07:17:50 2021 +0200 Minor improvements to checkdoc * lisp/emacs-lisp/checkdoc.el (checkdoc-symbol-words): Add ignored values. (checkdoc-proper-noun-list): Remove XEmacs from list of words to capitalize; there is little need to insist on consistency here. (checkdoc-in-abbreviation-p): Add abbreviation "etc." and sort entries alphabetically. diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 1ab44e0f66..bc568f10fc 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -304,11 +304,12 @@ variable `checkdoc-common-verbs-wrong-voice' if you wish to add your own." Do not set this by hand, use a function like `checkdoc-current-buffer' with a universal argument.") -(defcustom checkdoc-symbol-words nil +(defcustom checkdoc-symbol-words '("byte-code" "command-line" "top-level") "A list of symbol names (strings) which also happen to make good words. These words are ignored when unquoted symbols are searched for. This should be set in an Emacs Lisp file's local variables." - :type '(repeat (symbol :tag "Word"))) + :type '(repeat (symbol :tag "Word")) + :version "28.1") ;;;###autoload(put 'checkdoc-symbol-words 'safe-local-variable #'checkdoc-list-of-strings-p) ;;;###autoload @@ -320,7 +321,7 @@ This should be set in an Emacs Lisp file's local variables." (not (memq nil (mapcar #'stringp obj))))) (defvar checkdoc-proper-noun-list - '("ispell" "xemacs" "emacs" "lisp") + '("ispell" "emacs" "lisp") "List of words (not capitalized) which should be capitalized.") (defvar checkdoc-proper-noun-regexp @@ -2016,10 +2017,11 @@ Examples of abbreviations handled: \"e.g.\", \"i.e.\", \"cf.\"." ;; so we need to skip it here too. (? "\\(") ;; The abbreviations: - (or (seq (any "iI") "." (any "eE")) ; i.e. - (seq (any "eE") ".g") ; e.g. - (seq (any "cC") "f"))) ; c.f. - "vs") ; vs. + (or (seq (any "cC") "f") ; cf. + (seq (any "eE") ".g") ; e.g. + (seq (any "iI") "." (any "eE")))) ; i.e. + "etc" ; etc. + "vs") ; vs. "."))) (error t)))) commit 5a34b65a3bfbf639a02b314efb4c9e69ba063c07 Author: Dmitry Gutov Date: Tue Sep 14 00:56:20 2021 +0300 Use the term "future history" rather than "default" * lisp/progmodes/project.el (project-find-file, project-or-external-find-file): Update docstring. (project--read-file-cpd-relative, project--read-file-absolute) (project--completing-read-strict): Rename DEFAULT to MB-DEFAULT. (project-find-file-in): Rename FILENAME to SUGGESTED-FILENAME. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index d034443907..b2b1a7870a 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -837,8 +837,8 @@ pattern to search for." (defun project-find-file () "Visit a file (with completion) in the current project. -The completion default is the filename at point, determined by -`thing-at-point' (whether such file exists or not)." +The filename at point (determined by `thing-at-point'), if any, +is available as part of \"future history\"." (interactive) (let* ((pr (project-current t)) (dirs (list (project-root pr)))) @@ -848,8 +848,8 @@ The completion default is the filename at point, determined by (defun project-or-external-find-file () "Visit a file (with completion) in the current project or external roots. -The completion default is the filename at point, determined by -`thing-at-point' (whether such file exists or not)." +The filename at point (determined by `thing-at-point'), if any, +is available as part of \"future history\"." (interactive) (let* ((pr (project-current t)) (dirs (cons @@ -870,11 +870,14 @@ For the arguments list, see `project--read-file-cpd-relative'." (defun project--read-file-cpd-relative (prompt all-files &optional predicate - hist default) + hist mb-default) "Read a file name, prompting with PROMPT. ALL-FILES is a list of possible file name completions. -PREDICATE, HIST, and DEFAULT have the same meaning as in -`completing-read'." + +PREDICATE and HIST have the same meaning as in `completing-read'. + +MB-DEFAULT is used as part of \"future history\", to be inserted +by the user at will." (let* ((common-parent-directory (let ((common-prefix (try-completion "" all-files))) (if (> (length common-prefix) 0) @@ -888,36 +891,39 @@ PREDICATE, HIST, and DEFAULT have the same meaning as in (res (project--completing-read-strict prompt new-collection predicate - hist default))) + hist mb-default))) (concat common-parent-directory res))) (defun project--read-file-absolute (prompt all-files &optional predicate - hist default) + hist mb-default) (project--completing-read-strict prompt (project--file-completion-table all-files) predicate - hist default)) + hist mb-default)) + +(defun project-find-file-in (suggested-filename dirs project) + "Complete a file name in DIRS in PROJECT and visit the result. -(defun project-find-file-in (filename dirs project) - "Complete FILENAME in DIRS in PROJECT and visit the result." +SUGGESTED-FILENAME is a relative file name, or part of it, which +is used as part of \"future history\"." (let* ((all-files (project-files project dirs)) (completion-ignore-case read-file-name-completion-ignore-case) (file (funcall project-read-file-name-function "Find file" all-files nil nil - filename))) + suggested-filename))) (if (string= file "") (user-error "You didn't specify the file") (find-file file)))) (defun project--completing-read-strict (prompt collection &optional predicate - hist default) + hist mb-default) (minibuffer-with-setup-hook (lambda () (setq-local minibuffer-default-add-function (lambda () - (let ((minibuffer-default default)) + (let ((minibuffer-default mb-default)) (minibuffer-default-add-completions))))) (completing-read (format "%s: " prompt) collection predicate 'confirm commit 9000aeaed446a02aaf0684e02f40312b3a2e0b59 Author: Dmitry Gutov Date: Tue Sep 14 00:53:05 2021 +0300 Make sure to return some valid project root * lisp/progmodes/project.el (project-prompt-project-dir): If the user just pressed RET on prompt, prompt again. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index ba95ed094e..d034443907 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1308,7 +1308,10 @@ It's also possible to enter an arbitrary directory not in the list." ;; completion style). (project--file-completion-table (append project--list `(,dir-choice)))) - (pr-dir (completing-read "Select project: " choices nil t))) + (pr-dir "")) + (while (equal pr-dir "") + ;; If the user simply pressed RET, do this again until they don't. + (setq pr-dir (completing-read "Select project: " choices nil t))) (if (equal pr-dir dir-choice) (read-directory-name "Select directory: " default-directory nil t) pr-dir))) commit 8c80430824d52e5dfae97db2669b419621817956 Author: Juri Linkov Date: Mon Sep 13 21:41:24 2021 +0300 * lisp/progmodes/elisp-mode.el (elisp-context-menu): New function (bug#9054) (emacs-lisp-mode): Add elisp-context-menu to context-menu-functions. diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 8befae0dec..e5ad36c30b 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -153,6 +153,26 @@ All commands in `lisp-mode-shared-map' are inherited by this map.") :style toggle :selected (bound-and-true-p eldoc-mode)])) +(defun elisp-context-menu (menu click) + (define-key-after menu [elisp-separator] menu-bar-separator + 'mark-whole-buffer) + (when (thing-at-mouse click 'symbol) + (define-key-after menu [describe-symbol] + '(menu-item "Describe Symbol" + (lambda (click) (interactive "e") + (describe-symbol + (intern (thing-at-mouse click 'symbol t)))) + :help "Display the full documentation of symbol") + 'elisp-separator) + (define-key-after menu [info-lookup-symbol] + '(menu-item "Lookup Symbol" + (lambda (click) (interactive "e") + (info-lookup-symbol + (intern (thing-at-mouse click 'symbol t)))) + :help "Display definition in relevant manual") + 'describe-symbol)) + menu) + (defun emacs-lisp-byte-compile () "Byte compile the file containing the current buffer." (interactive nil emacs-lisp-mode) @@ -280,7 +300,8 @@ Blank lines separate paragraphs. Semicolons start comments. #'elisp-completion-at-point nil 'local) (add-hook 'flymake-diagnostic-functions #'elisp-flymake-checkdoc nil t) (add-hook 'flymake-diagnostic-functions - #'elisp-flymake-byte-compile nil t)) + #'elisp-flymake-byte-compile nil t) + (add-hook 'context-menu-functions #'elisp-context-menu 10 t)) ;; Font-locking support. commit a17bea6d63c23a943a6bae28e699398c4002c2a8 Author: Juri Linkov Date: Mon Sep 13 21:18:30 2021 +0300 * lisp/isearch.el: Improve 'isearch-allow-motion' feature (bug#50466) * lisp/isearch.el: Add recenter to 'isearch-motion' property of 'end-of-buffer' to maximize the number of search hits on the screen. In 'isearch-motion' property of 'scroll-up-command' use 'recenter 0' for the first line of the screen. (isearch-beginning-of-buffer) (isearch-end-of-buffer): Sync logic from 'isearch-allow-motion' part of isearch-pre-command-hook. Direct users to isearch-allow-motion in the docstrings. (isearch-pre-command-hook): Don't override shifted 'isearch-yank-on-move' in 'isearch-allow-motion'. diff --git a/lisp/isearch.el b/lisp/isearch.el index bebc80adb3..3f5e642fd2 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2003,7 +2003,8 @@ Move point to the beginning of the buffer and search forwards from the top. \\ With a numeric argument, go to the ARGth absolute occurrence counting from the beginning of the buffer. To find the next relative occurrence forwards, -type \\[isearch-repeat-forward] with a numeric argument." +type \\[isearch-repeat-forward] with a numeric argument. +You might want to use `isearch-allow-motion' instead of this command." (interactive "p") (if (and arg (< arg 0)) (isearch-end-of-buffer (abs arg)) @@ -2011,8 +2012,11 @@ type \\[isearch-repeat-forward] with a numeric argument." ;; don't forward char in isearch-repeat (setq isearch-just-started t) (goto-char (point-min)) - (let ((isearch-repeat-on-direction-change nil)) - (isearch-repeat 'forward arg)))) + (let ((current-direction (if isearch-forward 'forward 'backward)) + (isearch-repeat-on-direction-change nil)) + (isearch-repeat 'forward arg) + (unless (eq current-direction (if isearch-forward 'forward 'backward)) + (isearch-repeat current-direction))))) (defun isearch-end-of-buffer (&optional arg) "Go to the last occurrence of the current search string. @@ -2020,14 +2024,18 @@ Move point to the end of the buffer and search backwards from the bottom. \\ With a numeric argument, go to the ARGth absolute occurrence counting from the end of the buffer. To find the next relative occurrence backwards, -type \\[isearch-repeat-backward] with a numeric argument." +type \\[isearch-repeat-backward] with a numeric argument. +You might want to use `isearch-allow-motion' instead of this command." (interactive "p") (if (and arg (< arg 0)) (isearch-beginning-of-buffer (abs arg)) (setq isearch-just-started t) (goto-char (point-max)) - (let ((isearch-repeat-on-direction-change nil)) - (isearch-repeat 'backward arg)))) + (let ((current-direction (if isearch-forward 'forward 'backward)) + (isearch-repeat-on-direction-change nil)) + (isearch-repeat 'backward arg) + (unless (eq current-direction (if isearch-forward 'forward 'backward)) + (isearch-repeat current-direction))))) ;;; Toggles for `isearch-regexp-function' and `search-default-mode'. @@ -2939,9 +2947,9 @@ See also the related option `isearch-allow-motion'." (put 'beginning-of-buffer 'isearch-motion '((lambda () (goto-char (point-min))) . forward)) (put 'end-of-buffer 'isearch-motion - '((lambda () (goto-char (point-max))) . backward)) + '((lambda () (goto-char (point-max)) (recenter -1 t)) . backward)) (put 'scroll-up-command 'isearch-motion - '((lambda () (goto-char (window-end)) (recenter 1 t)) . forward)) + '((lambda () (goto-char (window-end)) (recenter 0 t)) . forward)) (put 'scroll-down-command 'isearch-motion '((lambda () (goto-char (window-start)) (recenter -1 t)) . backward)) @@ -3076,7 +3084,10 @@ See more for options in `search-exit-option'." ;; Handle motion command functions. ((and isearch-allow-motion (symbolp this-command) - (get this-command 'isearch-motion)) + (get this-command 'isearch-motion) + ;; Don't override `isearch-yank-on-move' used below. + (not (and (eq isearch-yank-on-move 'shift) + this-command-keys-shift-translated))) (let* ((property (get this-command 'isearch-motion)) (function (car property)) (current-direction (if isearch-forward 'forward 'backward)) commit 4cf6d03d04ecadfd74fa4998fde14dcc79fd6daf Author: Mattias Engdegård Date: Mon Sep 13 18:38:59 2021 +0200 Remove duplication of `find` file pattern arguments * lisp/cedet/semantic/symref/grep.el (semantic-symref-derive-find-filepatterns): Avoid including the same pattern twice. diff --git a/lisp/cedet/semantic/symref/grep.el b/lisp/cedet/semantic/symref/grep.el index 180d779a78..cee54d7818 100644 --- a/lisp/cedet/semantic/symref/grep.el +++ b/lisp/cedet/semantic/symref/grep.el @@ -87,7 +87,7 @@ Optional argument MODE specifies the `major-mode' to test." (if (null (cdr pat)) args `("(" ,@args - ,@(mapcan (lambda (s) `("-o" "-name" ,s)) pat) + ,@(mapcan (lambda (s) `("-o" "-name" ,s)) (cdr pat)) ")")))))) (defvar semantic-symref-grep-flags) commit 1b0fb8fc2e515d05e9834bf04d1be8756227a9e0 Author: Andrea Corallo Date: Mon Sep 13 16:43:33 2021 +0200 * Clean-up some unnecessary macro usage in comp.c * src/comp.c (emit_static_object) (Fcomp_native_driver_options_effective_p, add_driver_options) (Fcomp__compile_ctxt_to_file, Fcomp_libgccjit_version): Clean-up unenecessary 'defined (WINDOWSNT)' usage. diff --git a/src/comp.c b/src/comp.c index 0012860096..418ad75324 100644 --- a/src/comp.c +++ b/src/comp.c @@ -2481,8 +2481,7 @@ emit_static_object (const char *name, Lisp_Object obj) ptrdiff_t len = SBYTES (str); const char *p = SSDATA (str); -#if defined (LIBGCCJIT_HAVE_gcc_jit_global_set_initializer) \ - || defined (WINDOWSNT) +#if defined (LIBGCCJIT_HAVE_gcc_jit_global_set_initializer) if (gcc_jit_global_set_initializer) { ptrdiff_t str_size = len + 1; @@ -4375,8 +4374,7 @@ DEFUN ("comp-native-driver-options-effective-p", doc: /* Return t if `comp-native-driver-options' is effective. */) (void) { -#if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) \ - || defined (WINDOWSNT) +#if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) if (gcc_jit_context_add_driver_option) return Qt; #endif @@ -4405,8 +4403,7 @@ add_driver_options (void) { Lisp_Object options = Fsymbol_value (Qnative_comp_driver_options); -#if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) \ - || defined (WINDOWSNT) +#if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) load_gccjit_if_necessary (true); if (!NILP (Fcomp_native_driver_options_effective_p ())) FOR_EACH_TAIL (options) @@ -4425,8 +4422,7 @@ add_driver_options (void) " and above.")); /* Captured `comp-native-driver-options' because file-local. */ -#if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) \ - || defined (WINDOWSNT) +#if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) options = comp.driver_options; if (!NILP (Fcomp_native_driver_options_effective_p ())) FOR_EACH_TAIL (options) @@ -4587,8 +4583,7 @@ DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file, /* Work around bug#46495 (GCC PR99126). */ #if defined (WIDE_EMACS_INT) \ - && (defined (LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option) \ - || defined (WINDOWSNT)) + && defined (LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option) Lisp_Object version = Fcomp_libgccjit_version (); if (NILP (version) || XFIXNUM (XCAR (version)) < 11) @@ -4640,7 +4635,7 @@ The return value has the form (MAJOR MINOR PATCHLEVEL) or nil if unknown (before GCC version 10). */) (void) { -#if defined (LIBGCCJIT_HAVE_gcc_jit_version) || defined (WINDOWSNT) +#if defined (LIBGCCJIT_HAVE_gcc_jit_version) load_gccjit_if_necessary (true); return gcc_jit_version_major commit ab36b0f5ff18c822d01e32f7a1f757d4db14369d Author: Lars Ingebrigtsen Date: Mon Sep 13 16:18:30 2021 +0200 Continue NEWS tag checking diff --git a/etc/NEWS b/etc/NEWS index 50538a168a..76cfb43efc 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2125,6 +2125,7 @@ modified flag. The default is nil, to preserve the old behavior. ** CC Mode ++++ *** Added support for Doxygen documentation style. 'doxygen' is now a valid 'c-doc-comment-style' which recognises all comment styles supported by Doxygen (namely '///', '//!', '/** … */' @@ -2139,6 +2140,7 @@ use 'doxygen' by default one might evaluate: or use it in a custom 'c-style'. ++++ *** Added support to line up '?' and ':' of a ternary operator. The new 'c-lineup-ternary-bodies' function can be used as a lineup function to align question mark and colon which are part of a ternary commit 5ee05fa75d517fdd13c9795aa78e12489140e388 Author: Lars Ingebrigtsen Date: Mon Sep 13 15:32:20 2021 +0200 Fix typo in previous files.el change diff --git a/lisp/files.el b/lisp/files.el index 821be1eb2c..3055226ba2 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2533,7 +2533,7 @@ buffer unibyte, so if this function is used when handling binary (non-character) data, it can be convenient to make the buffer unibyte first. This isn't, strictly speaking, necessary, because multibyte buffers can also deal with raw bytes. See info -node `(elisp)Character Codes' for details.") +node `(elisp)Character Codes' for details." (let ((format-alist nil) (after-insert-file-functions nil) (coding-system-for-read 'no-conversion) commit 59ff342869062caba72af7834c00b36753fa7461 Author: Lars Ingebrigtsen Date: Mon Sep 13 15:17:02 2021 +0200 Mention unibyte issues in insert-file-contents-literally doc string * lisp/files.el (insert-file-contents-literally): Mention possible issues with multibyte buffers (bug#50560). diff --git a/lisp/files.el b/lisp/files.el index 67c4628468..821be1eb2c 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2526,7 +2526,14 @@ A buffer may be modified in several ways after reading into the buffer, due to Emacs features such as format decoding, character code conversion, `find-file-hook', automatic uncompression, etc. -This function ensures that none of these modifications will take place." +This function ensures that none of these modifications will take place. + +Unlike `find-file-literally', this function does not make the +buffer unibyte, so if this function is used when handling +binary (non-character) data, it can be convenient to make the +buffer unibyte first. This isn't, strictly speaking, necessary, +because multibyte buffers can also deal with raw bytes. See info +node `(elisp)Character Codes' for details.") (let ((format-alist nil) (after-insert-file-functions nil) (coding-system-for-read 'no-conversion) commit e4a187ca5908f5e151fd42b9ab7b72bc5a9bfc2a Author: Stefan Monnier Date: Mon Sep 13 09:14:05 2021 -0400 * doc/lispref/variables.texi (named-let): Document TCO diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 9646daab7a..a1d1919b4b 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -303,22 +303,38 @@ the forms, and then make the variables non-special again. @end defspec @defspec named-let name bindings &rest body -This special form is like @code{let}: It binds the variables in +This special form is a looping construct inspired from the +Scheme language. It is similar to @code{let}: It binds the variables in @var{bindings}, and then evaluates @var{body}. However, -@code{named-let} allows you to call @var{body} recursively by calling +@code{named-let} also binds @var{name} to a +local function whose formal arguments are the variables in @var{bindings} +and whose body is @var{body}. This allows @var{body} to call itself +recursively by calling @var{name}, where the arguments passed to @var{name} are used as the new values of the bound variables in the recursive invocation. -Here's a trivial example: +Example of a loop summing a list of numbers: @lisp -(named-let foo - ((a 1) - (b 2)) - (nconc (list a b) - (and (= a 1) (foo 3 4)))) - @result{} (1 2 3 4) +(named-let sum ((numbers '(1 2 3 4)) + (running-sum 0)) + (if numbers + (sum (cdr numbers) (+ running-sum (car numbers))) + running-sum)) +@result{} 10 @end lisp + +@anchor{Tail recursion} +Recursive calls to @var{name} that occur in @emph{tail +positions} in @var{body} are guaranteed to be optimised as @emph{tail +calls}, which means that they will not consume any additional stack +space no matter how deeply the recursion runs. Such recursive calls +will effectively jump to the top of the loop with new values for the +variables. + +A function call is in the tail position if it's the very last thing +done so that the value returned by the call is the value of @var{body} +itself, as is the case in the recursive call to @code{sum} above. @end defspec Here is a complete list of the other facilities that create local commit feadcae139fbf34add3f957bde4aa44da529cb6f Author: Dmitry Gutov Date: Mon Sep 13 15:47:45 2021 +0300 Fix the tests * test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-abs) (xref--xref-file-name-display-is-nondirectory) (xref--xref-file-name-display-is-relative-to-project-root): Update for the latest change in xref.el. diff --git a/test/lisp/progmodes/xref-tests.el b/test/lisp/progmodes/xref-tests.el index ff4b647ae0..b1de1a4df5 100644 --- a/test/lisp/progmodes/xref-tests.el +++ b/test/lisp/progmodes/xref-tests.el @@ -128,8 +128,12 @@ (let ((xref-file-name-display 'abs)) (should (equal (delete-dups - (mapcar 'xref-location-group - (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)"))) + (mapcar + (lambda (loc) + (xref--group-name-for-display + (xref-location-group loc) + nil)) + (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)"))) (list (concat xref-tests--data-dir "file1.txt") (concat xref-tests--data-dir "file2.txt")))))) @@ -137,8 +141,12 @@ (ert-deftest xref--xref-file-name-display-is-nondirectory () (let ((xref-file-name-display 'nondirectory)) (should (equal (delete-dups - (mapcar 'xref-location-group - (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)"))) + (mapcar + (lambda (loc) + (xref--group-name-for-display + (xref-location-group loc) + nil)) + (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)"))) (list "file1.txt" "file2.txt"))))) @@ -146,13 +154,15 @@ (ert-deftest xref--xref-file-name-display-is-relative-to-project-root () (let* ((data-parent-dir (file-name-directory (directory-file-name xref-tests--data-dir))) - (project-find-functions - (lambda (_) (cons 'transient data-parent-dir))) (xref-file-name-display 'project-relative)) (should (equal (delete-dups - (mapcar 'xref-location-group - (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)"))) + (mapcar + (lambda (loc) + (xref--group-name-for-display + (xref-location-group loc) + data-parent-dir)) + (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)"))) (list "xref-resources/file1.txt" "xref-resources/file2.txt"))))) commit 7fe88446c30279285e3171091189b3d1af697c05 Author: Lars Ingebrigtsen Date: Mon Sep 13 13:35:53 2021 +0200 Use a fringe mark in bookmark instead of a whole background line * lisp/bookmark.el (bookmark-face): Adjust colors. (bookmark-fringe-mark): New bitmap. (bookmark--fontify): Use a fringe instead of marking the whole line. (bookmark--unfontify): Adjust to remove. (bookmark--jump-via): Ditto. (bookmark-set-fringe-mark): Renamed from bookmark-fontify. (bookmark--set-fringe-mark, bookmark--remove-fringe-mark): Renamed from --*fontify. Callers adjusted. diff --git a/etc/NEWS b/etc/NEWS index ba7dc164be..50538a168a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1285,10 +1285,9 @@ the variables 'bookmark-bmenu-use-header-line' and 'bookmark-bmenu-inline-header-height' are now declared obsolete. --- -*** New user option 'bookmark-fontify'. -If non-nil, setting a bookmark will colorize the current line with -'bookmark-face', and jumping to a bookmark will colorize the line the -bookmark was set on. +*** New user option 'bookmark-set-fringe-mark'. +If non-nil, setting a bookmark will set a fringe mark on the current +line, and jumping to a bookmark will also set this mark. --- *** New user option 'bookmark-menu-confirm-deletion'. diff --git a/lisp/bookmark.el b/lisp/bookmark.el index b340d379b3..719fc98f76 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -173,10 +173,8 @@ A non-nil value may result in truncated bookmark names." "Time before `bookmark-bmenu-search' updates the display." :type 'number) -(defcustom bookmark-fontify t - "Whether to colorize a bookmarked line. -If non-nil, setting a bookmark will colorize the current line with -`bookmark-face'." +(defcustom bookmark-set-fringe-mark t + "Whether to set a fringe mark at bookmarked lines." :type 'boolean :version "28.1") @@ -189,16 +187,16 @@ If non-nil, setting a bookmark will colorize the current line with (defface bookmark-face '((((class grayscale) (background light)) - :background "DimGray") + :foreground "DimGray") (((class grayscale) (background dark)) - :background "LightGray") + :foreground "LightGray") (((class color) (background light)) - :foreground "White" :background "DarkOrange1") + :background "White" :foreground "DarkOrange1") (((class color) (background dark)) - :foreground "Black" :background "DarkOrange1")) + :background "Black" :foreground "DarkOrange1")) "Face used to highlight current line." :version "28.1") @@ -455,18 +453,23 @@ In other words, return all information but the name." (defvar bookmark-history nil "The history list for bookmark functions.") -(defun bookmark--fontify () +(define-fringe-bitmap 'bookmark-fringe-mark + "\x3c\x7e\xff\xff\xff\xff\x7e\x3c") + +(defun bookmark--set-fringe-mark () "Apply a colorized overlay to the bookmarked location. -See user option `bookmark-fontify'." - (let ((bm (make-overlay (point-at-bol) - (min (point-max) (1+ (point-at-eol)))))) +See user option `bookmark-set-fringe-mark'." + (let ((bm (make-overlay (point-at-bol) (point-at-bol)))) (overlay-put bm 'category 'bookmark) - (overlay-put bm 'face 'bookmark-face))) + (overlay-put bm 'before-string + (propertize + "x" 'display + `(left-fringe bookmark-fringe-mark bookmark-face))))) -(defun bookmark--unfontify (bm) +(defun bookmark--remove-fringe-mark (bm) "Remove a bookmark's colorized overlay. BM is a bookmark as returned from function `bookmark-get-bookmark'. -See user option `bookmark-fontify'." +See user option `bookmark-set-fringe'." (let ((filename (cdr (assq 'filename bm))) (pos (cdr (assq 'position bm))) overlays found temp) @@ -475,7 +478,7 @@ See user option `bookmark-fontify'." (dolist (buf (buffer-list)) (with-current-buffer buf (when (equal filename buffer-file-name) - (setq overlays (overlays-at pos)) + (setq overlays (overlays-in pos pos)) (while (and (not found) (setq temp (pop overlays))) (when (eq 'bookmark (overlay-get temp 'category)) (delete-overlay (setq found temp)))))))))) @@ -565,8 +568,8 @@ old one." ;; no prefix arg means just overwrite old bookmark. (let ((bm (bookmark-get-bookmark stripped-name))) ;; First clean up if previously location was fontified. - (when bookmark-fontify - (bookmark--unfontify bm)) + (when bookmark-set-fringe-mark + (bookmark--remove-fringe-mark bm)) ;; Modify using the new (NAME . ALIST) format. (setcdr bm alist)) @@ -882,8 +885,8 @@ still there, in order, if the topmost one is ever deleted." ;; Ask for an annotation buffer for this bookmark (when bookmark-use-annotations (bookmark-edit-annotation str)) - (when bookmark-fontify - (bookmark--fontify)))) + (when bookmark-set-fringe-mark + (bookmark--set-fringe-mark)))) (setq bookmark-yank-point nil) (setq bookmark-current-buffer nil))) @@ -1152,14 +1155,14 @@ and then show any annotations for this bookmark." (if win (set-window-point win (point)))) ;; FIXME: we used to only run bookmark-after-jump-hook in ;; `bookmark-jump' itself, but in none of the other commands. - (when bookmark-fontify - (let ((overlays (overlays-at (point))) + (when bookmark-set-fringe-mark + (let ((overlays (overlays-in (point) (point))) temp found) (while (and (not found) (setq temp (pop overlays))) (when (eq 'bookmark (overlay-get temp 'category)) (setq found t))) (unless found - (bookmark--fontify)))) + (bookmark--set-fringe-mark)))) (run-hooks 'bookmark-after-jump-hook) (if bookmark-automatically-show-annotations ;; if there is an annotation for this bookmark, @@ -1423,7 +1426,7 @@ probably because we were called from there." (bookmark-maybe-historicize-string bookmark-name) (bookmark-maybe-load-default-file) (let ((will-go (bookmark-get-bookmark bookmark-name 'noerror))) - (bookmark--unfontify will-go) + (bookmark--remove-fringe-mark will-go) (setq bookmark-alist (delq will-go bookmark-alist)) ;; Added by db, nil bookmark-current-bookmark if the last ;; occurrence has been deleted commit f5db7103678287d90fcf2a4e4d3a739b1825631c Author: Lars Ingebrigtsen Date: Mon Sep 13 13:02:16 2021 +0200 NEWS copy edits and tagging diff --git a/etc/NEWS b/etc/NEWS index 42c9f61b3b..ba7dc164be 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2909,13 +2909,16 @@ structures. This is for symmetry with 'visual-line-mode', which disables 'truncate-lines'. -** 'electric-indent-mode' now also indents inside strings and comments, -(unless the indentation function doesn't, of course). +--- +** 'electric-indent-mode' now also indents inside strings and comments. +(This only happens when indentation function also supports this.) + To recover the previous behavior you can use: (add-hook 'electric-indent-functions (lambda (_) (if (nth 8 (syntax-ppss)) 'no-indent))) +--- ** The 'M-o' ('facemenu-keymap') global binding has been removed. To restore the old binding, say something like: @@ -2927,6 +2930,7 @@ To restore the old binding, say something like: The last two lines are not strictly necessary if you don't care about having those two commands on the 'M-o' keymap; see the next section. +--- ** The 'M-o M-s' and 'M-o M-S' global bindings have been removed. Use 'M-x center-line' and 'M-x center-paragraph' instead. See the previous section for how to get back the old bindings. Alternatively, @@ -2936,10 +2940,12 @@ before, you can add the following to your init file: (define-key global-map "\M-o\M-s" 'center-line) (define-key global-map "\M-o\M-S" 'center-paragraph) +--- ** The 'M-o M-o' global binding has been removed. Use 'M-x font-lock-fontify-block' instead, or the new 'C-x x f' command, which updates the syntax highlighting in the current buffer. +--- ** The escape sequence '\e[29~' in Xterm is now mapped to 'menu'. Xterm sends this sequence for both 'F16' and 'Menu' keys It used to be mapped to 'print' but we couldn't find a terminal @@ -2953,8 +2959,9 @@ If non-nil (the default), Emacs pushes pasted text onto the kill ring (if using an xterm-like terminal that supports bracketed paste). Setting this to nil inhibits that. -** 'vc-print-branch-log' shows the change log for BRANCH from its root -directory instead of the default directory. +--- +** 'vc-print-branch-log' shows the change log from its root directory. +It previously used to use the default directory. --- ** 'project-shell' and 'shell' now use 'pop-to-buffer-same-window'. commit 494403f4e0efe898c9dc640b33df338c04abb393 Author: Lars Ingebrigtsen Date: Mon Sep 13 12:56:15 2021 +0200 Correct nroff-mode NEWS entry after `M-o' changes diff --git a/etc/NEWS b/etc/NEWS index da1ca69767..42c9f61b3b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2960,7 +2960,8 @@ directory instead of the default directory. ** 'project-shell' and 'shell' now use 'pop-to-buffer-same-window'. This is to keep the same behavior as Eshell. -** In 'nroff-mode', 'center-line' is now bound to 'M-o M-s'. +--- +** In 'nroff-mode', 'center-line' is no longer bound to a key. The original key binding was 'M-s', which interfered with I-search, since the latter uses 'M-s' as a prefix key of the search prefix map. commit acc575846d13cf6d925116edccb9f213f1adf1be Author: Lars Ingebrigtsen Date: Mon Sep 13 12:41:34 2021 +0200 Mention how to disable auto-fill-mode in the auto-fill section * doc/lispref/text.texi (Margins): Mention how to disable auto-fill-mode. diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 9e0401fffb..f83ca97163 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -1802,7 +1802,12 @@ read, you should set @code{fill-column} to no more than 70. Otherwise the line will be too long for people to read comfortably, and this can make the text seem clumsy. -The default value for @code{fill-column} is 70. +The default value for @code{fill-column} is 70. To disable Auto Fill +mode in a specific mode, you could say something like: + +@lisp +(add-hook 'foo-mode-hook (lambda () (auto-fill-mode -1)) +@end lisp @end defopt @deffn Command set-left-margin from to margin diff --git a/etc/NEWS b/etc/NEWS index 7d16bf08f3..da1ca69767 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2964,6 +2964,7 @@ This is to keep the same behavior as Eshell. The original key binding was 'M-s', which interfered with I-search, since the latter uses 'M-s' as a prefix key of the search prefix map. +--- ** In 'f90-mode', the backslash character ('\') no longer escapes. For about a decade, the backslash character has no longer had a special escape syntax in Fortran F90. To get the old behavior back, @@ -2971,6 +2972,7 @@ say something like: (modify-syntax-entry ?\\ "\\" f90-mode-syntax-table) ++++ ** Setting 'fill-column' to nil is obsolete. This undocumented use of 'fill-column' is now obsolete. To disable auto filling, turn off 'auto-fill-mode' instead. commit 0dc630b35bba13e812736ccaf6d5154f6c8277b9 Author: Lars Ingebrigtsen Date: Mon Sep 13 12:35:50 2021 +0200 Document backtrace-on-error-noninteractive in the --batch section * doc/emacs/cmdargs.texi (Initial Options): Mention backtrace-on-error-noninteractive. diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index b7f0bda785..d5177faea9 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi @@ -266,6 +266,11 @@ disables auto-saving except in buffers for which auto-saving is explicitly requested, and when saving files it omits the @code{fsync} system call unless otherwise requested. +@vindex backtrace-on-error-noninteractive +Errors that occur when running a @samp{--batch} Emacs will result in +an Emacs Lisp backtrace being printed. To disable this behaviour, set +@code{backtrace-on-error-noninteractive} to @code{nil}. + @item --script @var{file} @opindex --script @cindex script mode diff --git a/etc/NEWS b/etc/NEWS index 76beb79067..7d16bf08f3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2983,6 +2983,7 @@ file: * Incompatible Lisp Changes in Emacs 28.1 ++++ ** Emacs now prints a backtrace when signaling an error in batch mode. This makes debugging Emacs Lisp scripts run in batch mode easier. To get back the old behavior, set the new variable commit 11da064ff1fc90f5abce3d42b262abb2563c935b Author: Lars Ingebrigtsen Date: Mon Sep 13 12:32:10 2021 +0200 Further NEWS tagging updates diff --git a/etc/NEWS b/etc/NEWS index a4d31a32c9..76beb79067 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2996,6 +2996,7 @@ integer 2. Such numerals are now read as floats with the exponent included: 2.e6 is now read as the floating-point value 2000000.0. That is, '(read-from-string "1.e3")' => '(1000.0 . 4)' now. +--- ** 'equal' no longer examines some contents of window configurations. Instead, it considers window configurations to be equal only if they are 'eq'. To compare contents, use 'compare-window-configurations' @@ -3024,6 +3025,7 @@ hooks 'kill-buffer-hook', 'kill-buffer-query-functions', and 'buffer-list-update-hook' for the temporary buffers they create. This avoids slowing them down when a lot of these hooks are defined. ++++ ** New face 'child-frame-border' and frame parameter 'child-frame-border-width'. The face and width of child frames borders can now be determined separately from those of normal frames. To minimize backward @@ -3076,6 +3078,7 @@ replacement text. 'minibuffer-completion-table' and related variables are now set buffer-locally in the minibuffer instead of being set via a global let-binding. +--- ** XML serialization functions now reject invalid characters. Previously, 'xml-print' would produce invalid XML when given a string with characters that are not valid in XML (see @@ -3084,12 +3087,14 @@ https://www.w3.org/TR/xml/#charsets). Now it rejects such strings. --- ** JSON +--- *** JSON number parsing is now stricter. Numbers with a leading plus sign, leading zeros, or a missing integer component are now rejected by 'json-read' and friends. This makes them more compliant with the JSON specification and consistent with the native JSON parsing functions. +--- *** JSON functions support the semantics of RFC 8259. The JSON functions 'json-serialize', 'json-insert', 'json-parse-string', and 'json-parse-buffer' now implement some of the commit adda0df193e648931f10034bc9bbe6d8fbca9d58 Author: Lars Ingebrigtsen Date: Mon Sep 13 12:20:57 2021 +0200 completions-annotations doc string clarification * lisp/minibuffer.el (completions-annotations): Mention that it's not always used. diff --git a/etc/NEWS b/etc/NEWS index 6a705de362..a4d31a32c9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3120,8 +3120,10 @@ these cases. These were actually rendered obsolete in Emacs 21 but were never marked as such. +--- ** 'pcomplete-ignore-case' is now an obsolete alias of 'completion-ignore-case'. ++++ ** 'completions-annotations' face is not used when the caller puts own face. This affects the suffix specified by completion 'annotation-function'. @@ -3130,7 +3132,8 @@ This affects the suffix specified by completion 'annotation-function'. This is instead of the erroneous 'minibuffer-inactive-mode' it formerly had. -** 'make-text-button' no longer text properties of its first argument. +--- +** 'make-text-button' no longer modifies text properties of its first argument. When its first argument is a string, 'make-text-button' no longer modifies the string's text properties; instead, it uses and returns a copy of the string. This helps avoid trouble when strings are @@ -3142,6 +3145,7 @@ If 'minibuffer-allow-text-properties' is non-nil, doing completion over a table of strings with properties will no longer remove all the properties before returning. This affects things like 'completing-read'. +--- ** 'dns-query' now consistently uses Lisp integers to represent integers. Formerly it made an exception for integer components of SOA records, because SOA serial numbers can exceed fixnum ranges on 32-bit platforms. @@ -3156,6 +3160,7 @@ the Emacs Lisp reference manual for background. +++ ** The error 'ftp-error' belongs also to category 'remote-file-error'. ++++ ** The WHEN argument of 'make-obsolete' and related functions is mandatory. The use of those functions without a WHEN argument was marked obsolete back in Emacs 23.1. The affected functions are: 'make-obsolete', diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 539a2c28cd..9668e7c732 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1807,7 +1807,9 @@ Return nil if there is no valid completion, else t." (_ t))) (defface completions-annotations '((t :inherit (italic shadow))) - "Face to use for annotations in the *Completions* buffer.") + "Face to use for annotations in the *Completions* buffer. +This face is only used if the strings used for completions +doesn't already specify a face.") (defcustom completions-format 'horizontal "Define the appearance and sorting of completions. commit 5da8875e26001dae4dc793877e5e13c9335d84bd Author: Lars Ingebrigtsen Date: Mon Sep 13 12:13:01 2021 +0200 Update some more NEWS tagging diff --git a/etc/NEWS b/etc/NEWS index 3ec61c6650..6a705de362 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3176,6 +3176,7 @@ These variables describe facts about the SQL standard and product-specific additions. There should be no need for users to customize them. +--- ** Some locale-related variables have been removed. The Lisp variables 'previous-system-messages-locale' and 'previous-system-time-locale' have been removed, as they were created @@ -3185,12 +3186,15 @@ by mistake and were not useful to Lisp code. ** Function 'lm-maintainer' is replaced with 'lm-maintainers'. The former is now declared obsolete. ++++ ** 'facemenu.el' is no longer preloaded. To use functions/variables from the package, you now have to say '(require 'facemenu)' or similar. +--- ** 'facemenu-color-alist' is now obsolete, and is not used. +--- ** The variable 'keyboard-type' is obsolete and not dynamically scoped any more. +++ commit 893eb0b8a2d902cf734c5905f65a6a2b5cac6e47 Author: Lars Ingebrigtsen Date: Mon Sep 13 12:08:58 2021 +0200 Mention `benchmark-call' in the manual * doc/lispref/debugging.texi (Profiling): Mention `benchmark-call'. diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi index e458d76d5d..6548437817 100644 --- a/doc/lispref/debugging.texi +++ b/doc/lispref/debugging.texi @@ -1043,9 +1043,9 @@ functions written in Lisp, it cannot profile Emacs primitives. @cindex benchmarking You can measure the time it takes to evaluate individual Emacs Lisp forms using the @file{benchmark} library. See the function -@code{benchmark-call} as well as the macros -@code{benchmark-run}, @code{benchmark-run-compiled} and -@code{benchmark-progn} in @file{benchmark.el}. You can also use the +@code{benchmark-call} as well as the macros @code{benchmark-run}, +@code{benchmark-run-compiled}, @code{benchmark-progn} and +@code{benchmark-call} in @file{benchmark.el}. You can also use the @code{benchmark} command for timing forms interactively. @c Not worth putting in the printed manual. diff --git a/etc/NEWS b/etc/NEWS index dfbb739118..3ec61c6650 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3383,6 +3383,7 @@ It is written as '(:success BODY...)' where BODY is executed whenever the protected form terminates without error, with the specified variable bound to the the value of the protected form. ++++ ** New function 'benchmark-call' to measure the execution time of a function. Additionally, the number of repetitions can be expressed as a minimal duration in seconds. @@ -3410,6 +3411,7 @@ If bound to non-nil, a command with '(interactive "e")' doesn't signal an error when invoked by input event that is not a mouse click (e.g., a key sequence). +--- ** New variable 'redisplay-skip-initial-frame' to enable batch redisplay tests. Setting it to nil forces the redisplay to do its job even in the initial frame used in batch mode. @@ -3481,10 +3483,13 @@ To load the file after byte-compiling, add a call to 'load' from Lisp or use 'M-x emacs-lisp-byte-compile-and-load' interactively. ** Macroexp + --- *** New function 'macroexp-file-name' to know the name of the current file. + --- *** New function 'macroexp-compiling-p' to know if we're compiling. + --- *** New function 'macroexp-warn-and-return' to help emit warnings. This used to be named 'macroexp--warn-and-return' and has proved useful commit 4b813f781e2659286008edefa9d3e9bd8946f7af Author: Lars Ingebrigtsen Date: Mon Sep 13 11:59:56 2021 +0200 Update some pcase NEWS tags for already-documented functions diff --git a/etc/NEWS b/etc/NEWS index 930b9799a9..dfbb739118 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3526,11 +3526,13 @@ in better code. --- *** New function 'pcase-compile-patterns' to write other macros. ++++ *** Added 'cl-type' pattern. The new 'cl-type' pattern compares types using 'cl-typep', which allows comparing simple types like '(cl-type integer)', as well as forms like '(cl-type (integer 0 10))'. ++++ *** New macro 'pcase-setq'. This macro is the 'setq' equivalent of 'pcase-let', which allows for destructuring patterns in a 'setq' form. commit 53a9f751b511cd557f9fd28b561b9fcce9cd69d4 Author: Lars Ingebrigtsen Date: Mon Sep 13 11:58:56 2021 +0200 Update NEWS tagging for string helper functions diff --git a/etc/NEWS b/etc/NEWS index db98dbb026..930b9799a9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3598,10 +3598,30 @@ This splits a shell command string into separate components, respecting quoting with single ('like this') and double ("like this") quotes, as well as backslash quoting (like\ this). -** New string manipulation functions added to subr-x.el. -the functions are 'string-clean-whitespace', 'string-fill', -'string-limit', 'string-lines', 'string-pad' and -'string-chop-newline'. ++++ +** New function 'string-clean-whitespace'. +This removed whitespace from a string + ++++ +** New function 'string-fill'. +Word-wrap a string so that no lines are longer that a specific length. + ++++ +** New function 'string-limit'. +Return (up to) a specific substring length. + ++++ +** New function 'string-lines'. +Return a list of strings representing the individual lines in a +string. + ++++ +** New function 'string-pad'. +Pad a string to a specific length. + ++++ +** New function 'string-chop-newline'. +Remove a trailing newline from a string. +++ ** New function 'replace-regexp-in-region'. @@ -3646,6 +3666,7 @@ This is identical to 'ignore', but returns t instead. This is identical to 'sxhash-equal' but also accounts for string properties. +--- ** New function 'buffer-line-statistics'. This function returns some statistics about the line lengths in a buffer. commit ba0be8df532a497f67bb5fc0188a0ac3c7278b39 Author: Lars Ingebrigtsen Date: Mon Sep 13 11:53:18 2021 +0200 Document named-let and update some NEWS tags * doc/lispref/variables.texi (Local Variables): Document `named-let'. diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 3b0331847d..9646daab7a 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -300,6 +300,25 @@ that certain variables are dynamically bound (@pxref{Dynamic Binding}), but it's impractical to @code{defvar} these variables. @code{dlet} will temporarily make the bound variables special, execute the forms, and then make the variables non-special again. +@end defspec + +@defspec named-let name bindings &rest body +This special form is like @code{let}: It binds the variables in +@var{bindings}, and then evaluates @var{body}. However, +@code{named-let} allows you to call @var{body} recursively by calling +@var{name}, where the arguments passed to @var{name} are used as the +new values of the bound variables in the recursive invocation. + +Here's a trivial example: + +@lisp +(named-let foo + ((a 1) + (b 2)) + (nconc (list a b) + (and (= a 1) (foo 3 4)))) + @result{} (1 2 3 4) +@end lisp @end defspec Here is a complete list of the other facilities that create local diff --git a/etc/NEWS b/etc/NEWS index 4e70208158..db98dbb026 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3828,6 +3828,7 @@ Until it is solved you could ignore such errors by performing (setq debug-ignored-errors (cons 'remote-file-error debug-ignored-errors)) ++++ ** New macro 'named-let' added to subr-x.el. It provides Scheme's "named let" looping construct. @@ -3840,6 +3841,7 @@ non-nil value to get back the old behavior, whereby after reading from a subprocess, Emacs would check for output of other subprocesses in a way that is likely to read from the same process again. ++++ ** 'set-process-buffer' now updates the process mark. The mark will be set to point to the end of the new buffer. @@ -4041,6 +4043,7 @@ form below the header line. It is enabled by default in --- ** 'ascii' is now a coding system alias for 'us-ascii'. +--- ** New coding-systems for EBCDIC variants. New coding-systems 'ibm256', 'ibm273', 'ibm274', 'ibm277', 'ibm278', 'ibm280', 'ibm281', 'ibm284', 'ibm285', 'ibm290', 'ibm297'. These are @@ -4103,8 +4106,11 @@ The new variable 'xwidget-webkit-download-dir' says where to download to. --- *** New command 'xwidget-webkit-clone-and-split-below'. +Open a new window below displaying the current URL. + +--- *** New command 'xwidget-webkit-clone-and-split-right'. -These are used in 'xwidget-webkit-mode'. +Open a new window to the right displaying the current URL. --- *** New variable 'xwidget-webkit-enable-plugins'. commit 2a3ef454c2bc1b8d21e22dc5d0e0d8b897f8187d Author: Lars Ingebrigtsen Date: Mon Sep 13 10:40:56 2021 +0200 Clarify bookmark-fontify NEWS entry diff --git a/etc/NEWS b/etc/NEWS index c807c41325..4e70208158 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1287,7 +1287,8 @@ the variables 'bookmark-bmenu-use-header-line' and --- *** New user option 'bookmark-fontify'. If non-nil, setting a bookmark will colorize the current line with -'bookmark-face'. +'bookmark-face', and jumping to a bookmark will colorize the line the +bookmark was set on. --- *** New user option 'bookmark-menu-confirm-deletion'.