From 45cfa2a8cd521b81770a123aff548abae70f7322 Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Thu, 12 Aug 2021 14:59:45 +0200 Subject: Mention `find-ignore-file' in the vc.el commentary * lisp/vc/vc.el: Update documentation in the comments about `find-ignore-file' (bug#50013). --- lisp/vc/vc.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lisp/vc/vc.el') diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 9338b7191d0..a97caa702a1 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -486,11 +486,19 @@ ;; from ignored files. ;; When called from Lisp code, if DIRECTORY is non-nil, the ;; repository to use will be deduced by DIRECTORY. +;; The default behavior is to add or remove a line from the file +;; returned by the `find-ignore-file' function. ;; ;; - ignore-completion-table (directory) ;; ;; Return the completion table for files ignored by the current ;; version control system, e.g., the entries in `.gitignore' and +;; `.bzrignore'. The default behavior is to read the contents of +;; the file returned by the `find-ignore-file' function. +;; +;; - find-ignore-file +;; +;; Return the ignore file that controls FILE, e.g. `.gitignore' or ;; `.bzrignore'. ;; ;; - previous-revision (file rev) -- cgit v1.2.3 From 35023214031e130b43fd14f5ee7cd07e778b8176 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Mon, 16 Aug 2021 03:13:30 +0300 Subject: Fix regressions in the last change * lisp/vc/vc-git.el (vc-git-register): Use file names verbatim with 'git update-index', as it only accepts file names, not pathspecs (bug#39452). * lisp/vc/vc.el (vc-print-root-log): Expand ROOTDIR, so that vc-git-print-log doesn't receive an abbreviated name. Literal pathspecs don't work with those. --- lisp/vc/vc-git.el | 2 +- lisp/vc/vc.el | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp/vc/vc.el') diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index ffe1e6832ce..6b26515430f 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -876,7 +876,7 @@ The car of the list is the current branch." (push crt dlist) (push crt flist))) (when flist - (vc-git-command nil 0 (vc-git--literal-pathspecs flist) "update-index" "--add" "--")) + (vc-git-command nil 0 flist "update-index" "--add" "--")) (when dlist (vc-git-command nil 0 (vc-git--literal-pathspecs dlist) "add")))) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index a97caa702a1..e2b12c6cb03 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2603,8 +2603,8 @@ with its diffs (if the underlying VCS supports that)." (setq backend (vc-responsible-backend rootdir)) (unless backend (error "Directory is not version controlled"))) - (setq default-directory rootdir) - (vc-print-log-internal backend (list rootdir) revision revision limit + (setq default-directory (expand-file-name rootdir)) + (vc-print-log-internal backend (list default-directory) revision revision limit (when with-diff 'with-diff)))) ;;;###autoload -- cgit v1.2.3 From fba64e1697174369b87e3de0c189a0fb0963c49c Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Thu, 19 Aug 2021 03:57:58 +0300 Subject: Fix vc-root-diff broken with Git as well * lisp/vc/vc.el (vc-root-diff): Fix similar to 35023214031e1 by avoiding the abbreviated directory name in argument (bug#39452). --- lisp/vc/vc.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/vc/vc.el') diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index e2b12c6cb03..b75862e8a52 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2056,7 +2056,7 @@ saving the buffer." ;; relative file names work. (let ((default-directory rootdir)) (vc-diff-internal - t (list backend (list rootdir) working-revision) nil nil + t (list backend (list (expand-file-name rootdir)) working-revision) nil nil (called-interactively-p 'interactive)))))) ;;;###autoload -- cgit v1.2.3 From 5da9b3d2bdde0c9d23cdcd9d55883878900daa78 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 29 Aug 2021 22:37:30 +0200 Subject: Move vc-branch-p and vc-branch-part from vc.el to vc-rcs.el and rename * lisp/vc/vc-rcs.el (vc-rcs-branch-p): Renamed from `vc-branch-p' (old name made into obsolete alias) and moved from vc.el. (vc-rcs-branch-part): Renamed from `vc-branch-part' (old name made into obsolete alias) and moved from vc.el. --- lisp/vc/vc-cvs.el | 10 ++++------ lisp/vc/vc-rcs.el | 48 ++++++++++++++++++++++++++++++------------------ lisp/vc/vc.el | 14 -------------- 3 files changed, 34 insertions(+), 38 deletions(-) (limited to 'lisp/vc/vc.el') diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index c8f36fb76ec..ec6dc282dc8 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -24,9 +24,9 @@ ;;; Code: +(require 'vc-rcs) (eval-when-compile (require 'vc)) -(declare-function vc-branch-p "vc" (rev)) (declare-function vc-checkout "vc" (file &optional rev)) (declare-function vc-expand-dirs "vc" (file-or-dir-list backend)) (declare-function vc-read-revision "vc" @@ -451,17 +451,17 @@ REV is the revision to check out." ((string= first-revision "") (setq status (vc-cvs-merge-news file))) (t - (if (not (vc-branch-p first-revision)) + (if (not (vc-rcs-branch-p first-revision)) (setq second-revision (vc-read-revision "Second revision: " (list file) 'CVS nil - (concat (vc-branch-part first-revision) "."))) + (concat (vc-rcs-branch-part first-revision) "."))) ;; We want to merge an entire branch. Set revisions ;; accordingly, so that vc-cvs-merge understands us. (setq second-revision first-revision) ;; first-revision must be the starting point of the branch - (setq first-revision (vc-branch-part first-revision))) + (setq first-revision (vc-rcs-branch-part first-revision))) (setq status (vc-cvs-merge file first-revision second-revision)))) status)) @@ -542,14 +542,12 @@ Will fail unless you have administrative privileges on the repo." ;;; History functions ;;; -(declare-function vc-rcs-print-log-cleanup "vc-rcs" ()) ;; Follows vc-cvs-command, which uses vc-do-command from vc-dispatcher. (declare-function vc-exec-after "vc-dispatcher" (code)) (defun vc-cvs-print-log (files buffer &optional _shortlog _start-revision limit) "Print commit log associated with FILES into specified BUFFER. Remaining arguments are ignored." - (require 'vc-rcs) ;; It's just the catenation of the individual logs. (vc-cvs-command buffer diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el index 6ffc1a8a2ff..0b0c71b1ff9 100644 --- a/lisp/vc/vc-rcs.el +++ b/lisp/vc/vc-rcs.el @@ -41,7 +41,6 @@ (require 'cl-lib) (require 'vc)) -(declare-function vc-branch-p "vc" (rev)) (declare-function vc-read-revision "vc" (prompt &optional files backend default initial-input)) (declare-function vc-buffer-context "vc-dispatcher" ()) @@ -173,6 +172,19 @@ For a description of possible values, see `vc-check-master-templates'." (defun vc-rcs-dir-extra-headers (&rest _ignore)) +;; functions that operate on RCS revision numbers. +(defun vc-rcs-branch-p (rev) + "Return t if REV is a branch revision." + (not (eq nil (string-match "\\`[0-9]+\\(\\.[0-9]+\\.[0-9]+\\)*\\'" rev)))) +(define-obsolete-function-alias 'vc-branch-p #'vc-rcs-branch-p "28.1") + +(defun vc-rcs-branch-part (rev) + "Return the branch part of a revision number REV." + (let ((index (string-match "\\.[0-9]+\\'" rev))) + (when index + (substring rev 0 index)))) +(define-obsolete-function-alias 'vc-branch-part #'vc-rcs-branch-part "28.1") + (defun vc-rcs-working-revision (file) "RCS-specific version of `vc-working-revision'." (or (and vc-consult-headers @@ -198,7 +210,7 @@ When VERSION is given, perform check for that version." ;; If we are not on the trunk, we need to examine the ;; whole current branch. (vc-insert-file (vc-master-name file) "^desc") - (vc-rcs-find-most-recent-rev (vc-branch-part version)))))) + (vc-rcs-find-most-recent-rev (vc-rcs-branch-part version)))))) (defun vc-rcs-workfile-unchanged-p (file) "Has FILE remained unchanged since last checkout?" @@ -326,7 +338,7 @@ whether to remove it." (setq rev default-branch) (setq switches (cons "-f" switches))) (if (and (not rev) old-version) - (setq rev (vc-branch-part old-version))) + (setq rev (vc-rcs-branch-part old-version))) (apply #'vc-do-command "*vc*" 0 "ci" (vc-master-name file) ;; if available, use the secure check-in option (and (vc-rcs-release-p "5.6.4") "-j") @@ -349,11 +361,11 @@ whether to remove it." ;; branch accordingly (cond ((and old-version new-version - (not (string= (vc-branch-part old-version) - (vc-branch-part new-version)))) + (not (string= (vc-rcs-branch-part old-version) + (vc-rcs-branch-part new-version)))) (vc-rcs-set-default-branch file (if (vc-rcs-trunk-p new-version) nil - (vc-branch-part new-version))) + (vc-rcs-branch-part new-version))) ;; If this is an old (pre-1992!) RCS release, we might have ;; to remove a remaining lock. (if (not (vc-rcs-release-p "5.6.2")) @@ -414,7 +426,7 @@ attempt the checkout for all registered files beneath it." ;; REV is t ... (if (not (vc-rcs-trunk-p workrev)) ;; ... go to head of current branch - (vc-branch-part workrev) + (vc-rcs-branch-part workrev) ;; ... go to head of trunk (vc-rcs-set-default-branch file nil) @@ -431,7 +443,7 @@ attempt the checkout for all registered files beneath it." file (if (vc-rcs-latest-on-branch-p file new-version) (if (vc-rcs-trunk-p new-version) nil - (vc-branch-part new-version)) + (vc-rcs-branch-part new-version)) new-version))))) (message "Checking out %s...done" file)))))) @@ -456,17 +468,17 @@ revert all registered files beneath it." ((string= first-revision "") (error "A starting RCS revision is required")) (t - (if (not (vc-branch-p first-revision)) + (if (not (vc-rcs-branch-p first-revision)) (setq second-revision (vc-read-revision "Second RCS revision: " (list file) 'RCS nil - (concat (vc-branch-part first-revision) "."))) + (concat (vc-rcs-branch-part first-revision) "."))) ;; We want to merge an entire branch. Set revisions ;; accordingly, so that vc-rcs-merge understands us. (setq second-revision first-revision) ;; first-revision must be the starting point of the branch - (setq first-revision (vc-branch-part first-revision))))) + (setq first-revision (vc-rcs-branch-part first-revision))))) (vc-rcs-merge file first-revision second-revision))) (defun vc-rcs-merge (file first-version &optional second-version) @@ -637,11 +649,11 @@ Optional arg REVISION is a revision to annotate from." ;; Find which branches (if any) must be included in the edits. (let ((par revision) bpt kids) - (while (setq bpt (vc-branch-part par) - par (vc-branch-part bpt)) + (while (setq bpt (vc-rcs-branch-part par) + par (vc-rcs-branch-part bpt)) (setq kids (cdr (assq 'branches (cdr (assoc par revisions))))) ;; A branchpoint may have multiple children. Find the right one. - (while (not (string= bpt (vc-branch-part (car kids)))) + (while (not (string= bpt (vc-rcs-branch-part (car kids)))) (setq kids (cdr kids))) (push (cons par (car kids)) nbls))) ;; Start with the full text. @@ -818,7 +830,7 @@ systime, or nil if there is none. Also, reposition point." or nil if there is no previous revision. This default implementation works for MAJOR.MINOR-style revision numbers as used by RCS and CVS." - (let ((branch (vc-branch-part rev)) + (let ((branch (vc-rcs-branch-part rev)) (minor-num (string-to-number (vc-rcs-minor-part rev)))) (when branch (if (> minor-num 1) @@ -830,7 +842,7 @@ used by RCS and CVS." nil ;; we are at the beginning of a branch -- ;; return revision of starting point - (vc-branch-part branch)))))) + (vc-rcs-branch-part branch)))))) (defun vc-rcs-next-revision (file rev) "Return the revision number immediately following REV for FILE, @@ -838,7 +850,7 @@ or nil if there is no next revision. This default implementation works for MAJOR.MINOR-style revision numbers as used by RCS and CVS." (when (not (string= rev (vc-working-revision file))) - (let ((branch (vc-branch-part rev)) + (let ((branch (vc-rcs-branch-part rev)) (minor-num (string-to-number (vc-rcs-minor-part rev)))) (concat branch "." (number-to-string (1+ minor-num)))))) @@ -965,7 +977,7 @@ to its master version." (setq latest-rev rev) (setq value (match-string 1))))) (or value - (vc-branch-part branch)))) + (vc-rcs-branch-part branch)))) (defun vc-rcs-fetch-master-state (file &optional working-revision) "Compute the master file's idea of the state of FILE. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index b75862e8a52..38204ef91c8 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -3072,20 +3072,6 @@ log entries should be gathered." (vc-call-backend (vc-responsible-backend default-directory) 'update-changelog args)) -;; functions that operate on RCS revision numbers. This code should -;; also be moved into the backends. It stays for now, however, since -;; it is used in code below. -(defun vc-branch-p (rev) - "Return t if REV is a branch revision." - (not (eq nil (string-match "\\`[0-9]+\\(\\.[0-9]+\\.[0-9]+\\)*\\'" rev)))) - -;;;###autoload -(defun vc-branch-part (rev) - "Return the branch part of a revision number REV." - (let ((index (string-match "\\.[0-9]+\\'" rev))) - (when index - (substring rev 0 index)))) - (defun vc-default-responsible-p (_backend _file) "Indicate whether BACKEND is responsible for FILE. The default is to return nil always." -- cgit v1.2.3 From d2ad64b7a524450bd1a4f59a5e0801abb0637b32 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 31 Aug 2021 02:47:31 +0300 Subject: Move the expansion of abbreviated names to vc-git.el * lisp/vc/vc-git.el (vc-git--literal-pathspec): Perform the expansion of abbreviated file names here instead (bug#39452). * lisp/vc/vc.el (vc-root-diff, vc-print-root-log): Undo the recent change. --- lisp/vc/vc-git.el | 6 +++++- lisp/vc/vc.el | 10 +++++----- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'lisp/vc/vc.el') diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 1cd200cd134..a5431abb40c 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -245,7 +245,11 @@ included in the completions." (defun vc-git--literal-pathspec (file) "Prepend :(literal) path magic to FILE." ;; Good example of file name that needs this: "test[56].xx". - (and file (concat ":(literal)" (file-local-name file)))) + (let ((lname (file-local-name file))) + ;; Expand abbreviated file names. + (when (file-name-absolute-p lname) + (setq lname (expand-file-name lname))) + (and file (concat ":(literal)" lname)))) (defun vc-git--literal-pathspecs (files) "Prepend :(literal) path magic to FILES." diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 38204ef91c8..8036be390a9 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2055,9 +2055,9 @@ saving the buffer." ;; here, this way the *vc-diff* buffer is setup correctly, so ;; relative file names work. (let ((default-directory rootdir)) - (vc-diff-internal - t (list backend (list (expand-file-name rootdir)) working-revision) nil nil - (called-interactively-p 'interactive)))))) + (vc-diff-internal + t (list backend (list rootdir) working-revision) nil nil + (called-interactively-p 'interactive)))))) ;;;###autoload (defun vc-root-dir () @@ -2603,8 +2603,8 @@ with its diffs (if the underlying VCS supports that)." (setq backend (vc-responsible-backend rootdir)) (unless backend (error "Directory is not version controlled"))) - (setq default-directory (expand-file-name rootdir)) - (vc-print-log-internal backend (list default-directory) revision revision limit + (setq default-directory rootdir) + (vc-print-log-internal backend (list rootdir) revision revision limit (when with-diff 'with-diff)))) ;;;###autoload -- cgit v1.2.3 From a8de88e3300464eb382a65ea96da69f23d21ead2 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sat, 4 Sep 2021 11:14:12 +0200 Subject: Allow killing the diff buffer after `C-x v u' * doc/emacs/maintaining.texi (VC Undo): Document this. * lisp/vc/vc.el (vc-revert-show-diff): Allow a `kill' value. (vc-revert): Use it (bug#16902). --- doc/emacs/maintaining.texi | 18 +++++++++++------- etc/NEWS | 5 +++++ lisp/vc/vc.el | 6 ++++-- 3 files changed, 20 insertions(+), 9 deletions(-) (limited to 'lisp/vc/vc.el') diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 008639d1a9a..d17c6d3e757 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1136,13 +1136,17 @@ Revert the work file(s) in the current VC fileset to the last revision @findex vc-revert @vindex vc-revert-show-diff If you want to discard all the changes you have made to the current -VC fileset, type @kbd{C-x v u} (@code{vc-revert}). This shows -you a diff between the work file(s) and the revision from which you -started editing, and asks for confirmation for discarding the changes. -If you agree, the fileset is reverted. If you don't want @kbd{C-x v -u} to show a diff, set the variable @code{vc-revert-show-diff} to -@code{nil} (you can still view the diff directly with @kbd{C-x v =}; -@pxref{Old Revisions}). +VC fileset, type @kbd{C-x v u} (@code{vc-revert}). This will ask you +for confirmation before discarding the changes. If you agree, the +fileset is reverted. + + If @code{vc-revert-show-diff} is non-@code{nil}, this command will +show you a diff between the work file(s) and the revision from which +you started editing. Afterwards, the diff buffer will either be +killed (if this variable is @code{kill}), or the buffer will be buried +(any other non-@code{nil} value). If you don't want @kbd{C-x v u} to +show a diff, set this variable to @code{nil} (you can still view the +diff directly with @kbd{C-x v =}; @pxref{Old Revisions}). On locking-based version control systems, @kbd{C-x v u} leaves files unlocked; you must lock again to resume editing. You can also use diff --git a/etc/NEWS b/etc/NEWS index ec81541e655..506eaab0fc0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -997,6 +997,11 @@ keys, add the following to your init file: ** Change Logs and VC ++++ +*** 'vc-revert-show-diff' now has a third possible value: 'kill'. +If this variable is 'kill', then the diff buffer will be killed after +the 'vc-revert' action instead of buried. + *** More VC commands can be used from non-file buffers. The relevant commands are those that don't change the VC state. The non-file buffers which can use VC commands are those that have diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 8036be390a9..f6ae27075f3 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -860,7 +860,9 @@ See `run-hooks'." (defcustom vc-revert-show-diff t "If non-nil, `vc-revert' shows a `vc-diff' buffer before querying." - :type 'boolean + :type '(choice (const :tag "Show and bury afterwards" t) + (const :tag "Show and kill afterwards" kill) + (const :tag "Don't show" nil)) :version "24.1") ;; Header-insertion hair @@ -2757,7 +2759,7 @@ to the working revision (except for keyword expansion)." (if (= nfiles 1) "" "s")))))) (error "Revert canceled"))) (when diff-buffer - (quit-windows-on diff-buffer))) + (quit-windows-on diff-buffer (eq vc-revert-show-diff 'kill)))) (dolist (file files) (message "Reverting %s..." (vc-delistify files)) (vc-revert-file file) -- cgit v1.2.3 From fc4b956c7cb2fba8ed2a18865a7686c6cfa5d030 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 12 Sep 2021 18:33:03 +0200 Subject: ; Fix symbol quoting typos --- lisp/auth-source-pass.el | 2 +- lisp/calendar/calendar.el | 2 +- lisp/cedet/semantic/complete.el | 4 ++-- lisp/cedet/semantic/dep.el | 2 +- lisp/emacs-lisp/cl-macs.el | 2 +- lisp/emacs-lisp/lisp-mode.el | 2 +- lisp/files-x.el | 2 +- lisp/gnus/gnus.el | 5 +++-- lisp/hexl.el | 2 +- lisp/ldefs-boot.el | 2 +- lisp/obsolete/rcompile.el | 2 +- lisp/org/ob-sql.el | 4 ++-- lisp/org/org-compat.el | 6 +++--- lisp/org/org-list.el | 2 +- lisp/org/org.el | 2 +- lisp/progmodes/cperl-mode.el | 6 +++--- lisp/progmodes/elisp-mode.el | 2 +- lisp/textmodes/rst.el | 8 ++++---- lisp/vc/vc.el | 2 +- test/lisp/auth-source-pass-tests.el | 8 ++++---- test/lisp/progmodes/flymake-tests.el | 2 +- 21 files changed, 35 insertions(+), 34 deletions(-) (limited to 'lisp/vc/vc.el') diff --git a/lisp/auth-source-pass.el b/lisp/auth-source-pass.el index 914f8d2f1bf..162a3ec23c2 100644 --- a/lisp/auth-source-pass.el +++ b/lisp/auth-source-pass.el @@ -176,7 +176,7 @@ CONTENTS is the contents of a password-store formatted file." lines)))) (defun auth-source-pass--do-debug (&rest msg) - "Call `auth-source-do-debug` with MSG and a prefix." + "Call `auth-source-do-debug' with MSG and a prefix." (apply #'auth-source-do-debug (cons (concat "auth-source-pass: " (car msg)) (cdr msg)))) diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 7c929ebed0d..fd97192c466 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -119,7 +119,7 @@ ;; Calendar has historically relied heavily on dynamic scoping. ;; Concretely, this manifests in the use of references to let-bound variables ;; in Custom vars as well as code in diary files. -;; `eval` is hence the core of the culprit. It's used on: +;; `eval' is hence the core of the culprit. It's used on: ;; - calendar-date-display-form ;; - calendar-time-display-form ;; - calendar-chinese-time-zone diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el index d6ef7960473..5d34b308d0a 100644 --- a/lisp/cedet/semantic/complete.el +++ b/lisp/cedet/semantic/complete.el @@ -198,7 +198,7 @@ Argument COLLECTOR is an object which can be used to calculate a list of possible hits. See `semantic-completion-collector-engine' for details on COLLECTOR. Argument DISPLAYER is an object used to display a list of possible -completions for a given prefix. See`semantic-completion-display-engine' +completions for a given prefix. See `semantic-completion-display-engine' for details on DISPLAYER. PROMPT is a string to prompt with. DEFAULT-TAG is a semantic tag or string to use as the default value. @@ -746,7 +746,7 @@ Argument COLLECTOR is an object which can be used to calculate a list of possible hits. See `semantic-completion-collector-engine' for details on COLLECTOR. Argument DISPLAYER is an object used to display a list of possible -completions for a given prefix. See`semantic-completion-display-engine' +completions for a given prefix. See `semantic-completion-display-engine' for details on DISPLAYER. BUFFER is the buffer in which completion will take place. START is a location for the start of the full symbol. diff --git a/lisp/cedet/semantic/dep.el b/lisp/cedet/semantic/dep.el index efebe21a945..0694b9c2329 100644 --- a/lisp/cedet/semantic/dep.el +++ b/lisp/cedet/semantic/dep.el @@ -133,7 +133,7 @@ Changes made by this function are not persistent." ;;;###autoload (defun semantic-remove-system-include (dir &optional mode) "Add a system include DIR to path for MODE. -Modifies a mode-local version of`semantic-dependency-system-include-path'. +Modifies a mode-local version of `semantic-dependency-system-include-path'. Changes made by this function are not persistent." (interactive (list diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 4ea583d28f1..16308b3a595 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -3277,7 +3277,7 @@ the form NAME which is a shorthand for (NAME NAME)." (defun cl-struct-sequence-type (struct-type) "Return the sequence used to build STRUCT-TYPE. STRUCT-TYPE is a symbol naming a struct type. Return `record', -`vector`, or `list' if STRUCT-TYPE is a struct type, nil otherwise." +`vector', or `list' if STRUCT-TYPE is a struct type, nil otherwise." (declare (side-effect-free t) (pure t)) (cl--struct-class-type (cl--struct-get-class struct-type))) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 51fb88502ab..677da81144f 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -624,7 +624,7 @@ Value for `adaptive-fill-function'." (if (looking-at "\\s-+\"[^\n\"]+\"\\s-*$") "")) ;; Maybe this should be discouraged/obsoleted and users should be -;; encouraged to use `lisp-data-mode` instead. +;; encouraged to use `lisp-data-mode' instead. (defun lisp-mode-variables (&optional lisp-syntax keywords-case-insensitive elisp) "Common initialization routine for lisp modes. diff --git a/lisp/files-x.el b/lisp/files-x.el index 9e1954256a6..c7cc076f844 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -673,7 +673,7 @@ in order." (defun hack-connection-local-variables (criteria) "Read connection-local variables according to CRITERIA. Store the connection-local variables in buffer local -variable`connection-local-variables-alist'. +variable `connection-local-variables-alist'. This does nothing if `enable-connection-local-variables' is nil." (when enable-connection-local-variables diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index d52bd26a2cb..5009507208e 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -2140,8 +2140,9 @@ instance, to switch off all visual things except menus, you can say: Valid elements include `summary-highlight', `group-highlight', `article-highlight', `mouse-face', `summary-menu', `group-menu', -`article-menu', `tree-highlight', `menu', `highlight', `browse-menu', -`server-menu', `page-marker', `tree-menu', `binary-menu', and`pick-menu'." +`article-menu', `tree-highlight', `menu', `highlight', +`browse-menu', `server-menu', `page-marker', `tree-menu', +`binary-menu', and `pick-menu'." :group 'gnus-meta :group 'gnus-visual :type '(set (const summary-highlight) diff --git a/lisp/hexl.el b/lisp/hexl.el index 8bfc1fb89e4..f236498288e 100644 --- a/lisp/hexl.el +++ b/lisp/hexl.el @@ -93,7 +93,7 @@ as that will override any bit grouping options set here." "Face used in address area of Hexl mode buffer.") (defface hexl-ascii-region - ;; Copied from `header-line`. We used to inherit from it, but that + ;; Copied from `header-line'. We used to inherit from it, but that ;; looks awful when the headerline is given a variable-pitch font or ;; (even worse) a 3D look. '((((class color grayscale) (background light)) diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 542cbef9f57..586e4233c51 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -8735,7 +8735,7 @@ BODY contains code to execute each time the mode is enabled or disabled. It is executed after toggling the mode, and before running MODE-hook. Before the actual body code, you can write keyword arguments, i.e. alternating keywords and values. If you provide BODY, then you must - provide at least one keyword argument (e.g. `:lighter nil`). + provide at least one keyword argument (e.g. `:lighter nil'). The following special keywords are supported (other keywords are passed to `defcustom' if the minor mode is global): diff --git a/lisp/obsolete/rcompile.el b/lisp/obsolete/rcompile.el index d7020f0d074..ff7d1dcdcea 100644 --- a/lisp/obsolete/rcompile.el +++ b/lisp/obsolete/rcompile.el @@ -108,7 +108,7 @@ nil means run no commands." ;;;; entry point -;; We use the Tramp internal function`tramp-make-tramp-file-name'. +;; We use the Tramp internal function `tramp-make-tramp-file-name'. ;; Better would be, if there are functions to provide user, host and ;; localname of a remote filename, independent of Tramp's implementation. ;; The function calls are wrapped by `funcall' in order to pacify the byte diff --git a/lisp/org/ob-sql.el b/lisp/org/ob-sql.el index 947acef1b27..0a08925d4f6 100644 --- a/lisp/org/ob-sql.el +++ b/lisp/org/ob-sql.el @@ -189,8 +189,8 @@ Otherwise, use Emacs' standard conversion function." "Return database connection parameter NAME. Given a parameter NAME, if :dbconnection is defined in PARAMS then look for the parameter into the corresponding connection -defined in `sql-connection-alist`, otherwise look into PARAMS. -Look `sql-connection-alist` (part of SQL mode) for how to define +defined in `sql-connection-alist', otherwise look into PARAMS. +See `sql-connection-alist' (part of SQL mode) for how to define database connections." (if (assq :dbconnection params) (let* ((dbconnection (cdr (assq :dbconnection params))) diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el index b68e5b58fca..82611d907af 100644 --- a/lisp/org/org-compat.el +++ b/lisp/org/org-compat.el @@ -179,9 +179,9 @@ This is a floating point number if the size is too large for an integer." Case is significant." (string< s1 s2))) -;; The time- functions below translate nil to `current-time` and -;; accept an integer as of Emacs 25. `decode-time` and -;; `format-time-string` accept nil on Emacs 24 but don't accept an +;; The time- functions below translate nil to `current-time' and +;; accept an integer as of Emacs 25. `decode-time' and +;; `format-time-string' accept nil on Emacs 24 but don't accept an ;; integer until Emacs 25. (if (< emacs-major-version 25) (let ((convert diff --git a/lisp/org/org-list.el b/lisp/org/org-list.el index f97164ee33b..b26e47aba90 100644 --- a/lisp/org/org-list.el +++ b/lisp/org/org-list.el @@ -3355,7 +3355,7 @@ Valid parameters are: (when (and backend (symbolp backend) (not (org-export-get-backend backend))) (user-error "Unknown :backend value")) (unless backend (require 'ox-org)) - ;; When`:raw' property has a non-nil value, turn all objects back + ;; When `:raw' property has a non-nil value, turn all objects back ;; into Org syntax. (when (and backend (plist-get params :raw)) (org-element-map data org-element-all-objects diff --git a/lisp/org/org.el b/lisp/org/org.el index f560c65dc4f..dc56948b533 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -19654,7 +19654,7 @@ When BLOCK-REGEXP is non-nil, use this regexp to find blocks." ;; Org still relies on `comment-dwim', but cannot trust ;; `comment-only-p'. So, `comment-region-function' and ;; `uncomment-region-function' both point -;; to`org-comment-or-uncomment-region'. Eventually, +;; to `org-comment-or-uncomment-region'. Eventually, ;; `org-insert-comment' takes care of insertion of comments at the ;; beginning of line. diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 4f3ca924dd9..165834cc20f 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1304,7 +1304,7 @@ package name and for the version.") (regexp ,cperl--version-regexp))) ,cperl--ws*-rx (group-n 3 (or ";" "{"))) - "A regular expression to collect package names for `imenu`. + "A regular expression to collect package names for `imenu'. Catches \"package NAME;\", \"package NAME VERSION;\", \"package NAME BLOCK\" and \"package NAME VERSION BLOCK.\" Contains three groups: One for the keyword \"package\", one for the package @@ -1345,7 +1345,7 @@ heading text.") `(or ,cperl--package-for-imenu-rx ,cperl--sub-name-for-imenu-rx ,cperl--pod-heading-rx) - "A regular expression to collect stuff that goes into the `imenu` index. + "A regular expression to collect stuff that goes into the `imenu' index. Covers packages, subroutines, and POD headings.") ;; end of eval-and-compiled stuff @@ -5454,7 +5454,7 @@ indentation and initial hashes. Behaves usually outside of comment." (defvar cperl-imenu-pod-keywords '("=head")) (defun cperl-imenu--create-perl-index () - "Implement `imenu-create-index-function` for CPerl mode. + "Implement `imenu-create-index-function' for CPerl mode. This function relies on syntaxification to exclude lines which look like declarations but actually are part of a string, a comment, or POD." diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 483bf9d2edd..22150c7d825 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -883,7 +883,7 @@ there are no matches for variables." (secondary-xrefs nil)) ; other xrefs (let ((temp elisp-xref-find-def-functions)) - ;; FIXME: The `elisp-xref-find-def-functions` function interface does + ;; FIXME: The `elisp-xref-find-def-functions' function interface does ;; not allow for namespace filtering so we tacitly assume they all match. (while (and (null xrefs) temp) diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 1471be0ecd6..46654b6076d 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -2444,7 +2444,7 @@ PREFER-ROMAN roman numbering is preferred over using letters." tab)) ;; FIXME: At least the continuation may be folded into -;; `newline-and-indent`. However, this may not be wanted by everyone so +;; `newline-and-indent'. However, this may not be wanted by everyone so ;; it should be possible to switch this off. (defun rst-insert-list (&optional prefer-roman) ;; testcover: ok. @@ -2915,7 +2915,7 @@ error if there is no working link at the given position." (pop-to-buffer (marker-buffer mrkr)) (goto-char mrkr) ;; FIXME: Should be a customizable number of lines from beginning or end of - ;; window just like the argument to `recenter`. It would be ideal if + ;; window just like the argument to `recenter'. It would be ideal if ;; the adornment is always completely visible. (recenter 5))) @@ -2995,7 +2995,7 @@ burying it." (define-derived-mode rst-toc-mode special-mode "ReST-TOC" "Major mode for output from \\[rst-toc], the table-of-contents for the document. \\{rst-toc-mode-map}" - ;; FIXME: `revert-buffer-function` must be defined so `revert-buffer` works + ;; FIXME: `revert-buffer-function' must be defined so `revert-buffer' works ;; as expected for a special mode. In particular the referred buffer ;; needs to be rescanned and the TOC must be updated accordingly. ;; FIXME: Should contain the name of the buffer this is the toc of. @@ -3217,7 +3217,7 @@ Return a list of tabs sorted by likeliness to continue writing like `rst-line-tabs'. Nearer lines have generally a higher likeliness than farther lines. Return nil if no tab is found in the text above." - ;; FIXME: See test `indent-for-tab-command-BUGS`. + ;; FIXME: See test `indent-for-tab-command-BUGS'. (save-excursion (goto-char pt) (let (leftmost ; Leftmost column found so far. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index f6ae27075f3..4fcba65ab4d 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -515,7 +515,7 @@ ;; ;; Turn on the mode used for editing the check in log. This ;; defaults to `log-edit-mode'. If changed, it should use a mode -;; derived from`log-edit-mode'. +;; derived from `log-edit-mode'. ;; ;; - check-headers () ;; diff --git a/test/lisp/auth-source-pass-tests.el b/test/lisp/auth-source-pass-tests.el index d050ac5b695..a0a97eca5eb 100644 --- a/test/lisp/auth-source-pass-tests.el +++ b/test/lisp/auth-source-pass-tests.el @@ -56,10 +56,10 @@ ("key2" . "please: keep my space after colon")))))) (defvar auth-source-pass--debug-log nil - "Contains a list of all messages passed to `auth-source-do-debug`.") + "Contains a list of all messages passed to `auth-source-do-debug'.") (defun auth-source-pass--have-message-matching (regexp) - "Return non-nil iff at least one `auth-source-do-debug` match REGEXP." + "Return non-nil iff at least one `auth-source-do-debug' match REGEXP." (seq-find (lambda (message) (string-match regexp message)) auth-source-pass--debug-log)) @@ -75,8 +75,8 @@ REGEXP is the same as in `auth-source-pass--have-message-matching'." (put #'auth-source-pass--have-message-matching 'ert-explainer #'auth-source-pass--explain--have-message-matching) (defun auth-source-pass--debug (&rest msg) - "Format MSG and add that to `auth-source-pass--debug-log`. -This function is intended to be set to `auth-source-debug`." + "Format MSG and add that to `auth-source-pass--debug-log'. +This function is intended to be set to `auth-source-debug'." (add-to-list 'auth-source-pass--debug-log (apply #'format msg) t)) (defvar auth-source-pass--parse-log nil) diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el index bda1b663c22..45e0c435984 100644 --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el @@ -60,7 +60,7 @@ (cl-defun flymake-tests--call-with-fixture (fn file &key (severity-predicate nil sev-pred-supplied-p)) - "Call FN after flymake setup in FILE, using `flymake-proc`. + "Call FN after flymake setup in FILE, using `flymake-proc'. SEVERITY-PREDICATE is used to setup `flymake-proc-diagnostic-type-pred'" (let* ((file (expand-file-name file flymake-tests-data-directory)) -- cgit v1.2.3 From 25ebb9374bdadf66153727831fc7ff131c8cf299 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 14 Sep 2021 07:55:56 +0200 Subject: ; More minor docfixes found by checkdoc --- lisp/emacs-lisp/advice.el | 112 +++++++++++++++++++-------------------- lisp/emacs-lisp/bytecomp.el | 8 +-- lisp/emacs-lisp/cconv.el | 2 +- lisp/emacs-lisp/check-declare.el | 6 +-- lisp/emacs-lisp/cl-indent.el | 4 +- lisp/emacs-lisp/copyright.el | 4 +- lisp/emacs-lisp/debug.el | 2 +- lisp/emacs-lisp/disass.el | 4 +- lisp/emacs-lisp/easy-mmode.el | 4 +- lisp/emacs-lisp/eieio-custom.el | 2 +- lisp/emacs-lisp/eldoc.el | 2 +- lisp/emacs-lisp/elp.el | 4 +- lisp/emacs-lisp/ewoc.el | 6 +-- lisp/emacs-lisp/find-func.el | 2 +- lisp/emacs-lisp/generator.el | 6 +-- lisp/emacs-lisp/let-alist.el | 4 +- lisp/emacs-lisp/lisp-mode.el | 2 +- lisp/emacs-lisp/macroexp.el | 8 +-- lisp/emacs-lisp/nadvice.el | 2 +- lisp/emacs-lisp/package-x.el | 2 +- lisp/emacs-lisp/pcase.el | 2 +- lisp/emacs-lisp/shadow.el | 10 ++-- lisp/emacs-lisp/testcover.el | 36 +++++++------ lisp/emacs-lisp/thunk.el | 2 +- lisp/eshell/em-basic.el | 2 +- lisp/eshell/em-glob.el | 4 +- lisp/eshell/em-hist.el | 2 +- lisp/eshell/em-ls.el | 14 ++--- lisp/eshell/em-pred.el | 2 +- lisp/eshell/em-rebind.el | 2 +- lisp/eshell/em-smart.el | 4 +- lisp/eshell/esh-arg.el | 2 +- lisp/eshell/esh-cmd.el | 4 +- lisp/eshell/esh-ext.el | 2 +- lisp/eshell/esh-io.el | 2 +- lisp/eshell/esh-mode.el | 2 +- lisp/eshell/eshell.el | 10 ++-- lisp/gnus/gnus-msg.el | 2 +- lisp/gnus/message.el | 2 +- lisp/info-xref.el | 8 +-- lisp/net/dictionary.el | 12 ++--- lisp/org/ol.el | 2 +- lisp/so-long.el | 2 +- lisp/svg.el | 2 +- lisp/vc/compare-w.el | 2 +- lisp/vc/diff-mode.el | 2 +- lisp/vc/ediff-diff.el | 7 ++- lisp/vc/ediff-help.el | 1 - lisp/vc/ediff-init.el | 14 ++--- lisp/vc/ediff-merg.el | 5 +- lisp/vc/ediff-mult.el | 5 +- lisp/vc/ediff.el | 2 +- lisp/vc/log-edit.el | 4 +- lisp/vc/log-view.el | 2 +- lisp/vc/pcvs.el | 2 +- lisp/vc/vc-annotate.el | 2 +- lisp/vc/vc-bzr.el | 2 +- lisp/vc/vc-dav.el | 2 +- lisp/vc/vc-dir.el | 20 +++---- lisp/vc/vc-dispatcher.el | 9 ++-- lisp/vc/vc-git.el | 2 +- lisp/vc/vc-hg.el | 10 ++-- lisp/vc/vc-hooks.el | 4 +- lisp/vc/vc-rcs.el | 16 +++--- lisp/vc/vc-sccs.el | 6 +-- lisp/vc/vc-src.el | 11 ++-- lisp/vc/vc-svn.el | 2 +- lisp/vc/vc.el | 4 +- lisp/x-dnd.el | 2 +- 69 files changed, 228 insertions(+), 228 deletions(-) (limited to 'lisp/vc/vc.el') diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index 8e8d0e22651..1f276c7f7a3 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 47b3c82456c..776e84dfebb 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 3abbf716875..ba29e4ec85e 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 bec4ad92503..83a9d3ea6ae 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 c88e15d5a8b..9d8aae28441 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 d2e4891acee..9da370a725d 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 f76ae3fe69f..8da9fb76821 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 712fa511707..6c019e7387c 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 d9b5ea74f6e..dfbae746cc1 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 d7d078b2d94..4813ce8c33f 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 cec89cf3bc5..21f262adc6e 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 c2b026dc822..8c33b7c9948 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 d3ace97945f..ca29b6d8c9b 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 7bc3e6b25ff..4bbcf453569 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 4ae20ba4205..2acf939bed7 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 433b37d7923..2d634b7b037 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 9bbc7f8bba2..42e943a60df 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 61c1ea490f0..1e4fdd126cb 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 41a9c7242b3..a2a5aaed046 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 2e327d16de4..0175857b7f5 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 63b187be02b..c6173c710f7 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 02f2ad3d816..e2a24e9949c 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 e75f15140aa..f5a624bb61b 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 7e349d22a49..6f2e42af50b 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 64fc7e7f03b..af5550b11df 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 e36f2d0c7fe..ba12e43a3c2 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 d82946add00..aa158fa24cc 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 3d7c43b404b..57146bb126d 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 def52f42e55..639098a9b9e 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 fa61fffaec8..d70444ea109 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 d1c83db188a..dffc8f804b7 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 3cf80e45187..1990c0cfa55 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 90a8f85665a..1aac95e0b4f 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 9930e0884cb..fa149dd46e3 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 0e98aa0049e..0e6121031dc 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 f9dbce9770d..a9775b7c568 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 101ac860346..35153675faa 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 ef89e6e9fcb..863b6aa44e4 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 bff1b2a60d9..4a754b98569 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 e2e3e30ca21..f791927ee1d 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 5a6f3b555d2..9353b4d3759 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 38e2dd6a02c..4b7f2081a8a 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 7bf15e85dad..c39c3ecaf3f 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 05accf4f13f..3c7f0550314 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 4c1d9eaad55..7c2e125831e 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 eeb32f8fe50..0852f8790e9 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 0965e888f06..0f90bef2c5c 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 a5bb953b6d4..2f8f596ed17 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 96fa0633e84..5afc83d9e21 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 ad4ef473f84..2bdce9e33c7 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 8e88b60a0bd..20ff8f9f04d 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 3536cbf7381..e884ed8c516 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 46e9c97eb0a..e0a87ba941c 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 e8930979b5d..bc66191f333 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 42f531e4f75..23f0902b38c 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 07b2800c2dc..82531f742e4 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 5144b5d0bbb..bfe3293e45a 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 5fd8d8e5036..1785440d538 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 eb8cf8192c1..26cea0001cc 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 c29458620e9..cd23bcce941 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 4b309c338a0..ec572e96a57 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 8a9a6b85830..1e8d6738523 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 4b3c829a2c6..06123106401 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 0b0c71b1ff9..e38469ba9f0 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 92cce5f13a8..bcbb87eba8e 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 faba5bce2b7..b408b7de760 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 544a6c769fc..e14519cc20e 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 4fcba65ab4d..512f07d2f63 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 23e8001c013..2819c6163d0 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)) -- cgit v1.2.3 From 2e5740894a78dba4b19a80b19e54cabfa7cdb767 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Fri, 17 Sep 2021 02:01:09 +0300 Subject: Reuse vc-read-backend more * lisp/vc/vc.el (vc-read-backend): New optional arguments. (vc-create-repo): Use it here. (vc-switch-backend): And here (bug#50603). --- lisp/vc/vc.el | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'lisp/vc/vc.el') diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 512f07d2f63..1d4a2e8113a 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1157,10 +1157,12 @@ BEWARE: this function may change the current buffer." (eq p q) (and (member p '(edited added removed)) (member q '(edited added removed))))) -(defun vc-read-backend (prompt) - (intern - (completing-read prompt (mapcar #'symbol-name vc-handled-backends) - nil 'require-match))) +(defun vc-read-backend (prompt &optional backends default) + (let ((backends (or backends vc-handled-backends)) + (completion-ignore-case t)) + (intern + (completing-read prompt (mapcar #'symbol-name backends) + nil 'require-match nil nil default)))) ;; Here's the major entry point. @@ -1369,14 +1371,7 @@ For old-style locking-based version control systems, like RCS: (defun vc-create-repo (backend) "Create an empty repository in the current directory." - (interactive - (list - (intern - (upcase - (completing-read - "Create repository for: " - (mapcar (lambda (b) (list (downcase (symbol-name b)))) vc-handled-backends) - nil t))))) + (interactive (list (vc-read-backend "Create repository for: "))) (vc-call-backend backend 'create-repo)) ;;;###autoload @@ -2884,12 +2879,7 @@ To get a prompt, use a prefix argument." (cond ((null others) (error "No other backend to switch to")) (current-prefix-arg - (intern - (upcase - (completing-read - (format "Switch to backend [%s]: " def) - (mapcar (lambda (b) (list (downcase (symbol-name b)))) backends) - nil t nil nil (downcase (symbol-name def)))))) + (vc-read-backend "Switch to backend: " backends (symbol-name def))) (t def)))))) (unless (eq backend (vc-backend file)) (vc-file-clearprops file) -- cgit v1.2.3 From 7e27cb6e729d4a3cc3282db3b25f6d104ae17f0a Mon Sep 17 00:00:00 2001 From: "Alfred M. Szmidt" Date: Fri, 17 Sep 2021 02:03:22 +0300 Subject: * lisp/vc/vc.el: API doc fixes. --- lisp/vc/vc.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/vc/vc.el') diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 1d4a2e8113a..87679691637 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -431,7 +431,7 @@ ;; and displays a file name and a revision, then return a cons ;; (REVISION . FILENAME). ;; -;; - region-history (FILE BUFFER LFROM LTO) +;; - region-history (file buffer lfrom lto) ;; ;; Insert into BUFFER the history (log comments and diffs) of the content of ;; FILE between lines LFROM and LTO. This is typically done asynchronously. @@ -496,7 +496,7 @@ ;; `.bzrignore'. The default behavior is to read the contents of ;; the file returned by the `find-ignore-file' function. ;; -;; - find-ignore-file +;; - find-ignore-file (file) ;; ;; Return the ignore file that controls FILE, e.g. `.gitignore' or ;; `.bzrignore'. -- cgit v1.2.3 From f6f87917fc5eb151aff0facc390983012644a681 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Sat, 25 Sep 2021 03:38:43 +0200 Subject: Make 'C-u C-x v v' handle unregistered files. * lisp/vc/vc.el (vc-next-action): Make 'C-u C-x v v' handle unregistered files (bug#50602). --- lisp/vc/vc.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lisp/vc/vc.el') diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 87679691637..7d3b0f56f60 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1216,7 +1216,11 @@ For old-style locking-based version control systems, like RCS: ((eq state 'ignored) (error "Fileset files are ignored by the version-control system")) ((or (null state) (eq state 'unregistered)) - (vc-register vc-fileset)) + (cond (verbose + (let ((backend (vc-read-backend "Backend to register to: "))) + (vc-register (cons backend (cdr vc-fileset))))) + (t + (vc-register vc-fileset)))) ;; Files are up-to-date, or need a merge and user specified a revision ((or (eq state 'up-to-date) (and verbose (eq state 'needs-update))) (cond -- cgit v1.2.3 From c78e16962e63895d340f80cf245fad568a7da770 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 24 Sep 2021 14:46:56 +0200 Subject: ; Adjust overly long docstrings to fit 80 characters --- lisp/array.el | 5 +++-- lisp/cedet/data-debug.el | 3 ++- lisp/cedet/semantic/analyze/complete.el | 3 ++- lisp/cedet/semantic/db-find.el | 2 +- lisp/cedet/semantic/tag-ls.el | 19 ++++++++++++++----- lisp/emacs-lisp/eieio-core.el | 2 +- lisp/emacs-lisp/seq.el | 4 ++-- lisp/emulation/viper-cmd.el | 3 ++- lisp/emulation/viper-init.el | 3 ++- lisp/erc/erc-backend.el | 3 ++- lisp/erc/erc-dcc.el | 5 ++--- lisp/frameset.el | 3 ++- lisp/gnus/gnus-agent.el | 4 ++-- lisp/gnus/gnus-bookmark.el | 4 +++- lisp/gnus/gnus-fun.el | 3 ++- lisp/gnus/gnus-group.el | 6 ++++-- lisp/gnus/gnus-score.el | 4 +++- lisp/gnus/gnus-sum.el | 9 +++++---- lisp/gnus/nnvirtual.el | 8 +++++--- lisp/net/dbus.el | 3 ++- lisp/net/dictionary.el | 2 +- lisp/net/eudc.el | 5 +++-- lisp/net/ntlm.el | 4 ++-- lisp/net/tramp-gvfs.el | 11 +++++++---- lisp/net/tramp-sh.el | 2 +- lisp/org/ob-table.el | 3 ++- lisp/org/org-agenda.el | 3 ++- lisp/org/org-protocol.el | 15 ++++++++------- lisp/play/doctor.el | 4 ++-- lisp/progmodes/cc-cmds.el | 2 +- lisp/progmodes/flymake-proc.el | 7 ++++--- lisp/progmodes/idlwave.el | 3 ++- lisp/progmodes/prolog.el | 3 ++- lisp/progmodes/verilog-mode.el | 14 ++++++++++---- lisp/tab-bar.el | 7 ++++--- lisp/textmodes/texinfo.el | 3 ++- lisp/vc/ediff-merg.el | 3 ++- lisp/vc/ediff.el | 10 ++++++---- lisp/vc/vc-annotate.el | 3 ++- lisp/vc/vc-dir.el | 3 ++- lisp/vc/vc-dispatcher.el | 2 +- lisp/vc/vc.el | 4 ++-- lisp/whitespace.el | 4 ++-- test/lisp/auth-source-pass-tests.el | 6 ++++-- test/lisp/international/ucs-normalize-tests.el | 6 +++--- 45 files changed, 138 insertions(+), 87 deletions(-) (limited to 'lisp/vc/vc.el') diff --git a/lisp/array.el b/lisp/array.el index 6632da55dd4..2c9a6815d25 100644 --- a/lisp/array.el +++ b/lisp/array.el @@ -805,8 +805,9 @@ NOT recognized as integers or real numbers. The array MUST reside at the top of the buffer. TABs are not respected, and may be converted into spaces at any time. -Setting the variable `array-respect-tabs' to non-nil will prevent TAB conversion, -but will cause many functions to give errors if they encounter one. +Setting the variable `array-respect-tabs' to non-nil will prevent +TAB conversion, but will cause many functions to give errors if +they encounter one. Upon entering array mode, you will be prompted for the values of several variables. Others will be calculated based on the values you diff --git a/lisp/cedet/data-debug.el b/lisp/cedet/data-debug.el index 428848be04d..8f40a4db79d 100644 --- a/lisp/cedet/data-debug.el +++ b/lisp/cedet/data-debug.el @@ -413,7 +413,8 @@ PREBUTTONTEXT is some text between prefix and the stuff list button." ) (defun data-debug-insert-hash-table-button (hash-table prefix prebuttontext) - "Insert HASH-TABLE as expandable button with recursive prefix PREFIX and PREBUTTONTEXT in front of the button text." + "Insert HASH-TABLE as expandable button with recursive prefix PREFIX and +PREBUTTONTEXT in front of the button text." (let ((string (propertize (format "%s" hash-table) 'face 'font-lock-keyword-face))) (insert (propertize diff --git a/lisp/cedet/semantic/analyze/complete.el b/lisp/cedet/semantic/analyze/complete.el index 1e8cd9af088..5c3228ae166 100644 --- a/lisp/cedet/semantic/analyze/complete.el +++ b/lisp/cedet/semantic/analyze/complete.el @@ -70,7 +70,8 @@ context. Passing in a context is useful if the caller also needs to access parts of the analysis. The remaining FLAGS arguments are passed to the mode specific completion engine. Bad flags should be ignored by modes that don't use them. -See `semantic-analyze-possible-completions-default' for details on the default FLAGS. +See `semantic-analyze-possible-completions-default' for details +on the default FLAGS. Completions run through the following filters: * Elements currently in scope diff --git a/lisp/cedet/semantic/db-find.el b/lisp/cedet/semantic/db-find.el index 61baaa020f8..e6a7879775e 100644 --- a/lisp/cedet/semantic/db-find.el +++ b/lisp/cedet/semantic/db-find.el @@ -914,7 +914,7 @@ but should be good enough for debugging assertions." (null (car (cdr (car resultp))))))) (defun semanticdb-find-result-prin1-to-string (result) - "Presuming RESULT satisfies `semanticdb-find-results-p', provide a short PRIN1 output." + "If RESULT satisfies `semanticdb-find-results-p', provide a short PRIN1 output." (if (< (length result) 2) (concat "# (gnus-thread-highest-number h1) (gnus-thread-highest-number h2))) (defun gnus-thread-highest-number (thread) @@ -5187,7 +5188,7 @@ Unscored articles will be counted as having a score of zero." (gnus-article-sort-by-date h1 h2)) (defun gnus-thread-sort-by-most-recent-date (h1 h2) - "Sort threads such that the thread with the most recently dated article comes first." + "Sort threads such that the thread with most recently dated article is first." (> (gnus-thread-latest-date h1) (gnus-thread-latest-date h2))) (defsubst gnus-article-sort-by-newsgroups (h1 h2) @@ -5651,7 +5652,7 @@ or a straight list of headers." gnus-list-identifiers))) (defun gnus-summary-remove-list-identifiers () - "Remove list identifiers in `gnus-list-identifiers' from articles in the current group." + "Remove identifiers in `gnus-list-identifiers' from articles in current group." (let ((regexp (gnus-group-get-list-identifiers gnus-newsgroup-name)) changed subject) (when regexp diff --git a/lisp/gnus/nnvirtual.el b/lisp/gnus/nnvirtual.el index 03a0ff296f2..4136392c825 100644 --- a/lisp/gnus/nnvirtual.el +++ b/lisp/gnus/nnvirtual.el @@ -382,7 +382,8 @@ It is computed from the marks of individual component groups.") (defun nnvirtual-update-xref-header (group article prefix sysname) - "Edit current NOV header in current buffer to have an xref to the component group, and also server prefix any existing xref lines." + "Edit current NOV header in current buffer to have an xref to the component +group, and also server prefix any existing xref lines." ;; Move to beginning of Xref field, creating a slot if needed. (beginning-of-line) (looking-at @@ -569,7 +570,8 @@ If UPDATE-P is not nil, call gnus-group-update-group on the components." ;; unique reverse mapping. (defun nnvirtual-map-article (article) - "Return a cons of the component group and article corresponding to the given virtual ARTICLE." + "Return a cons of the component group and article corresponding to the given +virtual ARTICLE." (let ((table nnvirtual-mapping-table) entry group-pos) (while (and table @@ -590,7 +592,7 @@ If UPDATE-P is not nil, call gnus-group-update-group on the components." (defun nnvirtual-reverse-map-article (group article) - "Return the virtual article number corresponding to the given component GROUP and ARTICLE." + "Return virtual article number corresponding to component GROUP and ARTICLE." (when (numberp article) (let ((table nnvirtual-mapping-table) (group-pos 0) diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index 4116d293e1b..560ece67517 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el @@ -2073,7 +2073,8 @@ either a method name, a signal name, or an error name." (goto-char point))) (defun dbus-monitor-handler (&rest _args) - "Default handler for the \"org.freedesktop.DBus.Monitoring.BecomeMonitor\" interface. + "Default handler for the \"Monitoring.BecomeMonitor\" interface. +Its full name is \"org.freedesktop.DBus.Monitoring.BecomeMonitor\". It will be applied for all objects created by `dbus-register-monitor' which don't declare an own handler. The printed timestamps do not reflect the time the D-Bus message has passed the D-Bus diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index 85467cd7828..09d250fd7bf 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -1049,7 +1049,7 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"." 'dictionary-display-match-result))) (defun dictionary-do-matching (word dictionary strategy function) - "Find matches for WORD with STRATEGY in DICTIONARY and display them with FUNCTION." + "Search 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/net/eudc.el b/lisp/net/eudc.el index 5c451c6556d..14e5c28b2dc 100644 --- a/lisp/net/eudc.el +++ b/lisp/net/eudc.el @@ -798,8 +798,9 @@ see `eudc-inline-expansion-servers'." "Query the directory server, and return the matching responses. The variable `eudc-inline-query-format' controls how to associate the individual QUERY-WORDS with directory attribute names. -After querying the server for the given string, the expansion specified by -`eudc-inline-expansion-format' is applied to the matches before returning them.inserted in the buffer at point. +After querying the server for the given string, the expansion +specified by `eudc-inline-expansion-format' is applied to the +matches before returning them.inserted in the buffer at point. Multiple servers can be tried with the same query until one finds a match, see `eudc-inline-expansion-servers'." (cond diff --git a/lisp/net/ntlm.el b/lisp/net/ntlm.el index 747a69fb5d4..0e0146df969 100644 --- a/lisp/net/ntlm.el +++ b/lisp/net/ntlm.el @@ -436,7 +436,7 @@ PASSWD is truncated to 14 bytes if longer." (make-string (- 15 len) 0))))) (defun ntlm-smb-owf-encrypt (passwd c8) - "Return response string of 24 bytes long for password string PASSWD based on DES encryption. + "Return response string of 24 bytes long for PASSWD based on DES encryption. PASSWD is of at most 14 bytes long and the challenge string C8 of 8 bytes long." (let* ((len (min (length passwd) 16)) @@ -459,7 +459,7 @@ PASSWD is of at most 14 bytes long and the challenge string C8 of (substring p15 7) t))) (defun ntlm-smb-hash (in key forw) - "Return hash string of length 8 for a string IN of length 8 and a string KEY of length 8. + "Return hash string of length 8 for IN of length 8 and KEY of length 8. FORW is t or nil." (let ((out (make-string 8 0)) (inb (make-string 64 0)) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 5f0e7bcd98c..115d005c0ca 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1833,8 +1833,9 @@ a downcased host name only." result)))) (defun tramp-gvfs-handler-mounted-unmounted (mount-info) - "Signal handler for the \"org.gtk.vfs.MountTracker.mounted\" and \ -\"org.gtk.vfs.MountTracker.unmounted\" signals." + "Signal handler for the gvfs \"mounted\" and \"unmounted\" signals. +Their full names are \"org.gtk.vfs.MountTracker.mounted\" and +\"org.gtk.vfs.MountTracker.unmounted\"." (ignore-errors (let ((signal-name (dbus-event-member-name last-input-event)) (elt mount-info)) @@ -2090,8 +2091,10 @@ It was \"a(say)\", but has changed to \"a{sv})\"." `(:struct ,(tramp-gvfs-dbus-string-to-byte-array mount-pref) ,mount-spec))) (defun tramp-gvfs-handler-volumeadded-volumeremoved (_dbus-name _id volume) - "Signal handler for the \"org.gtk.Private.RemoteVolumeMonitor.VolumeAdded\" \ -and \"org.gtk.Private.RemoteVolumeMonitor.VolumeRemoved\" signals." + "Signal handler for the gvfs \"VolumeAdded\" and \"VolumeRemoved\" signals. +Their full names are +\"org.gtk.Private.RemoteVolumeMonitor.VolumeAdded\" and +\"org.gtk.Private.RemoteVolumeMonitor.VolumeRemoved\"." (ignore-errors (let* ((signal-name (dbus-event-member-name last-input-event)) (uri (url-generic-parse-url (nth 5 volume))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 0fe106684c5..dd92f226897 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1699,7 +1699,7 @@ ID-FORMAT valid values are `string' and `integer'." ;; FIXME: Fix function to work with count parameter. (defun tramp-do-directory-files-and-attributes-with-stat (vec localname &optional id-format) - "Implement `directory-files-and-attributes' for Tramp files using stat(1) command." + "Implement `directory-files-and-attributes' for Tramp files with stat(1) command." (tramp-message vec 5 "directory-files-and-attributes with stat: %s" localname) (tramp-send-command-and-read vec diff --git a/lisp/org/ob-table.el b/lisp/org/ob-table.el index 39a14a25d6c..e081708701d 100644 --- a/lisp/org/ob-table.el +++ b/lisp/org/ob-table.el @@ -78,7 +78,8 @@ So this `org-sbe' construct is the equivalent of the following source code block: - #+begin_src emacs-lisp :var results=source-block(n=val_at_col_2, m=3) :results silent + #+begin_src emacs-lisp :var results=source-block(n=val_at_col_2, m=3) \\ + :results silent results #+end_src diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el index 23c62809a2b..271eac1c30d 100644 --- a/lisp/org/org-agenda.el +++ b/lisp/org/org-agenda.el @@ -1230,7 +1230,8 @@ For example, 9:30am would become 09:30 rather than 9:30." ":" minute ampm))) (defun org-agenda-time-of-day-to-ampm-maybe (time) - "Conditionally convert TIME to AM/PM format based on `org-agenda-timegrid-use-ampm'." + "Conditionally convert TIME to AM/PM format. +This is based on `org-agenda-timegrid-use-ampm'." (if org-agenda-timegrid-use-ampm (org-agenda-time-of-day-to-ampm time) time)) diff --git a/lisp/org/org-protocol.el b/lisp/org/org-protocol.el index 726c1ca2bae..ff8c08d5c5f 100644 --- a/lisp/org/org-protocol.el +++ b/lisp/org/org-protocol.el @@ -178,11 +178,11 @@ Possible properties are: :working-suffix - the replacement for online-suffix :base-url - the base URL, e.g. http://www.example.com/project/ Last slash required. - :working-directory - the local working directory. This is, what base-url will - be replaced with. - :redirects - A list of cons cells, each of which maps a regular - expression to match to a path relative to - :working-directory. + :working-directory - the local working directory. This is what + base-url will be replaced with. + :redirects - A list of cons cells, each of which maps a + regular expression to match to a path relative + to `:working-directory'. Example: @@ -216,8 +216,9 @@ Example: does not include any suffix properties, allowing local source file to be opened as found by OpenGrok. -Consider using the interactive functions `org-protocol-create' and -`org-protocol-create-for-org' to help you filling this variable with valid contents." +Consider using the interactive functions `org-protocol-create' +and `org-protocol-create-for-org' to help you filling this +variable with valid contents." :group 'org-protocol :type 'alist) diff --git a/lisp/play/doctor.el b/lisp/play/doctor.el index b855f7e35a1..33fecaa188a 100644 --- a/lisp/play/doctor.el +++ b/lisp/play/doctor.el @@ -1011,8 +1011,8 @@ Put dialogue in buffer." (defun doctor-subjsearch (sent key type) "Search for the subject of a sentence SENT, looking for the noun closest -to and preceding KEY by at least TYPE words. Set global variable `doctor-subj' to -the subject noun, and return the portion of the sentence following it." +to and preceding KEY by at least TYPE words. Set global variable `doctor-subj' +to the subject noun, and return the portion of the sentence following it." (let ((i (- (length sent) (length (memq key sent)) type))) (while (and (> i -1) (not (doctor-nounp (nth i sent)))) (setq i (1- i))) diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 6c3da667bfc..d40433a9b0d 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -480,7 +480,7 @@ function to control that." ;; This function is only used in XEmacs. (defun c-hungry-delete () - "Delete a non-whitespace char, or all whitespace up to the next non-whitespace char. + "Delete non-whitespace char, or all whitespace up to next non-whitespace char. The direction of deletion depends on the configuration: If the function `delete-forward-p' is defined and returns non-nil, it deletes forward using `c-hungry-delete-forward'. Otherwise it deletes diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el index 27b46a45c50..7f2aa0f469f 100644 --- a/lisp/progmodes/flymake-proc.el +++ b/lisp/progmodes/flymake-proc.el @@ -902,7 +902,7 @@ can also be executed interactively independently of temp-dir)))) (defun flymake-proc--delete-temp-directory (dir-name) - "Attempt to delete temp dir created by `flymake-proc-create-temp-with-folder-structure', do not fail on error." + "Attempt to delete temp dir DIR-NAME, do not fail on error." (let* ((temp-dir temporary-file-directory) (suffix (substring dir-name (1+ (length (directory-file-name temp-dir)))))) @@ -919,7 +919,8 @@ can also be executed interactively independently of (defvar-local flymake-proc--base-dir nil) (defun flymake-proc-init-create-temp-buffer-copy (create-temp-f) - "Make a temporary copy of the current buffer, save its name in buffer data and return the name." + "Make a temporary copy of the current buffer, save its name in buffer data. +Return the name." (let* ((source-file-name buffer-file-name) (temp-source-file-name (funcall create-temp-f source-file-name "flymake"))) @@ -1007,7 +1008,7 @@ Return full-name. Names are real, not patched." buildfile-name source-file-name))))) (defun flymake-proc--init-create-temp-source-and-master-buffer-copy (get-incl-dirs-f create-temp-f master-file-masks include-regexp) - "Find master file (or buffer), create its copy along with a copy of the source file." + "Find master file (or buffer), create its copy and a copy of the source file." (let* ((source-file-name buffer-file-name) (temp-source-file-name (flymake-proc-init-create-temp-buffer-copy create-temp-f)) (master-and-temp-master (flymake-proc--create-master-file diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index d6828eeffbb..4224e47d16d 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -1522,7 +1522,8 @@ No spaces before and 1 after a comma A minimum of 1 space before and after `=' (see `idlwave-expand-equal'). (idlwave-action-and-binding \"=\" (lambda (_) (idlwave-expand-equal -1 -1))) Capitalize system variables - action only - (idlwave-action-and-binding idlwave-sysvar (lambda (_) (capitalize-word 1) t))" + (idlwave-action-and-binding idlwave-sysvar + (lambda (_) (capitalize-word 1) t))" (if (not (equal select 'noaction)) ;; Add action (let* ((table (if select 'idlwave-indent-action-table diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index 33ca01cc754..74a023775f8 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -2136,7 +2136,8 @@ A return value of N means N more left parentheses than right ones." (line-end-position))))) (defun prolog-electric--if-then-else () - "Insert spaces after the opening parenthesis, \"then\" (->) and \"else\" (;) branches. + "Insert spaces after the opening parenthesis. +\"then\" (->) and \"else\" (;) branches. Spaces are inserted if all preceding objects on the line are whitespace characters, parentheses, or then/else branches." (when prolog-electric-if-then-else-flag diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index ac6a8fbbcb1..d98230d9a0e 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -4038,9 +4038,12 @@ Some other functions are: \\[verilog-sk-repeat] Insert a repeat (..) begin .. end block. \\[verilog-sk-specify] Insert a specify .. endspecify block. \\[verilog-sk-task] Insert a task .. begin .. end endtask block. - \\[verilog-sk-while] Insert a while (...) begin .. end block, prompting for details. - \\[verilog-sk-casex] Insert a casex (...) item: begin.. end endcase block, prompting for details. - \\[verilog-sk-casez] Insert a casez (...) item: begin.. end endcase block, prompting for details. + \\[verilog-sk-while] Insert a while (...) begin .. end block, + prompting for details. + \\[verilog-sk-casex] Insert a casex (...) item: begin.. end endcase block, + prompting for details. + \\[verilog-sk-casez] Insert a casez (...) item: begin.. end endcase block, + prompting for details. \\[verilog-sk-if] Insert an if (..) begin .. end block. \\[verilog-sk-else-if] Insert an else if (..) begin .. end block. \\[verilog-sk-comment] Insert a comment block. @@ -6580,7 +6583,8 @@ Return >0 for nested struct." nil)))) (defun verilog-at-constraint-p () - "If at the { of a constraint or coverpoint definition, return true, moving point to constraint." + "If at the { of a constraint or coverpoint definition, return true. +Also move point to constraint." (if (save-excursion (let ((p (point))) (and @@ -14985,7 +14989,9 @@ but instead, [[Fill in here]] happens!. (provide 'verilog-mode) +;;TODO: Could `byte-compile-docstring-max-column' be decreased? ;; Local Variables: +;; byte-compile-docstring-max-column: 90 ;; checkdoc-permit-comma-termination-flag:t ;; checkdoc-force-docstrings-flag:nil ;; indent-tabs-mode:nil diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index ceacd85971d..abf0e814c41 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -1007,7 +1007,8 @@ on the tab bar instead." When this command is bound to a numeric key (with a prefix or modifier key using `tab-bar-select-tab-modifiers'), calling it without an argument will translate its bound numeric key to the numeric argument. -TAB-NUMBER counts from 1. Negative TAB-NUMBER counts tabs from the end of the tab bar." +TAB-NUMBER counts from 1. Negative TAB-NUMBER counts tabs from the end of +the tab bar." (interactive "P") (unless (integerp tab-number) (let ((key (event-basic-type last-command-event))) @@ -1908,7 +1909,7 @@ Letters do not insert themselves; instead, they are commands. (move-to-column tab-switcher-column)) (defun tab-switcher-unmark (&optional backup) - "Cancel all requested operations on window configuration on this line and move down. + "Cancel requested operations on window configuration on this line and move down. Optional prefix arg means move up." (interactive "P") (beginning-of-line) @@ -1920,7 +1921,7 @@ Optional prefix arg means move up." (move-to-column tab-switcher-column)) (defun tab-switcher-backup-unmark () - "Move up and cancel all requested operations on window configuration on line above." + "Move up one line and cancel requested operations on window configuration there." (interactive) (forward-line -1) (tab-switcher-unmark) diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el index 135a4047318..7876a87a281 100644 --- a/lisp/textmodes/texinfo.el +++ b/lisp/textmodes/texinfo.el @@ -806,7 +806,8 @@ temporary file before the region itself. The buffer's header is all lines between the strings defined by `tex-start-of-header' and `tex-end-of-header' inclusive. The header must start in the first 100 lines. -The value of `texinfo-tex-trailer' is appended to the temporary file after the region." +The value of `texinfo-tex-trailer' is appended to the temporary +file after the region." (interactive "r") (require 'tex-mode) (let ((tex-command texinfo-tex-command) diff --git a/lisp/vc/ediff-merg.el b/lisp/vc/ediff-merg.el index 2bdce9e33c7..d0ce9d326d8 100644 --- a/lisp/vc/ediff-merg.el +++ b/lisp/vc/ediff-merg.el @@ -257,7 +257,8 @@ Buffer B." (defun ediff-re-merge () - "Remerge unmodified diff regions using a new default. Start with the current region." + "Remerge unmodified diff regions using a new default. +Start with the current region." (interactive) (let* ((default-variant-alist (list '("default-A") '("default-B") '("combined"))) diff --git a/lisp/vc/ediff.el b/lisp/vc/ediff.el index 74ed1bd0ef2..e406275cd1a 100644 --- a/lisp/vc/ediff.el +++ b/lisp/vc/ediff.el @@ -680,7 +680,7 @@ MERGE-AUTOSTORE-DIR is the directory in which to store merged files." (defun ediff-merge-directories-with-ancestor (dir1 dir2 ancestor-dir regexp &optional merge-autostore-dir) - "Merge files in directories DIR1 and DIR2 using files in ANCESTOR-DIR as ancestors. + "Merge files in DIR1 and DIR2 using files in ANCESTOR-DIR as ancestors. Ediff merges files that have identical names in DIR1, DIR2. If a pair of files in DIR1 and DIR2 doesn't have an ancestor in ANCESTOR-DIR, Ediff will merge without ancestor. The fourth argument, REGEXP, is nil or a regular expression; @@ -746,7 +746,7 @@ MERGE-AUTOSTORE-DIR is the directory in which to store merged files." (defun ediff-merge-directory-revisions-with-ancestor (dir1 regexp &optional merge-autostore-dir) - "Run Ediff on a directory, DIR1, merging its files with their revisions and ancestors. + "Run Ediff on DIR1 and merge its files with their revisions and ancestors. The second argument, REGEXP, is a regular expression that filters the file names. Only the files that are under revision control are taken into account. MERGE-AUTOSTORE-DIR is the directory in which to store merged files." @@ -1600,7 +1600,8 @@ With optional NODE, goes to that node." ;;;###autoload (defun ediff-merge-with-ancestor-command () - "Call `ediff-merge-files-with-ancestor' with the next three command line arguments." + "Call `ediff-merge-files-with-ancestor' with the next three command line +arguments." (let ((file-a (nth 0 command-line-args-left)) (file-b (nth 1 command-line-args-left)) (ancestor (nth 2 command-line-args-left))) @@ -1637,7 +1638,8 @@ With optional NODE, goes to that node." ;;;###autoload (defun ediff-merge-directories-with-ancestor-command () - "Call `ediff-merge-directories-with-ancestor' with the next four command line arguments." + "Call `ediff-merge-directories-with-ancestor' with the next four command line +arguments." (let ((file-a (nth 0 command-line-args-left)) (file-b (nth 1 command-line-args-left)) (ancestor (nth 2 command-line-args-left)) diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el index 45bb17749bc..5a4ac1aca84 100644 --- a/lisp/vc/vc-annotate.el +++ b/lisp/vc/vc-annotate.el @@ -610,7 +610,8 @@ the file in question, search for the log entry required and move point." (vc-annotate-show-diff-revision-at-line-internal t)) (defun vc-annotate-show-changeset-diff-revision-at-line () - "Visit the diff of the revision at line from its previous revision for all files in the changeset." + "Visit diff of revision at line from previous revision. +This is done for all files in changeset." (interactive) (when (eq 'file (vc-call-backend vc-annotate-backend 'revision-granularity)) (error "The %s backend does not support changeset diffs" vc-annotate-backend)) diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index f8b87170af5..d079b891e4d 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -1015,7 +1015,8 @@ child files." (nreverse result))) (defun vc-dir-child-files-and-states () - "Return the list of conses (FILE . STATE) for child files of the current entry if it's a directory. + "Return list of conses for child files of the current entry if it's a directory. +The conses have the format (FILE . STATE). If it is a file, return the corresponding cons for the file itself." (let* ((crt (ewoc-locate vc-ewoc)) (crt-data (ewoc-data crt)) diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index cd23bcce941..346974bdba8 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -404,7 +404,7 @@ Display the buffer in some window, but don't select it." (defvar compilation-error-regexp-alist) (defun vc-compilation-mode (backend) - "Setup `compilation-mode' after with the appropriate `compilation-error-regexp-alist'." + "Setup `compilation-mode' with the appropriate `compilation-error-regexp-alist'." (require 'compile) (let* ((error-regexp-alist (vc-make-backend-sym backend 'error-regexp-alist)) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 7d3b0f56f60..5b259fcdb33 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2624,7 +2624,7 @@ with its diffs (if the underlying VCS supports that)." ;;;###autoload (defun vc-log-incoming (&optional remote-location) - "Show a log of changes that will be received with a pull operation from REMOTE-LOCATION. + "Show log of changes that will be received with pull from REMOTE-LOCATION. When called interactively with a prefix argument, prompt for REMOTE-LOCATION." (interactive (when current-prefix-arg @@ -2637,7 +2637,7 @@ When called interactively with a prefix argument, prompt for REMOTE-LOCATION." ;;;###autoload (defun vc-log-outgoing (&optional remote-location) - "Show a log of changes that will be sent with a push operation to REMOTE-LOCATION. + "Show log of changes that will be sent with a push operation to REMOTE-LOCATION. When called interactively with a prefix argument, prompt for REMOTE-LOCATION." (interactive (when current-prefix-arg diff --git a/lisp/whitespace.el b/lisp/whitespace.el index d4f2b2890a8..6e132de536d 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -2193,8 +2193,8 @@ resultant list will be returned." limit t)) (defun whitespace-empty-at-bob-regexp (limit) - "Match spaces at beginning of buffer which do not contain the point at \ -beginning of buffer." + "Match spaces at beginning of buffer which do not contain +the point at beginning of buffer." (let ((b (point)) r) (cond diff --git a/test/lisp/auth-source-pass-tests.el b/test/lisp/auth-source-pass-tests.el index a0a97eca5eb..3da6f3e9b7b 100644 --- a/test/lisp/auth-source-pass-tests.el +++ b/test/lisp/auth-source-pass-tests.el @@ -97,7 +97,8 @@ This function is intended to be set to `auth-source-debug'." (defun auth-source-pass--explain-match-entry-p (entry hostname &optional user port) "Explainer function for `auth-source-pass-match-entry-p'. -ENTRY, HOSTNAME, USER and PORT are the same as in `auth-source-pass-match-entry-p'." +ENTRY, HOSTNAME, USER and PORT are the same as in +`auth-source-pass-match-entry-p'." `(entry ,entry store @@ -122,7 +123,8 @@ HOSTNAME, USER and PORT are passed unchanged to (defun auth-source-pass--explain-includes-sorted-entries (entries hostname &optional user port) "Explainer function for `auth-source-pass--includes-sorted-entries'. -ENTRIES, HOSTNAME, USER and PORT are the same as in `auth-source-pass--includes-sorted-entries'." +ENTRIES, HOSTNAME, USER and PORT are the same as in +`auth-source-pass--includes-sorted-entries'." `(store ,(auth-source-pass-entries) matching-entries diff --git a/test/lisp/international/ucs-normalize-tests.el b/test/lisp/international/ucs-normalize-tests.el index 52c3d3704eb..eb577b97dc4 100644 --- a/test/lisp/international/ucs-normalize-tests.el +++ b/test/lisp/international/ucs-normalize-tests.el @@ -123,9 +123,9 @@ The following invariants must be true for all conformant implementations..." (defsubst ucs-normalize-tests--rule2-holds-p (X) "Check 2nd conformance rule. -For every code point X assigned in this version of Unicode that is not specifically -listed in Part 1, the following invariants must be true for all conformant -implementations: +For every code point X assigned in this version of Unicode that +is not specifically listed in Part 1, the following invariants +must be true for all conformant implementations: X == toNFC(X) == toNFD(X) == toNFKC(X) == toNFKD(X)" (and (ucs-normalize-tests--normalization-chareq-p NFC X X) -- cgit v1.2.3 From 66409422214a0a90e1d2a12ef2c4ebf86f2c01a9 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 5 Oct 2021 03:34:08 +0200 Subject: Use format-prompt for many more prompts * lisp/bookmark.el (bookmark-completing-read): * lisp/calc/calc-prog.el (calc-user-define-formula): * lisp/calc/calc-store.el (calc-permanent-variable): * lisp/calc/calc-units.el (calc-convert-units) (calc-convert-exact-units, calc-convert-temperature): * lisp/cedet/semantic/complete.el (semantic-complete-read-tag-engine): * lisp/cus-edit.el (customize-read-group): * lisp/dired-aux.el (dired-do-chxxx): * lisp/dired-x.el (dired-mark-unmarked-files): * lisp/emacs-lisp/debug.el (cancel-debug-on-entry) (cancel-debug-on-variable-change): * lisp/emacs-lisp/edebug.el (edebug-cancel-on-entry) (edebug-remove-instrumentation): * lisp/epa.el (epa-read-file-name, epa-export-keys): * lisp/faces.el (read-face-name): * lisp/format.el (format-decode-buffer, format-decode-region): * lisp/gnus/gnus-art.el (gnus-read-save-file-name): * lisp/gnus/gnus-util.el (gnus-completing-read): * lisp/gnus/message.el (message-check-news-header-syntax): * lisp/info.el (Info-follow-reference): * lisp/international/mule-diag.el (describe-font) (describe-fontset): * lisp/international/quail.el (quail-show-keyboard-layout): * lisp/language/cyril-util.el (standard-display-cyrillic-translit): * lisp/mail/rmailkwd.el (rmail-read-label): * lisp/mail/rmailmm.el (rmail-mime-save): * lisp/mail/rmailout.el (rmail-output-read-file-name): * lisp/man.el (Man-goto-section, Man-follow-manual-reference): * lisp/menu-bar.el (emacs-index--prompt): * lisp/net/ange-ftp.el (ange-ftp-get-passwd): * lisp/proced.el (proced-send-signal): * lisp/progmodes/cpp.el (cpp-choose-face): * lisp/progmodes/ebrowse.el (ebrowse-set-tree-indentation): * lisp/progmodes/etags.el (visit-tags-table) (visit-tags-table-buffer): * lisp/progmodes/grep.el (grep-read-files): * lisp/progmodes/hideif.el (hide-ifdef-define): * lisp/progmodes/pascal.el (pascal-goto-defun): * lisp/progmodes/prolog.el (prolog-read-predicate): * lisp/progmodes/sql.el (sql-get-login-ext): * lisp/ses.el (ses-define-local-printer): * lisp/textmodes/artist.el (artist-figlet-choose-font): * lisp/textmodes/tex-mode.el (tex-compile): * lisp/vc/diff.el (diff): * lisp/vc/ediff-ptch.el (ediff-prompt-for-patch-file): * lisp/vc/ediff-util.el (ediff-read-file-name): * lisp/vc/pcvs.el (cvs-mode-mark-on-state): * lisp/vc/vc.el (vc-diff-build-argument-list-internal) (vc-revision-other-window, vc-retrieve-tag): * lisp/wid-edit.el: Prefer format-prompt unconditionally. * lisp/org/org-capture.el (org-capture-fill-template): * lisp/org/org-refile.el (org-refile-get-location): * lisp/progmodes/python.el (python-eldoc-at-point): * lisp/progmodes/verilog-mode.el (verilog-surelint-off) (verilog-goto-defun): * lisp/progmodes/xref.el (xref--read-identifier): Prefer format-prompt when it is fboundp. --- lisp/bookmark.el | 7 ++----- lisp/calc/calc-prog.el | 9 ++++----- lisp/calc/calc-store.el | 2 +- lisp/calc/calc-units.el | 39 +++++++++++---------------------------- lisp/cedet/semantic/complete.el | 9 ++++----- lisp/cus-edit.el | 2 +- lisp/dired-aux.el | 8 ++++---- lisp/dired-x.el | 2 +- lisp/emacs-lisp/debug.el | 6 ++++-- lisp/emacs-lisp/edebug.el | 6 ++++-- lisp/epa.el | 6 ++---- lisp/faces.el | 2 +- lisp/format.el | 4 ++-- lisp/gnus/gnus-art.el | 13 ++++++------- lisp/gnus/gnus-util.el | 4 +--- lisp/gnus/message.el | 2 +- lisp/info.el | 9 +++------ lisp/international/mule-diag.el | 4 ++-- lisp/international/quail.el | 2 +- lisp/language/cyril-util.el | 2 +- lisp/mail/rmailkwd.el | 9 +++------ lisp/mail/rmailmm.el | 2 +- lisp/mail/rmailout.el | 5 ++--- lisp/man.el | 4 ++-- lisp/menu-bar.el | 5 +---- lisp/net/ange-ftp.el | 5 +++-- lisp/org/org-capture.el | 11 +++++++---- lisp/org/org-refile.el | 12 +++++++----- lisp/proced.el | 8 ++++---- lisp/progmodes/cpp.el | 7 ++----- lisp/progmodes/ebrowse.el | 6 +++--- lisp/progmodes/etags.el | 4 ++-- lisp/progmodes/grep.el | 8 +++----- lisp/progmodes/hideif.el | 2 +- lisp/progmodes/pascal.el | 4 +--- lisp/progmodes/prolog.el | 7 ++----- lisp/progmodes/python.el | 12 ++++++++---- lisp/progmodes/sql.el | 17 +++++------------ lisp/progmodes/verilog-mode.el | 23 +++++++++++++---------- lisp/progmodes/xref.el | 17 +++++++++++------ lisp/ses.el | 4 +++- lisp/textmodes/artist.el | 5 ++--- lisp/textmodes/tex-mode.el | 2 +- lisp/vc/diff.el | 8 ++++---- lisp/vc/ediff-ptch.el | 14 +++++--------- lisp/vc/ediff-util.el | 6 +----- lisp/vc/pcvs.el | 3 +-- lisp/vc/vc.el | 15 ++++++--------- lisp/wid-edit.el | 2 +- 49 files changed, 161 insertions(+), 204 deletions(-) (limited to 'lisp/vc/vc.el') diff --git a/lisp/bookmark.el b/lisp/bookmark.el index d64966df5af..5c4a9803b39 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -498,11 +498,8 @@ If DEFAULT is nil then return empty string for empty input." 'string-lessp) (bookmark-all-names))) (let* ((completion-ignore-case bookmark-completion-ignore-case) - (default (unless (equal "" default) default)) - (prompt (concat prompt (if default - (format " (%s): " default) - ": ")))) - (completing-read prompt + (default (unless (equal "" default) default))) + (completing-read (format-prompt prompt default) (lambda (string pred action) (if (eq action 'metadata) '(metadata (category . bookmark)) diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index f9dd9eb98a9..77adf6b7927 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -205,9 +205,8 @@ (progn (setq cmd-base-default (concat "User-" keyname)) (setq cmd (completing-read - (concat "Define M-x command name (default calc-" - cmd-base-default - "): ") + (format-prompt "Define M-x command name" + (concat "calc-" cmd-base-default)) obarray 'commandp nil (if (and odef (symbolp (cdr odef))) (symbol-name (cdr odef)) @@ -241,8 +240,8 @@ (setq func (concat "calcFunc-" (completing-read - (concat "Define algebraic function name (default " - cmd-base-default "): ") + (format-prompt "Define algebraic function name" + cmd-base-default) (mapcar (lambda (x) (substring x 9)) (all-completions "calcFunc-" obarray)) diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index ee29c440fe4..b3968555b62 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el @@ -586,7 +586,7 @@ (defun calc-permanent-variable (&optional var) (interactive) (calc-wrapper - (or var (setq var (calc-read-var-name "Save variable (default all): "))) + (or var (setq var (calc-read-var-name (format-prompt "Save variable" "all")))) (let (calc-pv-pos) (and var (or (and (boundp var) (symbol-value var)) (error "No such variable"))) diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index fd6f3a7b67b..f6d749db117 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -486,18 +486,13 @@ If COMP or STD is non-nil, put that in the units table instead." (setq defunits (math-get-default-units expr)) (unless new-units (setq new-units - (read-string (concat + (read-string (format-prompt (if (and uoldname (not nouold)) (concat "Old units: " uoldname ", new units") "New units") - (if defunits - (concat - " (default " - defunits - "): ") - ": ")))) + defunits))) (if (and (string= new-units "") defunits) @@ -533,14 +528,7 @@ If COMP or STD is non-nil, put that in the units table instead." (let* ((old-units (math-extract-units expr)) (defunits (math-get-default-units expr)) units - (new-units - (read-string (concat "New units" - (if defunits - (concat - " (default " - defunits - "): ") - ": "))))) + (new-units (read-string (format-prompt "New units" defunits)))) (if (and (string= new-units "") defunits) @@ -596,19 +584,14 @@ If COMP or STD is non-nil, put that in the units table instead." (setq expr (math-mul expr uold))) (setq defunits (math-get-default-units expr)) (setq unew (or new-units - (completing-read - (concat - (if uoldname - (concat "Old temperature units: " - uoldname - ", new units") - "New temperature units") - (if defunits - (concat " (default " - defunits - "): ") - ": ")) - tempunits))) + (completing-read (format-prompt + (if uoldname + (concat "Old temperature units: " + uoldname + ", new units") + "New temperature units") + defunits) + tempunits))) (setq unew (math-read-expr (if (string= unew "") defunits unew))) (when (eq (car-safe unew) 'error) (error "Bad format in units expression: %s" (nth 2 unew))) diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el index 6cfbdd5f03f..375b97a7a5d 100644 --- a/lisp/cedet/semantic/complete.el +++ b/lisp/cedet/semantic/complete.el @@ -224,11 +224,10 @@ HISTORY is a symbol representing a variable to story the history in." ;; @todo - move from () to into the editable area (if (string-match ":" prompt) - (setq prompt (concat - (substring prompt 0 (match-beginning 0)) - " (default " default-as-string ")" - (substring prompt (match-beginning 0)))) - (setq prompt (concat prompt " (" default-as-string "): ")))) + (setq prompt (format-prompt + (substring prompt 0 (match-beginning 0)) + default-as-string)) + (setq prompt (format-prompt prompt default-as-string)))) ;; ;; Perform the Completion ;; diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 814003587b8..34a6db508d5 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1133,7 +1133,7 @@ for the MODE to customize." (defun customize-read-group () (let ((completion-ignore-case t)) - (completing-read "Customize group (default emacs): " + (completing-read (format-prompt "Customize group" "emacs") obarray (lambda (symbol) (or (and (get symbol 'custom-loads) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 4b8d2710715..a1c6316d3f7 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -444,10 +444,10 @@ List has a form of (file-name full-file-name (attribute-list))." ((eq op-symbol 'chgrp) (file-attribute-group-id (file-attributes default-file 'string)))))) - (prompt (concat "Change " attribute-name " of %s to" - (if (eq op-symbol 'touch) - " (default now): " - ": "))) + (prompt (format-prompt "Change %s of %%s to" + (when (eq op-symbol 'touch) + "now") + attribute-name)) (new-attribute (dired-mark-read-string prompt nil op-symbol arg files default (cond ((eq op-symbol 'chown) diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 7c6f49f2ae4..7f889a2bfd6 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -554,7 +554,7 @@ If the region is active in Transient Mark mode, operate only on files in the active region if `dired-mark-region' is non-nil." (interactive (list (read-regexp - "Mark unmarked files matching regexp (default all): " + (format-prompt "Mark unmarked files matching regexp" "all") nil 'dired-regexp-history) nil current-prefix-arg nil)) (let ((dired-marker-char (if unflag-p ?\s dired-marker-char))) diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 0592db85df4..163528acf6f 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -701,7 +701,8 @@ To specify a nil argument interactively, exit with an empty minibuffer." (interactive (list (let ((name (completing-read - "Cancel debug on entry to function (default all functions): " + (format-prompt "Cancel debug on entry to function" + "all functions") (mapcar #'symbol-name (debug--function-list)) nil t))) (when name (unless (string= name "") @@ -804,7 +805,8 @@ To specify a nil argument interactively, exit with an empty minibuffer." (interactive (list (let ((name (completing-read - "Cancel debug on set for variable (default all variables): " + (format-prompt "Cancel debug on set for variable" + "all variables") (mapcar #'symbol-name (debug--variable-list)) nil t))) (when name (unless (string= name "") diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 4f3c05baa98..a38c8bd5ca9 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -3519,7 +3519,8 @@ The removes the effect of `edebug-on-entry'. If FUNCTION is nil, remove `edebug-on-entry' on all functions." (interactive (list (let ((name (completing-read - "Cancel edebug on entry to (default all functions): " + (format-prompt "Cancel edebug on entry to" + "all functions") (let ((functions (edebug--edebug-on-entry-functions))) (unless functions (user-error "No functions have `edebug-on-entry'")) @@ -4548,7 +4549,8 @@ instrumentation for, defaulting to all functions." (user-error "Found no functions to remove instrumentation from")) (let ((name (completing-read - "Remove instrumentation from (default all functions): " + (format-prompt "Remove instrumentation from" + "all functions") functions))) (if (and name (not (equal name ""))) diff --git a/lisp/epa.el b/lisp/epa.el index 57d355cb3e0..e4b89e984d2 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -648,7 +648,7 @@ If SECRET is non-nil, list secret keys instead of public keys." (setq input (file-name-sans-extension (expand-file-name input))) (expand-file-name (read-file-name - (concat "To file (default " (file-name-nondirectory input) ") ") + (format-prompt "To file" (file-name-nondirectory input)) (file-name-directory input) input))) @@ -1236,9 +1236,7 @@ If no one is selected, symmetric encryption will be performed. ") (list keys (expand-file-name (read-file-name - (concat "To file (default " - (file-name-nondirectory default-name) - ") ") + (format-prompt "To file" (file-name-nondirectory default-name)) (file-name-directory default-name) default-name))))) (let ((context (epg-make-context epa-protocol))) diff --git a/lisp/faces.el b/lisp/faces.el index 7b96d938c56..302bfa245ec 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1100,7 +1100,7 @@ returned. Otherwise, DEFAULT is returned verbatim." ;; prompt. If so, remove it. (setq prompt (replace-regexp-in-string ": ?\\'" "" prompt)) (let ((prompt (if default - (format-message "%s (default `%s'): " prompt default) + (format-prompt prompt default) (format "%s: " prompt))) aliasfaces nonaliasfaces faces) ;; Build up the completion tables. diff --git a/lisp/format.el b/lisp/format.el index 71cf885d417..a2f378efa72 100644 --- a/lisp/format.el +++ b/lisp/format.el @@ -320,7 +320,7 @@ If the format is not specified, attempt a regexp-based guess. Set `buffer-file-format' to the format used, and call any format-specific mode functions." (interactive - (list (format-read "Translate buffer from format (default guess): "))) + (list (format-read (format-prompt "Translate buffer from format" "guess")))) (save-excursion (goto-char (point-min)) (format-decode format (buffer-size) t))) @@ -331,7 +331,7 @@ Arg FORMAT is optional; if omitted the format will be determined by looking for identifying regular expressions at the beginning of the region." (interactive (list (region-beginning) (region-end) - (format-read "Translate region from format (default guess): "))) + (format-read (format-prompt "Translate region from format" "guess")))) (save-excursion (goto-char from) (format-decode format (- to from) nil))) diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 7b6e15d6f87..c2ec3f1f977 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -3933,8 +3933,8 @@ This format is defined by the `gnus-article-time-format' variable." ;; No split name was found. ((null split-name) (read-file-name - (concat prompt " (default " - (file-name-nondirectory default-name) "): ") + (format-prompt prompt + (file-name-nondirectory default-name)) (file-name-directory default-name) default-name)) ;; A single group name is returned. @@ -3943,8 +3943,8 @@ This format is defined by the `gnus-article-time-format' variable." (funcall function split-name headers (symbol-value variable))) (read-file-name - (concat prompt " (default " - (file-name-nondirectory default-name) "): ") + (format-prompt prompt + (file-name-nondirectory default-name)) (file-name-directory default-name) default-name)) ;; A single split name was found @@ -3956,9 +3956,8 @@ This format is defined by the `gnus-article-time-format' variable." (file-name-as-directory name)) ((file-exists-p name) name) (t gnus-article-save-directory)))) - (read-file-name - (concat prompt " (default " name "): ") - dir name))) + (read-file-name (format-prompt prompt name) + dir name))) ;; A list of splits was found. (t (setq split-name (nreverse split-name)) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index fb285962d6f..5bf2869983e 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1310,9 +1310,7 @@ SPEC is a predicate specifier that contains stuff like `or', `and', initial-input history def) "Call `gnus-completing-read-function'." (funcall gnus-completing-read-function - (concat prompt (when def - (concat " (default " def ")")) - ": ") + (format-prompt prompt def) collection require-match initial-input history def)) (defun gnus-emacs-completing-read (prompt collection &optional require-match diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index b08d8c26c9a..7ca43d603ff 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -5349,7 +5349,7 @@ Otherwise, generate and save a value for `canlock-password' first." (zerop (length (setq to (completing-read - "Followups to (default no Followup-To header): " + (format-prompt "Followups to" "no Followup-To header") (mapcar #'list (cons "poster" (message-tokenize-header diff --git a/lisp/info.el b/lisp/info.el index 8c08eaec3c8..41889d6de17 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -2604,12 +2604,9 @@ new buffer." (if (eq (length completions) 1) (setq default (car completions))) (if completions - (let ((input (completing-read (if default - (concat - "Follow reference named (default " - default "): ") - "Follow reference named: ") - completions nil t))) + (let ((input (completing-read (format-prompt "Follow reference named" + default) + completions nil t))) (list (if (equal input "") default input) current-prefix-arg)) diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el index 862c577bd5d..5cc73e43671 100644 --- a/lisp/international/mule-diag.el +++ b/lisp/international/mule-diag.el @@ -833,7 +833,7 @@ The IGNORED argument is ignored." "Display information about a font whose name is FONTNAME." (interactive (list (completing-read - "Font name (default current choice for ASCII chars): " + (format-prompt "Font name" "current choice for ASCII chars") (and window-system ;; Implied by `window-system'. (fboundp 'x-list-fonts) @@ -1004,7 +1004,7 @@ This shows which font is used for which character(s)." (mapcar 'cdr fontset-alias-alist))) (completion-ignore-case t)) (list (completing-read - "Fontset (default used by the current frame): " + (format-prompt "Fontset" "used by the current frame") fontset-list nil t))))) (if (= (length fontset) 0) (setq fontset (face-attribute 'default :fontset)) diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 50ff307b73a..89ab450aeee 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -917,7 +917,7 @@ The format of KBD-LAYOUT is the same as `quail-keyboard-layout'." The variable `quail-keyboard-layout-type' holds the currently selected keyboard type." (interactive - (list (completing-read "Keyboard type (default current choice): " + (list (completing-read (format-prompt "Keyboard type" "current choice") quail-keyboard-layout-alist nil t))) (or (and keyboard-type (> (length keyboard-type) 0)) diff --git a/lisp/language/cyril-util.el b/lisp/language/cyril-util.el index 04e681d743d..e404288ddca 100644 --- a/lisp/language/cyril-util.el +++ b/lisp/language/cyril-util.el @@ -60,7 +60,7 @@ If the argument is nil, we return the display table to its standard state." (list (let* ((completion-ignore-case t)) (completing-read - "Cyrillic language (default nil): " + (format-prompt "Cyrillic language" "nil") cyrillic-language-alist nil t nil nil nil)))) (or standard-display-table diff --git a/lisp/mail/rmailkwd.el b/lisp/mail/rmailkwd.el index 58a8eb7a370..d8fcc1c0a99 100644 --- a/lisp/mail/rmailkwd.el +++ b/lisp/mail/rmailkwd.el @@ -74,12 +74,9 @@ according to the choice made, and returns a symbol." (rmail-summary-exists) (and (setq old (rmail-get-keywords)) (mapc #'rmail-make-label (split-string old ", ")))) - (completing-read (concat prompt - (if rmail-last-label - (concat " (default " - (symbol-name rmail-last-label) - "): ") - ": ")) + (completing-read (format-prompt prompt + (and rmail-last-label + (symbol-name rmail-last-label))) rmail-label-obarray nil nil)))) diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index 99bff66657b..66a1e9a4dbd 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el @@ -254,7 +254,7 @@ TRUNCATED is non-nil if the text of this entity was truncated.")) (unless (y-or-n-p "This entity is truncated; save anyway? ") (error "Aborted"))) (setq filename (expand-file-name - (read-file-name (format "Save as (default: %s): " filename) + (read-file-name (format-prompt "Save as" filename) directory (expand-file-name filename directory)) directory)) diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el index 91f86a234d4..1f5bb2d9f1b 100644 --- a/lisp/mail/rmailout.el +++ b/lisp/mail/rmailout.el @@ -107,9 +107,8 @@ error: %S\n" (read-file (expand-file-name (read-file-name - (concat "Output message to mail file (default " - (file-name-nondirectory default-file) - "): ") + (format-prompt "Output message to mail file" + (file-name-nondirectory default-file)) (file-name-directory default-file) (abbreviate-file-name default-file)) (file-name-directory default-file)))) diff --git a/lisp/man.el b/lisp/man.el index 4ef2deac4f3..2bde1fc7fb2 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1786,7 +1786,7 @@ Returns t if section is found, nil otherwise." Man--last-section (car Man--sections))) (completion-ignore-case t) - (prompt (concat "Go to section (default " default "): ")) + (prompt (format-prompt "Go to section" default)) (chosen (completing-read prompt Man--sections nil nil nil nil default))) (list chosen)) @@ -1850,7 +1850,7 @@ Specify which REFERENCE to use; default is based on word at point." (defaults (mapcar 'substring-no-properties (cons default Man--refpages))) - (prompt (concat "Refer to (default " default "): ")) + (prompt (format-prompt "Refer to" default)) (chosen (completing-read prompt Man--refpages nil nil nil nil defaults))) chosen))) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index b2577c085fc..40a1730637d 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -1918,10 +1918,7 @@ key, a click, or a menu-item")) (let* ((default (thing-at-point 'sexp)) (topic (read-from-minibuffer - (format "Subject to look up%s: " - (if default - (format " (default \"%s\")" default) - "")) + (format-prompt "Subject to look up" default) nil nil nil nil default))) (list (if (zerop (length topic)) default diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 56a1d76d71a..876e138f284 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -1230,8 +1230,9 @@ only return the directory part of FILE." ;; found another machine with the same user. ;; Try that account. (read-passwd - (format "passwd for %s@%s (default same as %s@%s): " - user host user other) + (format-prompt "passwd for %s@%s" + (format "same as %s@%s" user other) + user host) nil (ange-ftp-lookup-passwd other user)) diff --git a/lisp/org/org-capture.el b/lisp/org/org-capture.el index a9350c58d52..1756b34fc5b 100644 --- a/lisp/org/org-capture.el +++ b/lisp/org/org-capture.el @@ -1815,10 +1815,13 @@ by their respective `org-store-link-plist' properties if present." ;; Load history list for current prompt. (setq org-capture--prompt-history (gethash prompt org-capture--prompt-history-table)) - (push (org-completing-read - (concat (or prompt "Enter string") - (and default (format " [%s]" default)) - ": ") + (push (org-completing-read + ;; `format-prompt' is new in Emacs 28.1. + (if (fboundp 'format-prompt) + (format-prompt (or prompt "Enter string") default) + (concat (or prompt "Enter string") + (and default (format " [%s]" default)) + ": ")) completions nil nil nil 'org-capture--prompt-history default) strings) diff --git a/lisp/org/org-refile.el b/lisp/org/org-refile.el index 678759e10db..73eaad6bf52 100644 --- a/lisp/org/org-refile.el +++ b/lisp/org/org-refile.el @@ -640,11 +640,13 @@ this function appends the default value from org-refile-target-table)) (completion-ignore-case t) cdef - (prompt (concat prompt - (or (and (car org-refile-history) - (concat " (default " (car org-refile-history) ")")) - (and (assoc cbnex tbl) (setq cdef cbnex) - (concat " (default " cbnex ")"))) ": ")) + (prompt (let ((default (or (car org-refile-history) + (and (assoc cbnex tbl) (setq cdef cbnex) + cbnex)))) + ;; `format-prompt' is new in Emacs 28.1. + (if (fboundp 'format-prompt) + (format-prompt prompt default) + (concat prompt " (default " default ": ")))) pa answ parent-target child parent old-hist) (setq old-hist org-refile-history) (setq answ (funcall cfunc prompt tbl nil (not new-nodes) diff --git a/lisp/proced.el b/lisp/proced.el index fec2a29c847..9a8eaf54e78 100644 --- a/lisp/proced.el +++ b/lisp/proced.el @@ -1772,8 +1772,8 @@ supported but discouraged. It will be removed in a future version of Emacs." `(:annotation-function ,(lambda (s) (cdr (assoc s proced-signal-list)))))) (proced-with-processes-buffer process-alist - (list (completing-read (concat "Send signal [" pnum - "] (default TERM): ") + (list (completing-read (format-prompt "Send signal [%s]" + "TERM" pnum) proced-signal-list nil nil nil nil "TERM") process-alist)))) @@ -1797,8 +1797,8 @@ supported but discouraged. It will be removed in a future version of Emacs." `(:annotation-function ,(lambda (s) (cdr (assoc s proced-signal-list)))))) (proced-with-processes-buffer process-alist - (setq signal (completing-read (concat "Send signal [" pnum - "] (default TERM): ") + (setq signal (completing-read (format-prompt "Send signal [%s]" + "TERM" pnum) proced-signal-list nil nil nil nil "TERM")))))) diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el index d800365e66d..baee72b332d 100644 --- a/lisp/progmodes/cpp.el +++ b/lisp/progmodes/cpp.el @@ -702,11 +702,8 @@ BRANCH should be either nil (false branch), t (true branch) or `both'." (x-popup-menu cpp-button-event (list prompt (cons prompt cpp-face-default-list))) (let ((name (car (rassq default cpp-face-default-list)))) - (cdr (assoc (completing-read (if name - (concat prompt - " (default " name "): ") - (concat prompt ": ")) - cpp-face-default-list nil t) + (cdr (assoc (completing-read (format-prompt "%s" name prompt) + cpp-face-default-list nil t) cpp-face-all-list)))) default)) diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el index ab0329d7eec..6e416d064a8 100644 --- a/lisp/progmodes/ebrowse.el +++ b/lisp/progmodes/ebrowse.el @@ -1330,9 +1330,9 @@ Pop to member buffer if no prefix ARG, to tree buffer otherwise." "Set the indentation width of the tree display." (interactive) (let ((width (string-to-number (read-string - (concat "Indentation (default " - (int-to-string ebrowse--indentation) - "): ") + (format-prompt + "Indentation" + (int-to-string ebrowse--indentation)) nil nil ebrowse--indentation)))) (when (cl-plusp width) (setq-local ebrowse--indentation width) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index f53b09d9e8c..d2ce813daae 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -292,7 +292,7 @@ file the tag was in." (or (locate-dominating-file default-directory "TAGS") default-directory))) (list (read-file-name - "Visit tags table (default TAGS): " + (format-prompt "Visit tags table" "TAGS") ;; default to TAGS from default-directory up to root. default-tag-dir (expand-file-name "TAGS" default-tag-dir) @@ -625,7 +625,7 @@ Returns t if it visits a tags table, or nil if there are no more in the list." (car list)) ;; Finally, prompt the user for a file name. (expand-file-name - (read-file-name "Visit tags table (default TAGS): " + (read-file-name (format-prompt "Visit tags table" "TAGS") default-directory "TAGS" t)))))) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index ec2850737c8..001989e39ad 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -1057,11 +1057,9 @@ REGEXP is used as a string in the prompt." default-extension (car grep-files-history) (car (car grep-files-aliases)))) - (files (completing-read - (concat "Search for \"" regexp - "\" in files matching wildcard" - (if default (concat " (default " default ")")) - ": ") + (files (completing-read + (format-prompt "Search for \"%s\" in files matching wildcard" + default regexp) #'read-file-name-internal nil nil nil 'grep-files-history (delete-dups diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index a18a67249ae..87732c10489 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el @@ -2456,7 +2456,7 @@ This allows #ifdef VAR to be hidden." (t nil)))) (var (read-minibuffer "Define what? " default)) - (val (read-from-minibuffer (format "Set %s to? (default 1): " var) + (val (read-from-minibuffer (format-prompt "Set %s to?" "1" var) nil nil t nil "1"))) (list var val))) (hif-set-var var (or val 1)) diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el index e6e6e40aa19..5938da542ac 100644 --- a/lisp/progmodes/pascal.el +++ b/lisp/progmodes/pascal.el @@ -1357,9 +1357,7 @@ The default is a name found in the buffer around point." default "")) (label ;; Do completion with default. - (completing-read (if (not (string= default "")) - (concat "Label (default " default "): ") - "Label: ") + (completing-read (format-prompt "Label" default) ;; Complete with the defuns found in the ;; current-buffer. (let ((buf (current-buffer))) diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index 74a023775f8..118117131f4 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -2484,11 +2484,8 @@ Interaction supports completion." (if (eq (try-completion default prolog-info-alist) nil) (setq default nil)) ;; Read the PredSpec from the user - (completing-read - (if (zerop (length default)) - "Help on predicate: " - (concat "Help on predicate (default " default "): ")) - prolog-info-alist nil t nil nil default))) + (completing-read (format-prompt "Help on predicate" default) + prolog-info-alist nil t nil nil default))) (defun prolog-build-info-alist (&optional verbose) "Build an alist of all builtins and library predicates. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 43ee3c0c152..b1f61c89a41 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -4773,10 +4773,14 @@ Interactively, prompt for symbol." (interactive (let ((symbol (python-eldoc--get-symbol-at-point)) (enable-recursive-minibuffers t)) - (list (read-string (if symbol - (format "Describe symbol (default %s): " symbol) - "Describe symbol: ") - nil nil symbol)))) + (list (read-string + ;; `format-prompt' is new in Emacs 28.1. + (if (fboundp 'format-prompt) + (format-prompt "Describe symbol" symbol) + (if symbol + (format "Describe symbol (default %s): " symbol) + "Describe symbol: ")) + nil nil symbol)))) (message (python-eldoc--get-doc-at-point symbol))) (defun python-describe-at-point (symbol process) diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 02eccb33012..283c057e522 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -3219,14 +3219,7 @@ For both `:file' and `:completion', there can also be a symbol (let* ((default (plist-get plist :default)) (last-value (sql-default-value symbol)) - (prompt-def - (if default - (if (string-match "\\(\\):[ \t]*\\'" prompt) - (replace-match (format " (default \"%s\")" default) t t prompt 1) - (replace-regexp-in-string "[ \t]*\\'" - (format " (default \"%s\") " default) - prompt t t)) - prompt)) + (prompt-def (format-prompt prompt default)) (use-dialog-box nil)) (cond ((plist-member plist :file) @@ -3311,7 +3304,7 @@ function like this: (sql-get-login \\='user \\='password \\='database)." (let ((plist (cdr-safe w))) (pcase (or (car-safe w) w) ('user - (sql-get-login-ext 'sql-user "User: " 'sql-user-history plist)) + (sql-get-login-ext 'sql-user "User" 'sql-user-history plist)) ('password (setq-default sql-password @@ -3330,14 +3323,14 @@ function like this: (sql-get-login \\='user \\='password \\='database)." (read-passwd "Password: " nil (sql-default-value 'sql-password))))) ('server - (sql-get-login-ext 'sql-server "Server: " 'sql-server-history plist)) + (sql-get-login-ext 'sql-server "Server" 'sql-server-history plist)) ('database - (sql-get-login-ext 'sql-database "Database: " + (sql-get-login-ext 'sql-database "Database" 'sql-database-history plist)) ('port - (sql-get-login-ext 'sql-port "Port: " + (sql-get-login-ext 'sql-port "Port" nil (append '(:number t) plist))))))) (defun sql-find-sqli-buffer (&optional product connection) diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index d98230d9a0e..5ef382b91ef 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -5478,8 +5478,11 @@ becomes: (let* ((pop-up-windows t)) (let ((name (expand-file-name (read-file-name - (format "Find this error in: (default %s) " - file) + ;; `format-prompt' is new in Emacs 28.1. + (if (fboundp 'format-prompt) + (format-prompt "Find this error in" file) + (format "Find this error in (default %s): " + file)) nil ;; dir file t)))) (setq buffer @@ -7863,14 +7866,14 @@ If search fails, other files are checked based on (let* ((default (verilog-get-default-symbol)) ;; The following variable is used in verilog-comp-function (verilog-buffer-to-use (current-buffer)) - (label (if (not (string= default "")) - ;; Do completion with default - (completing-read (concat "Goto-Label: (default " - default ") ") - #'verilog-comp-defun nil nil "") - ;; There is no default value. Complete without it - (completing-read "Goto-Label: " - #'verilog-comp-defun nil nil ""))) + (label + (completing-read (cond ((fboundp 'format-prompt) + ;; `format-prompt' is new in Emacs 28.1. + (format-prompt "Goto-Label" default)) + ((not (string= default "")) + (concat "Goto-Label (default " default "): ")) + (t "Goto-Label: ")) + #'verilog-comp-defun nil nil "")) pt) ;; Make sure library paths are correct, in case need to resolve module (verilog-auto-reeval-locals) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 267ee16400e..210fc2b1d8b 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1310,12 +1310,17 @@ definitions." (xref--prompt-p this-command)) (let ((id (completing-read - (if def - (format "%s (default %s): " - (substring prompt 0 (string-match - "[ :]+\\'" prompt)) - def) - prompt) + ;; `format-prompt' is new in Emacs 28.1 + (if (fboundp 'format-prompt) + (format-prompt (substring prompt 0 (string-match + "[ :]+\\'" prompt)) + def) + (if def + (format "%s (default %s): " + (substring prompt 0 (string-match + "[ :]+\\'" prompt)) + def) + prompt)) (xref-backend-identifier-completion-table backend) nil nil nil 'xref--read-identifier-history def))) diff --git a/lisp/ses.el b/lisp/ses.el index ea966295b18..51843eab032 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -3774,7 +3774,9 @@ function is redefined." (setq name (intern name)) (let* ((cur-printer (gethash name ses--local-printer-hashmap)) (default (and cur-printer (ses--locprn-def cur-printer)))) - (setq def (ses-read-printer (format "Enter definition of printer %S" name) + (setq def (ses-read-printer (format-prompt + "Enter definition of printer %S" + default name) default))) (list name def))) diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index c42286e5bc3..25f0c35aa5d 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -2840,9 +2840,8 @@ Returns a list of strings." (if (memq system-type '(windows-nt ms-dos)) (artist-figlet-get-font-list-windows) (artist-figlet-get-font-list))) - (font (completing-read (concat "Select font (default " - artist-figlet-default-font - "): ") + (font (completing-read (format-prompt "Select font" + artist-figlet-default-font) (mapcar (lambda (font) (cons font font)) avail-fonts)))) diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 6fd66b2502f..5fba93c76eb 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -2457,7 +2457,7 @@ Only applies the FSPEC to the args part of FORMAT." (default (tex-compile-default fspec))) (list default-directory (completing-read - (format "Command [%s]: " (tex-summarize-command default)) + (format-prompt "Command" (tex-summarize-command default)) (mapcar (lambda (x) (list (tex-format-cmd (eval (car x) t) fspec))) tex-compile-commands) diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el index 352fa693ffb..4061fedd578 100644 --- a/lisp/vc/diff.el +++ b/lisp/vc/diff.el @@ -96,15 +96,15 @@ Non-interactively, OLD and NEW may each be a file or a buffer." (interactive (let* ((newf (if (and buffer-file-name (file-exists-p buffer-file-name)) (read-file-name - (concat "Diff new file (default " - (file-name-nondirectory buffer-file-name) "): ") + (format-prompt "Diff new file" + (file-name-nondirectory buffer-file-name)) nil buffer-file-name t) (read-file-name "Diff new file: " nil nil t))) (oldf (file-newest-backup newf))) (setq oldf (if (and oldf (file-exists-p oldf)) (read-file-name - (concat "Diff original file (default " - (file-name-nondirectory oldf) "): ") + (format-prompt "Diff original file" + (file-name-nondirectory oldf)) (file-name-directory oldf) oldf t) (read-file-name "Diff original file: " (file-name-directory newf) nil t))) diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el index 4135e8b4702..7622cf4c196 100644 --- a/lisp/vc/ediff-ptch.el +++ b/lisp/vc/ediff-ptch.el @@ -503,15 +503,11 @@ are two possible targets for this %spatch. However, these files do not exist." patch-file-name) (setq patch-file-name (read-file-name - (format "Patch is in file%s: " - (cond ((and buffer-file-name - (equal (expand-file-name dir) - (file-name-directory buffer-file-name))) - (concat - " (default " - (file-name-nondirectory buffer-file-name) - ")")) - (t ""))) + (format-prompt "Patch is in file" + (and buffer-file-name + (equal (expand-file-name dir) + (file-name-directory buffer-file-name)) + (file-name-nondirectory buffer-file-name))) dir buffer-file-name 'must-match)) (if (file-directory-p patch-file-name) (error "Patch file cannot be a directory: %s" patch-file-name) diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index 9016d1df5c4..346c3c0a666 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -3103,11 +3103,7 @@ Hit \\[ediff-recenter] to reset the windows afterward." (lambda () (when defaults (setq minibuffer-default defaults))) (read-file-name - (format "%s%s " - prompt - (cond (default-file - (concat " (default " default-file "):")) - (t (concat " (default " default-dir "):")))) + (format-prompt prompt (or default-file default-dir)) default-dir (or default-file default-dir) t ; must match, no-confirm diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el index bbc81ef195d..8f662e84589 100644 --- a/lisp/vc/pcvs.el +++ b/lisp/vc/pcvs.el @@ -1284,8 +1284,7 @@ marked instead. A directory can never be marked." (intern (upcase (completing-read - (concat - "Mark files in state" (if default (concat " [" default "]")) ": ") + (format-prompt "Mark files in state" default) (mapcar (lambda (x) (list (downcase (symbol-name (car x))))) cvs-states) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 5b259fcdb33..edc4169465a 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1863,13 +1863,10 @@ Return t if the buffer had changes, nil otherwise." (vc-working-revision first)))) (when (string= rev1-default "") (setq rev1-default nil)))) ;; construct argument list - (let* ((rev1-prompt (if rev1-default - (concat "Older revision (default " - rev1-default "): ") - "Older revision: ")) - (rev2-prompt (concat "Newer revision (default " - ;; (or rev2-default - "current source): ")) + (let* ((rev1-prompt (format-prompt "Older revision" rev1-default)) + (rev2-prompt (format-prompt "Newer revision" + ;; (or rev2-default + "current source")) (rev1 (vc-read-revision rev1-prompt files backend rev1-default)) (rev2 (vc-read-revision rev2-prompt files backend nil))) ;; rev2-default (when (string= rev1 "") (setq rev1 nil)) @@ -2082,7 +2079,7 @@ If `F.~REV~' already exists, use it instead of checking it out again." (with-current-buffer (or (buffer-base-buffer) (current-buffer)) (vc-ensure-vc-buffer) (list - (vc-read-revision "Revision to visit (default is working revision): " + (vc-read-revision (format-prompt "Revision to visit" "working revision") (list buffer-file-name))))) (set-buffer (or (buffer-base-buffer) (current-buffer))) (vc-ensure-vc-buffer) @@ -2378,7 +2375,7 @@ This function runs the hook `vc-retrieve-tag-hook' when finished." (read-directory-name "Directory: " default-directory nil t)))) (list dir - (vc-read-revision "Tag name to retrieve (default latest revisions): " + (vc-read-revision (format-prompt "Tag name to retrieve" "latest revisions") (list dir) (vc-responsible-backend dir))))) (let* ((backend (vc-responsible-backend dir)) diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 05606fbfb4a..fb06a95f51c 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -3325,7 +3325,7 @@ It reads a file name from an editable text field." ;;; (file (file-name-nondirectory value)) ;;; (menu-tag (widget-apply widget :menu-tag-get)) ;;; (must-match (widget-get widget :must-match)) -;;; (answer (read-file-name (concat menu-tag " (default " value "): ") +;;; (answer (read-file-name (format-prompt menu-tag value) ;;; dir nil must-match file))) ;;; (widget-value-set widget (abbreviate-file-name answer)) ;;; (widget-setup) -- cgit v1.2.3 From 0aa52e94f37e34a8f59d3a91e4798ee082781e3d Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Thu, 14 Oct 2021 02:28:00 +0300 Subject: Mark vc-switch-backend as obsolete * etc/NEWS: Mention the change. * lisp/vc/vc.el (vc-switch-backend): Mark as obsolete (bug#50344). (vc-transfer-file): Wrap the calls in 'with-suppressed-warnings'. --- etc/NEWS | 4 ++++ lisp/vc/vc.el | 13 +++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'lisp/vc/vc.el') diff --git a/etc/NEWS b/etc/NEWS index 791248f7dc4..b7c4346db97 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1937,6 +1937,10 @@ tags to be considered as well. *** New user option 'vc-git-log-switches'. String or list of strings specifying switches for Git log under VC. +*** Command 'vc-switch-backend' is now obsolete. +If you are still using it with any regularity, please file a bug +report with some details. + ** Gnus +++ diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 5b259fcdb33..67003c83926 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2864,6 +2864,7 @@ permanent, only for the current session. This function only changes VC's perspective on FILE, it does not register or unregister it. By default, this command cycles through the registered backends. To get a prompt, use a prefix argument." + (declare (obsolete nil "28.1")) (interactive (list (or buffer-file-name @@ -2918,7 +2919,8 @@ backend to NEW-BACKEND, and unregister FILE from the current backend. (if registered (set-file-modes file (logior (file-modes file) 128)) ;; `registered' might have switched under us. - (vc-switch-backend file old-backend) + (with-suppressed-warnings ((obsolete vc-switch-backend)) + (vc-switch-backend file old-backend)) (let* ((rev (vc-working-revision file)) (modified-file (and edited (make-temp-file file))) (unmodified-file (and modified-file (vc-version-backup-file file)))) @@ -2937,16 +2939,19 @@ backend to NEW-BACKEND, and unregister FILE from the current backend. (vc-revert-file file)))) (vc-call-backend new-backend 'receive-file file rev)) (when modified-file - (vc-switch-backend file new-backend) + (with-suppressed-warnings ((obsolete vc-switch-backend)) + (vc-switch-backend file new-backend)) (unless (eq (vc-checkout-model new-backend (list file)) 'implicit) (vc-checkout file)) (rename-file modified-file file 'ok-if-already-exists) (vc-file-setprop file 'vc-checkout-time nil))))) (when move - (vc-switch-backend file old-backend) + (with-suppressed-warnings ((obsolete vc-switch-backend)) + (vc-switch-backend file old-backend)) (setq comment (vc-call-backend old-backend 'comment-history file)) (vc-call-backend old-backend 'unregister file)) - (vc-switch-backend file new-backend) + (with-suppressed-warnings ((obsolete vc-switch-backend)) + (vc-switch-backend file new-backend)) (when (or move edited) (vc-file-setprop file 'vc-state 'edited) (vc-mode-line file new-backend) -- cgit v1.2.3 From f0768d31457bb9740957958d6b8abc281d5012d8 Mon Sep 17 00:00:00 2001 From: Matthias Meulien Date: Fri, 5 Nov 2021 03:50:01 +0100 Subject: Fix 'diff-font-lock-prettify' breaking display of outline headers * lisp/vc/diff-mode.el (diff-outline-level): Make hunk headers be at level 2. (diff-mode): Use prettified line as outline header. (diff--outline-level): New function (bug#51016). * lisp/vc/vc.el (vc-diff-internal): Fix diff mode being set before content inserted (bug#51016). --- lisp/vc/diff-mode.el | 25 +++++++++++++++++-------- lisp/vc/vc.el | 5 +++-- 2 files changed, 20 insertions(+), 10 deletions(-) (limited to 'lisp/vc/vc.el') diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index ae1a8b254ff..746f76b46c3 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -893,6 +893,9 @@ data such as \"Index: ...\" and such." ;; Fix the original hunk-header. (diff-fixup-modifs start pos)))) +(defun diff--outline-level () + (if (string-match-p diff-hunk-header-re (match-string 0)) + 2 1)) ;;;; ;;;; jump to other buffers @@ -1493,7 +1496,6 @@ a diff with \\[diff-reverse-direction]. (setq-local font-lock-defaults diff-font-lock-defaults) (add-hook 'font-lock-mode-hook #'diff--font-lock-cleanup nil 'local) - (setq-local outline-regexp diff-outline-regexp) (setq-local imenu-generic-expression diff-imenu-generic-expression) ;; These are not perfect. They would be better done separately for @@ -1542,7 +1544,12 @@ a diff with \\[diff-reverse-direction]. (setq-local diff-buffer-type (if (re-search-forward "^diff --git" nil t) 'git - nil)))) + nil))) + (when (eq diff-buffer-type 'git) + (setq diff-outline-regexp + (concat "\\(^diff --git.*\n\\|" diff-hunk-header-re "\\)")) + (setq-local outline-level #'diff--outline-level)) + (setq-local outline-regexp diff-outline-regexp)) ;;;###autoload (define-minor-mode diff-minor-mode @@ -2602,13 +2609,15 @@ fixed, visit it in a buffer." (or (match-beginning 2) (match-beginning 1)) 'display (propertize (cond - ((null (match-beginning 1)) "new file ") - ((null (match-beginning 2)) "deleted ") - (t "modified ")) + ((null (match-beginning 1)) + (concat "new file " (match-string 2))) + ((null (match-beginning 2)) + (concat "deleted " (match-string 1))) + (t + (concat "modified " (match-string 1)))) 'face '(diff-file-header diff-header))) - (unless (match-beginning 2) - (put-text-property (match-end 1) (1- (match-end 0)) - 'display ""))))) + (put-text-property (match-end 1) (1- (match-end 0)) + 'display "")))) nil) ;;; Syntax highlighting from font-lock diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 927a241a606..df8990c1187 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1793,7 +1793,6 @@ Return t if the buffer had changes, nil otherwise." (setq files (nreverse filtered)))) (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 buffer async) (set-buffer buffer) - (diff-mode) (setq-local diff-vc-backend (car vc-fileset)) (setq-local diff-vc-revisions (list rev1 rev2)) (setq-local revert-buffer-function @@ -1815,7 +1814,9 @@ Return t if the buffer had changes, nil otherwise." ;; after `pop-to-buffer'; the former assumes the diff buffer is ;; shown in some window. (let ((buf (current-buffer))) - (vc-run-delayed (vc-diff-finish buf (when verbose messages)))) + (vc-run-delayed (progn + (vc-diff-finish buf (when verbose messages)) + (diff-mode)))) ;; In the async case, we return t even if there are no differences ;; because we don't know that yet. t))) -- cgit v1.2.3 From cfd4d45f1164fb86bdad306ed0d532150a88f7e7 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Sat, 6 Nov 2021 01:13:49 +0100 Subject: Make 'C-x v v' on an unregistered file use the most specific backend * lisp/vc/vc.el (vc-next-action): Mention this. * lisp/vc/vc.el (vc-backend-for-registration): Choose the most specific backend (bug#50572). --- etc/NEWS | 12 +++++++++++- lisp/vc/vc.el | 23 +++++++++++++++++------ 2 files changed, 28 insertions(+), 7 deletions(-) (limited to 'lisp/vc/vc.el') diff --git a/etc/NEWS b/etc/NEWS index 9b4112a8f2b..78c848126a6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -167,6 +167,16 @@ change the terminal used on a remote host. * Changes in Specialized Modes and Packages in Emacs 29.1 +** vc + +--- +*** 'C-x v v' on an unregistered file will now use the most specific backend. +Previously, if you had an SVN-covered ~/ directory, and a Git-covered +directory in ~/foo/bar, using 'C-x v v' on a new, unregistered file +~/foo/bar/zot would register it in the SVN repository in ~/ instead of +in the Git repository in ~/foo/bar. This makes this command +consistent with 'vc-responsible-backend'. + ** Message --- @@ -432,7 +442,7 @@ long lists and vectors. 'pp' formats general Lisp sexps. This function does much the same, but applies formatting rules appropriate for Emacs Lisp code. -+++ ++++, *** New function 'file-has-changed-p'. This convenience function is useful when writing code that parses files at run-time, and allows Lisp programs to re-parse files only diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index df8990c1187..c9500f454ae 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -937,11 +937,18 @@ repository, prompting for the directory and the VC backend to use." (catch 'found ;; First try: find a responsible backend, it must be a backend - ;; under which FILE is not yet registered. - (dolist (backend vc-handled-backends) - (and (not (vc-call-backend backend 'registered file)) - (vc-call-backend backend 'responsible-p file) - (throw 'found backend))) + ;; under which FILE is not yet registered and with the most + ;; specific path to FILE. + (let ((max 0) + bk) + (dolist (backend vc-handled-backends) + (when (not (vc-call-backend backend 'registered file)) + (let* ((path (vc-call-backend backend 'responsible-p file)) + (len (length path))) + (when (and len (> len max)) + (setq max len bk backend))))) + (when bk + (throw 'found bk))) ;; no responsible backend (let* ((possible-backends (let (pos) @@ -1188,7 +1195,11 @@ For old-style locking-based version control systems, like RCS: *vc-log* buffer to check in the changes. Leave a read-only copy of each changed file after checking in. If every file is locked by you and unchanged, unlock them. - If every file is locked by someone else, offer to steal the lock." + If every file is locked by someone else, offer to steal the lock. + +When using this command to register a new file (or files), it +will automatically deduce which VC repository to register it +with, using the most specific one." (interactive "P") (let* ((vc-fileset (vc-deduce-fileset nil t 'state-model-only-files)) (backend (car vc-fileset)) -- cgit v1.2.3 From 358b8d0361c8152026aeb263f0d0fc29d76d2362 Mon Sep 17 00:00:00 2001 From: Matthias Meulien Date: Tue, 9 Nov 2021 04:46:53 +0100 Subject: Fix local variables overwritten when diff-mode is set * lisp/vc/diff-mode.el (diff-mode): (diff-setup-buffer-type): Defun to initialize `diff-buffer-type' * lisp/vc/vc.el (vc-diff-finish): Set `diff-buffer-type' after content inserted (vc-diff-internal): Restore `diff-mode' being set before local variables (bug#51016). --- lisp/vc/diff-mode.el | 26 ++++++++++++++++---------- lisp/vc/vc.el | 6 +++--- 2 files changed, 19 insertions(+), 13 deletions(-) (limited to 'lisp/vc/vc.el') diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 746f76b46c3..9bac3aa67d8 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -1475,6 +1475,21 @@ See `after-change-functions' for the meaning of BEG, END and LEN." ;; Added when diff--font-lock-prettify is non-nil! (cl-pushnew 'display font-lock-extra-managed-props))) +(defun diff-setup-buffer-type () + "Try to guess the `diff-buffer-type' from content of current Diff mode buffer. +`outline-regexp' is updated accordingly." + (save-excursion + (goto-char (point-min)) + (setq-local diff-buffer-type + (if (re-search-forward "^diff --git" nil t) + 'git + nil))) + (when (eq diff-buffer-type 'git) + (setq diff-outline-regexp + (concat "\\(^diff --git.*\n\\|" diff-hunk-header-re "\\)")) + (setq-local outline-level #'diff--outline-level)) + (setq-local outline-regexp diff-outline-regexp)) + (defvar whitespace-style) (defvar whitespace-trailing-regexp) @@ -1540,16 +1555,7 @@ a diff with \\[diff-reverse-direction]. #'diff--filter-substring) (unless buffer-file-name (hack-dir-local-variables-non-file-buffer)) - (save-excursion - (setq-local diff-buffer-type - (if (re-search-forward "^diff --git" nil t) - 'git - nil))) - (when (eq diff-buffer-type 'git) - (setq diff-outline-regexp - (concat "\\(^diff --git.*\n\\|" diff-hunk-header-re "\\)")) - (setq-local outline-level #'diff--outline-level)) - (setq-local outline-regexp diff-outline-regexp)) + (diff-setup-buffer-type)) ;;;###autoload (define-minor-mode diff-minor-mode diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index c9500f454ae..87137d8ede2 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1739,6 +1739,7 @@ to override the value of `vc-diff-switches' and `diff-switches'." (insert (cdr messages) ".\n") (message "%s" (cdr messages)))) (diff-setup-whitespace) + (diff-setup-buffer-type) (goto-char (point-min)) (when window (shrink-window-if-larger-than-buffer window))) @@ -1804,6 +1805,7 @@ Return t if the buffer had changes, nil otherwise." (setq files (nreverse filtered)))) (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 buffer async) (set-buffer buffer) + (diff-mode) (setq-local diff-vc-backend (car vc-fileset)) (setq-local diff-vc-revisions (list rev1 rev2)) (setq-local revert-buffer-function @@ -1825,9 +1827,7 @@ Return t if the buffer had changes, nil otherwise." ;; after `pop-to-buffer'; the former assumes the diff buffer is ;; shown in some window. (let ((buf (current-buffer))) - (vc-run-delayed (progn - (vc-diff-finish buf (when verbose messages)) - (diff-mode)))) + (vc-run-delayed (vc-diff-finish buf (when verbose messages)))) ;; In the async case, we return t even if there are no differences ;; because we don't know that yet. t))) -- cgit v1.2.3 From 565514fe96a575ceda2db229ac2dc7a78c2f9abd Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 9 Nov 2021 10:18:24 +0200 Subject: * lisp/vc/diff-mode.el (diff-setup-buffer-type): Move to diff-setup-whitespace * lisp/vc/vc.el: Add declare-function for diff-setup-buffer-type (bug#51016). --- lisp/vc/diff-mode.el | 30 +++++++++++++++--------------- lisp/vc/vc.el | 3 ++- 2 files changed, 17 insertions(+), 16 deletions(-) (limited to 'lisp/vc/vc.el') diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 9bac3aa67d8..e68aa2257d2 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -1475,21 +1475,6 @@ See `after-change-functions' for the meaning of BEG, END and LEN." ;; Added when diff--font-lock-prettify is non-nil! (cl-pushnew 'display font-lock-extra-managed-props))) -(defun diff-setup-buffer-type () - "Try to guess the `diff-buffer-type' from content of current Diff mode buffer. -`outline-regexp' is updated accordingly." - (save-excursion - (goto-char (point-min)) - (setq-local diff-buffer-type - (if (re-search-forward "^diff --git" nil t) - 'git - nil))) - (when (eq diff-buffer-type 'git) - (setq diff-outline-regexp - (concat "\\(^diff --git.*\n\\|" diff-hunk-header-re "\\)")) - (setq-local outline-level #'diff--outline-level)) - (setq-local outline-regexp diff-outline-regexp)) - (defvar whitespace-style) (defvar whitespace-trailing-regexp) @@ -1591,6 +1576,21 @@ modified lines of the diff." "^[-+!] .*?\\([\t ]+\\)$" "^[-+!<>].*?\\([\t ]+\\)$")))) +(defun diff-setup-buffer-type () + "Try to guess the `diff-buffer-type' from content of current Diff mode buffer. +`outline-regexp' is updated accordingly." + (save-excursion + (goto-char (point-min)) + (setq-local diff-buffer-type + (if (re-search-forward "^diff --git" nil t) + 'git + nil))) + (when (eq diff-buffer-type 'git) + (setq diff-outline-regexp + (concat "\\(^diff --git.*\n\\|" diff-hunk-header-re "\\)")) + (setq-local outline-level #'diff--outline-level)) + (setq-local outline-regexp diff-outline-regexp)) + (defun diff-delete-if-empty () ;; An empty diff file means there's no more diffs to integrate, so we ;; can just remove the file altogether. Very handy for .rej files if we diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 87137d8ede2..4b56f1b795c 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -739,6 +739,7 @@ (require 'cl-lib) (declare-function diff-setup-whitespace "diff-mode" ()) +(declare-function diff-setup-buffer-type "diff-mode" ()) (eval-when-compile (require 'dired)) @@ -1739,7 +1740,7 @@ to override the value of `vc-diff-switches' and `diff-switches'." (insert (cdr messages) ".\n") (message "%s" (cdr messages)))) (diff-setup-whitespace) - (diff-setup-buffer-type) + (diff-setup-buffer-type) (goto-char (point-min)) (when window (shrink-window-if-larger-than-buffer window))) -- cgit v1.2.3