From a6f67d60e13e06a8d07e54e63f93801a39b5c04b Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sun, 1 Aug 2021 23:43:37 +0300 Subject: * lisp/progmodes/project.el (project-switch-project): Use 'let*' (bug#49635). This allows overriding-local-map to have effect on read-key-sequence. --- lisp/progmodes/project.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/progmodes/project.el') diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index eab60756c8f..0e732864268 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1386,8 +1386,8 @@ to directory DIR." (define-key temp-map (vector keychar) cmd))))) command) (while (not command) - (let ((overriding-local-map commands-map) - (choice (read-key-sequence (project--keymap-prompt)))) + (let* ((overriding-local-map commands-map) + (choice (read-key-sequence (project--keymap-prompt)))) (when (setq command (lookup-key commands-map choice)) (unless (or project-switch-use-entire-map (assq command commands-menu)) -- cgit v1.2.3 From fa895379d6166c52b89774a9e450a94c2e429dae Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Fri, 6 Aug 2021 03:30:10 +0300 Subject: Change how project-find-file's completion works * lisp/progmodes/project.el (project--completing-read-strict): Allow to choose a non-existent file, with confirmation (bug#49204). Don't use the string at point as a "real" default, and instead only include it in "future history": meaning, it will be inserted on 'M-n' (bug#49865). --- etc/NEWS | 6 ++++++ lisp/progmodes/project.el | 27 ++++++++++----------------- 2 files changed, 16 insertions(+), 17 deletions(-) (limited to 'lisp/progmodes/project.el') diff --git a/etc/NEWS b/etc/NEWS index 6495fd09515..7fc53ff6c01 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2074,6 +2074,12 @@ project's root directory, respectively. This command lets you interactively remove an entry from the list of projects in 'project-list-file'. +*** 'project-find-file' now accepts non-existent file names (to +facilitate creating a file inside some nested sub-directory easily). + +*** 'project-find-file' doesn't use the string at point as default +input, now it's only suggested as part of "future history". + ** xref --- diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 0e732864268..6a330ecb2b3 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -879,23 +879,16 @@ PREDICATE, HIST, and DEFAULT have the same meaning as in (defun project--completing-read-strict (prompt collection &optional predicate hist default) - ;; Tried both expanding the default before showing the prompt, and - ;; removing it when it has no matches. Neither seems natural - ;; enough. Removal is confusing; early expansion makes the prompt - ;; too long. - (let* ((new-prompt (if (and default (not (string-equal default ""))) - (format "%s (default %s): " prompt default) - (format "%s: " prompt))) - (res (completing-read new-prompt - collection predicate t - nil ;; initial-input - hist default))) - (when (and (equal res default) - (not (test-completion res collection predicate))) - (setq res - (completing-read (format "%s: " prompt) - collection predicate t res hist nil))) - res)) + (minibuffer-with-setup-hook + (lambda () + (setq-local minibuffer-default-add-function + (lambda () + (let ((minibuffer-default default)) + (minibuffer-default-add-completions))))) + (completing-read prompt + collection predicate 'confirm + nil + hist))) ;;;###autoload (defun project-dired () -- cgit v1.2.3 From 35cea6c94c658f101548df5325ec3abda0079d2a Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Fri, 6 Aug 2021 11:34:02 +0300 Subject: Add colon-space after prompt * lisp/progmodes/project.el (project--completing-read-strict): Fix last change's regression (bug#49865). --- lisp/progmodes/project.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/progmodes/project.el') diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 6a330ecb2b3..b7101754779 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -885,7 +885,7 @@ PREDICATE, HIST, and DEFAULT have the same meaning as in (lambda () (let ((minibuffer-default default)) (minibuffer-default-add-completions))))) - (completing-read prompt + (completing-read (format "%s: " prompt) collection predicate 'confirm nil hist))) -- cgit v1.2.3 From 3b32d057ff2258177fdcd90cd70836ec2ad45f86 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sun, 8 Aug 2021 14:13:49 +0300 Subject: project.el: Bump the version * lisp/progmodes/project.el: Bump the version. --- lisp/progmodes/project.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/progmodes/project.el') diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index b7101754779..4620ea8f47e 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1,7 +1,7 @@ ;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- ;; Copyright (C) 2015-2021 Free Software Foundation, Inc. -;; Version: 0.6.0 +;; Version: 0.6.1 ;; Package-Requires: ((emacs "26.1") (xref "1.0.2")) ;; This is a GNU ELPA :core package. Avoid using functionality that -- cgit v1.2.3 From 28170b7d48ec81eb3811551cc1d63401f37cd108 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sat, 21 Aug 2021 05:26:12 +0300 Subject: Speed up project--read-project-buffer in remote buffers * lisp/progmodes/project.el (project-buffers): New generic function. (project--read-project-buffer): Use it here (bug#49264). (project--buffers-to-kill): And here. (project-buffers): Specialized implementation for vc-project. --- lisp/progmodes/project.el | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) (limited to 'lisp/progmodes/project.el') diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 4620ea8f47e..f9b302bb2be 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -51,6 +51,11 @@ ;; files and its relations to external directories. `project-files' ;; should be consistent with `project-ignores'. ;; +;; `project-buffers' can be overridden if the project has some unusual +;; shape (e.g. it contains files residing outside of its root, or some +;; files inside the root must not be considered a part of it). It +;; should be consistent with `project-files'. +;; ;; This list can change in future versions. ;; ;; VC project: @@ -334,6 +339,16 @@ Also quote LOCAL-FILES if `default-directory' is quoted." (concat remote-id file)) local-files)))) +(cl-defgeneric project-buffers (project) + "Return the list of all live buffers that belong to PROJECT." + (let ((root (expand-file-name (file-name-as-directory (project-root project)))) + bufs) + (dolist (buf (buffer-list)) + (when (string-prefix-p root (expand-file-name + (buffer-local-value 'default-directory buf))) + (push buf bufs))) + (nreverse bufs))) + (defgroup project-vc nil "Project implementation based on the VC package." :version "25.1" @@ -628,6 +643,23 @@ DIRS must contain directory names." (hack-dir-local-variables-non-file-buffer)) (symbol-value var))) +(cl-defmethod project-buffers ((project (head vc))) + (let* ((root (expand-file-name (file-name-as-directory (project-root project)))) + (modules (unless (or (project--vc-merge-submodules-p root) + (project--submodule-p root)) + (mapcar + (lambda (m) (format "%s%s/" root m)) + (project--git-submodules)))) + dd + bufs) + (dolist (buf (buffer-list)) + (setq dd (expand-file-name (buffer-local-value 'default-directory buf))) + (when (and (string-prefix-p root dd) + (not (cl-find-if (lambda (module) (string-prefix-p module dd)) + modules))) + (push buf bufs))) + (nreverse bufs))) + ;;; Project commands @@ -1014,13 +1046,11 @@ If non-nil, it overrides `compilation-buffer-name-function' for (current-buffer (current-buffer)) (other-buffer (other-buffer current-buffer)) (other-name (buffer-name other-buffer)) + (buffers (project-buffers pr)) (predicate (lambda (buffer) ;; BUFFER is an entry (BUF-NAME . BUF-OBJ) of Vbuffer_alist. - (and (cdr buffer) - (equal pr - (with-current-buffer (cdr buffer) - (project-current))))))) + (memq (cdr buffer) buffers)))) (read-buffer "Switch to buffer: " (when (funcall predicate (cons other-name other-buffer)) @@ -1160,7 +1190,7 @@ of CONDITIONS." What buffers should or should not be killed is described in `project-kill-buffer-conditions'." (let (bufs) - (dolist (buf (project--buffer-list pr)) + (dolist (buf (project-buffers pr)) (when (project--kill-buffer-check buf project-kill-buffer-conditions) (push buf bufs))) bufs)) -- cgit v1.2.3 From 742ae84a9c53fd8479b0000e907028254a8add7f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 21 Aug 2021 10:10:28 +0300 Subject: ; * lisp/progmodes/project.el: Fix punctuation in the commentary. --- lisp/progmodes/project.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/progmodes/project.el') diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index f9b302bb2be..ae9bf035717 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -53,7 +53,7 @@ ;; ;; `project-buffers' can be overridden if the project has some unusual ;; shape (e.g. it contains files residing outside of its root, or some -;; files inside the root must not be considered a part of it). It +;; files inside the root must not be considered a part of it). It ;; should be consistent with `project-files'. ;; ;; This list can change in future versions. -- cgit v1.2.3 From 8761d30da0c4d7d9fd59c192bc283e17b04c5db3 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 31 Aug 2021 22:24:02 +0200 Subject: Avoid failing if vc backend doesn't implement ignore-completion-table * project.el (project-ignores): Handle vc-not-supported signals --- lisp/progmodes/project.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp/progmodes/project.el') diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index ae9bf035717..e420a4ccca7 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -604,7 +604,9 @@ backend implementation of `project-external-roots'.") (replace-match "./" t t entry 1) (concat "./" entry))) (t entry))) - (vc-call-backend backend 'ignore-completion-table root)))) + (condition-case nil + (vc-call-backend backend 'ignore-completion-table root) + (vc-not-supported () nil))))) (project--value-in-dir 'project-vc-ignores root) (mapcar (lambda (dir) -- cgit v1.2.3 From 71f8b55f46af307759fb30dcf3f784092dd8834d Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Mon, 6 Sep 2021 05:01:07 +0300 Subject: project--files-in-directory: Fix handling of ignores * lisp/progmodes/project.el (project--files-in-directory): Pass "." as the DIR argument to 'find' because otherwise the ignore expression can match the project root directory name, which we don't want to happen (bug#50240). Fixup the resulting file names at the end with concatenation. Originally I thought it could lead to worse performance, but the results show equal or slightly better timings. * lisp/progmodes/xref.el (xref-matches-in-directory): Apply a similar fix. (xref--find-ignores-arguments): Use file-name-as-directory, so that when passed "." replace-match still had the expected effect. * test/lisp/progmodes/project-tests.el (project-ignores-bug-50240): New test. * test/lisp/progmodes/xref-tests.el (xref-matches-in-directory-filters-with-ignores): New test. --- lisp/progmodes/project.el | 12 ++++++------ lisp/progmodes/xref.el | 17 +++++++++++------ test/lisp/progmodes/project-tests.el | 15 +++++++++++++++ test/lisp/progmodes/xref-tests.el | 8 ++++++++ 4 files changed, 40 insertions(+), 12 deletions(-) (limited to 'lisp/progmodes/project.el') diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index e420a4ccca7..b6eea7e27e4 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -302,11 +302,10 @@ to find the list of ignores for each directory." ;; expanded and not left for the shell command ;; to interpret. (localdir (file-name-unquote (file-local-name (expand-file-name dir)))) - (command (format "%s -H %s %s -type f %s -print0" + (dfn (directory-file-name localdir)) + (command (format "%s -H . %s -type f %s -print0" find-program - (shell-quote-argument - (directory-file-name localdir)) ; Bug#48471 - (xref--find-ignores-arguments ignores localdir) + (xref--find-ignores-arguments ignores "./") (if files (concat (shell-quote-argument "(") " " find-name-arg " " @@ -324,8 +323,9 @@ to find the list of ignores for each directory." (unless (zerop status) (error "File listing failed: %s" (buffer-string)))))))) (project--remote-file-names - (sort (split-string output "\0" t) - #'string<)))) + (mapcar (lambda (s) (concat dfn (substring s 1))) + (sort (split-string output "\0" t) + #'string<))))) (defun project--remote-file-names (local-files) "Return LOCAL-FILES as if they were on the system of `default-directory'. diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index e594624573b..ec8b05d2943 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1553,18 +1553,18 @@ IGNORES is a list of glob patterns for files to ignore." ;; do that reliably enough, without creating false negatives? (command (xref--rgrep-command (xref--regexp-to-extended regexp) files - (directory-file-name - (file-name-unquote - (file-local-name (expand-file-name dir)))) + "." ignores)) - (def default-directory) + (local-dir (directory-file-name + (file-name-unquote + (file-local-name (expand-file-name dir))))) (buf (get-buffer-create " *xref-grep*")) (`(,grep-re ,file-group ,line-group . ,_) (car grep-regexp-alist)) (status nil) (hits nil)) (with-current-buffer buf (erase-buffer) - (setq default-directory def) + (setq default-directory dir) (setq status (process-file-shell-command command nil t)) (goto-char (point-min)) @@ -1577,7 +1577,7 @@ IGNORES is a list of glob patterns for files to ignore." (user-error "Search failed with status %d: %s" status (buffer-string))) (while (re-search-forward grep-re nil t) (push (list (string-to-number (match-string line-group)) - (match-string file-group) + (concat local-dir (substring (match-string file-group) 1)) (buffer-substring-no-properties (point) (line-end-position))) hits))) (xref--convert-hits (nreverse hits) regexp))) @@ -1746,6 +1746,11 @@ directory, used as the root of the ignore globs." (cl-assert (not (string-match-p "\\`~" dir))) (if (not ignores) "" + ;; TODO: All in-tree callers are passing in just "." or "./". + ;; We can simplify. + ;; And, if we ever end up deleting xref-matches-in-directory, move + ;; this function to the project package. + (setq dir (file-name-as-directory dir)) (concat (shell-quote-argument "(") " -path " diff --git a/test/lisp/progmodes/project-tests.el b/test/lisp/progmodes/project-tests.el index 68460a9fa5b..1e3f258ac2a 100644 --- a/test/lisp/progmodes/project-tests.el +++ b/test/lisp/progmodes/project-tests.el @@ -107,4 +107,19 @@ directory name (Bug#48471)." collect (file-relative-name file dir)))) (should (equal relative-files '("some-file")))))) +(ert-deftest project-ignores-bug-50240 () + "Check that `project-files' does not ignore all files. +When `project-ignores' includes a name matching project dir." + (skip-unless (executable-find find-program)) + (project-tests--with-temporary-directory dir + (make-empty-file (expand-file-name "some-file" dir)) + (let* ((project (make-project-tests--trivial + :root (file-name-as-directory dir) + :ignores (list (file-name-nondirectory + (directory-file-name dir))))) + (files (project-files project))) + (should (equal files + (list + (expand-file-name "some-file" dir))))))) + ;;; project-tests.el ends here diff --git a/test/lisp/progmodes/xref-tests.el b/test/lisp/progmodes/xref-tests.el index d29452243b2..ff4b647ae0f 100644 --- a/test/lisp/progmodes/xref-tests.el +++ b/test/lisp/progmodes/xref-tests.el @@ -52,6 +52,14 @@ (should (string-match-p "file1\\.txt\\'" (xref-location-group (nth 0 locs)))) (should (string-match-p "file2\\.txt\\'" (xref-location-group (nth 1 locs)))))) +(ert-deftest xref-matches-in-directory-filters-with-ignores () + (let ((locs (xref-matches-in-directory "bar" "*" xref-tests--data-dir + '("./file1.*")))) + (should (= 1 (length locs))) + (should (string-match-p "file2\\.txt\\'" (xref-location-group + (xref-item-location + (nth 0 locs))))))) + (ert-deftest xref-matches-in-directory-finds-two-matches-on-the-same-line () (let ((locs (xref-tests--locations-in-data-dir "foo"))) (should (= 2 (length locs))) -- cgit v1.2.3 From b52cafe49650f7b3398059e1655c77438b9cb125 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 7 Sep 2021 04:44:38 +0300 Subject: Support specifying just one command in project-switch-commands * lisp/progmodes/project.el (project-switch-commands): Describe the new possible type of value. (project--switch-project-command): New function, extract from project-switch-project. (project-switch-project): If project-switch-commands's value is a symbol, invoke that command without showing a menu. Co-authored-by: Jiacai Liu --- lisp/progmodes/project.el | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) (limited to 'lisp/progmodes/project.el') diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index b6eea7e27e4..ba95ed094ed 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1344,17 +1344,22 @@ Each element is of the form (COMMAND LABEL &optional KEY) where COMMAND is the command to run when KEY is pressed. LABEL is used to distinguish the menu entries in the dispatch menu. If KEY is absent, COMMAND must be bound in `project-prefix-map', and the -key is looked up in that map." +key is looked up in that map. + +The value can also be a symbol, the name of the command to be +invoked immediately without any dispatch menu." :version "28.1" :group 'project :package-version '(project . "0.6.0") - :type '(repeat - (list - (symbol :tag "Command") - (string :tag "Label") - (choice :tag "Key to press" - (const :tag "Infer from the keymap" nil) - (character :tag "Explicit key"))))) + :type '(choice + (repeat :tag "Commands menu" + (list + (symbol :tag "Command") + (string :tag "Label") + (choice :tag "Key to press" + (const :tag "Infer from the keymap" nil) + (character :tag "Explicit key")))) + (symbol :tag "Single command"))) (defcustom project-switch-use-entire-map nil "Make `project-switch-project' use entire `project-prefix-map'. @@ -1384,15 +1389,7 @@ are legal even if they aren't listed in the dispatch menu." project-switch-commands " ")) -;;;###autoload -(defun project-switch-project (dir) - "\"Switch\" to another project by running an Emacs command. -The available commands are presented as a dispatch menu -made from `project-switch-commands'. - -When called in a program, it will use the project corresponding -to directory DIR." - (interactive (list (project-prompt-project-dir))) +(defun project--switch-project-command () (let* ((commands-menu (mapcar (lambda (row) @@ -1423,6 +1420,20 @@ to directory DIR." (when (memq global-command '(keyboard-quit keyboard-escape-quit)) (call-interactively global-command))))) + command)) + +;;;###autoload +(defun project-switch-project (dir) + "\"Switch\" to another project by running an Emacs command. +The available commands are presented as a dispatch menu +made from `project-switch-commands'. + +When called in a program, it will use the project corresponding +to directory DIR." + (interactive (list (project-prompt-project-dir))) + (let ((command (if (symbolp project-switch-commands) + project-switch-commands + (project--switch-project-command)))) (let ((default-directory dir) (project-current-inhibit-prompt t)) (call-interactively command)))) -- cgit v1.2.3 From 9000aeaed446a02aaf0684e02f40312b3a2e0b59 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 14 Sep 2021 00:53:05 +0300 Subject: Make sure to return some valid project root * lisp/progmodes/project.el (project-prompt-project-dir): If the user just pressed RET on prompt, prompt again. --- lisp/progmodes/project.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lisp/progmodes/project.el') diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index ba95ed094ed..d034443907d 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1308,7 +1308,10 @@ It's also possible to enter an arbitrary directory not in the list." ;; completion style). (project--file-completion-table (append project--list `(,dir-choice)))) - (pr-dir (completing-read "Select project: " choices nil t))) + (pr-dir "")) + (while (equal pr-dir "") + ;; If the user simply pressed RET, do this again until they don't. + (setq pr-dir (completing-read "Select project: " choices nil t))) (if (equal pr-dir dir-choice) (read-directory-name "Select directory: " default-directory nil t) pr-dir))) -- cgit v1.2.3 From 5a34b65a3bfbf639a02b314efb4c9e69ba063c07 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 14 Sep 2021 00:56:20 +0300 Subject: Use the term "future history" rather than "default" * lisp/progmodes/project.el (project-find-file, project-or-external-find-file): Update docstring. (project--read-file-cpd-relative, project--read-file-absolute) (project--completing-read-strict): Rename DEFAULT to MB-DEFAULT. (project-find-file-in): Rename FILENAME to SUGGESTED-FILENAME. --- lisp/progmodes/project.el | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'lisp/progmodes/project.el') diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index d034443907d..b2b1a7870a3 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -837,8 +837,8 @@ pattern to search for." (defun project-find-file () "Visit a file (with completion) in the current project. -The completion default is the filename at point, determined by -`thing-at-point' (whether such file exists or not)." +The filename at point (determined by `thing-at-point'), if any, +is available as part of \"future history\"." (interactive) (let* ((pr (project-current t)) (dirs (list (project-root pr)))) @@ -848,8 +848,8 @@ The completion default is the filename at point, determined by (defun project-or-external-find-file () "Visit a file (with completion) in the current project or external roots. -The completion default is the filename at point, determined by -`thing-at-point' (whether such file exists or not)." +The filename at point (determined by `thing-at-point'), if any, +is available as part of \"future history\"." (interactive) (let* ((pr (project-current t)) (dirs (cons @@ -870,11 +870,14 @@ For the arguments list, see `project--read-file-cpd-relative'." (defun project--read-file-cpd-relative (prompt all-files &optional predicate - hist default) + hist mb-default) "Read a file name, prompting with PROMPT. ALL-FILES is a list of possible file name completions. -PREDICATE, HIST, and DEFAULT have the same meaning as in -`completing-read'." + +PREDICATE and HIST have the same meaning as in `completing-read'. + +MB-DEFAULT is used as part of \"future history\", to be inserted +by the user at will." (let* ((common-parent-directory (let ((common-prefix (try-completion "" all-files))) (if (> (length common-prefix) 0) @@ -888,36 +891,39 @@ PREDICATE, HIST, and DEFAULT have the same meaning as in (res (project--completing-read-strict prompt new-collection predicate - hist default))) + hist mb-default))) (concat common-parent-directory res))) (defun project--read-file-absolute (prompt all-files &optional predicate - hist default) + hist mb-default) (project--completing-read-strict prompt (project--file-completion-table all-files) predicate - hist default)) + hist mb-default)) + +(defun project-find-file-in (suggested-filename dirs project) + "Complete a file name in DIRS in PROJECT and visit the result. -(defun project-find-file-in (filename dirs project) - "Complete FILENAME in DIRS in PROJECT and visit the result." +SUGGESTED-FILENAME is a relative file name, or part of it, which +is used as part of \"future history\"." (let* ((all-files (project-files project dirs)) (completion-ignore-case read-file-name-completion-ignore-case) (file (funcall project-read-file-name-function "Find file" all-files nil nil - filename))) + suggested-filename))) (if (string= file "") (user-error "You didn't specify the file") (find-file file)))) (defun project--completing-read-strict (prompt collection &optional predicate - hist default) + hist mb-default) (minibuffer-with-setup-hook (lambda () (setq-local minibuffer-default-add-function (lambda () - (let ((minibuffer-default default)) + (let ((minibuffer-default mb-default)) (minibuffer-default-add-completions))))) (completing-read (format "%s: " prompt) collection predicate 'confirm -- cgit v1.2.3 From 79eb840753edb2dd9e0bf1d4befb8e3e1275e009 Mon Sep 17 00:00:00 2001 From: João Távora Date: Mon, 13 Sep 2021 17:43:43 +0100 Subject: Bump lisp/progmodes/project.el version to 0.7.1 Amont other things exposes the new project-buffers generic function to ELPA users. * lisp/progmodes/project.el (Version): Bump to 0.7.1 --- lisp/progmodes/project.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/progmodes/project.el') diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index b2b1a7870a3..67c34b4e5c5 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1,7 +1,7 @@ ;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- ;; Copyright (C) 2015-2021 Free Software Foundation, Inc. -;; Version: 0.6.1 +;; Version: 0.7.1 ;; Package-Requires: ((emacs "26.1") (xref "1.0.2")) ;; This is a GNU ELPA :core package. Avoid using functionality that -- cgit v1.2.3 From df1d4f58948b6db8a4063c1458748deb684d4a1b Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 21 Sep 2021 03:34:00 +0300 Subject: New command: project-find-dir * doc/emacs/maintaining.texi (Project File Commands): Mention the new command and update the bindings information. * lisp/progmodes/project.el (project-find-dir): New command (bug#43153). (project-prefix-map): Use 'd' as its binding. Move 'project-dired' to 'D'. (project-switch-commands): Replace 'project-dired' with 'project-find-dir'. --- doc/emacs/maintaining.texi | 7 ++++++- lisp/progmodes/project.el | 25 +++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) (limited to 'lisp/progmodes/project.el') diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index b692c995513..f98e7b1edaf 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1769,8 +1769,13 @@ Replace}), and continues to the next match after you respond. If your response causes Emacs to exit the query-replace loop, you can later continue with @w{@kbd{M-x fileloop-continue @key{RET}}}. +@findex project-find-dir + The command @kbd{C-x p d} (@code{project-find-dir}) prompts you to +choose a directory inside the current project, with completion. +And opens a Dired buffer (@pxref{Dired}) listing the files in it. + @findex project-dired - The command @kbd{C-x p d} (@code{project-dired}) opens a Dired + The command @kbd{C-x p D} (@code{project-dired}) opens a Dired buffer (@pxref{Dired}) listing the files in the current project's root directory. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 67c34b4e5c5..f1437c6a238 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -674,7 +674,8 @@ DIRS must contain directory names." (define-key map "F" 'project-or-external-find-file) (define-key map "b" 'project-switch-to-buffer) (define-key map "s" 'project-shell) - (define-key map "d" 'project-dired) + (define-key map "d" 'project-find-dir) + (define-key map "D" 'project-dired) (define-key map "v" 'project-vc-dir) (define-key map "c" 'project-compile) (define-key map "e" 'project-eshell) @@ -930,6 +931,26 @@ is used as part of \"future history\"." nil hist))) +;;;###autoload +(defun project-find-dir () + "Start Dired in a directory inside the current project." + (interactive) + (let* ((project (project-current t)) + (all-files (project-files project)) + (completion-ignore-case read-file-name-completion-ignore-case) + ;; FIXME: This misses directories without any files directly + ;; inside. Consider DIRS-ONLY as an argument for + ;; `project-files-filtered', and see + ;; https://stackoverflow.com/a/50685235/615245 for possible + ;; implementation. + (all-dirs (mapcar #'file-name-directory all-files)) + (dir (funcall project-read-file-name-function + "Dired" + ;; Some completion UIs show duplicates. + (delete-dups all-dirs) + nil nil))) + (dired dir))) + ;;;###autoload (defun project-dired () "Start Dired in the current project's root." @@ -1342,7 +1363,7 @@ It's also possible to enter an arbitrary directory not in the list." (defcustom project-switch-commands '((project-find-file "Find file") (project-find-regexp "Find regexp") - (project-dired "Dired") + (project-find-dir "Find directory") (project-vc-dir "VC-Dir") (project-eshell "Eshell")) "Alist mapping commands to descriptions. -- cgit v1.2.3 From e1712bdb353914f621a956ffeb72c53f34e007f7 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 21 Sep 2021 16:07:39 +0300 Subject: Rename project-remove-known-project to project-forget-project * doc/emacs/maintaining.texi (Managing Projects): Ditto. * etc/NEWS: Update accordingly. * lisp/progmodes/project.el (project-forget-project): Rename from 'project-remove-known-project', for consistency with 'project-remember-project' (discussed in bug#50297). --- doc/emacs/maintaining.texi | 6 +++--- etc/NEWS | 2 +- lisp/ldefs-boot.el | 2 +- lisp/progmodes/project.el | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'lisp/progmodes/project.el') diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index f98e7b1edaf..7e8b0e5914d 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1866,14 +1866,14 @@ records the list of known projects. It defaults to the file @subsection Managing the Project List File @table @kbd -@item M-x project-remove-known-project +@item M-x project-forget-project Remove a known project from the @code{project-list-file}. @end table -@findex project-remove-known-project +@findex project-forget-project Normally Emacs automatically adds and removes projects to and from the @code{project-list-file}, but sometimes you may want to manually edit -the available projects. @kbd{M-x project-remove-known-project} +the available projects. @kbd{M-x project-forget-project} prompts you to choose one of the available projects, and then removes it from the file. diff --git a/etc/NEWS b/etc/NEWS index d241f864d35..e8196d277d0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2397,7 +2397,7 @@ project's root directory, respectively. This specifies the file in which to save the list of known projects. +++ -*** New command 'project-remove-known-project'. +*** New command 'project-forget-project'. This command lets you interactively remove an entry from the list of projects in 'project-list-file'. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 9cd5c9bfa84..0ab9552c60b 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -26590,7 +26590,7 @@ Save the result in `project-list-file' if the list of projects has changed. \(fn PR)" nil nil) -(autoload 'project-remove-known-project "project" "\ +(autoload 'project-forget-project "project" "\ Remove directory PROJECT-ROOT from the project list. PROJECT-ROOT is the root directory of a known project listed in the project list. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index f1437c6a238..ebd21d4b602 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1315,7 +1315,7 @@ passed to `message' as its first argument." (project--write-project-list))) ;;;###autoload -(defun project-remove-known-project (project-root) +(defun project-forget-project (project-root) "Remove directory PROJECT-ROOT from the project list. PROJECT-ROOT is the root directory of a known project listed in the project list." -- cgit v1.2.3 From 7f06fe894cabf8f33e10386d6adb5d2ce9481a25 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Wed, 22 Sep 2021 21:07:49 +0300 Subject: Put './' in the project directory completions * lisp/progmodes/project.el (project--read-file-cpd-relative): Put './' in the completions set when cpd was in the original (bug#50732). --- lisp/progmodes/project.el | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lisp/progmodes/project.el') diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index ebd21d4b602..2eead0d0696 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -887,7 +887,13 @@ by the user at will." (prompt (if (zerop cpd-length) prompt (concat prompt (format " in %s" common-parent-directory)))) + (included-cpd (when (member common-parent-directory all-files) + (setq all-files + (delete common-parent-directory all-files)) + t)) (substrings (mapcar (lambda (s) (substring s cpd-length)) all-files)) + (_ (when included-cpd + (setq substrings (cons "./" substrings)))) (new-collection (project--file-completion-table substrings)) (res (project--completing-read-strict prompt new-collection -- cgit v1.2.3 From aebba085cba13ad1439462923ffa0520456f1aad Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 22 Sep 2021 20:26:40 +0200 Subject: ; More minor stylistic fixes found by checkdoc --- lisp/allout.el | 35 +++++++++--------- lisp/ansi-color.el | 2 +- lisp/apropos.el | 4 +-- lisp/auth-source.el | 8 ++--- lisp/autoinsert.el | 7 ++-- lisp/bindings.el | 6 ++-- lisp/bookmark.el | 17 +++++---- lisp/buff-menu.el | 6 ++-- lisp/button.el | 45 +++++++++++------------ lisp/calc/calc-aent.el | 3 +- lisp/calc/calc-forms.el | 15 ++++---- lisp/calc/calc-poly.el | 2 +- lisp/calc/calc.el | 12 +++---- lisp/calculator.el | 9 +++-- lisp/calendar/diary-lib.el | 7 ++-- lisp/char-fold.el | 2 ++ lisp/cmuscheme.el | 2 +- lisp/comint.el | 2 +- lisp/cus-edit.el | 4 +-- lisp/cus-theme.el | 2 ++ lisp/dabbrev.el | 3 +- lisp/dired-aux.el | 4 +-- lisp/dired-x.el | 4 +-- lisp/dired.el | 5 ++- lisp/display-fill-column-indicator.el | 2 +- lisp/dos-vars.el | 6 ++-- lisp/edmacro.el | 13 +++---- lisp/elec-pair.el | 2 +- lisp/epa-dired.el | 2 ++ lisp/epa-file.el | 3 +- lisp/epa-hook.el | 2 ++ lisp/epa-mail.el | 3 +- lisp/epa.el | 11 +++--- lisp/epg.el | 4 ++- lisp/face-remap.el | 2 +- lisp/faces.el | 4 +-- lisp/ffap.el | 10 +++--- lisp/fileloop.el | 1 + lisp/files.el | 4 +-- lisp/filesets.el | 14 ++++---- lisp/find-dired.el | 2 +- lisp/foldout.el | 2 +- lisp/font-core.el | 2 ++ lisp/forms.el | 4 +-- lisp/hexl.el | 2 +- lisp/hi-lock.el | 2 +- lisp/image-dired.el | 4 +-- lisp/imenu.el | 3 +- lisp/indent.el | 15 ++++---- lisp/info-look.el | 6 ++-- lisp/international/ccl.el | 13 +++---- lisp/international/quail.el | 3 +- lisp/international/robin.el | 3 +- lisp/isearch.el | 2 +- lisp/jit-lock.el | 2 +- lisp/kmacro.el | 4 +-- lisp/loadhist.el | 3 +- lisp/locate.el | 2 +- lisp/macros.el | 13 ++++--- lisp/menu-bar.el | 6 ++-- lisp/mouse-drag.el | 2 +- lisp/mouse.el | 2 +- lisp/nxml/nxml-mode.el | 3 +- lisp/nxml/rng-loc.el | 4 +-- lisp/nxml/rng-valid.el | 5 ++- lisp/pcmpl-x.el | 2 ++ lisp/play/5x5.el | 6 ++-- lisp/play/doctor.el | 4 +-- lisp/play/dunnet.el | 12 +++---- lisp/play/hanoi.el | 2 +- lisp/play/mpuz.el | 2 +- lisp/play/tetris.el | 2 +- lisp/printing.el | 12 +++---- lisp/profiler.el | 6 ++-- lisp/progmodes/cc-bytecomp.el | 30 ++++++++-------- lisp/progmodes/cc-cmds.el | 5 +-- lisp/progmodes/cc-defs.el | 14 ++++---- lisp/progmodes/cc-engine.el | 10 +++--- lisp/progmodes/cc-fonts.el | 2 +- lisp/progmodes/cc-langs.el | 3 +- lisp/progmodes/cc-mode.el | 2 +- lisp/progmodes/cc-vars.el | 2 +- lisp/progmodes/cmacexp.el | 2 +- lisp/progmodes/compile.el | 8 +++-- lisp/progmodes/cperl-mode.el | 4 +-- lisp/progmodes/cpp.el | 6 ++-- lisp/progmodes/dcl-mode.el | 4 +-- lisp/progmodes/ebnf-yac.el | 2 +- lisp/progmodes/f90.el | 6 ++-- lisp/progmodes/flymake.el | 4 +-- lisp/progmodes/gdb-mi.el | 6 ++-- lisp/progmodes/grep.el | 4 +-- lisp/progmodes/hideshow.el | 2 +- lisp/progmodes/idlwave.el | 2 +- lisp/progmodes/opascal.el | 5 +-- lisp/progmodes/prog-mode.el | 4 +-- lisp/progmodes/project.el | 4 +-- lisp/progmodes/verilog-mode.el | 4 +-- lisp/progmodes/vhdl-mode.el | 67 +++++++++++++++++------------------ lisp/progmodes/xref.el | 2 +- lisp/rect.el | 4 +-- lisp/repeat.el | 2 +- lisp/replace.el | 13 +++---- lisp/ruler-mode.el | 2 +- lisp/server.el | 2 +- lisp/ses.el | 10 +++--- lisp/shell.el | 3 +- lisp/simple.el | 18 ++++++---- lisp/so-long.el | 8 ++--- lisp/sort.el | 3 +- lisp/subr.el | 2 ++ lisp/tempo.el | 2 +- lisp/term.el | 38 ++++++++++---------- lisp/textmodes/bib-mode.el | 2 +- lisp/textmodes/flyspell.el | 2 +- lisp/textmodes/makeinfo.el | 7 ++-- lisp/textmodes/mhtml-mode.el | 2 ++ lisp/textmodes/refill.el | 2 +- lisp/textmodes/reftex-dcr.el | 19 +++++----- lisp/textmodes/reftex-global.el | 6 ++-- lisp/textmodes/reftex-index.el | 4 +-- lisp/textmodes/reftex-parse.el | 6 ++-- lisp/textmodes/reftex-vars.el | 9 ++--- lisp/textmodes/texinfmt.el | 14 ++++---- lisp/transient.el | 4 +-- lisp/wdired.el | 4 +-- lisp/whitespace.el | 6 ++-- lisp/wid-edit.el | 7 ++-- lisp/woman.el | 4 +-- 129 files changed, 447 insertions(+), 408 deletions(-) (limited to 'lisp/progmodes/project.el') diff --git a/lisp/allout.el b/lisp/allout.el index bb365246587..c123e8ded4c 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -116,7 +116,7 @@ Do NOT set the value of this variable. Instead, customize "Create the allout keymap according to the keybinding specs, and set it. Useful standalone or to effect customizations of the -respective allout-mode keybinding variables, `allout-command-prefix', +respective `allout-mode' keybinding variables, `allout-command-prefix', `allout-prefixed-keybindings', and `allout-unprefixed-keybindings'" ;; Set the customization variable, if any: (when varname @@ -145,7 +145,7 @@ respective allout-mode keybinding variables, `allout-command-prefix', (allout-institute-keymap map))) ;;;_ > allout-institute-keymap (map) (defun allout-institute-keymap (map) - "Associate allout-mode bindings with allout as a minor mode." + "Associate `allout-mode' bindings with allout as a minor mode." ;; Architecture: ;; allout-mode-map var is a keymap by virtue of being a defalias for ;; allout-mode-map-value, which has the actual keymap value. @@ -358,7 +358,7 @@ Examples: See `allout-expose-topic' for more about the exposure process. Also, allout's mode-specific provisions will make topic prefixes default -to the comment-start string, if any, of the language of the file. This +to the `comment-start' string, if any, of the language of the file. This is modulo the setting of `allout-use-mode-specific-leader', which see." :type 'allout-layout-type :group 'allout) @@ -429,8 +429,7 @@ those that do not have the variable `comment-start' set. A value of ;;;_ = allout-show-bodies (defcustom allout-show-bodies nil - "If non-nil, show entire body when exposing a topic, rather than -just the header." + "If non-nil, show entire body when exposing a topic, rather than just the header." :type 'boolean :group 'allout) (make-variable-buffer-local 'allout-show-bodies) @@ -596,16 +595,16 @@ strings." "When non-nil, use mode-specific topic-header prefixes. Allout outline mode will use the mode-specific `allout-mode-leaders' or -comment-start string, if any, to lead the topic prefix string, so topic +`comment-start' string, if any, to lead the topic prefix string, so topic headers look like comments in the programming language. It will also use -the comment-start string, with an `_' appended, for `allout-primary-bullet'. +the `comment-start' string, with an `_' appended, for `allout-primary-bullet'. String values are used as literals, not regular expressions, so do not escape any regular-expression characters. Value t means to first check for assoc value in `allout-mode-leaders' -alist, then use comment-start string, if any, then use default (`.'). -\(See note about use of comment-start strings, below.) +alist, then use `comment-start' string, if any, then use default (`.'). +\(See note about use of `comment-start' strings, below.) Set to the symbol for either of `allout-mode-leaders' or `comment-start' to use only one of them, respectively. @@ -613,9 +612,9 @@ Set to the symbol for either of `allout-mode-leaders' or Value nil means to always use the default (`.') and leave `allout-primary-bullet' unaltered. -comment-start strings that do not end in spaces are tripled in +`comment-start' strings that do not end in spaces are tripled in the header-prefix, and an `_' underscore is tacked on the end, to -distinguish them from regular comment strings. comment-start +distinguish them from regular comment strings. `comment-start' strings that do end in spaces are not tripled, but an underscore is substituted for the space. [This presumes that the space is for appearance, not comment syntax. You can use @@ -633,8 +632,8 @@ undesired.]" (defvar allout-mode-leaders '() "Specific allout-prefix leading strings per major modes. -Use this if the mode's comment-start string isn't what you -prefer, or if the mode lacks a comment-start string. See +Use this if the mode's `comment-start' string isn't what you +prefer, or if the mode lacks a `comment-start' string. See `allout-use-mode-specific-leader' for more details. If you're constructing a string that will comment-out outline @@ -860,7 +859,7 @@ For details, see `allout-toggle-current-subtree-encryption's docstring." ;;;_ : Version ;;;_ = allout-version (defvar allout-version "2.3" - "Version of currently loaded outline package. (allout.el)") + "Version of currently loaded allout.el package.") ;;;_ > allout-version (defun allout-version (&optional here) "Return string describing the loaded outline version." @@ -1509,7 +1508,7 @@ See `allout-encryption-ciphertext-rejection-regexps' for rejection reasons.") 'allout-mode) ;;;_ > allout-write-contents-hook-handler () (defun allout-write-contents-hook-handler () - "Implement `allout-encrypt-unencrypted-on-saves' for file writes + "Implement `allout-encrypt-unencrypted-on-saves' for file writes. Return nil if all goes smoothly, or else return an informative message if an error is encountered. The message will serve as a @@ -3998,8 +3997,7 @@ With repeat count, shift topic depth by that amount." index do-successors sans-offspring) - "Like `allout-rebullet-topic', but on nearest containing topic -\(visible or not). + "Like `allout-rebullet-topic', but on nearest containing topic (visible or not). See `allout-rebullet-heading' for rebulleting behavior. @@ -5056,8 +5054,7 @@ Examples: max-pos))) ;;;_ > allout-old-expose-topic (spec &rest followers) (defun allout-old-expose-topic (spec &rest followers) - "Deprecated. Use `allout-expose-topic' (with different schema -format) instead. + "Deprecated. Use `allout-expose-topic' (with different schema format) instead. Dictate wholesale exposure scheme for current topic, according to SPEC. diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el index 79b1c9912f5..4315a7f3cef 100644 --- a/lisp/ansi-color.el +++ b/lisp/ansi-color.el @@ -604,7 +604,7 @@ codes. Finally, the so changed list of codes is returned." codes)) (defun ansi-color-make-color-map () - "Creates a vector of face definitions and returns it. + "Create a vector of face definitions and return it. The index into the vector is an ANSI code. See the documentation of `ansi-color-map' for an example. diff --git a/lisp/apropos.el b/lisp/apropos.el index 513175d7513..fc15cd3e011 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -1305,7 +1305,7 @@ as a heading." (error "There is nothing to follow here")))) (defun apropos-next-symbol () - "Move cursor down to the next symbol in an apropos-mode buffer." + "Move cursor down to the next symbol in an `apropos-mode' buffer." (interactive) (forward-line) (while (and (not (eq (face-at-point) 'apropos-symbol)) @@ -1313,7 +1313,7 @@ as a heading." (forward-line))) (defun apropos-previous-symbol () - "Move cursor back to the last symbol in an apropos-mode buffer." + "Move cursor back to the last symbol in an `apropos-mode' buffer." (interactive) (forward-line -1) (while (and (not (eq (face-at-point) 'apropos-symbol)) diff --git a/lisp/auth-source.el b/lisp/auth-source.el index d938522c803..3c1a6feaeeb 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -176,7 +176,7 @@ Overrides `password-cache-expiry' through a let-binding." ;; TODO: or maybe leave as (setq auth-source-netrc-use-gpg-tokens 'never) (defcustom auth-source-netrc-use-gpg-tokens 'never - "Set this to tell auth-source when to create GPG password + "Set this to tell `auth-source' when to create GPG password tokens in netrc files. It's either an alist or `never'. Note that if EPA/EPG is not available, this should NOT be used." :version "23.2" ;; No Gnus @@ -503,7 +503,7 @@ soon as a function returns non-nil.") (add-hook 'auth-source-backend-parser-functions #'auth-source-backends-parser-secrets) (defun auth-source-backend-parse-parameters (entry backend) - "Fill in the extra auth-source-backend parameters of ENTRY. + "Fill in the extra `auth-source-backend' parameters of ENTRY. Using the plist ENTRY, get the :host, :port, and :user search parameters." (let ((entry (if (stringp entry) @@ -1227,7 +1227,7 @@ FILE is the file from which we obtained this token." &key backend require create type max host user port &allow-other-keys) - "Given a property list SPEC, return search matches from the :backend. + "Given a property list SPEC, return search matches from the `:backend'. See `auth-source-search' for details on SPEC." ;; just in case, check that the type is correct (null or same as the backend) (cl-assert (or (null type) (eq type (oref backend type))) @@ -2274,7 +2274,7 @@ entries for git.gnus.org: &key backend require type max host user port &allow-other-keys) - "Given a property list SPEC, return search matches from the :backend. + "Given a property list SPEC, return search matches from the `:backend'. See `auth-source-search' for details on SPEC." ;; just in case, check that the type is correct (null or same as the backend) (cl-assert (or (null type) (eq type (oref backend type))) diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el index 995d9e2e0fe..063d0a14d63 100644 --- a/lisp/autoinsert.el +++ b/lisp/autoinsert.el @@ -83,10 +83,11 @@ When this is `function', only ask when called non-interactively." (const :tag "Ask if called non-interactively" function) (other :tag "Ask" t))) -(defcustom auto-insert-prompt "Perform %s auto-insertion? " - "Prompt to use when querying whether to auto-insert. +(defcustom auto-insert-prompt "Perform %s auto-insertion?" + "Prompt to use when querying whether to `auto-insert'. If this contains a %s, that will be replaced by the matching rule." - :type 'string) + :type 'string + :version "28.1") (defcustom auto-insert-alist diff --git a/lisp/bindings.el b/lisp/bindings.el index 5c1adef9b50..343f1ba0fa7 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -184,8 +184,8 @@ mouse-3: Remove current window from display")) (defvar mode-line-front-space '(:eval (if (display-graphic-p) " " "-")) "Mode line construct to put at the front of the mode line. By default, this construct is displayed right at the beginning of -the mode line, except that if there is a memory-full message, it -is displayed first.") +the mode line, except that if there is a \"memory full\" message, +it is displayed first.") (put 'mode-line-front-space 'risky-local-variable t) (defun mode-line-mule-info-help-echo (window _object _point) @@ -1086,7 +1086,7 @@ if `inhibit-field-text-motion' is non-nil." (define-key map "p" 'previous-error) (define-key map "\M-p" 'previous-error) map) - "Keymap to repeat next-error key sequences. Used in `repeat-mode'.") + "Keymap to repeat `next-error' key sequences. Used in `repeat-mode'.") (put 'next-error 'repeat-map 'next-error-repeat-map) (put 'previous-error 'repeat-map 'next-error-repeat-map) diff --git a/lisp/bookmark.el b/lisp/bookmark.el index ac63c8f1b0a..d64966df5af 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -905,7 +905,9 @@ others are still there, should the user decide to delete the most recent one. To yank words from the text of the buffer and use them as part of the -bookmark name, type C-w while setting a bookmark. Successive C-w's +bookmark name, type \\\ +\\[bookmark-yank-word] while setting a bookmark. Successive \ +\\[bookmark-yank-word]'s yank successive words. Typing \\[universal-argument] inserts (at the bookmark name prompt) the name of the last @@ -938,7 +940,9 @@ Otherwise, if a bookmark named NAME already exists but PUSH-BOOKMARK is nil, raise an error. To yank words from the text of the buffer and use them as part of the -bookmark name, type C-w while setting a bookmark. Successive C-w's +bookmark name, type \\\ +\\[bookmark-yank-word] while setting a bookmark. Successive \ +\\[bookmark-yank-word]'s yank successive words. Typing \\[universal-argument] inserts (at the bookmark name prompt) the name of the last @@ -1361,7 +1365,8 @@ If called from Lisp, prompt for NEW-NAME if only OLD-NAME was passed as an argument. If called with two strings, then no prompting is done. You must pass at least OLD-NAME when calling from Lisp. -While you are entering the new name, consecutive C-w's insert +While you are entering the new name, consecutive \ +\\\\[bookmark-yank-word]'s insert consecutive words from the text of the buffer into the new bookmark name." (interactive (list (bookmark-completing-read "Old bookmark name"))) @@ -1734,8 +1739,8 @@ unique numeric suffixes \"<2>\", \"<3>\", etc." (define-key map [mouse-2] 'bookmark-bmenu-other-window-with-mouse) map)) -(easy-menu-define - bookmark-menu bookmark-bmenu-mode-map "Bookmark Menu" +(easy-menu-define bookmark-menu bookmark-bmenu-mode-map + "Menu for `bookmark-bmenu'." '("Bookmark" ["Select Bookmark in This Window" bookmark-bmenu-this-window t] ["Select Bookmark in Full-Frame Window" bookmark-bmenu-1-window t] @@ -2062,7 +2067,7 @@ You can mark bookmarks with the \\\\[bookmark-bmenu-mar (defun bookmark-bmenu-save () "Save the current list into a bookmark file. -With a prefix arg, prompts for a file to save them in. +With a prefix arg, prompt for a file to save them in. See also the related behaviors of `bookmark-load' and `bookmark-bmenu-load'." diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index 340c926f8d6..1013a7c4973 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el @@ -222,7 +222,7 @@ In Buffer Menu mode, the following commands are defined: so the Buffer Menu remains visible in its window. \\[Buffer-menu-view] Select current line's buffer, in View mode. \\[Buffer-menu-view-other-window] Select that buffer in - another window, in view-mode. + another window, in `view-mode'. \\[Buffer-menu-switch-other-window] Make another window display that buffer. \\[Buffer-menu-mark] Mark current line's buffer to be displayed. \\[Buffer-menu-select] Select current line's buffer. @@ -233,7 +233,7 @@ In Buffer Menu mode, the following commands are defined: \\[Buffer-menu-isearch-buffers] Incremental search in the marked buffers. \\[Buffer-menu-isearch-buffers-regexp] Isearch for regexp in the marked buffers. \\[Buffer-menu-multi-occur] Show lines matching regexp in the marked buffers. -\\[Buffer-menu-visit-tags-table] visit-tags-table this buffer. +\\[Buffer-menu-visit-tags-table] `visit-tags-table' this buffer. \\[Buffer-menu-not-modified] Clear modified-flag on that buffer. \\[Buffer-menu-save] Mark that buffer to be saved, and move down. \\[Buffer-menu-delete] Mark that buffer to be deleted, and move down. @@ -306,7 +306,7 @@ ARG, show only buffers that are visiting files." (display-buffer (list-buffers-noselect arg))) (defun Buffer-menu-toggle-files-only (arg) - "Toggle whether the current buffer-menu displays only file buffers. + "Toggle whether the current `buffer-menu' displays only file buffers. With a positive ARG, display only file buffers. With zero or negative ARG, display other buffers as well." (interactive "P" Buffer-menu-mode) diff --git a/lisp/button.el b/lisp/button.el index 74dfb5d5419..aedd07b762d 100644 --- a/lisp/button.el +++ b/lisp/button.el @@ -113,21 +113,22 @@ Mode-specific keymaps may want to use this as their parent keymap.") ;; [this is an internal function] (defsubst button-category-symbol (type) - "Return the symbol used by button-type TYPE to store properties. + "Return the symbol used by `button-type' TYPE to store properties. Buttons inherit them by setting their `category' property to that symbol." (or (get type 'button-category-symbol) (error "Unknown button type `%s'" type))) (defun define-button-type (name &rest properties) "Define a `button type' called NAME (a symbol). -The remaining arguments form a plist of PROPERTY VALUE pairs, -specifying properties to use as defaults for buttons with this type -\(a button's type may be set by giving it a `type' property when -creating the button, using the :type keyword argument). +The remaining PROPERTIES arguments form a plist of PROPERTY VALUE +pairs, specifying properties to use as defaults for buttons with +this type (a button's type may be set by giving it a `type' +property when creating the button, using the :type keyword +argument). In addition, the keyword argument :supertype may be used to specify a -button-type from which NAME inherits its default property values -\(however, the inheritance happens only when NAME is defined; subsequent +`button-type' from which NAME inherits its default property values +(however, the inheritance happens only when NAME is defined; subsequent changes to a supertype are not reflected in its subtypes)." (let ((catsym (make-symbol (concat (symbol-name name) "-button"))) (super-catsym @@ -156,15 +157,15 @@ changes to a supertype are not reflected in its subtypes)." name)) (defun button-type-put (type prop val) - "Set the button-type TYPE's PROP property to VAL." + "Set the `button-type' TYPE's PROP property to VAL." (put (button-category-symbol type) prop val)) (defun button-type-get (type prop) - "Get the property of button-type TYPE named PROP." + "Get the property of `button-type' TYPE named PROP." (get (button-category-symbol type) prop)) (defun button-type-subtype-p (type supertype) - "Return non-nil if button-type TYPE is a subtype of SUPERTYPE." + "Return non-nil if `button-type' TYPE is a subtype of SUPERTYPE." (or (eq type supertype) (and type (button-type-subtype-p (button-type-get type 'supertype) @@ -271,11 +272,11 @@ This function only works when BUTTON is in the current buffer." (button-end button)))) (defsubst button-type (button) - "Return BUTTON's button-type." + "Return BUTTON's `button-type'." (button-get button 'type)) (defun button-has-type-p (button type) - "Return non-nil if BUTTON has button-type TYPE, or one of its subtypes." + "Return non-nil if BUTTON has `button-type' TYPE, or one of its subtypes." (button-type-subtype-p (button-get button 'type) type)) (defun button--area-button-p (b) @@ -290,10 +291,10 @@ Such area buttons are used for buttons in the mode-line and header-line." (defun make-button (beg end &rest properties) "Make a button from BEG to END in the current buffer. -The remaining arguments form a plist of PROPERTY VALUE pairs, -specifying properties to add to the button. +The remaining PROPERTIES arguments form a plist of PROPERTY VALUE +pairs, specifying properties to add to the button. In addition, the keyword argument :type may be used to specify a -button-type from which to inherit other properties; see +`button-type' from which to inherit other properties; see `define-button-type'. Also see `make-text-button', `insert-button'." @@ -314,7 +315,7 @@ Also see `make-text-button', `insert-button'." The remaining arguments form a plist of PROPERTY VALUE pairs, specifying properties to add to the button. In addition, the keyword argument :type may be used to specify a -button-type from which to inherit other properties; see +`button-type' from which to inherit other properties; see `define-button-type'. Also see `insert-text-button', `make-button'." @@ -328,10 +329,10 @@ Also see `insert-text-button', `make-button'." (defun make-text-button (beg end &rest properties) "Make a button from BEG to END in the current buffer. -The remaining arguments form a plist of PROPERTY VALUE pairs, -specifying properties to add to the button. +The remaining PROPERTIES arguments form a plist of PROPERTY VALUE +pairs, specifying properties to add to the button. In addition, the keyword argument :type may be used to specify a -button-type from which to inherit other properties; see +`button-type' from which to inherit other properties; see `define-button-type'. This function is like `make-button', except that the button is actually @@ -382,10 +383,10 @@ Also see `insert-text-button'." (defun insert-text-button (label &rest properties) "Insert a button with the label LABEL. -The remaining arguments form a plist of PROPERTY VALUE pairs, -specifying properties to add to the button. +The remaining PROPERTIES arguments form a plist of PROPERTY VALUE +pairs, specifying properties to add to the button. In addition, the keyword argument :type may be used to specify a -button-type from which to inherit other properties; see +`button-type' from which to inherit other properties; see `define-button-type'. This function is like `insert-button', except that the button is diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index 0e913ddfdb9..52c024865a7 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -537,8 +537,7 @@ The value t means abort and give an error message.") ("₋" "-") ; - ("₍" "(") ; ( ("₎" ")")) ; ) - "A list whose elements (old new) indicate replacements to make -in Calc algebraic input.") + "A list indicating replacements to make in Calc algebraic input.") (defvar math-read-superscripts "⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁽⁾ⁿⁱ" ; 0123456789+-()ni diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index ac57011da04..ce8e3579f48 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el @@ -703,16 +703,19 @@ in the Gregorian calendar." fmt)))) (defconst math-julian-date-beginning '(float 17214245 -1) - "The beginning of the Julian date calendar, -as measured in the number of days before December 31, 1 BC (Gregorian).") + "The beginning of the Julian date calendar. +This is measured in the number of days before December 31, 1 +BC (Gregorian).") (defconst math-julian-date-beginning-int 1721425 - "The beginning of the Julian date calendar, -as measured in the integer number of days before December 31, 1 BC (Gregorian).") + "The beginning of the Julian date calendar. +This is measured in the integer number of days before December +31, 1 BC (Gregorian).") (defconst math-unix-epoch 719163 - "The beginning of Unix time: days from December 31, 1 BC (Gregorian) -to Jan 1, 1970 AD.") + "The beginning of Unix time. +This is measured in the integer number of days from December 31, +1 BC (Gregorian) to Jan 1, 1970 AD.") (defun math-format-date-part (x) (cond ((stringp x) diff --git a/lisp/calc/calc-poly.el b/lisp/calc/calc-poly.el index 77587cc4b86..5d74a8f106b 100644 --- a/lisp/calc/calc-poly.el +++ b/lisp/calc/calc-poly.el @@ -454,7 +454,7 @@ This returns only the remainder from the pseudo-division." (defun math-atomic-factorp (expr) - "Return true if is a factor containing no sums or quotients." + "Return non-nil if is a factor containing no sums or quotients." (cond ((eq (car-safe expr) '*) (and (math-atomic-factorp (nth 1 expr)) (math-atomic-factorp (nth 2 expr)))) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index afb43c0f338..45a4d56a371 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -400,8 +400,7 @@ This is not required to be present for user-written mode annotations." :type 'boolean) (defcustom calc-ensure-consistent-units nil - "If non-nil, make sure new units are consistent with current units -when converting units." + "If non-nil, ensure new units are consistent with current units when converting." :version "24.3" :type 'boolean) @@ -468,11 +467,11 @@ This is 1 unless `calc-truncate-stack' has been used.") (defvar calc-display-sci-high 0 "Floating-point numbers with this positive exponent or higher above the -current precision are displayed in scientific notation in calc-mode.") +current precision are displayed in scientific notation in `calc-mode'.") (defvar calc-display-sci-low -3 "Floating-point numbers with this negative exponent or lower are displayed -scientific notation in calc-mode.") +scientific notation in `calc-mode'.") (defvar calc-digit-after-point nil "If t, display at least one digit after the decimal point, as in `12.0'. @@ -493,8 +492,7 @@ This setting only applies to floats in normal display mode.") "List of variables used in customizing GNU Calc.") (defmacro defcalcmodevar (var defval &optional doc) - "Declare VAR as a Calc variable, with default value DEFVAL -and doc-string DOC. + "Declare VAR as a Calc variable, with default value DEFVAL and doc-string DOC. The variable VAR will be added to `calc-mode-var-list'." `(progn (defvar ,var ,defval ,doc) @@ -912,7 +910,7 @@ Used by `calc-user-invocation'.") (defvar calc-trail-pointer nil "The \"current\" entry in trail buffer.") (defvar calc-trail-overlay nil - "The value of overlay-arrow-string.") + "The value of `overlay-arrow-string'.") (defvar calc-undo-list nil "The list of previous operations for undo.") (defvar calc-redo-list nil diff --git a/lisp/calculator.el b/lisp/calculator.el index 415e0b4c77c..6bcea2d885e 100644 --- a/lisp/calculator.el +++ b/lisp/calculator.el @@ -833,8 +833,7 @@ The result should not exceed the screen width." (concat prompt (if (<= trim 0) expr (substring expr trim))))) (defun calculator-string-to-number (str) - "Convert the given STR to a number, according to the value of -`calculator-input-radix'." + "Convert STR to number according to `calculator-input-radix'." (if calculator-input-radix (string-to-number str (cadr (assq calculator-input-radix '((bin 2) (oct 8) (hex 16))))) @@ -1171,9 +1170,9 @@ arguments." ;;; Input interaction (defun calculator-last-input (&optional keys) - "Return the last key sequence that was used to invoke this command, or -the input KEYS. Uses the `function-key-map' translate keypad numbers to -plain ones." + "Return the last key sequence used to invoke this command, or the input KEYS. +Uses the `function-key-map' translate keypad numbers to plain +ones." (let* ((inp (or keys (this-command-keys))) (inp (or (and (arrayp inp) (not (stringp inp)) (lookup-key function-key-map inp)) diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 9ca7ce3f003..2eb7977a164 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -1223,8 +1223,7 @@ ensure that all relevant variables are set. \(diary-mail-entries) -# diary-rem.el ends here -" +# diary-rem.el ends here" (interactive "P") (if (string-equal diary-mail-addr "") (user-error "You must set `diary-mail-addr' to use this command") @@ -1254,10 +1253,10 @@ the regexp with parentheses." paren)) (defvar diary-marking-entries-flag nil - "True during the marking of diary entries, nil otherwise.") + "Non-nil during the marking of diary entries, nil otherwise.") (defvar diary-marking-entry-flag nil - "True during the marking of diary entries, if current entry is marking.") + "Non-nil during the marking of diary entries, if current entry is marking.") ;; file-glob-attrs bound in diary-mark-entries. (defun diary-mark-entries-1 (markfunc &optional months symbol absfunc) diff --git a/lisp/char-fold.el b/lisp/char-fold.el index 46a3f93d0af..e3ab7d5b64c 100644 --- a/lisp/char-fold.el +++ b/lisp/char-fold.el @@ -20,6 +20,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: (eval-and-compile diff --git a/lisp/cmuscheme.el b/lisp/cmuscheme.el index 0910ea6187e..e197069d6b8 100644 --- a/lisp/cmuscheme.el +++ b/lisp/cmuscheme.el @@ -186,7 +186,7 @@ Return before the end of the process' output copies the sexp ending at point Delete converts tabs to spaces as it moves back. Tab indents for Scheme; with argument, shifts rest of expression rigidly with the current line. -C-M-q does Tab on each line starting within following expression. +\\[indent-pp-sexp] does Tab on each line starting within following expression. Paragraphs are separated only by blank lines. Semicolons start comments. If you accidentally suspend your process, use \\[comint-continue-subjob] to continue it." diff --git a/lisp/comint.el b/lisp/comint.el index 56d4420e609..8bf23897f9e 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -2830,7 +2830,7 @@ if necessary." (when (>= count 0) (comint-update-fence)))) (defun comint-kill-region (beg end) - "Like `kill-region', but ignores read-only properties, if safe. + "Like `kill-region', but ignore read-only properties, if safe. This command assumes that the buffer contains read-only \"prompts\" which are regions with front-sticky read-only properties at the beginning of a line, with the preceding newline diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 7eae2e416bb..69baf17f5ee 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -5123,8 +5123,8 @@ If several parents are listed, go to the first of them." The following commands are available: \\\ -Move to next button, link or editable field. \\[widget-forward] -Move to previous button, link or editable field. \\[widget-backward] +Move to next button, link or editable field. \\[widget-forward] +Move to previous button, link or editable field. \\[widget-backward] \\\ Complete content of editable text field. \\[widget-complete] \\\ diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el index 7457d9e3236..07881e9b74e 100644 --- a/lisp/cus-theme.el +++ b/lisp/cus-theme.el @@ -22,6 +22,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: (require 'widget) diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el index e113cc94c33..037787797bb 100644 --- a/lisp/dabbrev.el +++ b/lisp/dabbrev.el @@ -568,8 +568,7 @@ See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion]." major-mode))) (defun dabbrev--goto-start-of-abbrev () - "Back over all abbrev type characters and then moves forward over -all skip characters." + "Back over all abbrev type characters then move forward over all skip characters." ;; Move backwards over abbrev chars (save-match-data (when (> (point) (minibuffer-prompt-end)) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 4549f45ef67..1bb5b929353 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1326,7 +1326,7 @@ Return nil if no change in files." (user-error "No compression rule found for \ `dired-compress-directory-default-suffix' %s, see `dired-compress-files-alist' for\ - the supported suffixes list." + the supported suffixes list" dired-compress-directory-default-suffix))) (let* ((suffix (or dired-compress-file-default-suffix ".gz")) (out-name (concat file suffix)) @@ -1335,7 +1335,7 @@ Return nil if no change in files." dired-compress-file-alist))) (if (not rule) (user-error "No compression rule found for suffix %s, \ -see `dired-compress-file-alist' for the supported suffixes list." +see `dired-compress-file-alist' for the supported suffixes list" dired-compress-file-default-suffix) (and (file-exists-p file) (or (not (file-exists-p out-name)) diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 9f9f1701730..cf257c8169d 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -589,7 +589,7 @@ This is useful if you want to peruse and move around in an ls -lR output file, for example one you got from an ftp server. With ange-ftp, you can even Dired a directory containing an ls-lR file, visit that file and turn on Virtual Dired mode. But don't try to save -this file, as dired-virtual indents the listing and thus changes the +this file, as `dired-virtual' indents the listing and thus changes the buffer. If you have saved a Dired buffer in a file you can use \\[dired-virtual] to @@ -956,7 +956,7 @@ as the variable `file'. If several COMMANDs are given, the first one will be the default and the rest will be added temporarily to the history and can be retrieved -with \\[previous-history-element] (M-p) . +with `previous-history-element' (\\\\[previous-history-element]). The variable `dired-guess-shell-case-fold-search' controls whether REGEXP is matched case-sensitively." diff --git a/lisp/dired.el b/lisp/dired.el index 266a03e6cc3..07c13e18b95 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2219,8 +2219,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." ;; Autoload cookie needed by desktop.el ;;;###autoload (defun dired-mode (&optional dirname switches) - "\ -Mode for \"editing\" directory listings. + "Mode for \"editing\" directory listings. In Dired, you are \"editing\" a list of the files in a directory and (optionally) its subdirectories, in the format of `ls -lR'. Each directory is a page: use \\[backward-page] and \\[forward-page] to move pagewise. @@ -3697,7 +3696,7 @@ no ARGth marked file is found before this line." (defun dired-mark-files-in-region (start end) (let ((inhibit-read-only t)) (if (> start end) - (error "start > end")) + (error "Start > End")) (goto-char start) ; assumed at beginning of line (while (< (point) end) ;; Skip subdir line and following garbage like the `total' line: diff --git a/lisp/display-fill-column-indicator.el b/lisp/display-fill-column-indicator.el index 50252af4533..7e9d62c5d1a 100644 --- a/lisp/display-fill-column-indicator.el +++ b/lisp/display-fill-column-indicator.el @@ -45,7 +45,7 @@ ;;;###autoload (define-minor-mode display-fill-column-indicator-mode - "Toggle display of fill-column indicator. + "Toggle display of `fill-column' indicator. This uses `display-fill-column-indicator' internally. To change the position of the column displayed by default diff --git a/lisp/dos-vars.el b/lisp/dos-vars.el index 2f7b3760e3f..7fcbb56d224 100644 --- a/lisp/dos-vars.el +++ b/lisp/dos-vars.el @@ -34,9 +34,9 @@ :type '(repeat string)) (defcustom dos-codepage-setup-hook nil - "List of functions to be called after the DOS terminal and coding -systems are set up. This is the place, e.g., to set specific entries -in `standard-display-table' as appropriate for your codepage, if + "List of functions to call after setting up DOS terminal and coding systems. +This is the place, e.g., to set specific entries in +`standard-display-table' as appropriate for your codepage, if `IT-display-table-setup' doesn't do a perfect job." :type '(hook) :version "20.3.3") diff --git a/lisp/edmacro.el b/lisp/edmacro.el index 8ee413acd06..e90b3a006ef 100644 --- a/lisp/edmacro.el +++ b/lisp/edmacro.el @@ -108,7 +108,7 @@ With a prefix argument, format the macro in a more concise way." (memq cmd-noremap '(call-last-kbd-macro kmacro-call-macro kmacro-end-or-call-macro kmacro-end-and-call-macro)) (member keys '("\r" [return]))) (or last-kbd-macro - (y-or-n-p "No keyboard macro defined. Create one? ") + (y-or-n-p "No keyboard macro defined. Create one?") (keyboard-quit)) (setq mac (or last-kbd-macro "")) (setq keys nil) @@ -244,8 +244,9 @@ or nil, use a compact 80-column format." (and (fboundp cmd) (not (arrayp (symbol-function cmd))) (not (get cmd 'kmacro)) (not (y-or-n-p - (format "Command %s is already defined; %s" - cmd "proceed? "))) + (format + "Command %s is already defined; proceed?" + cmd))) (keyboard-quit)))) t) ((looking-at "Key:\\(.*\\)$") @@ -264,9 +265,9 @@ or nil, use a compact 80-column format." (not (or (arrayp (symbol-function b)) (get b 'kmacro)))) (not (y-or-n-p - (format "Key %s is already defined; %s" - (edmacro-format-keys key 1) - "proceed? "))) + (format + "Key %s is already defined; proceed?" + (edmacro-format-keys key 1)))) (keyboard-quit)))))) t) ((looking-at "Counter:[ \t]*\\([^ \t\n]*\\)[ \t]*$") diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el index 45bc270db6a..ba88c819133 100644 --- a/lisp/elec-pair.el +++ b/lisp/elec-pair.el @@ -63,7 +63,7 @@ When inserting a closing paren character right before the same character, just skip that character instead, so that hitting ( followed by ) results in \"()\" rather than \"())\". -This can be convenient for people who find it easier to hit ) than C-f. +This can be convenient for people who find it easier to hit ) than \\[forward-char]. Can also be a function of one argument (the closer char just inserted), in which case that function's return value is diff --git a/lisp/epa-dired.el b/lisp/epa-dired.el index 8a4f8933bf8..18f3f055745 100644 --- a/lisp/epa-dired.el +++ b/lisp/epa-dired.el @@ -21,6 +21,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: (require 'epa) diff --git a/lisp/epa-file.el b/lisp/epa-file.el index 33bf5adabe6..fe187589aa7 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -21,8 +21,9 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: -;;; Dependencies (require 'epa) (require 'epa-hook) diff --git a/lisp/epa-hook.el b/lisp/epa-hook.el index 99a432c236e..aa196851d4d 100644 --- a/lisp/epa-hook.el +++ b/lisp/epa-hook.el @@ -21,6 +21,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: (defgroup epa-file nil diff --git a/lisp/epa-mail.el b/lisp/epa-mail.el index b9dd437ed12..9b3aa0c7fd3 100644 --- a/lisp/epa-mail.el +++ b/lisp/epa-mail.el @@ -21,8 +21,9 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: -;;; Dependencies (require 'epa) (require 'mail-utils) diff --git a/lisp/epa.el b/lisp/epa.el index ed1dae3e8ae..57d355cb3e0 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -20,8 +20,9 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: -;;; Dependencies (require 'epg) (eval-when-compile (require 'subr-x)) @@ -461,7 +462,7 @@ q trust status questionable. - trust status unspecified. ;;;###autoload (defun epa-select-keys (context prompt &optional names secret) "Display a user's keyring and ask him to select keys. -CONTEXT is an epg-context. +CONTEXT is an `epg-context'. PROMPT is a string to prompt with. NAMES is a list of strings to be matched with keys. If it is nil, all the keys are listed. @@ -968,8 +969,7 @@ For example: ;;;###autoload (defun epa-verify-cleartext-in-region (start end) - "Verify OpenPGP cleartext signed messages in the current region -between START and END. + "Verify OpenPGP cleartext signed messages in current region from START to END. Don't use this command in Lisp programs! See the reason described in the `epa-verify-region' documentation." @@ -1202,8 +1202,7 @@ If no one is selected, symmetric encryption will be performed. ") ;;;###autoload (defun epa-import-armor-in-region (start end) - "Import keys in the OpenPGP armor format in the current region -between START and END." + "Import keys in the OpenPGP armor format in the current region from START to END." (interactive "r") (save-excursion (save-restriction diff --git a/lisp/epg.el b/lisp/epg.el index 1d37cbcfb57..ea7aa869a0f 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -21,6 +21,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: ;;; Prelude @@ -804,7 +806,7 @@ callback data (if any)." (when (and epg-key-id (string-match "\\`passphrase\\." string)) (unless (epg-context-passphrase-callback context) - (error "passphrase-callback not set")) + (error "Variable `passphrase-callback' not set")) (let (inhibit-quit passphrase passphrase-with-new-line diff --git a/lisp/face-remap.el b/lisp/face-remap.el index c84742be5a2..50302b9682c 100644 --- a/lisp/face-remap.el +++ b/lisp/face-remap.el @@ -397,7 +397,7 @@ a top-level keymap, `text-scale-increase' or (defcustom buffer-face-mode-face 'variable-pitch "The face specification used by `buffer-face-mode'. It may contain any value suitable for a `face' text property, -including a face name, a list of face names, a face-attribute +including a face name, a list of face names, a face attribute plist, etc." :type '(choice (face) (repeat :tag "List of faces" face) diff --git a/lisp/faces.el b/lisp/faces.el index a5aef757b1d..7b96d938c56 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1796,8 +1796,8 @@ If FRAME is nil, that stands for the selected frame." (defalias 'x-defined-colors 'defined-colors) (defun defined-colors-with-face-attributes (&optional frame foreground) - "Return a list of colors supported for a particular frame. -See `defined-colors' for arguments and return value. In contrast + "Return a list of colors supported for a particular FRAME. +See `defined-colors' for arguments and return value. In contrast to `defined-colors' the elements of the returned list are color strings with text properties, that make the color names render with the color they represent as background color (if FOREGROUND diff --git a/lisp/ffap.el b/lisp/ffap.el index b6e419b2d67..db380164272 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -465,11 +465,11 @@ Returned values: mesg) nil) ((string-match "not responding$" mesg) mesg) ;; v19: - ;; (file-error "connection failed" "permission denied" + ;; (file-error "Connection failed" "permission denied" ;; "nonesuch" "ffap-machine-p") - ;; (file-error "connection failed" "host is unreachable" + ;; (file-error "Connection failed" "host is unreachable" ;; "gopher.house.gov" "ffap-machine-p") - ;; (file-error "connection failed" "address already in use" + ;; (file-error "Connection failed" "address already in use" ;; "ftp.uu.net" "ffap-machine-p") ((equal mesg "connection failed") (if (string= (downcase (nth 2 error)) "permission denied") @@ -1088,8 +1088,8 @@ If a given RFC isn't in these then `ffap-rfc-path' is offered." (latex-mode "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:") (tex-mode "--:\\\\$+<>@-Z_[:alpha:]~*?" "<@" "@>;.,!:") ) - "Alist of (MODE CHARS BEG END), where MODE is a symbol, -possibly a major-mode name, or one of the symbols + "Alist of (MODE CHARS BEG END), where MODE is a symbol. +This is possibly a major-mode name, or one of the symbols `file', `url', `machine', and `nocolon'. Function `ffap-string-at-point' uses the data fields as follows: 1. find a maximal string of CHARS around point, diff --git a/lisp/fileloop.el b/lisp/fileloop.el index 45b9cea9397..cd60600a250 100644 --- a/lisp/fileloop.el +++ b/lisp/fileloop.el @@ -44,6 +44,7 @@ (defcustom fileloop-revert-buffers 'silent "Whether to revert files during fileloop operation. +This can be one of: `silent' means to only do it if `revert-without-query' is applicable; t means to offer to do it for all applicable files; nil means never to do it" diff --git a/lisp/files.el b/lisp/files.el index b113ff32f2f..2f7e936ff61 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1584,7 +1584,7 @@ Signals a `file-already-exists' error if a file of the new name already exists unless optional fourth argument OK-IF-ALREADY-EXISTS is non-nil. A number as fourth arg means request confirmation if the new name already exists. This is what happens in interactive -use with M-x." +use with \\[execute-extended-command]." (interactive (let ((default-coding (or file-name-coding-system default-file-name-coding-system)) @@ -2520,7 +2520,7 @@ Do you want to revisit the file normally now? "))) (current-buffer)))) (defun insert-file-contents-literally (filename &optional visit beg end replace) - "Like `insert-file-contents', but only reads in the file literally. + "Like `insert-file-contents', but only read in the file literally. See `insert-file-contents' for an explanation of the parameters. A buffer may be modified in several ways after reading into the buffer, due to Emacs features such as format decoding, character code diff --git a/lisp/filesets.el b/lisp/filesets.el index 63f0e8ba3ff..9182c539452 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -112,7 +112,8 @@ (defvar filesets-updated-buffers nil "A list of buffers with updated menu bars.") (defvar filesets-menu-use-cached-flag nil - "Use cached data. See `filesets-menu-ensure-use-cached' for details.") + "Non-nil means use cached data. +See `filesets-menu-ensure-use-cached' for details.") (defvar filesets-update-cache-file-flag nil "Non-nil means the cache needs updating.") (defvar filesets-ignore-next-set-default nil @@ -607,8 +608,8 @@ the filename." (:ignore-on-read-text t) ;; (:constraintp ,pic-cmd) )))) - "Alist of file patterns and external viewers for use with -`filesets-find-or-display-file'. + "Alist of file patterns and external viewers. +This is intended for use with `filesets-find-or-display-file'. Has the form ((FILE-PATTERN VIEWER PROPERTIES) ...), VIEWER being either a function or a command name as string. @@ -1770,7 +1771,7 @@ User will be queried, if no fileset name is provided." filesets-data nil))) (entry (or (assoc name filesets-data) (when (y-or-n-p - (format "Fileset %s does not exist. Create it? " + (format "Fileset %s does not exist. Create it?" name)) (progn (add-to-list 'filesets-data (list name '(:files))) @@ -2198,8 +2199,9 @@ FS is a fileset's name. FLIST is a list returned by nil)) (defun filesets-build-dir-submenu (entry lookup-name dir patt) - "Build a :tree submenu named LOOKUP-NAME with base directory DIR including -all files matching PATT for filesets ENTRY." + "Build a `:tree' submenu named LOOKUP-NAME. +It has base directory DIR including all files matching PATT for +filesets ENTRY." (let ((fd (filesets-entry-get-filter-dirs-flag entry)) (depth (or (filesets-entry-get-tree-max-level entry) filesets-tree-max-level))) diff --git a/lisp/find-dired.el b/lisp/find-dired.el index 87a7407a866..ebdb10ae9fc 100644 --- a/lisp/find-dired.el +++ b/lisp/find-dired.el @@ -266,7 +266,7 @@ it finishes, type \\[kill-find]." ;;;###autoload (defun find-name-dired (dir pattern) - "Search DIR recursively for files matching the globbing pattern PATTERN, + "Search DIR recursively for files matching the globbing PATTERN, and run Dired on those files. PATTERN is a shell wildcard (not an Emacs regexp) and need not be quoted. The default command run (after changing into DIR) is diff --git a/lisp/foldout.el b/lisp/foldout.el index cadf2746ba1..8925241df32 100644 --- a/lisp/foldout.el +++ b/lisp/foldout.el @@ -239,7 +239,7 @@ An end marker of nil means the fold ends after (point-max).") Normally the body and the immediate subheadings are exposed, but optional arg EXPOSURE \(interactively with prefix arg) changes this:- - EXPOSURE > 0 exposes n levels of subheadings (c.f. show-children) + EXPOSURE > 0 exposes n levels of subheadings (c.f. `show-children') EXPOSURE < 0 exposes only the body EXPOSURE = 0 exposes the entire subtree" (interactive "P") diff --git a/lisp/font-core.el b/lisp/font-core.el index db06a607660..95bf46c9b8b 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el @@ -21,6 +21,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: ;; This variable is used by mode packages that support Font Lock mode by diff --git a/lisp/forms.el b/lisp/forms.el index e1de0111336..551a1ba3c97 100644 --- a/lisp/forms.el +++ b/lisp/forms.el @@ -1705,7 +1705,7 @@ As a side effect: re-calculates the number of records in the data file." ;;; Other commands (defun forms-toggle-read-only (arg) - "Toggles read-only mode of a forms mode buffer. + "Toggle read-only mode of a forms mode buffer. With an argument, enables read-only mode if the argument is positive. Otherwise enables edit mode if the visited file is writable." @@ -1878,7 +1878,7 @@ after the current record." (setq forms--search-regexp regexp)) (defun forms-save-buffer (&optional args) - "Forms mode replacement for save-buffer. + "Forms mode replacement for `save-buffer'. It saves the data buffer instead of the forms buffer. Calls `forms-write-file-filter' before, and `forms-read-file-filter' after writing out the data." diff --git a/lisp/hexl.el b/lisp/hexl.el index 4a7bf9479aa..79dd5c40c69 100644 --- a/lisp/hexl.el +++ b/lisp/hexl.el @@ -1165,7 +1165,7 @@ This function is assumed to be used as callback function for `hl-line-mode'." ;; startup stuff. -(easy-menu-define hexl-menu hexl-mode-map "Hexl Mode menu" +(easy-menu-define hexl-menu hexl-mode-map "Hexl Mode menu." '("Hexl" :help "Hexl-specific Features" diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index 4c924e9d52a..7d126cb558e 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -244,7 +244,7 @@ by cycling through the faces in `hi-lock-face-defaults'." "String used to identify hi-lock patterns at the start of files.") (defvar hi-lock-archaic-interface-message-used nil - "True if user alerted that `global-hi-lock-mode' is now the global switch. + "Non-nil if user alerted that `global-hi-lock-mode' is now the global switch. Earlier versions of hi-lock used `hi-lock-mode' as the global switch; the message is issued if it appears that `hi-lock-mode' is used assuming that older functionality. This variable avoids multiple reminders.") diff --git a/lisp/image-dired.el b/lisp/image-dired.el index b92a9371ec2..3ca47300a99 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -519,7 +519,7 @@ Used by `image-dired-copy-with-exif-file-name'." (defcustom image-dired-show-all-from-dir-max-files 50 "Maximum number of files to show using `image-dired-show-all-from-dir' -before warning the user." +before warning." :type 'integer) (defmacro image-dired--with-db-file (&rest body) @@ -1958,7 +1958,7 @@ With prefix argument ARG, display image in its original size." (image-dired-display-image (dired-get-filename) arg)) (defun image-dired-image-at-point-p () - "Return true if there is an image-dired thumbnail at point." + "Return non-nil if there is an `image-dired' thumbnail at point." (get-text-property (point) 'image-dired-thumbnail)) (defun image-dired-rotate-thumbnail (degrees) diff --git a/lisp/imenu.el b/lisp/imenu.el index 788755a2d7e..22412d5f88b 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -829,8 +829,7 @@ A trivial interface to `imenu-add-to-menubar' suitable for use in a hook." (defvar imenu-buffer-menubar nil) (defvar-local imenu-menubar-modified-tick 0 - "The value of (buffer-chars-modified-tick) as of the last call -to `imenu-update-menubar'.") + "Value of (buffer-chars-modified-tick) when `imenu-update-menubar' was called.") (defun imenu-update-menubar () (when (and (current-local-map) diff --git a/lisp/indent.el b/lisp/indent.el index aa2bfbceebf..aa6b8d17c4a 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -463,7 +463,7 @@ Optional fifth argument OBJECT specifies the string or buffer to operate on." (put-text-property begin to prop (funcall func val) object)))) (defun increase-left-margin (from to inc) - "Increase or decrease the left-margin of the region. + "Increase or decrease the `left-margin' of the region. With no prefix argument, this adds `standard-indent' of indentation. A prefix arg (optional third arg INC noninteractively) specifies the amount to change the margin by, in characters. @@ -520,11 +520,14 @@ If `auto-fill-mode' is active, re-fills region to fit in new margin." (defun beginning-of-line-text (&optional n) "Move to the beginning of the text on this line. -With optional argument, move forward N-1 lines first. -From the beginning of the line, moves past the left-margin indentation, the -fill-prefix, and any indentation used for centering or right-justifying the -line, but does not move past any whitespace that was explicitly inserted -\(such as a tab used to indent the first line of a paragraph)." + +With optional argument N, move forward N-1 lines first. + +From the beginning of the line, moves past the `left-margin' +indentation, the `fill-prefix', and any indentation used for +centering or right-justifying the line, but does not move past +any whitespace that was explicitly inserted (such as a tab used +to indent the first line of a paragraph)." (interactive "^p") (beginning-of-line n) (skip-chars-forward " \t") diff --git a/lisp/info-look.el b/lisp/info-look.el index 33f15a34e99..7cc5462dd4a 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -262,7 +262,8 @@ system." (defun info-lookup-symbol (symbol &optional mode) "Display the definition of SYMBOL, as found in the relevant manual. When this command is called interactively, it reads SYMBOL from the -minibuffer. In the minibuffer, use M-n to yank the default argument +minibuffer. In the minibuffer, use \\\ +\\[next-history-element] to yank the default argument value into the minibuffer so you can edit it. The default symbol is the one found at point. @@ -276,7 +277,8 @@ With prefix arg MODE a query for the symbol help mode is offered." (defun info-lookup-file (file &optional mode) "Display the documentation of a file. When this command is called interactively, it reads FILE from the minibuffer. -In the minibuffer, use M-n to yank the default file name +In the minibuffer, use \\\ +\\[next-history-element] to yank the default file name into the minibuffer so you can edit it. The default file name is the one found at point. diff --git a/lisp/international/ccl.el b/lisp/international/ccl.el index 0eb009fa526..9be4d1ee955 100644 --- a/lisp/international/ccl.el +++ b/lisp/international/ccl.el @@ -213,8 +213,7 @@ proper index number for SYMBOL. PROP should be (ccl-embed-data (cons symbol prop))) (defun ccl-embed-string (len str) - "Embed string STR of length LEN in `ccl-program-vector' at -`ccl-current-ic'." + "Embed string STR of length LEN in `ccl-program-vector' at `ccl-current-ic'." (if (> len #xFFFFF) (error "CCL: String too long: %d" len)) (if (> (string-bytes str) len) @@ -282,8 +281,7 @@ changed to a relative jump address." (defvar ccl-loop-head nil "If non-nil, index of the start of the current loop.") (defvar ccl-breaks nil - "If non-nil, list of absolute addresses of the breaking points of -the current loop.") + "If non-nil, list of absolute addresses of breaking points of the current loop.") ;;;###autoload (defun ccl-compile (ccl-program) @@ -568,8 +566,8 @@ If READ-FLAG is non-nil, this statement has the form (cdr (cdr cmd)))) (defun ccl-compile-branch-expression (expr cmd) - "Compile EXPRESSION part of BRANCH statement and return register -which holds a value of the expression." + "Compile EXPRESSION part of BRANCH statement. +Return register which holds a value of the expression." (if (listp expr) ;; EXPR has the form `(EXPR2 OP ARG)'. Compile it as SET ;; statement of the form `(r7 = (EXPR2 OP ARG))'. @@ -1554,8 +1552,7 @@ MAP := MAP-IDs := MAP-ID ... MAP-SET := MAP-IDs | (MAP-IDs) MAP-SET -MAP-ID := integer -" +MAP-ID := integer" (declare (doc-string 3)) `(let ((prog ,(unwind-protect (progn diff --git a/lisp/international/quail.el b/lisp/international/quail.el index c0e53d26fba..50ff307b73a 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -471,7 +471,8 @@ conversion region is active. It is an alist of single key character vs. corresponding command to be called. If SIMPLE is non-nil, then we do not alter the meanings of -commands such as C-f, C-b, C-n, C-p and TAB; they are treated as +commands such as \\[forward-char], \\[backward-char], \\[next-line], \ +\\[previous-line] and \\[indent-for-tab-command]; they are treated as non-Quail commands." (let (translation-keymap conversion-keymap) (if deterministic (setq forget-last-selection t)) diff --git a/lisp/international/robin.el b/lisp/international/robin.el index e4a11801c38..c38cd822693 100644 --- a/lisp/international/robin.el +++ b/lisp/international/robin.el @@ -276,8 +276,7 @@ this robin package will be the following. (?c \"AC\" (?d \"ACD\") (?e \"ACE\"))) - (?b \"B\")) -") + (?b \"B\"))") ;;;###autoload (defmacro robin-define-package (name docstring &rest rules) diff --git a/lisp/isearch.el b/lisp/isearch.el index 952caa7ac22..242f2b0dd09 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1221,7 +1221,7 @@ is processed. (It is not called after characters that exit the search.) When the arg RECURSIVE-EDIT is non-nil, this function behaves modally and does not return to the calling function until the search is completed. -To behave this way it enters a recursive-edit and exits it when done +To behave this way it enters a recursive edit and exits it when done isearching. The arg REGEXP-FUNCTION, if non-nil, should be a function. It is diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el index c1a5bbe9478..bb2df2b1ffa 100644 --- a/lisp/jit-lock.el +++ b/lisp/jit-lock.el @@ -47,7 +47,7 @@ Preserves the `buffer-modified-p' state of the current buffer." (defcustom jit-lock-chunk-size 1500 "Jit-lock fontifies chunks of at most this many characters at a time. -This variable controls both display-time and stealth fontification. +This variable controls both `display-time' and stealth fontification. The optimum value is a little over the typical number of buffer characters which fit in a typical window." diff --git a/lisp/kmacro.el b/lisp/kmacro.el index a39f433cdc3..53e6e5e288a 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el @@ -820,8 +820,8 @@ If kbd macro currently being defined end it before activating it." (defun kmacro-bind-to-key (_arg) "When not defining or executing a macro, offer to bind last macro to a key. -The key sequences [C-x C-k 0] through [C-x C-k 9] and [C-x C-k A] -through [C-x C-k Z] are reserved for user bindings, and to bind to +The key sequences `C-x C-k 0' through `C-x C-k 9' and `C-x C-k A' +through `C-x C-k Z' are reserved for user bindings, and to bind to one of these sequences, just enter the digit or letter, rather than the whole sequence. diff --git a/lisp/loadhist.el b/lisp/loadhist.el index 0b12bdad058..4a7946a212b 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el @@ -168,8 +168,7 @@ documentation of `unload-feature' for details.") ;; So we use this auxiliary variable to keep track of the last (t . SYMBOL) ;; that occurred. (defvar loadhist--restore-autoload nil - "If non-nil, this is a symbol for which we should -restore a previous autoload if possible.") + "If non-nil, is a symbol for which to try to restore a previous autoload.") (cl-defmethod loadhist-unload-element ((x (head t))) (setq loadhist--restore-autoload (cdr x))) diff --git a/lisp/locate.el b/lisp/locate.el index 008d65e055f..6190fc6302a 100644 --- a/lisp/locate.el +++ b/lisp/locate.el @@ -50,7 +50,7 @@ ;; from a shell prompt. GNU locate and BSD find expect the file databases ;; to either be in standard places or located via environment variables. ;; If the latter, make sure these environment variables are set in -;; your emacs process. +;; your Emacs process. ;; ;; Locate-mode assumes that each line output from the locate-command ;; consists exactly of a file name, possibly preceded or trailed by diff --git a/lisp/macros.el b/lisp/macros.el index 689c4210cd7..89e38abab2d 100644 --- a/lisp/macros.el +++ b/lisp/macros.el @@ -148,11 +148,16 @@ use this command, and then save the file." ;;;###autoload (defun kbd-macro-query (flag) "Query user during kbd macro execution. - With prefix argument, enters recursive edit, reading keyboard -commands even within a kbd macro. You can give different commands -each time the macro executes. - Without prefix argument, asks whether to continue running the macro. + +With prefix argument FLAG, enter recursive edit, reading +keyboard commands even within a kbd macro. You can give +different commands each time the macro executes. + +Without prefix argument, ask whether to continue running the +macro. + Your options are: \\ + \\[act] Finish this iteration normally and continue with the next. \\[skip] Skip the rest of this iteration, and start the next. \\[exit] Stop the macro entirely right now. diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 07f7beb92c8..e84eec5002c 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -2156,7 +2156,7 @@ otherwise it could decide to silently do nothing." (> count 1))) (defcustom yank-menu-length 20 - "Maximum length to display in the yank-menu." + "Maximum length to display in the `yank-menu'." :type 'integer :group 'menu) @@ -2289,7 +2289,7 @@ Buffers menu is regenerated." It must accept a buffer as its only required argument.") (defun menu-bar-buffer-vector (alist) - ;; turn ((name . buffer) ...) into a menu + "Turn ((name . buffer) ...) into a menu." (let ((buffers-vec (make-vector (length alist) nil)) (i (length alist))) (dolist (pair alist) @@ -2303,7 +2303,7 @@ It must accept a buffer as its only required argument.") buffers-vec)) (defun menu-bar-update-buffers (&optional force) - ;; If user discards the Buffers item, play along. + "If user discards the Buffers item, play along." (and (lookup-key (current-global-map) [menu-bar buffer]) (or force (frame-or-buffer-changed-p)) (let ((buffers (buffer-list)) diff --git a/lisp/mouse-drag.el b/lisp/mouse-drag.el index b424b6edfe8..ecfb359b36f 100644 --- a/lisp/mouse-drag.el +++ b/lisp/mouse-drag.el @@ -147,7 +147,7 @@ Keep the cursor on the screen as needed." (= (cdr start-col-row) (cdr end-col-row))))) (defvar mouse-drag-electric-col-scrolling t - "If non-nil, mouse-drag on a long line enables truncate-lines.") + "If non-nil, mouse-drag on a long line enables `truncate-lines'.") (defun mouse-drag-should-do-col-scrolling () "Determine if it's wise to enable col-scrolling for the current window. diff --git a/lisp/mouse.el b/lisp/mouse.el index edac5085ff8..41333eb7f71 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -46,7 +46,7 @@ :type 'boolean) (defcustom mouse-drag-copy-region nil - "If non-nil, copy to kill-ring upon mouse adjustments of the region. + "If non-nil, copy to kill ring upon mouse adjustments of the region. This affects `mouse-save-then-kill' (\\[mouse-save-then-kill]) in addition to mouse drags. diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index c5c9dfb2afc..98ce1d6993e 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -455,8 +455,9 @@ reference.") ;; because Emacs turns C-c C-i into C-c TAB which is hard to type and ;; not mnemonic. "Major mode for editing XML. - +\\ \\[nxml-finish-element] finishes the current element by inserting an end-tag. + C-c C-i closes a start-tag with `>' and then inserts a balancing end-tag leaving point between the start-tag and end-tag. \\[nxml-balanced-close-start-tag-block] is similar but for block rather than inline elements: diff --git a/lisp/nxml/rng-loc.el b/lisp/nxml/rng-loc.el index a38da794226..c8b19e8c229 100644 --- a/lisp/nxml/rng-loc.el +++ b/lisp/nxml/rng-loc.el @@ -501,7 +501,7 @@ saved to the first writable file in `rng-schema-locating-files'." nil (error "Buffer does not have a filename"))) ((and prompt - (not (y-or-n-p (format "Save %s to %s " + (not (y-or-n-p (format "Save %s to %s?" (if type-id "type identifier" "schema location") @@ -539,7 +539,7 @@ saved to the first writable file in `rng-schema-locating-files'." locating-file-uri)))))) (indent-according-to-mode) (when (or (not modified) - (y-or-n-p (format "Save file %s " + (y-or-n-p (format "Save file %s?" (buffer-file-name)))) (save-buffer)))))))) diff --git a/lisp/nxml/rng-valid.el b/lisp/nxml/rng-valid.el index fca666115a2..9df20a16b1d 100644 --- a/lisp/nxml/rng-valid.el +++ b/lisp/nxml/rng-valid.el @@ -962,9 +962,8 @@ Return nil at end of buffer, t otherwise." (and type t))) (defun rng-process-start-tag (tag-type) - "TAG-TYPE is `start-tag' for a start-tag, `empty-element' for -an empty element. `partial-empty-element' should be passed -as empty-element." + "TAG-TYPE is `start-tag' for a start-tag, `empty-element' for an empty element. +`partial-empty-element' should be passed as empty-element." (and rng-collecting-text (rng-flush-text)) (setq rng-collecting-text nil) (setq rng-pending-contents nil) diff --git a/lisp/pcmpl-x.el b/lisp/pcmpl-x.el index fd147101b69..d9479edf6a6 100644 --- a/lisp/pcmpl-x.el +++ b/lisp/pcmpl-x.el @@ -21,6 +21,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: (eval-when-compile (require 'cl-lib)) diff --git a/lisp/play/5x5.el b/lisp/play/5x5.el index 1d193306296..085c97f5d8e 100644 --- a/lisp/play/5x5.el +++ b/lisp/play/5x5.el @@ -387,7 +387,7 @@ Mutate the result." (defun 5x5-crack (breeder) "Attempt to find a solution for 5x5. -5x5-crack takes the argument BREEDER which should be a function that takes +`5x5-crack' takes the argument BREEDER which should be a function that takes two parameters, the first will be a grid vector array that is the current solution and the second will be the best solution so far. The function should return a grid vector array that is the new solution." @@ -474,8 +474,8 @@ position." grid))) (defun 5x5-vec-to-grid (grid-matrix) - "Convert a grid matrix GRID-MATRIX in Calc format to a grid in -5x5 format. See function `5x5-grid-to-vec'." + "Convert a grid matrix GRID-MATRIX in Calc format to a grid in 5x5 format. +See function `5x5-grid-to-vec'." (apply #'vector (mapcar diff --git a/lisp/play/doctor.el b/lisp/play/doctor.el index 9777fc3ea24..b855f7e35a1 100644 --- a/lisp/play/doctor.el +++ b/lisp/play/doctor.el @@ -115,7 +115,7 @@ (defun doc// (x) x) (defmacro doc$ (what) - "Quoted arg form of doctor-$." + "Quoted arg form of `doctor-$'." `(doctor-$ ',what)) (defun doctor-$ (what) @@ -1011,7 +1011,7 @@ 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 +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)))) diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el index d9acad8e43e..706c1be81e0 100644 --- a/lisp/play/dunnet.el +++ b/lisp/play/dunnet.el @@ -944,8 +944,8 @@ handled specially by 'dun-describe-room.") (list obj-pc) ;; pc-area nil nil nil nil nil nil ) - "These are objects in a room that are only described in the -room description. They are permanent.") + "These are objects in a room that are only described in the room description. +They are permanent.") (defvar dun-inventory '(1)) (defconst dun-objects @@ -1010,8 +1010,7 @@ the inventory.") nil nil ("There is a bus here.") nil nil nil) - "These are the descriptions for the negative numbered objects from -`dun-room-objects'.") + "Descriptions for the negative numbered objects from `dun-room-objects'.") (defconst dun-physobj-desc '( @@ -1216,8 +1215,9 @@ Otherwise short. Also give long if we were called with negative room number." (dun-mprincl "You are on the bus.")))) (defun dun-special-object () - "There is a special object in the room. This object's description, -or lack thereof, depends on certain conditions." + "There is a special object in the room. +This object's description, or lack thereof, depends on certain +conditions." (cond ((= dun-current-room computer-room) (if dun-computer diff --git a/lisp/play/hanoi.el b/lisp/play/hanoi.el index d3d0ad1309c..227dd790af5 100644 --- a/lisp/play/hanoi.el +++ b/lisp/play/hanoi.el @@ -133,7 +133,7 @@ Repent before ring 31 moves." (defun hanoi-unix-64 () "Like `hanoi-unix', but pretend to have a 64-bit clock. This is, necessarily (as of Emacs 20.3), a crock. When the -current-time interface is made s2G-compliant, hanoi.el will need +`current-time' interface is made s2G-compliant, hanoi.el will need to be updated." (interactive) (let* ((start (ftruncate (float-time))) diff --git a/lisp/play/mpuz.el b/lisp/play/mpuz.el index 5ac1d7c60c2..ff174fed6c2 100644 --- a/lisp/play/mpuz.el +++ b/lisp/play/mpuz.el @@ -119,7 +119,7 @@ You may abort a game by typing \\\\[mpuz-offer-abort]." ;; Some variables for game tracking ;;--------------------------------- (defvar mpuz-in-progress nil - "True if a game is currently in progress.") + "Non-nil if a game is currently in progress.") (defvar mpuz-found-digits (make-bool-vector 10 nil) "A vector recording which digits have been decrypted.") diff --git a/lisp/play/tetris.el b/lisp/play/tetris.el index f43aa47326f..3d6ddd5307f 100644 --- a/lisp/play/tetris.el +++ b/lisp/play/tetris.el @@ -620,7 +620,7 @@ Shapes drop from the top of the screen, and the user has to move and rotate the shape to fit in with those at the bottom of the screen so as to form complete rows. -tetris-mode keybindings: +`tetris-mode' keybindings: \\ \\[tetris-start-game] Start a new game of Tetris \\[tetris-end-game] Terminate the current game diff --git a/lisp/printing.el b/lisp/printing.el index 89e49ccb2a4..fb718f9aa62 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -1672,7 +1672,7 @@ DEFAULT It's a way to set default values when this entry is selected. (set VARIABLE (eval VALUE)) - Note that VALUE can be any valid lisp expression. So, don't + Note that VALUE can be any valid Lisp expression. So, don't forget to quote symbols and constant lists. If VARIABLE is the special keyword `inherits-from:', VALUE must be a symbol name setting defined in `pr-setting-database' from @@ -1772,8 +1772,7 @@ Useful links: `https://linux.die.net/man/1/lp' * GNU utilities for w32 (cp.exe) - `http://unxutils.sourceforge.net/' -" + `http://unxutils.sourceforge.net/'" :type '(repeat (list :tag "PostScript Printer" @@ -2181,7 +2180,7 @@ DEFAULT It's a way to set default values when this entry is selected. (set (make-local-variable VARIABLE-SYM) (eval VALUE)) - Note that VALUE can be any valid lisp expression. So, don't + Note that VALUE can be any valid Lisp expression. So, don't forget to quote symbols and constant lists. If VARIABLE is the special keyword `inherits-from:', VALUE must be a symbol name setting defined in `pr-setting-database' from @@ -2413,8 +2412,7 @@ Useful links: * GNU Enscript documentation (Windows, GNU or Unix) `https://people.ssh.com/mtr/genscript/enscript.man.html' - (on GNU or Unix, type `man enscript') -" + (on GNU or Unix, type `man enscript')" :type '(repeat (list :tag "PS File Utility" (symbol :tag "Utility Symbol") @@ -4276,7 +4274,7 @@ printed using `pr-ps-mode-ps-print'. Interactively, you have the following situations: - M-x pr-ps-fast-fire RET + \\[pr-ps-fast-fire] The command prompts the user for a N-UP value and printing will immediately be done using the current active printer. diff --git a/lisp/profiler.el b/lisp/profiler.el index 0b456bb3e31..fa74fe8de25 100644 --- a/lisp/profiler.el +++ b/lisp/profiler.el @@ -105,8 +105,8 @@ ;;; Entries (defun profiler-format-entry (entry) - "Format ENTRY in human readable string. ENTRY would be a -function name of a function itself." + "Format ENTRY in human readable string. +ENTRY would be a function name of a function itself." (cond ((memq (car-safe entry) '(closure lambda)) (format "#" (sxhash entry))) ((byte-code-function-p entry) @@ -463,7 +463,7 @@ Optional argument MODE means only check for the specified mode (cpu or mem)." "The current profile.") (defvar-local profiler-report-reversed nil - "True if calltree is rendered in bottom-up. + "Non-nil if calltree is rendered in bottom-up. Do not touch this variable directly.") (defvar-local profiler-report-order nil diff --git a/lisp/progmodes/cc-bytecomp.el b/lisp/progmodes/cc-bytecomp.el index f07f18678a2..b6805898b0e 100644 --- a/lisp/progmodes/cc-bytecomp.el +++ b/lisp/progmodes/cc-bytecomp.el @@ -339,8 +339,8 @@ should be a string. CONDITION should not be quoted." '(progn))) (defmacro cc-provide (feature) - "A replacement for the `provide' form that restores the environment -after the compilation. Don't use within `eval-when-compile'." + "A replacement for `provide' that restores the environment after the compilation. +Don't use within `eval-when-compile'." (declare (debug t)) `(progn (eval-when-compile (cc-bytecomp-restore-environment)) @@ -381,8 +381,9 @@ afterwards. Don't use within `eval-when-compile'." (eval-when-compile (cc-bytecomp-setup-environment)))) (defmacro cc-bytecomp-defvar (var) - "Bind the symbol as a variable during compilation of the file, -to silence the byte compiler. Don't use within `eval-when-compile'." + "Bind the symbol VAR as a variable during compilation of the file. +This can be used to silence the byte compiler. Don't use within +`eval-when-compile'." (declare (debug nil)) `(eval-when-compile (if (boundp ',var) @@ -403,8 +404,9 @@ to silence the byte compiler. Don't use within `eval-when-compile'." "cc-bytecomp-defvar: Covered variable %s" ',var)))))) (defmacro cc-bytecomp-defun (fun) - "Bind the symbol as a function during compilation of the file, -to silence the byte compiler. Don't use within `eval-when-compile'. + "Bind the symbol FUN as a function during compilation of the file. +This can be used to silence the byte compiler. Don't use within +`eval-when-compile'. If the symbol already is bound as a function, it will keep that definition. That means that this macro will not shut up warnings @@ -431,8 +433,8 @@ at compile time, e.g. for macros and inline functions." "cc-bytecomp-defun: Covered function %s" ',fun)))))) (defmacro cc-bytecomp-put (symbol propname value) - "Set a property on a symbol during compilation (and evaluation) of -the file. Don't use outside `eval-when-compile'." + "Set a property on SYMBOL during compilation (and evaluation) of the file. +Don't use outside `eval-when-compile'." (declare (debug t)) `(eval-when-compile (if (not (assoc (cons ,symbol ,propname) cc-bytecomp-original-properties)) @@ -450,9 +452,9 @@ the file. Don't use outside `eval-when-compile'." ,propname ,symbol ,value))) (defmacro cc-bytecomp-boundp (symbol) - "Return non-nil if the given symbol is bound as a variable outside -the compilation. This is the same as using `boundp' but additionally -exclude any variables that have been bound during compilation with + "Return non-nil if SYMBOL is bound as a variable outside the compilation. +This is the same as using `boundp' but additionally exclude any +variables that have been bound during compilation with `cc-bytecomp-defvar'." (declare (debug t)) (if (and (cc-bytecomp-is-compiling) @@ -461,9 +463,9 @@ exclude any variables that have been bound during compilation with `(boundp ,symbol))) (defmacro cc-bytecomp-fboundp (symbol) - "Return non-nil if the given symbol is bound as a function outside -the compilation. This is the same as using `fboundp' but additionally -exclude any functions that have been bound during compilation with + "Return non-nil if SYMBOL is bound as a function outside the compilation. +This is the same as using `fboundp' but additionally exclude any +functions that have been bound during compilation with `cc-bytecomp-defun'." (declare (debug t)) (let (fun-elem) diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 217281b8a24..6c3da667bfc 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -5113,8 +5113,9 @@ inside a preprocessor directive." (defun c-context-open-line () "Insert a line break suitable to the context and leave point before it. -This is the `c-context-line-break' equivalent to `open-line', which is -normally bound to C-o. See `c-context-line-break' for the details." +This is the `c-context-line-break' equivalent to `open-line' +\(bound to \\[open-line]). See `c-context-line-break' for the +details." (interactive "*") (let ((here (point))) (unwind-protect diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index be0b40fd6c2..12e10c26eec 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el @@ -827,9 +827,9 @@ right side of it." ;; impossible to get a feel for how that function works. (defmacro c-go-list-forward (&optional pos limit) - "Move forward across one balanced group of parentheses starting at POS or -point. Return POINT when we succeed, NIL when we fail. In the latter case, -leave point unmoved. + "Move forward across one balanced group of parentheses starting at POS or point. +Return POINT when we succeed, NIL when we fail. In the latter +case, leave point unmoved. A LIMIT for the search may be given. The start position is assumed to be before it." @@ -838,9 +838,9 @@ before it." (when dest (goto-char dest) dest))) (defmacro c-go-list-backward (&optional pos limit) - "Move backward across one balanced group of parentheses starting at POS or -point. Return POINT when we succeed, NIL when we fail. In the latter case, -leave point unmoved. + "Move backward across one balanced group of parentheses starting at POS or point. +Return POINT when we succeed, NIL when we fail. In the latter +case, leave point unmoved. A LIMIT for the search may be given. The start position is assumed to be after it." @@ -2593,7 +2593,7 @@ quoted." (defvar c-lang-constants-under-evaluation nil "Alist of constants in the process of being evaluated. The `cdr' of each entry indicates how far we've looked in the list -of definitions, so that the def for var FOO in c-mode can be defined in +of definitions, so that the def for var FOO in `c-mode' can be defined in terms of the def for that same var FOO (which will then rely on the fallback definition for all modes, to break the cycle).") diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 53c382f018c..20cdb72ccf1 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -1545,7 +1545,7 @@ comment at the start of cc-engine.el for more info." nil)))))) (defun c-at-statement-start-p () - "Return non-nil if the point is at the first token in a statement + "Return non-nil if point is at the first token in a statement or somewhere in the syntactic whitespace before it. A \"statement\" here is not restricted to those inside code blocks. @@ -1574,7 +1574,7 @@ comment at the start of cc-engine.el for more info." (c-crosses-statement-barrier-p (point) end))))) (defun c-at-expression-start-p () - "Return non-nil if the point is at the first token in an expression or + "Return non-nil if point is at the first token in an expression or statement, or somewhere in the syntactic whitespace before it. An \"expression\" here is a bit different from the normal language @@ -4969,7 +4969,7 @@ out of an enclosing paren." nil)))) (defun c-forward-over-token-and-ws (&optional balanced) - "Move forward over a token and any following whitespace + "Move forward over a token and any following whitespace. Return t if we moved, nil otherwise (i.e. we were at EOB, or a non-token or BALANCED is non-nil and we can't move). If we are at syntactic whitespace, move over this in place of a token. @@ -5384,8 +5384,8 @@ comment at the start of cc-engine.el for more info." (defvar safe-pos-list) ; bound in c-syntactic-skip-backward (defun c-syntactic-skip-backward (skip-chars &optional limit paren-level) - "Like `skip-chars-backward' but only look at syntactically relevant chars, -i.e. don't stop at positions inside syntactic whitespace or string + "Like `skip-chars-backward' but only look at syntactically relevant chars. +This means don't stop at positions inside syntactic whitespace or string literals. Preprocessor directives are also ignored, with the exception of the one that the point starts within, if any. If LIMIT is given, it's assumed to be at a syntactically relevant position. diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 7e7053b98e1..bc0ae6cc95a 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -1765,7 +1765,7 @@ casts and declarations are fontified. Used on level 2 and higher." (> (match-beginning 0) (point-min)) (memq (c-get-char-property (1- (match-beginning 0)) 'face) '(font-lock-comment-face font-lock-string-face - font-lock-comment-delimiter-face)))) + font-lock-comment-delimiter-face)))) (when found (setq open-delim (cons (match-beginning 1) (cons (match-end 1) (match-beginning 2))) diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index b106454b11e..36f12369fca 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -4178,8 +4178,7 @@ aliases in Emacs are resolved." (cdr c-emacs-variable-inits)))) (defun c-make-init-lang-vars-fun (mode) - "Create a function that initializes all the language dependent variables -for the given mode. + "Create a function that initializes all language dependent variables for MODE. This function should be evaluated at compile time, so that the function it returns is byte compiled with all the evaluated results diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index c818c1a3582..8b302414496 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -1648,7 +1648,7 @@ Note that the style variables are always made local to the buffer." (and (memq (char-before) c-string-delims) (not (nth 4 s))))) ; Check we're actually out of the ; comment. not stuck at EOB - (unless + (unless (and c-ml-string-opener-re (c-maybe-re-mark-ml-string)) (if (c-unescaped-nls-in-string-p (1- (point))) diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index dcd9546d9aa..8869c565737 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el @@ -1227,7 +1227,7 @@ can always override the use of `c-default-style' by making calls to ;; Anchor pos: None. )) (defcustom c-offsets-alist nil - "Association list of syntactic element symbols and indentation offsets. + "Alist of syntactic element symbols and indentation offsets. As described below, each cons cell in this list has the form: (SYNTACTIC-SYMBOL . OFFSET) diff --git a/lisp/progmodes/cmacexp.el b/lisp/progmodes/cmacexp.el index 0f7c8c6f31a..07648ac623c 100644 --- a/lisp/progmodes/cmacexp.el +++ b/lisp/progmodes/cmacexp.el @@ -101,7 +101,7 @@ :type 'boolean) (defcustom c-macro-prompt-flag nil - "Non-nil makes `c-macro-expand' prompt for preprocessor arguments." + "Non-nil means `c-macro-expand' will prompt for preprocessor arguments." :type 'boolean) (defcustom c-macro-preprocessor diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 6b521e8d90b..73f98068110 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -687,11 +687,13 @@ matched file names, and weeding out false positives." ,(expand-file-name "compilation.txt" data-directory))) (defvar compilation-error-case-fold-search nil - "If non-nil, use case-insensitive matching of compilation errors -by the regexps of `compilation-error-regexp-alist' and -`compilation-error-regexp-alist-alist'. + "If non-nil, use case-insensitive matching of compilation errors. If nil, matching is case-sensitive. +Compilation errors are given by the regexps in +`compilation-error-regexp-alist' and +`compilation-error-regexp-alist-alist'. + This variable should only be set for backward compatibility as a temporary measure. The proper solution is to use a regexp that matches the messages without case-folding.") diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 634dd29bad6..c371a84b9d2 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -361,14 +361,14 @@ Affects: `cperl-font-lock', `cperl-electric-lbrace-space', ;; :group 'cperl) (defcustom cperl-info-on-command-no-prompt nil - "Not-nil (and non-null) means not to prompt on C-h f. + "Not-nil (and non-null) means not to prompt on \\[cperl-info-on-command]. The opposite behavior is always available if prefixed with C-c. Can be overwritten by `cperl-hairy' if nil." :type '(choice (const null) boolean) :group 'cperl-affected-by-hairy) (defcustom cperl-clobber-lisp-bindings nil - "Not-nil (and non-null) means not overwrite C-h f. + "Not-nil (and non-null) means not overwrite \\[describe-function]. The function is available on \\[cperl-info-on-command], \\[cperl-get-help]. Can be overwritten by `cperl-hairy' if nil." :type '(choice (const null) boolean) diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el index 6602a79b2a4..d800365e66d 100644 --- a/lisp/progmodes/cpp.el +++ b/lisp/progmodes/cpp.el @@ -711,8 +711,8 @@ BRANCH should be either nil (false branch), t (true branch) or `both'." default)) (defun cpp-choose-default-face (type) - ;; Choose default face list for screen of TYPE. - ;; Type must be one of the types defined in `cpp-face-type-list'. + "Choose default face list for screen of TYPE. +Type must be one of the types defined in `cpp-face-type-list'." (interactive (list (if cpp-button-event (x-popup-menu cpp-button-event (list "Screen type" @@ -789,7 +789,7 @@ BRANCH should be either nil (false branch), t (true branch) or `both'." (if data (list 'cpp-data data)))))) (defun cpp-push-button (event) - ;; Pushed a CPP button. + "Pushed a CPP button." (interactive "@e") (set-buffer (window-buffer (posn-window (event-start event)))) (let ((pos (posn-point (event-start event)))) diff --git a/lisp/progmodes/dcl-mode.el b/lisp/progmodes/dcl-mode.el index ed024f24344..b74b558f8df 100644 --- a/lisp/progmodes/dcl-mode.el +++ b/lisp/progmodes/dcl-mode.el @@ -494,7 +494,7 @@ Variables controlling indentation style and extra features: These variables control the look of expanded templates. dcl-imenu-generic-expression - Default value for imenu-generic-expression. The default includes + Default value for `imenu-generic-expression'. The default includes SUBROUTINE labels in the main listing and sub-listings for other labels, CALL, GOTO and GOSUB statements. @@ -1463,7 +1463,7 @@ Inserts continuation marks and splits character strings." ;;;------------------------------------------------------------------------- (defun dcl-delete-indentation (&optional arg) - "Join this line to previous like delete-indentation. + "Join this line to previous like `delete-indentation'. Also remove the continuation mark if easily detected." (interactive "*P") (delete-indentation arg) diff --git a/lisp/progmodes/ebnf-yac.el b/lisp/progmodes/ebnf-yac.el index 816cc432d1b..84950e45f51 100644 --- a/lisp/progmodes/ebnf-yac.el +++ b/lisp/progmodes/ebnf-yac.el @@ -113,7 +113,7 @@ ;;; YACC-Code = "any C definition". (defun ebnf-yac-parser (start) - "yacc/Bison parser." + "Yacc/Bison parser." (let ((total (+ (- ebnf-limit start) 1)) (bias (1- start)) (origin (point)) diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index 3f2c9b71485..f9e6101e7ab 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -65,8 +65,8 @@ ;; the variable f90-comment-region in every line of the region. ;; One common convention for free vs. fixed format is that free format -;; files have the ending .f90 or .f95 while fixed format files have -;; the ending .f. Emacs automatically loads Fortran files in the +;; files have the ending ".f90" or ".f95" while fixed format files have +;; the ending ".f". Emacs automatically loads Fortran files in the ;; appropriate mode based on extension. You can modify this by ;; adjusting the variable `auto-mode-alist'. ;; For example: @@ -984,7 +984,7 @@ Used in the F90 entry in `hs-special-modes-alist'.") ;; FIXME trivial to extend this to enum. Worth it? (defun f90-imenu-type-matcher () "Search backward for the start of a derived type. -Set subexpression 1 in the match-data to the name of the type." +Set subexpression 1 in the `match-data' to the name of the type." (let (found) (while (and (re-search-backward "^[ \t0-9]*type[ \t]*" nil t) (not (setq found diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index e8ce0e723e4..9418debe5e3 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -559,7 +559,7 @@ Currently accepted REPORT-KEY arguments are: (put :warning 'flymake-category 'flymake-warning) (put :note 'flymake-category 'flymake-note) -(defvar flymake-diagnostic-types-alist '() "") +(defvar flymake-diagnostic-types-alist '()) (make-obsolete-variable 'flymake-diagnostic-types-alist "Set properties on the diagnostic symbols instead. See Info @@ -1329,7 +1329,7 @@ default) no filter is applied." ;;; Mode-line and menu ;;; -(easy-menu-define flymake-menu flymake-mode-map "Flymake" +(easy-menu-define flymake-menu flymake-mode-map "Flymake menu." '("Flymake" [ "Go to next problem" flymake-goto-next-error t ] [ "Go to previous problem" flymake-goto-prev-error t ] diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 902466e4feb..3e5b8e2f32b 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -467,8 +467,8 @@ GDB session needs to be restarted for this setting to take effect." ;; TODO Some commands can't be called with --all (give a notice about ;; it in setting doc) (defcustom gdb-gud-control-all-threads t - "When non-nil, GUD execution commands affect all threads when -in non-stop mode. Otherwise, only current thread is affected." + "When non-nil, GUD execution commands affect all threads when in non-stop mode. +Otherwise, only current thread is affected." :type 'boolean :group 'gdb-non-stop :version "23.2") @@ -1483,7 +1483,7 @@ INDENT is the current indentation depth." (expr (nth 1 var)) (children (nth 2 var))) (if (or (<= (string-to-number children) gdb-max-children) (y-or-n-p - (format "%s has %s children. Continue? " expr children))) + (format "%s has %s children. Continue?" expr children))) (gdb-var-list-children token)))) ((string-search "-" text) ;contract this node (dolist (var gdb-var-list) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index d7f4582dd0b..ec2850737c8 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -72,7 +72,7 @@ SYMBOL should be one of `grep-command', `grep-template', Some grep programs are able to surround matches with special markers in grep output. Such markers can be used to highlight matches in grep mode. This requires `font-lock-mode' to be active -in grep buffers, so if you have globally disabled font-lock-mode, +in grep buffers, so if you have globally disabled `font-lock-mode', you will not get highlighting. This option sets the environment variable GREP_COLORS to specify @@ -137,7 +137,7 @@ The following place holders should be present in the string: - file names and wildcards to search. - file names and wildcards to exclude. - the regular expression searched for. - - place to insert null-device. + - place to insert `null-device'. In interactive usage, the actual value of this variable is set up by `grep-compute-defaults'; to change the default value, use diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index b2557587c6c..e2ad480281f 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -62,7 +62,7 @@ ;; activated or deactivated, `hs-minor-mode-hook' is run w/ `run-hooks'. ;; ;; Additionally, Joseph Eydelnant writes: -;; I enjoy your package hideshow.el Ver. 5.24 2001/02/13 +;; I enjoy your package hideshow.el Version 5.24 2001/02/13 ;; a lot and I've been looking for the following functionality: ;; toggle hide/show all with a single key. ;; Here are a few lines of code that lets me do just that. diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 36f8a6d6b6e..d6828eeffbb 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -5316,7 +5316,7 @@ directories and save the routine info. (defun idlwave-delete-user-catalog-file (&rest _ignore) (if (yes-or-no-p - (format "Delete file %s " idlwave-user-catalog-file)) + (format "Delete file %s?" idlwave-user-catalog-file)) (progn (delete-file idlwave-user-catalog-file) (message "%s has been deleted" idlwave-user-catalog-file)))) diff --git a/lisp/progmodes/opascal.el b/lisp/progmodes/opascal.el index 51c888d25f3..e55b09d8fcf 100644 --- a/lisp/progmodes/opascal.el +++ b/lisp/progmodes/opascal.el @@ -51,7 +51,7 @@ :group 'languages) (defconst opascal-debug nil - "True if in debug mode.") + "Non-nil if in debug mode.") (define-obsolete-variable-alias 'delphi-search-path 'opascal-search-path "24.4") @@ -1732,7 +1732,8 @@ comment block. If not in a // comment, just does a normal newline." (define-obsolete-function-alias 'delphi-mode #'opascal-mode "24.4") ;;;###autoload (define-derived-mode opascal-mode prog-mode "OPascal" - "Major mode for editing OPascal code.\\ + "Major mode for editing OPascal code. +\\ \\[opascal-find-unit]\t- Search for a OPascal source file. \\[opascal-fill-comment]\t- Fill the current comment. \\[opascal-new-comment-line]\t- If in a // comment, do a new comment line. diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index 7f70e02b72e..6c09dcf881d 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el @@ -127,7 +127,7 @@ which case it will be used to compose the new symbol as per the third argument of `compose-region'.") (defun prettify-symbols-default-compose-p (start end _match) - "Return true iff the symbol MATCH should be composed. + "Return non-nil iff the symbol MATCH should be composed. The symbol starts at position START and ends at position END. This is the default for `prettify-symbols-compose-predicate' which is suitable for most programming languages such as C or Lisp." @@ -145,7 +145,7 @@ which is suitable for most programming languages such as C or Lisp." "A predicate for deciding if the currently matched symbol is to be composed. The matched symbol is the car of one entry in `prettify-symbols-alist'. The predicate receives the match's start and end positions as well -as the match-string as arguments.") +as the `match-string' as arguments.") (defun prettify-symbols--compose-symbol (alist) "Compose a sequence of characters into a symbol. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 2eead0d0696..9b63f4b1bc8 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1033,8 +1033,8 @@ command \\[fileloop-continue]." (defun project-query-replace-regexp (from to) "Query-replace REGEXP in all the files of the project. Stops when a match is found and prompts for whether to replace it. -If you exit the query-replace, you can later continue the query-replace -loop using the command \\[fileloop-continue]." +If you exit the `query-replace', you can later continue the +`query-replace' loop using the command \\[fileloop-continue]." (interactive (pcase-let ((`(,from ,to) (query-replace-read-args "Query replace (regexp)" t t))) diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index d47bb8bcb96..dabf9c479e2 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -414,7 +414,7 @@ wherever possible, since it is slow." ;; "----" ["MB" nil :help "Help MB"])) (defun verilog-define-abbrev-table (tablename definitions &optional docstring &rest props) - "Filter `define-abbrev-table' TABLENAME DEFINITIONS + "Filter `define-abbrev-table' TABLENAME DEFINITIONS. Provides DOCSTRING PROPS in newer Emacs (23.1)." (condition-case nil (apply #'define-abbrev-table tablename definitions docstring props) @@ -13380,7 +13380,7 @@ Typing \\[verilog-auto] will call my-verilog-insert-hello and expand the above into: /*AUTOINSERTLISP(my-verilog-insert-hello \"world\")*/ - // Beginning of automatic insert lisp + // Beginning of automatic insert Lisp initial $write(\"hello world\"); // End of automatics diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index fef7dff65e2..fc0d406f73c 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -2197,8 +2197,8 @@ is pair matching KEY." (setq alist alist-cdr))))) (defun vhdl-aget (alist key) - "Return the value in ALIST that is associated with KEY. If KEY is -not found, then nil is returned." + "Return the value in ALIST that is associated with KEY. +If KEY is not found, then nil is returned." (cdr (assoc key alist))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -4275,8 +4275,7 @@ STRING are replaced by `-' and substrings are converted to lower case." (defvar vhdl-sources-menu nil) (defun vhdl-directory-files (directory &optional full match) - "Call `directory-files' if DIRECTORY exists, otherwise generate error -message." + "Call `directory-files' if DIRECTORY exists, otherwise generate error message." (if (not (file-directory-p directory)) (vhdl-warning-when-idle "No such directory: \"%s\"" directory) (let ((dir (directory-files directory full match))) @@ -5734,8 +5733,8 @@ the offset is simply returned." (save-excursion (re-search-forward "\\\\" (vhdl-point 'eol) t))))) (defun vhdl-forward-comment (&optional direction) - "Skip all comments (including whitespace). Skip backwards if DIRECTION is -negative, skip forward otherwise." + "Skip all comments (including whitespace). +Skip backwards if DIRECTION is negative, skip forward otherwise." (interactive "p") (if (and direction (< direction 0)) ;; skip backwards @@ -6912,9 +6911,9 @@ previous libunit keyword)." (concat vhdl-case-alternative-re "\\|" vhdl-case-header-key)) (defun vhdl-skip-case-alternative (&optional lim) - "Skip forward over case/when bodies, with optional maximal -limit. If no next case alternative is found, nil is returned and -point is not moved." + "Skip forward over case/when bodies, with optional maximal limit. +If no next case alternative is found, nil is returned and point +is not moved." (let ((lim (or lim (point-max))) (here (point)) donep foundp) @@ -6939,9 +6938,8 @@ point is not moved." foundp)) (defun vhdl-backward-skip-label (&optional lim) - "Skip backward over a label, with optional maximal -limit. If label is not found, nil is returned and point -is not moved." + "Skip backward over a label, with optional maximal limit. +If label is not found, nil is returned and point is not moved." (let ((lim (or lim (point-min))) placeholder) (if (save-excursion @@ -6955,9 +6953,8 @@ is not moved." )) (defun vhdl-forward-skip-label (&optional lim) - "Skip forward over a label, with optional maximal -limit. If label is not found, nil is returned and point -is not moved." + "Skip forward over a label, with optional maximal limit. +If label is not found, nil is returned and point is not moved." (let ((lim (or lim (point-max)))) (if (looking-at vhdl-label-key) (progn @@ -7327,9 +7324,9 @@ after the containing paren which starts the arglist." (- ce-curcol cs-curcol -1)))) (defun vhdl-lineup-comment (_langelem) - "Support old behavior for comment indentation. We look at -vhdl-comment-only-line-offset to decide how to indent comment -only-lines." + "Support old behavior for comment indentation. +We look at `vhdl-comment-only-line-offset' to decide how to +indent comment only-lines." (save-excursion (back-to-indentation) ;; at or to the right of comment-column @@ -7445,7 +7442,7 @@ else indent `correctly'." (setq this-command 'vhdl-electric-tab))) (defun vhdl-electric-return () - "newline-and-indent or indent-new-comment-line if in comment and preceding + "`newline-and-indent' or `indent-new-comment-line' if in comment and preceding character is a space." (interactive) (if (and (= (preceding-char) ? ) (vhdl-in-comment-p)) @@ -7456,8 +7453,8 @@ character is a space." (newline-and-indent))) (defun vhdl-indent-line () - "Indent the current line as VHDL code. Returns the amount of -indentation change." + "Indent the current line as VHDL code. +Return the amount of indentation change." (interactive) (let* ((syntax (and vhdl-indent-syntax-based (vhdl-get-syntactic-context))) (pos (- (point-max) (point))) @@ -7617,8 +7614,8 @@ ALIGN-PATTERN matches the white space to be expanded/contracted.") ;; Align code (defvar vhdl-align-try-all-clauses t - "If REGEXP is not found on the first line of the region that clause -is ignored. If this variable is non-nil, then the clause is tried anyway.") + "If REGEXP is not found on the first line of the region that clause is ignored. +If this variable is non-nil, then the clause is tried anyway.") (defun vhdl-do-group (function &optional spacing) "Apply FUNCTION on group of lines between empty lines." @@ -7637,8 +7634,7 @@ is ignored. If this variable is non-nil, then the clause is tried anyway.") (funcall function beg end spacing))) (defun vhdl-do-list (function &optional spacing) - "Apply FUNCTION to the lines of a list surrounded by a balanced group of -parentheses." + "Apply FUNCTION to lines of a list surrounded by a balanced group of parentheses." (let (beg end) (save-excursion ;; search for beginning of balanced group of parentheses @@ -7683,11 +7679,11 @@ parentheses." (funcall function beg end spacing))) (defun vhdl-align-region-1 (begin end &optional spacing alignment-list _indent) - "Attempt to align a range of lines based on the content of the -lines. The definition of `alignment-list' determines the matching -order and the manner in which the lines are aligned. If ALIGNMENT-LIST -is not specified `vhdl-align-alist' is used. If INDENT is non-nil, -indentation is done before aligning." + "Attempt to align a range of lines based on the content of the lines. +The definition of `alignment-list' determines the matching order +and the manner in which the lines are aligned. If ALIGNMENT-LIST +is not specified `vhdl-align-alist' is used. If INDENT is +non-nil, indentation is done before aligning." (interactive "r\np") (setq alignment-list (or alignment-list vhdl-align-alist)) (setq spacing (or spacing 1)) @@ -11070,7 +11066,7 @@ Point is left between them." ;; Help functions (defun vhdl-electric-space (count) - "Expand abbreviations and self-insert space(s), do indent-new-comment-line + "Expand abbreviations and self-insert space(s), do `indent-new-comment-line' if in comment and past end-comment-column." (interactive "p") (cond ((vhdl-in-comment-p) @@ -11619,8 +11615,7 @@ but not if inside a comment or quote." string))) (defun vhdl-paste-group-comment (string indent) - "Paste comment and empty lines from STRING between groups of lines -with INDENT." + "Paste comment and empty lines from STRING between groups of lines with INDENT." (let ((pos (point-marker))) (when (> indent 0) (while (string-match "^\\(--\\)" string) @@ -14919,7 +14914,8 @@ if required." (setq project-alist (cdr project-alist))))) (defun vhdl-speedbar-insert-project-hierarchy (project indent &optional rescan) - "Insert hierarchy of PROJECT. Rescan directories if RESCAN is non-nil, + "Insert hierarchy of PROJECT. +Rescan directories if optional argument RESCAN is non-nil, otherwise use cached data." (when (or rescan (and (not (assoc project vhdl-file-alist)) (not (vhdl-load-cache project)))) @@ -14937,7 +14933,8 @@ otherwise use cached data." (vhdl-speedbar-expand-units project)) (defun vhdl-speedbar-insert-dir-hierarchy (directory depth &optional rescan) - "Insert hierarchy of DIRECTORY. Rescan directory if RESCAN is non-nil, + "Insert hierarchy of DIRECTORY. +Rescan directory if optional argument RESCAN is non-nil, otherwise use cached data." (when (or rescan (and (not (assoc directory vhdl-file-alist)) (not (vhdl-load-cache directory)))) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 69cabd0b5a5..772e6646d95 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -760,7 +760,7 @@ references displayed in the current *xref* buffer." (defun xref--outdated-p (item) "Check that the match location at current position is up-to-date. -ITEMS is an xref item which " +ITEMS is an xref item which " ; FIXME: Expand documentation. ;; FIXME: The check should most likely be a generic function instead ;; of the assumption that all matches' summaries relate to the ;; buffer text in a particular way. diff --git a/lisp/rect.el b/lisp/rect.el index 504be41b673..d288adfbaf6 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -202,8 +202,8 @@ rectangles, as conses of the form (WIDTH . HEIGHT)." (<= (+ y2 h2) y1))))) (defun rectangle-dimensions (start end) - "Return the dimensions of the rectangle with corners at START -and END. The returned value has the form of (WIDTH . HEIGHT)." + "Return the dimensions of the rectangle with corners at START and END. +The returned value has the form of (WIDTH . HEIGHT)." (save-excursion (let* ((height (1+ (abs (- (line-number-at-pos end) (line-number-at-pos start))))) diff --git a/lisp/repeat.el b/lisp/repeat.el index 0b761fff1e3..ee9e14b5155 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -218,7 +218,7 @@ recently executed command not bound to an input event\"." ((null last-repeatable-command) (error "There is nothing to repeat")) ((eq last-repeatable-command 'mode-exit) - (error "last-repeatable-command is mode-exit & can't be repeated")) + (error "`last-repeatable-command' is `mode-exit' and can't be repeated")) ((memq last-repeatable-command repeat-too-dangerous) (error "Command %S too dangerous to repeat automatically" last-repeatable-command))) diff --git a/lisp/replace.el b/lisp/replace.el index e4155d4c27a..84ec042f455 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -63,7 +63,7 @@ it will match any sequence matched by the regexp `search-whitespace-regexp'." :version "24.3") (defvar query-replace-history nil - "Default history list for query-replace commands. + "Default history list for `query-replace' commands. See `query-replace-from-history-variable' and `query-replace-to-history-variable'.") @@ -202,7 +202,7 @@ by this function to the end of values available via (car (symbol-value query-replace-from-history-variable))))) (defun query-replace-read-from (prompt regexp-flag) - "Query and return the `from' argument of a query-replace operation. + "Query and return the `from' argument of a `query-replace' operation. Prompt with PROMPT. REGEXP-FLAG non-nil means the response should be a regexp. The return value can also be a pair (FROM . TO) indicating that the user wants to replace FROM with TO." @@ -326,8 +326,9 @@ the original string if not." (defun query-replace-read-to (from prompt regexp-flag) - "Query and return the `to' argument of a query-replace operation. -Prompt with PROMPT. REGEXP-FLAG non-nil means the response should a regexp." + "Query and return the `to' argument of a `query-replace' operation. +Prompt with PROMPT. REGEXP-FLAG non-nil means the response +should a regexp." (query-replace-compile-replacement (save-excursion (let* ((history-add-new-input nil) @@ -1300,7 +1301,7 @@ See `occur-revert-function'.") (defcustom occur-mode-find-occurrence-hook nil "Hook run by Occur after locating an occurrence. This will be called with the cursor position at the occurrence. An application -for this is to reveal context in an outline-mode when the occurrence is hidden." +for this is to reveal context in an outline mode when the occurrence is hidden." :type 'hook :group 'matching) @@ -2606,7 +2607,7 @@ passed in. If LITERAL is set, no checking is done, anyway." noedit) (defvar replace-update-post-hook nil - "Function(s) to call after query-replace has found a match in the buffer.") + "Function(s) to call after `query-replace' has found a match in the buffer.") (defvar replace-search-function nil "Function to use when searching for strings to replace. diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el index a0d4f6e96c2..84c9d06ecec 100644 --- a/lisp/ruler-mode.el +++ b/lisp/ruler-mode.el @@ -348,7 +348,7 @@ nothing is dragged.") (defun ruler-mode-text-scaled-width (width) "Compute scaled text width according to current font scaling. Convert a width of char units into a text-scaled char width units, -Ex. `window-hscroll'." +for example `window-hscroll'." (/ (* width (frame-char-width)) (default-font-width))) (defun ruler-mode-text-scaled-window-hscroll () diff --git a/lisp/server.el b/lisp/server.el index 5dd30db195a..6359a761994 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -1078,7 +1078,7 @@ The following commands are accepted by the client: `-suspend' Suspend this terminal, i.e., stop the client process. - Sent when the user presses C-z." + Sent when the user presses \\[suspend-frame]." (server-log (concat "Received " string) proc) ;; First things first: let's check the authentication (unless (process-get proc :authenticated) diff --git a/lisp/ses.el b/lisp/ses.el index 9250f7ede0f..ea966295b18 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -299,11 +299,11 @@ Used for listing local printers or renamed cells.") ses-center-span ses-dashfill ses-dashfill-span ses-tildefill-span ses-prin1) - "List of print functions to be included in initial history of -printer functions. None of these standard-printer functions, -except function `ses-prin1', is suitable for use as a column -printer or a global-default printer because they invoke the -column or default printer and then modify its output.") + "List of print functions to be included in initial history of printer functions. +None of these standard-printer functions, except function +`ses-prin1', is suitable for use as a column printer or a +global-default printer because they invoke the column or default +printer and then modify its output.") ;;---------------------------------------------------------------------------- diff --git a/lisp/shell.el b/lisp/shell.el index 5cdc0385a6f..b575024e016 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -517,7 +517,8 @@ Shell buffers. It implements `shell-completion-execonly' for (put 'shell-mode 'mode-class 'special) (define-derived-mode shell-mode comint-mode "Shell" - "Major mode for interacting with an inferior shell.\\ + "Major mode for interacting with an inferior shell. +\\ \\[comint-send-input] after the end of the process' output sends the text from the end of process to the end of the current line. \\[comint-send-input] before end of process output copies the current line minus the prompt to diff --git a/lisp/simple.el b/lisp/simple.el index 1267c92fe54..298e3ea5ee0 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -241,7 +241,7 @@ all other buffers." (defun next-error-buffer-on-selected-frame (&optional _avoid-current extra-test-inclusive extra-test-exclusive) - "Return a single visible next-error buffer on the selected frame." + "Return a single visible `next-error' buffer on the selected frame." (let ((window-buffers (delete-dups (delq nil (mapcar (lambda (w) @@ -2133,21 +2133,23 @@ or (if one of MODES is a minor mode), if it is switched on in BUFFER." command-names))) (defcustom suggest-key-bindings t - "Non-nil means show the equivalent key-binding when M-x command has one. + "Non-nil means show the equivalent keybinding when \ +\\[execute-extended-command] has one. The value can be a length of time to show the message for. If the value is non-nil and not a number, we wait 2 seconds. Also see `extended-command-suggest-shorter'. Equivalent key-bindings are also shown in the completion list of -M-x for all commands that have them." +\\[execute-extended-command] for all commands that have them." :group 'keyboard :type '(choice (const :tag "off" nil) (integer :tag "time" 2) (other :tag "on"))) (defcustom extended-command-suggest-shorter t - "If non-nil, show a shorter M-x invocation when there is one. + "If non-nil, show a shorter \\[execute-extended-command] invocation \ +when there is one. Also see `suggest-key-bindings'." :group 'keyboard @@ -3522,7 +3524,7 @@ with < or <= based on USE-<." ;; called or in some cases on a timer called after a change is made in ;; any buffer. (defvar-local undo-auto--last-boundary-cause nil - "Describe the cause of the last undo-boundary. + "Describe the cause of the last `undo-boundary'. If `explicit', the last boundary was caused by an explicit call to `undo-boundary', that is one not called by the code in this @@ -9817,11 +9819,13 @@ warning using STRING as the message.") The argument `COMMAND' should be a symbol. -Running `M-x COMMAND RET' for the first time prompts for which +Running `\\[execute-extended-command] COMMAND RET' for \ +the first time prompts for which alternative to use and records the selected command as a custom variable. -Running `C-u M-x COMMAND RET' prompts again for an alternative +Running `\\[universal-argument] \\[execute-extended-command] COMMAND RET' \ +prompts again for an alternative and overwrites the previous choice. The variable `COMMAND-alternatives' contains an alist with diff --git a/lisp/so-long.el b/lisp/so-long.el index 65570bf253d..c975384ddb3 100644 --- a/lisp/so-long.el +++ b/lisp/so-long.el @@ -492,7 +492,7 @@ ;; considered internal-use only (with `global-so-long-mode' the interface ;; for enabling or disabling the automated behaviour). FIXME: Establish a ;; way to support the original use-case, or rename to `so-long--enabled'. - "Internal use. Non-nil when any so-long functionality has been used.") + "Internal use. Non-nil when any `so-long' functionality has been used.") (defvar-local so-long--active nil ; internal use "Non-nil when `so-long' mitigations are in effect.") @@ -1100,7 +1100,7 @@ This command calls `so-long' with the selected action as an argument.") ;;;###autoload (defun so-long-commentary () - "View the so-long library's documentation in `outline-mode'." + "View the `so-long' library's documentation in `outline-mode'." (interactive) (let ((buf "*So Long: Commentary*")) (when (buffer-live-p (get-buffer buf)) @@ -1862,14 +1862,14 @@ invoked." ;;;###autoload (defun so-long-enable () - "Enable the so-long library's functionality. + "Enable the `so-long' library's functionality. Equivalent to calling (global-so-long-mode 1)" (interactive) (global-so-long-mode 1)) (defun so-long-disable () - "Disable the so-long library's functionality. + "Disable the `so-long' library's functionality. Equivalent to calling (global-so-long-mode 0)" (interactive) diff --git a/lisp/sort.el b/lisp/sort.el index be373fba99b..d6767ed5098 100644 --- a/lisp/sort.el +++ b/lisp/sort.el @@ -507,7 +507,8 @@ Use \\[untabify] to convert tabs to spaces before sorting." (setq col-start (min col-beg1 col-end1)) (setq col-end (max col-beg1 col-end1)) (if (search-backward "\t" beg1 t) - (error "sort-columns does not work with tabs -- use M-x untabify")) + (error (substitute-command-keys + "sort-columns does not work with tabs -- use \\[untabify]"))) (if (not (or (memq system-type '(windows-nt)) (let ((pos beg1) plist fontified) (catch 'found diff --git a/lisp/subr.el b/lisp/subr.el index 0793cbca5e1..a6434bf28a8 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -22,6 +22,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: ;; declare-function's args use &rest, not &optional, for compatibility diff --git a/lisp/tempo.el b/lisp/tempo.el index 25f54af3c9d..b722cc04ca2 100644 --- a/lisp/tempo.el +++ b/lisp/tempo.el @@ -445,7 +445,7 @@ never prompted." ;;; tempo-is-user-element (defun tempo-is-user-element (element) - "Tries all the user-defined element handlers in `tempo-user-elements'." + "Try all the user-defined element handlers in `tempo-user-elements'." ;; Sigh... I need (some list) (catch 'found (mapc (lambda (handler) diff --git a/lisp/term.el b/lisp/term.el index d3d02188573..af930891043 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -340,7 +340,7 @@ (defvar term-home-marker) ; Marks the "home" position for cursor addressing. (defvar term-saved-home-marker nil "When using alternate sub-buffer, -contains saved term-home-marker from original sub-buffer.") +contains saved `term-home-marker' from original sub-buffer.") (defvar term-start-line-column 0 "(current-column) at start of screen line, or nil if unknown.") (defvar term-current-column 0 "If non-nil, is cache for (current-column).") @@ -377,7 +377,7 @@ are not allowed.") (defvar term-scroll-with-delete nil "If t, forward scrolling should be implemented by delete to top-most line(s); and if nil, scrolling should be implemented -by moving term-home-marker. It is set to t if there is a +by moving `term-home-marker'. It is set to t if there is a \(non-default) scroll-region OR the alternate buffer is used.") (defvar term-pending-delete-marker) ; New user input in line mode ; needs to be deleted, because it gets echoed by the inferior. @@ -669,7 +669,7 @@ Do not change it directly; use `term-set-escape-char' instead.") "Keymap used in Term pager mode.") (defvar term-ptyp t - "True if communications via pty; false if by pipe. Buffer local. + "Non-nil if communications via pty; false if by pipe. Buffer local. This is to work around a bug in Emacs process signaling.") (defvar term-last-input-match "" @@ -1228,8 +1228,7 @@ Entry to this mode runs the hooks on `term-mode-hook'." (process-send-string proc chars)))) (defun term-send-raw () - "Send the last character typed through the terminal-emulator -without any interpretation." + "Send last typed character to the terminal-emulator without any interpretation." (interactive) (let ((keys (this-command-keys))) (term-send-raw-string (string (aref keys (1- (length keys))))))) @@ -1401,8 +1400,8 @@ Called as a buffer-local `read-only-mode-hook' function." (force-mode-line-update)) (defun term-check-proc (buffer) - "True if there is a process associated w/buffer BUFFER, and it -is alive. BUFFER can be either a buffer or the name of one." + "Non-nil if there is a process associated w/buffer BUFFER, and it is alive. +BUFFER can be either a buffer or the name of one." (let ((proc (get-buffer-process buffer))) (and proc (memq (process-status proc) '(run stop open listen connect))))) @@ -1538,7 +1537,7 @@ Using \"emacs\" loses, because bash disables editing if $TERM == emacs.") Some other integer if Bash is new or not in use. Nil if unknown.") (defun term--bash-needs-EMACSp () - "t if Bash is old, nil if it is new or not in use." + "Return t if Bash is old, nil if it is new or not in use." (eq 43 (or term--bash-needs-EMACS-status (setf @@ -2107,17 +2106,17 @@ The values of `term-get-old-input', `term-input-filter-functions', and in the buffer. E.g., If the interpreter is the csh, - term-get-old-input is the default: take the current line, discard any - initial string matching regexp term-prompt-regexp. - term-input-filter-functions monitors input for \"cd\", \"pushd\", and + `term-get-old-input' is the default: take the current line, discard any + initial string matching regexp `term-prompt-regexp'. + `term-input-filter-functions' monitors input for \"cd\", \"pushd\", and \"popd\" commands. When it sees one, it cd's the buffer. - term-input-filter is the default: returns t if the input isn't all white + `term-input-filter' is the default: returns t if the input isn't all white space. If the term is Lucid Common Lisp, - term-get-old-input snarfs the sexp ending at point. - term-input-filter-functions does nothing. - term-input-filter returns nil if the input matches input-filter-regexp, + `term-get-old-input' snarfs the sexp ending at point. + `term-input-filter-functions' does nothing. + `term-input-filter' returns nil if the input matches input-filter-regexp, which matches (1) all whitespace (2) :a, :c, etc. Similarly for Soar, Scheme, etc." @@ -2403,8 +2402,7 @@ Useful if you accidentally suspend the top-level process." (kill-region pmark (point))))) (defun term-delchar-or-maybe-eof (arg) - "Delete ARG characters forward, or send an EOF to process if at end of -buffer." + "Delete ARG characters forward, or send an EOF to process if at end of buffer." (interactive "p") (if (eobp) (process-send-eof) @@ -3171,7 +3169,7 @@ See `term-prompt-regexp'." Set in `pre-command-hook' in char mode by `term-set-goto-process-mark'.") (defun term-set-goto-process-mark () - "Sets `term-goto-process-mark'. + "Set `term-goto-process-mark'. Always set to nil if `term-char-mode-point-at-process-mark' is nil. @@ -3430,7 +3428,7 @@ option is enabled. See `term-set-goto-process-mark'." (t))) (defun term--reset-scroll-region () - "Sets the scroll region to the full height of the terminal." + "Set the scroll region to the full height of the terminal." (term-set-scroll-region 0 (term--last-line))) (defun term-set-scroll-region (top bottom) @@ -3793,7 +3791,7 @@ all pending output has been dealt with.")) (defun term-erase-in-display (kind) "Erase (that is blank out) part of the window. -If KIND is 0, erase from (point) to (point-max); +If KIND is 0, erase from point to point-max; if KIND is 1, erase from home to point; else erase from home to point-max." (term-handle-deferred-scroll) (cond ((eq kind 0) diff --git a/lisp/textmodes/bib-mode.el b/lisp/textmodes/bib-mode.el index e2fd3ecaa42..a429aae7f70 100644 --- a/lisp/textmodes/bib-mode.el +++ b/lisp/textmodes/bib-mode.el @@ -137,7 +137,7 @@ with the cdr.") (defcustom bib-auto-capitalize t - "True to automatically capitalize appropriate fields in Bib mode." + "Non-nil to automatically capitalize appropriate fields in Bib mode." :type 'boolean) (defconst bib-capitalized-fields "%[AETCBIJR]") diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 9b3211df57a..1d450b50012 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -1861,7 +1861,7 @@ is itself incorrect, but suspiciously repeated." ;;* flyspell-highlight-duplicate-region ... */ ;;*---------------------------------------------------------------------*/ (defun flyspell-highlight-duplicate-region (beg end poss) - "Set up an overlay on a duplicate misspelled word, in the buffer from BEG to END. + "Set up overlay on duplicate misspelled word, in the buffer from BEG to END. POSS is a list of possible spelling/correction lists, as returned by `ispell-parse-output'." (let ((inhibit-read-only t)) diff --git a/lisp/textmodes/makeinfo.el b/lisp/textmodes/makeinfo.el index 13367a09bcf..6b9b3f3e9de 100644 --- a/lisp/textmodes/makeinfo.el +++ b/lisp/textmodes/makeinfo.el @@ -175,10 +175,9 @@ command to gain use of `next-error'." 'makeinfo-compilation-sentinel-region))))))) (defun makeinfo-next-error (_arg _reset) - "This function is used to disable `next-error' if the user has -used `makeinfo-region'. Since the compilation process is used on -a temporary file in that case, calling `next-error' would give -nonsensical results." + "This is used to disable `next-error' if the user has used `makeinfo-region'. +Since the compilation process is used on a temporary file in that +case, calling `next-error' would give nonsensical results." (error "Use `makeinfo-buffer' to gain use of the `next-error' command")) ;; Actually run makeinfo. COMMAND is the command to run. If diff --git a/lisp/textmodes/mhtml-mode.el b/lisp/textmodes/mhtml-mode.el index 25905385685..936732153ae 100644 --- a/lisp/textmodes/mhtml-mode.el +++ b/lisp/textmodes/mhtml-mode.el @@ -19,6 +19,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +;;; Commentary: + ;;; Code: (eval-when-compile (require 'cl-lib)) diff --git a/lisp/textmodes/refill.el b/lisp/textmodes/refill.el index 0a0e4cc444c..b2ebbd5f375 100644 --- a/lisp/textmodes/refill.el +++ b/lisp/textmodes/refill.el @@ -153,7 +153,7 @@ regardless of the number of after-change calls from commands doing complex processing.") (defun refill-after-change-function (_beg end _len) - "Function for `after-change-functions' which just sets `refill-doit'." + "Set `refill-doit'. Used by `after-change-functions'." (unless undo-in-progress (setq refill-doit end))) diff --git a/lisp/textmodes/reftex-dcr.el b/lisp/textmodes/reftex-dcr.el index abcf119fb82..ee26d911a5d 100644 --- a/lisp/textmodes/reftex-dcr.el +++ b/lisp/textmodes/reftex-dcr.el @@ -32,14 +32,17 @@ ;;;###autoload (defun reftex-view-crossref (&optional arg auto-how fail-quietly) - "View cross reference of macro at point. Point must be on the KEY -argument. When at a `\\ref' macro, show corresponding `\\label' -definition, also in external documents (`xr'). When on a label, show -a locations where KEY is referenced. Subsequent calls find additional -locations. When on a `\\cite', show the associated `\\bibitem' macro or -the BibTeX database entry. When on a `\\bibitem', show a `\\cite' macro -which uses this KEY. When on an `\\index', show other locations marked -by the same index entry. + "View cross reference of macro at point. + +Point must be on the KEY argument. When at a `\\ref' macro, show +corresponding `\\label' definition, also in external +documents (`xr'). When on a label, show a locations where KEY is +referenced. Subsequent calls find additional locations. When on +a `\\cite', show the associated `\\bibitem' macro or the BibTeX +database entry. When on a `\\bibitem', show a `\\cite' macro +which uses this KEY. When on an `\\index', show other locations +marked by the same index entry. + To define additional cross referencing items, use the option `reftex-view-crossref-extra'. See also `reftex-view-crossref-from-bibtex'. With one or two \\[universal-argument] prefixes, enforce rescanning of the document. diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el index 3b7518e5c3f..cc8b3244b99 100644 --- a/lisp/textmodes/reftex-global.el +++ b/lisp/textmodes/reftex-global.el @@ -338,17 +338,17 @@ Also checks if buffers visiting the files are in read-only mode." (while (setq file (pop files)) (unless (file-exists-p file) (ding) - (or (y-or-n-p (format "No such file %s. Continue? " file)) + (or (y-or-n-p (format "No such file %s. Continue?" file)) (error "Abort"))) (unless (file-writable-p file) (ding) - (or (y-or-n-p (format "No write access to %s. Continue? " file)) + (or (y-or-n-p (format "No write access to %s. Continue?" file)) (error "Abort"))) (when (and (setq buf (find-buffer-visiting file)) (with-current-buffer buf buffer-read-only)) (ding) - (or (y-or-n-p (format "Buffer %s is read-only. Continue? " + (or (y-or-n-p (format "Buffer %s is read-only. Continue?" (buffer-name buf))) (error "Abort")))))) diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el index 423c5398dd6..9d9eab4d7b5 100644 --- a/lisp/textmodes/reftex-index.el +++ b/lisp/textmodes/reftex-index.el @@ -934,8 +934,8 @@ When index is restricted, select the previous section as restriction criterion." (t nil)))) (defun reftex-index-analyze-entry (data) - ;; This splits the index context so that key, attribute and visual - ;; values are accessible individually. + "Split index context so that key, attribute and visual +values are accessible individually." (interactive) (let* ((arg (nth 5 data)) (context (nth 2 data)) diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el index 9def10cee05..c521a07f192 100644 --- a/lisp/textmodes/reftex-parse.el +++ b/lisp/textmodes/reftex-parse.el @@ -435,7 +435,8 @@ This function also makes sure the old toc markers do not point anywhere." ;;;###autoload (defun reftex-section-info (file) "Return a section entry for the current match. -Careful: This function expects the match-data to be still in place!" +Careful: This function expects the `match-data' to still be in +place!" (let* ((marker (set-marker (make-marker) (1- (match-beginning 3)))) (macro (reftex-match-string 3)) (prefix (save-match-data @@ -494,7 +495,8 @@ will rescan the entire document." ;;;###autoload (defun reftex-index-info (file) "Return an index entry for the current match. -Careful: This function expects the match-data to be still in place!" +Careful: This function expects the `match-data' to still be in +place!" (catch 'exit (let* ((macro (reftex-match-string 10)) (bom (match-beginning 10)) diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index 23f2193501d..d57a7678553 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el @@ -330,7 +330,8 @@ select the nearest entry with the correct new level." "The maximum level of toc entries which will be included in the TOC. Section headings with a bigger level will be ignored. In RefTeX, chapters are level 1, sections are level 2 etc. -This variable can be changed from within the *toc* buffer with the `t' key." +This variable can be changed from within the *toc* buffer with \ +\\\\[reftex-toc-max-level]." :group 'reftex-table-of-contents-browser :type 'integer) @@ -1208,7 +1209,7 @@ path." :type '(repeat (file))) (defcustom reftex-sort-bibtex-matches 'reverse-year - "Sorting of the entries found in BibTeX databases by reftex-citation. + "Sorting of the entries found in BibTeX databases by `reftex-citation'. Possible values: nil Do not sort entries. `author' Sort entries by author name. @@ -1364,7 +1365,7 @@ should return the string to insert into the buffer." :type '(choice (const nil) function)) (defcustom reftex-select-bib-mode-hook nil - "Mode hook for reftex-select-bib-mode." + "Mode hook for `reftex-select-bib-mode'." :group 'reftex-citation-support :type 'hook) @@ -1840,7 +1841,7 @@ upon the variable `reftex-initialize-temporary-buffers'." (defcustom reftex-initialize-temporary-buffers nil "Non-nil means do initializations even when visiting file temporarily. -When nil, RefTeX may turn off find-file hooks and other stuff to briefly +When nil, RefTeX may turn off `find-file' hooks and other stuff to briefly visit a file. When t, the full default initializations are done (find-file-hook etc.). Instead of t or nil, this variable may also be a list of hook functions to diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el index 604a67df323..550994cd7b6 100644 --- a/lisp/textmodes/texinfmt.el +++ b/lisp/textmodes/texinfmt.el @@ -932,9 +932,9 @@ commands." "Text of the copyright notice and copying permissions.") (defun texinfo-copying () - "Copy the copyright notice and copying permissions from the Texinfo file, -as indicated by the @copying ... @end copying command; -insert the text with the @insertcopying command." + "Copy the copyright notice and copying permissions from Texinfo file. +This is indicated by the \"@copying ... @end copying\" command; +insert the text with the \"@insertcopying\" command." (let ((beg (progn (beginning-of-line) (point))) (end (progn (re-search-forward "^@end copying[ \t]*\n") (point)))) (setq texinfo-copying-text @@ -944,8 +944,8 @@ insert the text with the @insertcopying command." (delete-region beg end))) (defun texinfo-insertcopying () - "Insert the copyright notice and copying permissions from the Texinfo file, -which are indicated by the @copying ... @end copying command." + "Insert the copyright notice and copying permissions from Texinfo file. +This is indicated by the \"@copying ... @end copying\" command." (insert (concat "\n" texinfo-copying-text))) (put 'begin 'texinfo-format 'texinfo-format-begin) @@ -2546,7 +2546,9 @@ If used within a line, follow `@bullet' with braces." "smalllisp" "\\)") "Regexp specifying end of environments in which @kbd does not put `...' -around argument. (See `texinfo-format-kbd-regexp')") +around argument. + +See `texinfo-format-kbd-regexp'.") (put 'kbd 'texinfo-format 'texinfo-format-kbd) (defun texinfo-format-kbd () diff --git a/lisp/transient.el b/lisp/transient.el index 2be82f56d86..f3d3902a77e 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -1289,8 +1289,8 @@ variable instead.") (defvar transient--exitp nil "Whether to exit the transient.") (defvar transient--showp nil "Whether the transient is show in a popup buffer.") -(defvar transient--helpp nil "Whether help-mode is active.") -(defvar transient--editp nil "Whether edit-mode is active.") +(defvar transient--helpp nil "Whether `help-mode' is active.") +(defvar transient--editp nil "Whether `edit-mode' is active.") (defvar transient--active-infix nil "The active infix awaiting user input.") diff --git a/lisp/wdired.el b/lisp/wdired.el index eafb50cc18a..eb5a6385563 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -453,7 +453,7 @@ non-nil means return old filename." (remove-function (local 'revert-buffer-function) #'wdired-revert)) (defun wdired-abort-changes () - "Abort changes and return to dired mode." + "Abort changes and return to `dired-mode'." (interactive) (remove-hook 'before-change-functions #'wdired--before-change-fn t) (let ((inhibit-read-only t)) @@ -689,7 +689,7 @@ Optional arguments are ignored." ;; FIXME: Can't we use the normal mechanism for that? --Stef (if (and (buffer-modified-p) - (not (y-or-n-p "Buffer changed. Discard changes and kill buffer?"))) + (not (y-or-n-p "Buffer changed. Discard changes and kill buffer?"))) (error "Error"))) ;; Added to after-change-functions in wdired-change-to-wdired-mode to diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 59d3249c5de..e193be6cdd2 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -565,8 +565,8 @@ Used when `whitespace-style' includes the value `space-before-tab'.") (defvar whitespace-indentation 'whitespace-indentation - "Symbol face used to visualize `tab-width' or more SPACEs at beginning of -line. Used when `whitespace-style' includes the value `indentation'.") + "Symbol face used to visualize `tab-width' or more SPACEs at beginning of line. +Used when `whitespace-style' includes the value `indentation'.") (make-obsolete-variable 'whitespace-indentation "use the face instead." "24.4") (defface whitespace-indentation @@ -2353,7 +2353,7 @@ Also refontify when necessary." (defun whitespace-display-vector-p (vec) - "Return true if every character in vector VEC can be displayed." + "Return non-nil if every character in vector VEC can be displayed." (let ((i (length vec))) (when (> i 0) (while (and (>= (setq i (1- i)) 0) diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 9a34dc8d438..ab358da7e3f 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -190,7 +190,7 @@ the contents of strings." (buffer-enable-undo)) (defcustom widget-menu-max-size 40 - "Largest number of items allowed in a popup-menu. + "Largest number of items allowed in a popup menu. Larger menus are read through the minibuffer." :group 'widgets :type 'integer) @@ -202,9 +202,8 @@ For a larger number of items, the minibuffer is used." :type 'integer) (defcustom widget-menu-minibuffer-flag nil - "Control how to ask for a choice from the keyboard. -Non-nil means use the minibuffer; -nil means read a single character." + "Non-nil means use the minibuffer; to ask for a choice from the keyboard. +If nil, read a single character." :group 'widgets :type 'boolean) diff --git a/lisp/woman.el b/lisp/woman.el index fe9f8969c3e..1ca4d5e8716 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -1790,7 +1790,7 @@ Argument EVENT is the invoking mouse event." ;; That comment was moved after the symbol `woman-menu' to make ;; find-function-search-for-symbol work. -- rost woman-mode-map - "WoMan Menu" + "WoMan Menu." `("WoMan" ["WoMan..." woman t] ; [NAME CALLBACK ENABLE] "--" @@ -2182,7 +2182,7 @@ To be called on original buffer and any .so insertions." ;; variable. zsoelim is always run as the very first preprocessor. (defvar woman-emulate-tbl nil - "True if WoMan should emulate the tbl preprocessor. + "Non-nil if WoMan should emulate the tbl preprocessor. This applies to text between .TE and .TS directives. Currently set only from \\='\\\" t in the first line of the source file.") -- cgit v1.2.3 From aef84c5f17c33714bda402e9408a3cb2ae928b61 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 31 Aug 2021 14:12:13 +0200 Subject: Add aggregate project discovery and maintenance functions * project.el (project-remember-project): Add optional no-write argument (project-remember-projects-under): Add command (project-forget-zombie-projects): Add command (project-forget-projects-under): Add command * etc/NEWS: Document new commands --- etc/NEWS | 15 ++++++++-- lisp/progmodes/project.el | 72 +++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 82 insertions(+), 5 deletions(-) (limited to 'lisp/progmodes/project.el') diff --git a/etc/NEWS b/etc/NEWS index fb7a7f628ae..a64c714e2c6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2410,10 +2410,21 @@ project's root directory, respectively. This specifies the file in which to save the list of known projects. +++ -*** New command 'project-forget-project'. -This command lets you interactively remove an entry from the list of projects +*** New command 'project-remember-projects-under'. +This command can automatically locate and index projects in a +directory and optionally also it's subdirectories, storing them in +'project-list-file'. + ++++ +*** New commands 'project-forget-project' and 'project-forget-projects-under' +These command lets you interactively remove entries from the list of projects in 'project-list-file'. ++++ +*** New command 'project-forget-zombie-projects' +This command detects indexed projects that have since been deleted, +and removes them from the list of known projects in 'project-list-file' + --- *** 'project-find-file' now accepts non-existent file names. This is to allow easy creation of files inside some nested diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 9b63f4b1bc8..57a961c2607 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1296,9 +1296,10 @@ With some possible metadata (to be decided).") (write-region nil nil filename nil 'silent)))) ;;;###autoload -(defun project-remember-project (pr) +(defun project-remember-project (pr &optional no-write) "Add project PR to the front of the project list. -Save the result in `project-list-file' if the list of projects has changed." +Save the result in `project-list-file' if the list of projects +has changed, and NO-WRITE is nil." (project--ensure-read-project-list) (let ((dir (project-root pr))) (unless (equal (caar project--list) dir) @@ -1306,7 +1307,8 @@ Save the result in `project-list-file' if the list of projects has changed." (when (equal dir (car ent)) (setq project--list (delq ent project--list)))) (push (list dir) project--list) - (project--write-project-list)))) + (unless no-write + (project--write-project-list))))) (defun project--remove-from-project-list (project-root report-message) "Remove directory PROJECT-ROOT of a missing project from the project list. @@ -1363,6 +1365,70 @@ It's also possible to enter an arbitrary directory not in the list." (let ((default-directory (project-root (project-current t)))) (call-interactively #'execute-extended-command))) +(defun project-remember-projects-under (dir &optional recursive) + "Index all projects below a directory DIR. +If RECURSIVE is non-nil, recurse into all subdirectories to find +more projects. After finishing, a message is printed summarizing +the progress. The function returns the number of detected +projects." + (interactive "DDirectory: \nP") + (project--ensure-read-project-list) + (let ((queue (directory-files dir t nil t)) (count 0) + (known (make-hash-table + :size (* 2 (length project--list)) + :test #'equal ))) + (dolist (project (mapcar #'car project--list)) + (puthash project t known)) + (while queue + (when-let ((subdir (pop queue)) + ((file-directory-p subdir)) + ((not (gethash subdir known)))) + (when-let (pr (project--find-in-directory subdir)) + (project-remember-project pr t) + (message "Found %s..." (project-root pr)) + (setq count (1+ count))) + (when (and recursive (file-symlink-p subdir)) + (setq queue (nconc (directory-files subdir t nil t) queue)) + (puthash subdir t known)))) + (unless (eq recursive 'in-progress) + (if (zerop count) + (message "No projects were found") + (project--write-project-list) + (message "%d project%s were found" + count (if (= count 1) "" "s")))) + count)) + +(defun project-forget-zombie-projects () + "Forget all known projects that don't exist any more." + (interactive) + (dolist (proj (project-known-project-roots)) + (unless (file-exists-p proj) + (project-forget-project proj)))) + +(defun project-forget-projects-under (dir &optional recursive) + "Forget all known projects below a directory DIR. +If RECURSIVE is non-nil, recurse into all subdirectories to +remove all known projects. After finishing, a message is printed +summarizing the progress. The function returns the number of +forgotten projects." + (interactive "DDirectory: \nP") + (let ((count 0)) + (if recursive + (dolist (proj (project-known-project-roots)) + (when (file-in-directory-p proj dir) + (project-forget-project proj) + (setq count (1+ count)))) + (dolist (proj (project-known-project-roots)) + (when (file-equal-p (file-name-directory proj) dir) + (project-forget-project proj) + (setq count (1+ count))))) + (if (zerop count) + (message "No projects were forgotten") + (project--write-project-list) + (message "%d project%s were forgotten" + count (if (= count 1) "" "s"))) + count)) + ;;; Project switching -- cgit v1.2.3 From 9f041cdfaca0f3def74eb7d3348bbf35c12bcc5b Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 5 Oct 2021 19:58:26 +0300 Subject: Bump project.el version * lisp/progmodes/project.el: Bump the version. --- lisp/progmodes/project.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/progmodes/project.el') diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 57a961c2607..3eaa789b3e9 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1,7 +1,7 @@ ;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- ;; Copyright (C) 2015-2021 Free Software Foundation, Inc. -;; Version: 0.7.1 +;; Version: 0.8.0 ;; Package-Requires: ((emacs "26.1") (xref "1.0.2")) ;; This is a GNU ELPA :core package. Avoid using functionality that -- cgit v1.2.3 From 6bf29072e968401f842789c71468e624e5c913a9 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sun, 10 Oct 2021 04:14:35 +0300 Subject: Avoid mapping file names through 'substring' * lisp/progmodes/project.el (project--files-in-directory): Avoid mapping file names through 'substring'. Reducing the amount of garbage generated. Better perf by up to 20%. Bump the package version. --- lisp/progmodes/project.el | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'lisp/progmodes/project.el') diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 3eaa789b3e9..da7435cddf3 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1,7 +1,7 @@ ;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- ;; Copyright (C) 2015-2021 Free Software Foundation, Inc. -;; Version: 0.8.0 +;; Version: 0.8.1 ;; Package-Requires: ((emacs "26.1") (xref "1.0.2")) ;; This is a GNU ELPA :core package. Avoid using functionality that @@ -316,16 +316,21 @@ to find the list of ignores for each directory." " " (shell-quote-argument ")")) ""))) - (output (with-output-to-string - (with-current-buffer standard-output - (let ((status - (process-file-shell-command command nil t))) - (unless (zerop status) - (error "File listing failed: %s" (buffer-string)))))))) + res) + (with-temp-buffer + (let ((status + (process-file-shell-command command nil t)) + (pt (point-min))) + (unless (zerop status) + (error "File listing failed: %s" (buffer-string))) + (goto-char pt) + (while (search-forward "\0" nil t) + (push (buffer-substring-no-properties (1+ pt) (1- (point))) + res) + (setq pt (point))))) (project--remote-file-names - (mapcar (lambda (s) (concat dfn (substring s 1))) - (sort (split-string output "\0" t) - #'string<))))) + (mapcar (lambda (s) (concat dfn s)) + (sort res #'string<))))) (defun project--remote-file-names (local-files) "Return LOCAL-FILES as if they were on the system of `default-directory'. -- cgit v1.2.3 From 14bfb31dba47a947538f2dec76a059fcab496280 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Thu, 14 Oct 2021 03:43:42 +0300 Subject: Add new argument INCLUDE-ALL to project-find-file * lisp/progmodes/project.el (project-find-file): Add new argument INCLUDE-ALL. Have 'C-u' make it non-nil. (project-or-external-find-file): Ditto. (project-find-file-in): Add new argument INCLUDE-ALL. (https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg00209.html) --- etc/NEWS | 5 +++++ lisp/progmodes/project.el | 43 ++++++++++++++++++++++++++++++++----------- 2 files changed, 37 insertions(+), 11 deletions(-) (limited to 'lisp/progmodes/project.el') diff --git a/etc/NEWS b/etc/NEWS index 82847cf9b99..7dd4d14274f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -123,6 +123,11 @@ also handle ANSI codes for faint, italic and blinking text, displaying it with new 'ansi-term-faint/italic/slow-blinking/fast-blinking' faces. +** Xref + +*** 'project-find-file' and 'project-or-external-find-file' now accept +a prefix argument which is interpreted to mean "include all files". + * New Modes and Packages in Emacs 29.1 diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index da7435cddf3..79d2e050d95 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -840,28 +840,36 @@ pattern to search for." project-regexp-history-variable))) ;;;###autoload -(defun project-find-file () +(defun project-find-file (&optional include-all) "Visit a file (with completion) in the current project. The filename at point (determined by `thing-at-point'), if any, -is available as part of \"future history\"." - (interactive) +is available as part of \"future history\". + +If INCLUDE-ALL is non-nil, or with prefix argument when called +interactively, include all files under the project root, except +for VCS directories listed in `vc-directory-exclusion-list'." + (interactive "P") (let* ((pr (project-current t)) (dirs (list (project-root pr)))) - (project-find-file-in (thing-at-point 'filename) dirs pr))) + (project-find-file-in (thing-at-point 'filename) dirs pr include-all))) ;;;###autoload -(defun project-or-external-find-file () +(defun project-or-external-find-file (&optional include-all) "Visit a file (with completion) in the current project or external roots. The filename at point (determined by `thing-at-point'), if any, -is available as part of \"future history\"." - (interactive) +is available as part of \"future history\". + +If INCLUDE-ALL is non-nil, or with prefix argument when called +interactively, include all files under the project root, except +for VCS directories listed in `vc-directory-exclusion-list'." + (interactive "P") (let* ((pr (project-current t)) (dirs (cons (project-root pr) (project-external-roots pr)))) - (project-find-file-in (thing-at-point 'filename) dirs pr))) + (project-find-file-in (thing-at-point 'filename) dirs pr include-all))) (defcustom project-read-file-name-function #'project--read-file-cpd-relative "Function to call to read a file name from a list. @@ -914,12 +922,25 @@ by the user at will." predicate hist mb-default)) -(defun project-find-file-in (suggested-filename dirs project) +(defun project-find-file-in (suggested-filename dirs project &optional include-all) "Complete a file name in DIRS in PROJECT and visit the result. SUGGESTED-FILENAME is a relative file name, or part of it, which -is used as part of \"future history\"." - (let* ((all-files (project-files project dirs)) +is used as part of \"future history\". + +If INCLUDE-ALL is non-nil, or with prefix argument when called +interactively, include all files from DIRS, except for VCS +directories listed in `vc-directory-exclusion-list'." + (let* ((vc-dirs-ignores (mapcar + (lambda (dir) + (concat dir "/")) + vc-directory-exclusion-list)) + (all-files + (if include-all + (mapcan + (lambda (dir) (project--files-in-directory dir vc-dirs-ignores)) + dirs) + (project-files project dirs))) (completion-ignore-case read-file-name-completion-ignore-case) (file (funcall project-read-file-name-function "Find file" all-files nil nil -- cgit v1.2.3 From 7dedba1cc02055befa097f8782cda108f4af08c6 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Fri, 15 Oct 2021 15:02:23 +0300 Subject: Special-case the "Permission denied" messages * lisp/progmodes/project.el (project--files-in-directory): Special-case the "Permission denied" messages, to make sure the user sees the unreadable directory's name (https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg01015.html). --- lisp/progmodes/project.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lisp/progmodes/project.el') diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 79d2e050d95..ed076a683d1 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -322,7 +322,15 @@ to find the list of ignores for each directory." (process-file-shell-command command nil t)) (pt (point-min))) (unless (zerop status) - (error "File listing failed: %s" (buffer-string))) + (goto-char (point-min)) + (if (and + (not (eql status 127)) + (search-forward "Permission denied\n" nil t)) + (let ((end (1- (point)))) + (re-search-backward "\\`\\|\0") + (error "File listing failed: %s" + (buffer-substring (1+ (point)) end))) + (error "File listing failed: %s" (buffer-string)))) (goto-char pt) (while (search-forward "\0" nil t) (push (buffer-substring-no-properties (1+ pt) (1- (point))) -- cgit v1.2.3