From 0fb3fc92b33a6adb657194e056b2910058478022 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Mon, 31 Aug 2020 11:46:23 -0700 Subject: [PATCH 01/73] Remove obsolete "Wide Characters" section of Gnus manual * doc/misc/gnus.texi: This hasn't been valid since 2016. --- doc/misc/gnus.texi | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index c8ac7f0a7c2..a96be30cd61 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -839,7 +839,6 @@ Formatting Variables * Formatting Fonts:: Making the formatting look colorful and nice. * Positioning Point:: Moving point to a position after an operation. * Tabulation:: Tabulating your output. -* Wide Characters:: Dealing with wide characters. Image Enhancements @@ -22356,7 +22355,6 @@ lots of percentages everywhere. * Formatting Fonts:: Making the formatting look colorful and nice. * Positioning Point:: Moving point to a position after an operation. * Tabulation:: Tabulating your output. -* Wide Characters:: Dealing with wide characters. @end menu Currently Gnus uses the following formatting variables: @@ -22611,23 +22609,6 @@ This is the soft tabulator. 50 will be removed. This is the hard tabulator. -@node Wide Characters -@subsection Wide Characters - -Fixed width fonts in most countries have characters of the same width. -Some countries, however, use Latin characters mixed with wider -characters---most notable East Asian countries. - -The problem is that when formatting, Gnus assumes that if a string is 10 -characters wide, it'll be 10 Latin characters wide on the screen. In -these countries, that's not true. - -@vindex gnus-use-correct-string-widths -To help fix this, you can set @code{gnus-use-correct-string-widths} to -@code{t}. This makes buffer generation slower, but the results will be -prettier. The default value is @code{nil}. - - @node Window Layout @section Window Layout @cindex window layout From 302f71e55da427529d3d0d62dd1511552aad9f7b Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 1 Sep 2020 11:39:22 +0200 Subject: [PATCH 02/73] Fix help message with help-window-select * lisp/help.el (help-print-return-message): (help-window-display-message): Recommend 'scroll-up-command' instead of 'scroll-up' when 'help-window-select' is non-nil. (Bug#43122) --- lisp/help.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/help.el b/lisp/help.el index 0f1991e3185..c276c1dc280 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -179,7 +179,7 @@ Do not call this in the scope of `with-help-window'." (if (same-window-p (buffer-name standard-output)) ;; Say how to scroll this window. (substitute-command-keys - "\\[scroll-up] to scroll the help.") + "\\[scroll-up-command] to scroll the help.") ;; Say how to scroll some other window. (substitute-command-keys "\\[scroll-other-window] to scroll the help.")))))))) @@ -1243,7 +1243,7 @@ window." ".") ((eq scroll 'other) ", \\[scroll-other-window] to scroll help.") - (scroll ", \\[scroll-up] to scroll help.")))) + (scroll ", \\[scroll-up-command] to scroll help.")))) (message "%s" (substitute-command-keys (concat quit-part scroll-part))))) From e0a8a7e94cdf1352e7f66de74131c6c5df9b6983 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 1 Sep 2020 06:12:02 -0700 Subject: [PATCH 03/73] ; Auto-commit of loaddefs files. --- lisp/ldefs-boot.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index c755bdfde3f..9febeb96d4f 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -7250,7 +7250,7 @@ file. To upgrade a version 206 file to version 208, call this command explicitly with a prefix argument: \\[universal-argument] \\[desktop-save]. -If you are upgrading from Emacs 24 or older, we recommed to do +If you are upgrading from Emacs 24 or older, we recommend to do this once you decide you no longer need compatibility with versions of Emacs before 25.1. @@ -34508,7 +34508,7 @@ the output buffer or changing the window configuration. ;;;### (autoloads nil "tramp" "net/tramp.el" (0 0 0 0)) ;;; Generated autoloads from net/tramp.el -(push (purecopy '(tramp 2 4 3)) package--builtin-versions) +(push (purecopy '(tramp 2 4 5 -1)) package--builtin-versions) (defvar tramp-mode t "\ Whether Tramp is enabled. From abca75d2e9b2a406157383dfb7fe3f185e0b5741 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 1 Sep 2020 23:59:11 +0200 Subject: [PATCH 04/73] ; Fix typos; change "Emacs-Lisp" to "Emacs Lisp" --- doc/lispref/debugging.texi | 2 +- doc/lispref/streams.texi | 2 +- lisp/calendar/holidays.el | 2 +- lisp/gnus/gnus-start.el | 4 ++-- lisp/play/handwrite.el | 2 +- lisp/ses.el | 2 +- test/file-organization.org | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi index 29a0ab71ea4..3fea604184c 100644 --- a/doc/lispref/debugging.texi +++ b/doc/lispref/debugging.texi @@ -147,7 +147,7 @@ set @code{debug-ignored-errors} to @code{nil}. If this variable has a non-@code{nil} value (the default), running the command @code{eval-expression} causes @code{debug-on-error} to be temporarily bound to @code{t}. @xref{Lisp Eval,, Evaluating -Emacs-Lisp Expressions, emacs, The GNU Emacs Manual}. +Emacs Lisp Expressions, emacs, The GNU Emacs Manual}. If @code{eval-expression-debug-on-error} is @code{nil}, then the value of @code{debug-on-error} is not changed during @code{eval-expression}. diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi index d40ec8db105..2cd61ad04fc 100644 --- a/doc/lispref/streams.texi +++ b/doc/lispref/streams.texi @@ -859,7 +859,7 @@ exceeding this limit is abbreviated with an ellipsis. A value of These are the values for @code{print-length} and @code{print-level} used by @code{eval-expression}, and thus, indirectly, by many interactive evaluation commands (@pxref{Lisp Eval,, Evaluating -Emacs-Lisp Expressions, emacs, The GNU Emacs Manual}). +Emacs Lisp Expressions, emacs, The GNU Emacs Manual}). @end defopt These variables are used for detecting and reporting circular diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index 182e99a611f..444a0e53b95 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el @@ -310,7 +310,7 @@ to the list. To include the phases of the moon, add (lunar-phases) -to the holiday list, where `lunar-phases' is an Emacs-Lisp function that +to the holiday list, where `lunar-phases' is an Emacs Lisp function that you've written to return a (possibly empty) list of the relevant VISIBLE dates with descriptive strings such as diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 61319266ced..dbe92a164d0 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -71,7 +71,7 @@ uses considerably less memory." (const :tag "Write directly to file" nil))) (defcustom gnus-init-file (nnheader-concat gnus-home-directory ".gnus") - "Your Gnus Emacs-Lisp startup file name. + "Your Gnus Emacs Lisp startup file name. If a file with the `.el' or `.elc' suffixes exists, it will be read instead." :group 'gnus-start :type 'file) @@ -82,7 +82,7 @@ If a file with the `.el' or `.elc' suffixes exists, it will be read instead." (directory-file-name installation-directory)) "site-lisp/gnus-init") (error nil)) - "The site-wide Gnus Emacs-Lisp startup file name, or nil if none. + "The site-wide Gnus Emacs Lisp startup file name, or nil if none. If a file with the `.el' or `.elc' suffixes exists, it will be read instead." :group 'gnus-start :type '(choice file (const nil))) diff --git a/lisp/play/handwrite.el b/lisp/play/handwrite.el index f69e0622c9a..7b4a59b6fcd 100644 --- a/lisp/play/handwrite.el +++ b/lisp/play/handwrite.el @@ -45,7 +45,7 @@ ;; Installation ;; ;; type at your prompt "emacs -l handwrite.el" or put this file on your -;; Emacs-Lisp load path, add the following into your init file: +;; Emacs Lisp load path, add the following into your init file: ;; ;; (require 'handwrite) ;; diff --git a/lisp/ses.el b/lisp/ses.el index 96b219fc601..218043f2192 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -378,7 +378,7 @@ area of a spreadsheet.") ;; "Side-effect variables". They are set in one function, altered in ;; another as a side effect, then read back by the first, as a way of ;; passing back more than one value. These declarations are just to make -;; the compiler happy, and to conform to standard Emacs-Lisp practice (I +;; the compiler happy, and to conform to standard Emacs Lisp practice (I ;; think the make-local-variable trick above is cleaner). ;; diff --git a/test/file-organization.org b/test/file-organization.org index 34bd0b90e03..64c0755b3bc 100644 --- a/test/file-organization.org +++ b/test/file-organization.org @@ -1,10 +1,10 @@ -#+TITLE: The Location of Emacs-Lisp Tests +#+TITLE: The Location of Emacs Lisp Tests * The Main Emacs Repository -The Emacs repository contains a very large number of Emacs-Lisp files, many of +The Emacs repository contains a very large number of Emacs Lisp files, many of which pre-date both formal package support for Emacs and automated unit testing. From 9b35b0c99ceaeca74a16bea86a665ae5f44430a1 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 31 Aug 2020 20:47:50 +0200 Subject: [PATCH 05/73] ; * lisp/man.el (Man-mode): Fix formatting. --- lisp/man.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/man.el b/lisp/man.el index c914ec34b97..bec3bfdbb2e 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1541,8 +1541,8 @@ The following man commands are available in the buffer. Try \\[man] Prompt to retrieve a new manpage. \\[Man-follow-manual-reference] Retrieve reference in SEE ALSO section. -\\[Man-next-manpage] Jump to next manpage in circular list. -\\[Man-previous-manpage] Jump to previous manpage in circular list. +\\[Man-next-manpage] Jump to next manpage in circular list. +\\[Man-previous-manpage] Jump to previous manpage in circular list. \\[Man-next-section] Jump to next manpage section. \\[Man-previous-section] Jump to previous manpage section. \\[Man-goto-section] Go to a manpage section. From c9708e5ba238661fede5a0d6cb175342a9e7fd31 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 3 Sep 2020 13:56:13 +0200 Subject: [PATCH 06/73] Fix bug in dbus.el; do not merge with master * lisp/net/dbus.el (dbus-register-property) (dbus-property-handler): Handle properties of the same interface at different object paths properly. (Bug#43146) --- lisp/net/dbus.el | 57 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 16 deletions(-) diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index 06bd9e567fe..cafbfa73c15 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el @@ -1477,6 +1477,26 @@ nil is returned." (nreverse result)) (push (cons (car dict) (cl-caadr dict)) result))))) +(defun dbus-get-this-registered-property (bus _service path interface property) + "Return PROPERTY entry of `dbus-registered-objects-table'. +Filter out not matching PATH." + ;; Remove entries not belonging to this case. + (seq-remove + (lambda (item) + (not (string-equal path (nth 2 item)))) + (gethash (list :property bus interface property) + dbus-registered-objects-table))) + +(defun dbus-get-other-registered-property (bus _service path interface property) + "Return PROPERTY entry of `dbus-registered-objects-table'. +Filter out matching PATH." + ;; Remove matching entries. + (seq-remove + (lambda (item) + (string-equal path (nth 2 item))) + (gethash (list :property bus interface property) + dbus-registered-objects-table))) + (defun dbus-register-property (bus service path interface property access value &optional emits-signal dont-register-service) @@ -1543,12 +1563,14 @@ clients from discovering the still incomplete interface." ;; because the property might be accessed from anybody. (let ((key (list :property bus interface property)) (val - (list + (cons (list nil service path (cons (if emits-signal (list access :emits-signal) (list access)) - value))))) + value)) + (dbus-get-other-registered-property + bus service path interface property)))) (puthash key val dbus-registered-objects-table) ;; Return the object. @@ -1566,16 +1588,16 @@ It will be registered for all objects created by `dbus-register-property'." (cond ;; "Get" returns a variant. ((string-equal method "Get") - (let ((entry (gethash (list :property bus interface property) - dbus-registered-objects-table))) + (let ((entry (dbus-get-this-registered-property + bus service path interface property))) (when (string-equal path (nth 2 (car entry))) `((:variant ,(cdar (last (car entry)))))))) ;; "Set" expects a variant. ((string-equal method "Set") (let* ((value (caar (cddr args))) - (entry (gethash (list :property bus interface property) - dbus-registered-objects-table)) + (entry (dbus-get-this-registered-property + bus service path interface property)) ;; The value of the hash table is a list; in case of ;; properties it contains just one element (UNAME SERVICE ;; PATH OBJECT). OBJECT is a cons cell of a list, which @@ -1590,8 +1612,10 @@ It will be registered for all objects created by `dbus-register-property'." (signal 'dbus-error (list "Property not writable at path" property path))) (puthash (list :property bus interface property) - (list (append (butlast (car entry)) - (list (cons (car object) value)))) + (cons (append (butlast (car entry)) + (list (cons (car object) value))) + (dbus-get-other-registered-property + bus service path interface property)) dbus-registered-objects-table) ;; Send the "PropertiesChanged" signal. (when (member :emits-signal (car object)) @@ -1607,14 +1631,15 @@ It will be registered for all objects created by `dbus-register-property'." (let (result) (maphash (lambda (key val) - (when (and (equal (butlast key) (list :property bus interface)) - (string-equal path (nth 2 (car val))) - (not (functionp (car (last (car val)))))) - (push - (list :dict-entry - (car (last key)) - (list :variant (cdar (last (car val))))) - result))) + (dolist (item val) + (when (and (equal (butlast key) (list :property bus interface)) + (string-equal path (nth 2 item)) + (not (functionp (car (last item))))) + (push + (list :dict-entry + (car (last key)) + (list :variant (cdar (last item)))) + result)))) dbus-registered-objects-table) ;; Return the result, or an empty array. (list :array (or result '(:signature "{sv}")))))))) From 5489524ab0dfb1854bf43077d9adedf1eb022027 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 4 Sep 2020 14:24:23 +0200 Subject: [PATCH 07/73] Backport recent change in tramp-tests.el from master, don't merge * test/lisp/net/tramp-tests.el (tramp-test05-expand-file-name): No need to expect different results in Emacs 28 and later. --- test/lisp/net/tramp-tests.el | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 02f436141f9..89d4171ddea 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2057,8 +2057,8 @@ properly. BODY shall not contain a timeout." ;; user "foo" to "/~foo"". Otherwise, it doesn't expand. (should (string-equal - (substitute-in-file-name - "/method:host:/path/~foo") "/method:host:/path/~foo")) + (substitute-in-file-name "/method:host:/path/~foo") + "/method:host:/path/~foo")) ;; Quoting local part. (should (string-equal @@ -2070,12 +2070,12 @@ properly. BODY shall not contain a timeout." "/method:host:/:/~foo") "/method:host:/:/~foo")) (should (string-equal - (substitute-in-file-name - "/method:host:/:/path//~foo") "/method:host:/:/path//~foo")) + (substitute-in-file-name "/method:host:/:/path//~foo") + "/method:host:/:/path//~foo")) (should (string-equal - (substitute-in-file-name - "/method:host:/:/path/~foo") "/method:host:/:/path/~foo"))) + (substitute-in-file-name "/method:host:/:/path/~foo") + "/method:host:/:/path/~foo"))) (let (process-environment) (should @@ -2120,19 +2120,16 @@ properly. BODY shall not contain a timeout." (expand-file-name "/method:host:/path/../file") "/method:host:/file")) (should (string-equal - (expand-file-name "/method:host:/path/.") - (if (tramp--test-emacs28-p) "/method:host:/path/" "/method:host:/path"))) + (expand-file-name "/method:host:/path/.") "/method:host:/path")) (should (string-equal (expand-file-name "/method:host:/path/..") "/method:host:/")) (should (string-equal - (expand-file-name "." "/method:host:/path/") - (if (tramp--test-emacs28-p) "/method:host:/path/" "/method:host:/path"))) + (expand-file-name "." "/method:host:/path/") "/method:host:/path")) (should (string-equal - (expand-file-name "" "/method:host:/path/") - (if (tramp--test-emacs28-p) "/method:host:/path/" "/method:host:/path"))) + (expand-file-name "" "/method:host:/path/") "/method:host:/path")) ;; Quoting local part. (should (string-equal From 2b95300cf8e3da9f505233f116cabe39a3564fa7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 4 Sep 2020 08:46:45 -0400 Subject: [PATCH 08/73] * lisp/display-fill-column-indicator.el: Fix bug#41145 (global-display-fill-column-indicator-mode): Specify the implicit defustom's group explicitly. * lisp/cus-dep.el (custom-make-dependencies): Also look at define(-globalized)-minor-mode since it can also define custom vars. --- lisp/cus-dep.el | 2 +- lisp/display-fill-column-indicator.el | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el index fd307a5c04e..e2fd7febd2f 100644 --- a/lisp/cus-dep.el +++ b/lisp/cus-dep.el @@ -99,7 +99,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS" (setq name (intern name))) (condition-case nil (while (re-search-forward - "^(def\\(custom\\|face\\|group\\)" nil t) + "^(def\\(custom\\|face\\|group\\|ine\\(?:-globalized\\)?-minor-mode\\)" nil t) (beginning-of-line) (let ((type (match-string 1)) (expr (read (current-buffer)))) diff --git a/lisp/display-fill-column-indicator.el b/lisp/display-fill-column-indicator.el index 3f947bdc1c9..3391aa371b7 100644 --- a/lisp/display-fill-column-indicator.el +++ b/lisp/display-fill-column-indicator.el @@ -73,7 +73,9 @@ See Info node `Displaying Boundaries' for details." ;;;###autoload (define-globalized-minor-mode global-display-fill-column-indicator-mode - display-fill-column-indicator-mode display-fill-column-indicator--turn-on) + display-fill-column-indicator-mode display-fill-column-indicator--turn-on + ;; See bug#41145 + :group 'display-fill-column-indicator) (provide 'display-fill-column-indicator) From 793871310599f8c75cf86bed97bdad70577cc5dd Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Fri, 4 Sep 2020 19:10:17 +0000 Subject: [PATCH 09/73] C++ Mode: handle comma separated brace initializers. This includes both indentation and fontification. * lisp/progmodes/cc-engine.el (c-do-declarators): Handle brace initializers without = correctly. (c-looking-at-or-maybe-in-bracelist): Use c-do-declarators with a simple inline function to check that after-type-id-pos points to the start of a declarator. * lisp/progmodes/cc-langs.el (c-recognize-bare-brace-inits): New lang const/variable. --- lisp/progmodes/cc-engine.el | 53 ++++++++++++++++++++++++------------- lisp/progmodes/cc-langs.el | 14 ++++++++++ 2 files changed, 49 insertions(+), 18 deletions(-) diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 34490d1356a..4b14dd131c2 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -9091,7 +9091,7 @@ This function might do hidden buffer changes." (let ((cdd-pos (point)) cdd-next-pos cdd-id-start cdd-id-end cdd-decl-res cdd-got-func cdd-got-type cdd-got-init - c-last-identifier-range cdd-exhausted) + c-last-identifier-range cdd-exhausted cdd-after-block) ;; The following `while' applies `cdd-function' to a single declarator id ;; each time round. It loops only when CDD-LIST is non-nil. @@ -9144,23 +9144,25 @@ This function might do hidden buffer changes." (c-forward-syntactic-ws cdd-limit) (setq cdd-exhausted t))) ; unbalanced parens - (cdd-got-init ; "=" sign OR opening "(", "[", or "{" - ;; Skip an initializer expression. If we're at a '=' - ;; then accept a brace list directly after it to cope - ;; with array initializers. Otherwise stop at braces - ;; to avoid going past full function and class blocks. - (if (and (if (and (eq cdd-got-init ?=) - (= (c-forward-token-2 1 nil cdd-limit) 0) - (looking-at "{")) - (c-go-list-forward (point) cdd-limit) - t) - ;; FIXME: Should look for c-decl-end markers here; - ;; we might go far into the following declarations - ;; in e.g. ObjC mode (see e.g. methods-4.m). - (c-syntactic-re-search-forward "[;,{]" cdd-limit 'move t)) + (cdd-got-init ; "=" sign OR opening "(", "[", or "(" + ;; Skip an initializer expression in braces, whether or not (in + ;; C++ Mode) preceded by an "=". Be careful that the brace list + ;; isn't a code block or a struct (etc.) block. + (cond + ((and (eq cdd-got-init ?=) + (zerop (c-forward-token-2 1 nil cdd-limit)) + (eq (char-after) ?{) + (c-go-list-forward (point) cdd-limit))) + ((and (eq cdd-got-init ?{) + c-recognize-bare-brace-inits + (setq cdd-after-block + (save-excursion + (c-go-list-forward (point) cdd-limit))) + (not (c-looking-at-statement-block))) + (goto-char cdd-after-block))) + (if (c-syntactic-re-search-forward "[;,{]" cdd-limit 'move t) (backward-char) - (setq cdd-exhausted t) - )) + (setq cdd-exhausted t))) (t (c-forward-syntactic-ws cdd-limit))) @@ -11729,7 +11731,22 @@ comment at the start of cc-engine.el for more info." (save-excursion (c-backward-syntactic-ws) (point)) nil nil)) (and (consp res) - (eq (car res) after-type-id-pos)))))) + (cond + ((eq (car res) after-type-id-pos)) + ((> (car res) after-type-id-pos) nil) + (t + (catch 'find-decl + (save-excursion + (goto-char (car res)) + (c-do-declarators + (point-max) t nil nil + (lambda (id-start id-end tok not-top func init) + (cond + ((> id-start after-type-id-pos) + (throw 'find-decl nil)) + ((eq id-start after-type-id-pos) + (throw 'find-decl t))))) + nil))))))))) (cons bufpos (or in-paren inexpr-brace-list))) ((or (eq (char-after) ?\;) ;; Brace lists can't contain a semicolon, so we're done. diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index e7e7cfd4b09..0a7f4565c0e 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -3684,6 +3684,20 @@ Foo bar = gnu;" c++ t) (c-lang-defvar c-recognize-paren-inits (c-lang-const c-recognize-paren-inits)) +(c-lang-defconst c-recognize-bare-brace-inits + "Non-nil means that brace initializers without \"=\" exist, +i.e. constructs like + +int foo[] {1, 2, 3}; + +in addition to the more classic + +int foo[] = {1, 2, 3};" + t nil + c++ t) +(c-lang-defvar c-recognize-bare-brace-inits + (c-lang-const c-recognize-bare-brace-inits)) + (c-lang-defconst c-recognize-paren-inexpr-blocks "Non-nil to recognize gcc style in-expression blocks, i.e. compound statements surrounded by parentheses inside expressions." From 6fc502c1ef327ab357c971b9bffbbd7cb6a436f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sun, 6 Sep 2020 08:35:53 +0100 Subject: [PATCH 10/73] Don't resort Icomplete candidates when default already on top Fixes: bug#43222 Icomplete mode re-sorts candidates, bubbling the default to top if it's found somewhere down the list. This is done according to two criteria: exact match and prefix match. Before this fix, it didn't take into account the possibility that the exact match for the default would already be on top, and would incorrectly bubble a prefixing completion down the list to the top. This commit fixes that. * lisp/icomplete.el (icomplete--sorted-completions): Rework. Recomment. --- lisp/icomplete.el | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lisp/icomplete.el b/lisp/icomplete.el index ba266cfbfe9..47d78a0bc82 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -469,6 +469,7 @@ Usually run by inclusion in `minibuffer-setup-hook'." with beg = (icomplete--field-beg) with end = (icomplete--field-end) with all = (completion-all-sorted-completions beg end) + ;; First, establish the "bubble up" predicates. for fn in (cond ((and minibuffer-default (stringp minibuffer-default) ; bug#38992 (= (icomplete--field-end) (icomplete--field-beg))) @@ -493,14 +494,18 @@ Usually run by inclusion in `minibuffer-setup-hook'." ;; what vanilla Emacs and `ido-mode' both do. `(,(lambda (comp) (string= "./" comp))))) - thereis (cl-loop - for l on all - while (consp (cdr l)) - for comp = (cadr l) - when (funcall fn comp) - do (setf (cdr l) (cddr l)) - and return - (completion--cache-all-sorted-completions beg end (cons comp all))) + ;; Now, look for a completion matching one of those predicates + ;; to bubble up (unless that completion is already on top). + thereis (or + (and (funcall fn (car all)) all) + (cl-loop + for l on all + while (consp (cdr l)) + for comp = (cadr l) + when (funcall fn comp) + do (setf (cdr l) (cddr l)) + and return + (completion--cache-all-sorted-completions beg end (cons comp all)))) finally return all))) From 92bec37d56099940edd07e73bed607765e1c55c6 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Sun, 6 Sep 2020 15:38:28 +0100 Subject: [PATCH 11/73] ; Minor touchups to recent D-Bus changes * doc/misc/dbus.texi (Receiving Method Calls): Use lowercase @var names. * lisp/net/dbus.el (dbus-register-method): Don't quote nil in docstring. (dbus-get-this-registered-property): Simplify double negation. --- doc/misc/dbus.texi | 6 +++--- lisp/net/dbus.el | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi index c16b7aa9154..a68cb26a3e5 100644 --- a/doc/misc/dbus.texi +++ b/doc/misc/dbus.texi @@ -1466,9 +1466,9 @@ If @var{handler} returns a reply message with an empty argument list, to distinguish it from @code{nil} (the boolean false). If @var{handler} detects an error, it shall return the list -@code{(:error @var{ERROR-NAME} @var{ERROR-MESSAGE)}}. -@var{ERROR-NAME} is a namespaced string which characterizes the error -type, and @var{ERROR-MESSAGE} is a free text string. Alternatively, +@code{(:error @var{error-name} @var{error-message)}}. +@var{error-name} is a namespaced string which characterizes the error +type, and @var{error-message} is a free text string. Alternatively, any Emacs signal @code{dbus-error} in @var{handler} raises a D-Bus error message with the error name @samp{org.freedesktop.DBus.Error.Failed}. diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index 639b766d426..ad5ff8d450e 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el @@ -802,7 +802,7 @@ received. It must accept the input arguments of METHOD. The return value of HANDLER is used for composing the returning D-Bus message. If HANDLER returns a reply message with an empty argument list, HANDLER must return the symbol `:ignore' in order -to distinguish it from `nil' (the boolean false). +to distinguish it from nil (the boolean false). If HANDLER detects an error, it shall return the list `(:error ERROR-NAME ERROR-MESSAGE)'. ERROR-NAME is a namespaced string @@ -1459,9 +1459,9 @@ nil is returned." "Return PROPERTY entry of `dbus-registered-objects-table'. Filter out not matching PATH." ;; Remove entries not belonging to this case. - (seq-remove + (seq-filter (lambda (item) - (not (string-equal path (nth 2 item)))) + (string-equal path (nth 2 item))) (gethash (list :property bus interface property) dbus-registered-objects-table))) From d5c399b4d41f48193bdef9571ef04d9a0531b905 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 6 Sep 2020 14:15:41 +0200 Subject: [PATCH 12/73] Make C-h S in Customize buffers work more reliably * lisp/cus-edit.el (custom-unlispify-menu-entry): Put a property on the returned string so that we can determine what the symbol was after the fact. * lisp/info-look.el (info-lookup-guess-default*): Allow lambda forms as rules. (:mode): Use the stored symbol. (info-lookup-guess-custom-symbol): No longer used; mark as obsolete (bug#41905). --- lisp/cus-edit.el | 2 +- lisp/info-look.el | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 7153ba40e13..3557dce5854 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -561,7 +561,7 @@ value unless you are sure you know what it does." (unless no-suffix (goto-char (point-max)) (insert "...")) - (buffer-string))))) + (propertize (buffer-string) 'custom-data symbol))))) (defcustom custom-unlispify-tag-names t "Display tag names as words instead of symbols if non-nil." diff --git a/lisp/info-look.el b/lisp/info-look.el index 4e379cadef1..40f7f6003e7 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -557,7 +557,7 @@ Return nil if there is nothing appropriate in the buffer near point." (info-lookup->regexp topic mode))) (start (point)) end regexp subexp result) (save-excursion - (if (symbolp rule) + (if (functionp rule) (setq result (funcall rule)) (if (consp rule) (setq regexp (car rule) @@ -610,6 +610,7 @@ Return nil if there is nothing appropriate in the buffer near point." (defun info-lookup-guess-custom-symbol () "Get symbol at point in custom buffers." + (declare (obsolete nil "28.1")) (condition-case nil (save-excursion (let ((case-fold-search t) @@ -1065,7 +1066,9 @@ Return nil if there is nothing appropriate in the buffer near point." :mode 'Custom-mode :ignore-case t :regexp "[^][()`'‘’,:\" \t\n]+" - :parse-rule 'info-lookup-guess-custom-symbol + :parse-rule (lambda () + (when-let ((symbol (get-text-property (point) 'custom-data))) + (symbol-name symbol))) :other-modes '(emacs-lisp-mode)) (info-lookup-maybe-add-help From 7d927fa8dd5b557e77a0b3dbafc252ede1211c52 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 6 Sep 2020 16:56:44 +0200 Subject: [PATCH 13/73] Use `format-prompt' when prompting with default values * lisp/woman.el (woman-file-name): * lisp/wid-edit.el (widget-file-prompt-value) (widget-coding-system-prompt-value): * lisp/w32-fns.el (w32-set-system-coding-system): * lisp/vc/vc.el (vc-print-root-log): * lisp/vc/vc-annotate.el (vc-annotate): * lisp/vc/emerge.el (emerge-read-file-name): * lisp/vc/ediff.el (ediff-directories) (ediff-directory-revisions, ediff-directories3) (ediff-merge-directories, ) (ediff-merge-directories-with-ancestor) (ediff-merge-directory-revisions) (ediff-merge-directory-revisions-with-ancestor) (ediff-merge-revisions, ediff-merge-revisions-with-ancestor) (ediff-revision): * lisp/vc/ediff-util.el (ediff-toggle-regexp-match): * lisp/vc/ediff-mult.el (ediff-filegroup-action): * lisp/vc/add-log.el (prompt-for-change-log-name): * lisp/textmodes/table.el (table-insert-row-column) (table-span-cell, table-split-cell-horizontally) (table-split-cell, table-justify, table-generate-source) (table-insert-sequence, table-capture) (table--read-from-minibuffer, table--query-justification): * lisp/textmodes/sgml-mode.el (sgml-tag, sgml-tag-help): * lisp/textmodes/reftex-ref.el (reftex-goto-label): * lisp/textmodes/refer.el (refer-get-bib-files): * lisp/textmodes/css-mode.el (css-lookup-symbol): * lisp/term.el (serial-read-name, serial-read-speed): * lisp/speedbar.el (speedbar-change-initial-expansion-list): * lisp/simple.el (previous-matching-history-element) (set-variable): * lisp/ses.el (ses-read-cell, ses-set-column-width): * lisp/replace.el (query-replace-read-from) (occur-read-primary-args): * lisp/rect.el (string-rectangle, string-insert-rectangle): * lisp/progmodes/tcl.el (tcl-help-on-word): * lisp/progmodes/sh-script.el (sh-set-shell): * lisp/progmodes/python.el (python-eldoc-at-point): * lisp/progmodes/octave.el (octave-completing-read) (octave-update-function-file-comment, octave-insert-defun): * lisp/progmodes/inf-lisp.el (lisp-symprompt): * lisp/progmodes/cperl-mode.el (cperl-info-on-command) (cperl-perldoc): * lisp/progmodes/compile.el (compilation-find-file): * lisp/net/rcirc.el (rcirc-prompt-for-encryption): * lisp/net/eww.el (eww): * lisp/net/browse-url.el (browse-url-with-browser-kind): * lisp/man.el (man): * lisp/mail/sendmail.el (sendmail-query-user-about-smtp): * lisp/mail/mailalias.el (build-mail-aliases): * lisp/mail/mailabbrev.el (merge-mail-abbrevs) (rebuild-mail-abbrevs): * lisp/locate.el (locate-prompt-for-search-string): * lisp/isearch.el (isearch-occur): * lisp/international/ogonek.el (ogonek-read-encoding) (ogonek-read-prefix): * lisp/international/mule.el (read-buffer-file-coding-system) (set-terminal-coding-system, set-keyboard-coding-system) (set-next-selection-coding-system, recode-region): * lisp/international/mule-cmds.el () (universal-coding-system-argument, search-unencodable-char) (select-safe-coding-system-interactively): * lisp/info.el (Info-search, Info-search-backward, Info-menu): * lisp/info-look.el (info-lookup-interactive-arguments): * lisp/imenu.el (imenu--completion-buffer): * lisp/ibuf-ext.el (mode, used-mode, ibuffer-mark-by-mode): * lisp/hi-lock.el (hi-lock-unface-buffer) (hi-lock-read-face-name): * lisp/help.el (view-emacs-news, where-is): * lisp/help-fns.el (describe-variable, describe-symbol) (describe-keymap): * lisp/gnus/mm-decode.el (mm-save-part): * lisp/gnus/gnus-sum.el (gnus-summary-browse-url): * lisp/gnus/gnus-group.el (gnus-group--read-bug-ids) (gnus-group-set-current-level): * lisp/frame.el (make-frame-on-monitor) (close-display-connection, select-frame-by-name): * lisp/format.el (format-encode-buffer, format-encode-region): * lisp/files.el (recode-file-name): * lisp/files-x.el (read-file-local-variable) (read-file-local-variable-value, ) (read-file-local-variable-mode): * lisp/ffap.el (ffap-menu-ask): * lisp/faces.el (face-read-string): * lisp/facemenu.el (facemenu-set-charset): * lisp/erc/erc-dcc.el (erc-dcc-do-GET-command): * lisp/emulation/edt-mapper.el (edt-mapper): * lisp/emacs-lisp/trace.el (trace--read-args) (trace-function-foreground, trace-function-background): * lisp/emacs-lisp/smie.el (smie-config-set-indent): * lisp/emacs-lisp/re-builder.el (reb-change-syntax): * lisp/emacs-lisp/package.el (describe-package): * lisp/emacs-lisp/find-func.el (read-library-name) (find-function-read): * lisp/emacs-lisp/ert.el (ert-read-test-name) (ert-run-tests-interactively): * lisp/emacs-lisp/disass.el (disassemble): * lisp/emacs-lisp/debug.el (debug-on-entry) (debug-on-variable-change): * lisp/emacs-lisp/advice.el (ad-read-advised-function) (ad-read-advice-class, ad-read-advice-name, ad-read-regexp): * lisp/dired-x.el (dired--mark-suffix-interactive-spec): * lisp/dired-aux.el (dired-diff): * lisp/cus-edit.el (custom-variable-prompt, customize-mode) (customize-changed-options): * lisp/completion.el (interactive-completion-string-reader): * lisp/calendar/timeclock.el (timeclock-ask-for-project): * lisp/calc/calcalg3.el (calc-get-fit-variables): * lisp/calc/calc-store.el (calc-edit-variable): * lisp/calc/calc-bin.el (calc-word-size): * lisp/bookmark.el (bookmark-set-internal): * lisp/abbrev.el (read-abbrev-file): Use `format-prompt' for prompting (bug#12443). --- lisp/abbrev.el | 3 +- lisp/bookmark.el | 2 +- lisp/calc/calc-bin.el | 4 +- lisp/calc/calc-store.el | 10 ++-- lisp/calc/calcalg3.el | 24 ++++---- lisp/calendar/timeclock.el | 6 +- lisp/completion.el | 6 +- lisp/cus-edit.el | 14 ++--- lisp/dired-aux.el | 6 +- lisp/dired-x.el | 16 +++-- lisp/emacs-lisp/advice.el | 14 ++--- lisp/emacs-lisp/debug.el | 7 +-- lisp/emacs-lisp/disass.el | 5 +- lisp/emacs-lisp/ert.el | 8 +-- lisp/emacs-lisp/find-func.el | 10 +--- lisp/emacs-lisp/package.el | 5 +- lisp/emacs-lisp/re-builder.el | 2 +- lisp/emacs-lisp/smie.el | 7 +-- lisp/emacs-lisp/trace.el | 17 ++---- lisp/emulation/edt-mapper.el | 3 +- lisp/erc/erc-dcc.el | 4 +- lisp/facemenu.el | 2 +- lisp/faces.el | 5 +- lisp/ffap.el | 2 +- lisp/files-x.el | 19 ++---- lisp/files.el | 8 +-- lisp/format.el | 8 +-- lisp/frame.el | 6 +- lisp/gnus/gnus-group.el | 10 ++-- lisp/gnus/gnus-sum.el | 8 +-- lisp/gnus/mm-decode.el | 5 +- lisp/help-fns.el | 13 ++-- lisp/help.el | 11 ++-- lisp/hi-lock.el | 8 +-- lisp/ibuf-ext.el | 26 ++++---- lisp/imenu.el | 11 ++-- lisp/info-look.el | 4 +- lisp/info.el | 23 +++----- lisp/international/mule-cmds.el | 14 ++--- lisp/international/mule.el | 17 ++---- lisp/international/ogonek.el | 8 +-- lisp/isearch.el | 2 +- lisp/locate.el | 4 +- lisp/mail/mailabbrev.el | 5 +- lisp/mail/mailalias.el | 6 +- lisp/mail/sendmail.el | 2 +- lisp/man.el | 7 +-- lisp/net/browse-url.el | 2 +- lisp/net/eww.el | 9 ++- lisp/net/rcirc.el | 2 +- lisp/progmodes/compile.el | 7 +-- lisp/progmodes/cperl-mode.el | 8 +-- lisp/progmodes/inf-lisp.el | 5 +- lisp/progmodes/octave.el | 14 ++--- lisp/progmodes/python.el | 4 +- lisp/progmodes/sh-script.el | 3 +- lisp/progmodes/tcl.el | 5 +- lisp/rect.el | 9 +-- lisp/replace.el | 15 +++-- lisp/ses.el | 12 ++-- lisp/simple.el | 10 ++-- lisp/speedbar.el | 5 +- lisp/term.el | 8 +-- lisp/textmodes/css-mode.el | 9 +-- lisp/textmodes/refer.el | 6 +- lisp/textmodes/reftex-ref.el | 4 +- lisp/textmodes/sgml-mode.el | 6 +- lisp/textmodes/table.el | 31 +++++----- lisp/vc/add-log.el | 2 +- lisp/vc/ediff-mult.el | 8 +-- lisp/vc/ediff-util.el | 29 ++++----- lisp/vc/ediff.el | 101 +++++++++++++++----------------- lisp/vc/emerge.el | 5 +- lisp/vc/vc-annotate.el | 2 +- lisp/vc/vc.el | 7 +-- lisp/w32-fns.el | 3 +- lisp/wid-edit.el | 9 ++- lisp/woman.el | 13 ++-- 78 files changed, 310 insertions(+), 450 deletions(-) diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 468b0d995b3..be6f9ee3437 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -209,8 +209,7 @@ it defaults to the value of `abbrev-file-name'. Optional second argument QUIETLY non-nil means don't display a message." (interactive (list - (read-file-name (format "Read abbrev file (default %s): " - abbrev-file-name) + (read-file-name (format-prompt "Read abbrev file" abbrev-file-name) nil abbrev-file-name t))) (load (or file abbrev-file-name) nil quietly) (setq abbrevs-changed nil)) diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 8a3bcf8e59d..dcb03adadd8 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -803,7 +803,7 @@ still there, in order, if the topmost one is ever deleted." (let ((str (or name (read-from-minibuffer - (format "%s (default %s): " prompt default) + (format-prompt prompt default) nil bookmark-minibuffer-read-name-map nil nil defaults)))) diff --git a/lisp/calc/calc-bin.el b/lisp/calc/calc-bin.el index e9083b84c61..33fd1af6ffb 100644 --- a/lisp/calc/calc-bin.el +++ b/lisp/calc/calc-bin.el @@ -126,8 +126,8 @@ (defun calc-word-size (n) (interactive "P") (calc-wrapper - (or n (setq n (read-string (format "Binary word size: (default %d) " - calc-word-size)))) + (or n (setq n (read-string (format-prompt "Binary word size" + calc-word-size)))) (setq n (if (stringp n) (if (equal n "") calc-word-size diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index 5282b834021..79e6cf5c00c 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el @@ -428,11 +428,11 @@ (defun calc-edit-variable (&optional var) (interactive) (calc-wrapper - (or var (setq var (calc-read-var-name - (if calc-last-edited-variable - (format "Edit (default %s): " - (calc-var-name calc-last-edited-variable)) - "Edit: ")))) + (unless var + (setq var (calc-read-var-name + (format-prompt "Edit" (and calc-last-edited-variable + (calc-var-name + calc-last-edited-variable)))))) (or var (setq var calc-last-edited-variable)) (if var (let* ((value (calc-var-value var))) diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el index 67183fb754a..75e691a28ff 100644 --- a/lisp/calc/calcalg3.el +++ b/lisp/calc/calcalg3.el @@ -470,17 +470,19 @@ (setq defv (calc-invent-independent-variables nv))) (or defc (setq defc (calc-invent-parameter-variables nc defv))) - (let ((vars (read-string (format "Fitting variables (default %s; %s): " - (mapconcat 'symbol-name - (mapcar (function (lambda (v) - (nth 1 v))) - defv) - ",") - (mapconcat 'symbol-name - (mapcar (function (lambda (v) - (nth 1 v))) - defc) - ",")))) + (let ((vars (read-string (format-prompt + "Fitting variables" + (format "%s; %s)" + (mapconcat 'symbol-name + (mapcar (function (lambda (v) + (nth 1 v))) + defv) + ",") + (mapconcat 'symbol-name + (mapcar (function (lambda (v) + (nth 1 v))) + defc) + ","))))) (coefs nil)) (setq vars (if (string-match "\\[" vars) (math-read-expr vars) diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index d12feaae8c3..2ee1d34bf15 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -597,9 +597,9 @@ arguments of `completing-read'." (defun timeclock-ask-for-project () "Ask the user for the project they are clocking into." (completing-read - (format "Clock into which project (default %s): " - (or timeclock-last-project - (car timeclock-project-list))) + (format-prompt "Clock into which project" + (or timeclock-last-project + (car timeclock-project-list))) timeclock-project-list nil nil nil nil (or timeclock-last-project diff --git a/lisp/completion.el b/lisp/completion.el index b2864746fc7..ed13455b711 100644 --- a/lisp/completion.el +++ b/lisp/completion.el @@ -1276,11 +1276,7 @@ String must be longer than `completion-prefix-min-length'." (defun interactive-completion-string-reader (prompt) (let* ((default (symbol-under-or-before-point)) - (new-prompt - (if default - (format "%s (default %s): " prompt default) - (format "%s: " prompt))) - (read (completing-read new-prompt cmpl-obarray))) + (read (completing-read (format-prompt prompt default) cmpl-obarray))) (if (zerop (length read)) (setq read (or default ""))) (list read))) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 3557dce5854..cb1a78d8e20 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -485,10 +485,8 @@ Return a list suitable for use in `interactive'." (default (and (symbolp v) (custom-variable-p v) (symbol-name v))) (enable-recursive-minibuffers t) val) - (setq val (completing-read - (if default (format "Customize variable (default %s): " default) - "Customize variable: ") - obarray 'custom-variable-p t nil nil default)) + (setq val (completing-read (format-prompt "Customize variable" default) + obarray 'custom-variable-p t nil nil default)) (list (if (equal val "") (if (symbolp v) v nil) (intern val))))) @@ -1084,9 +1082,7 @@ for the MODE to customize." (if (and group (not current-prefix-arg)) major-mode (intern - (completing-read (if group - (format "Mode (default %s): " major-mode) - "Mode: ") + (completing-read (format-prompt "Mode" (and group major-mode)) obarray 'custom-group-of-mode t nil nil (if group (symbol-name major-mode)))))))) @@ -1219,8 +1215,8 @@ that were added or redefined since that version." (interactive (list (read-from-minibuffer - (format "Customize options changed, since version (default %s): " - customize-changed-options-previous-release)))) + (format-prompt "Customize options changed, since version" + customize-changed-options-previous-release)))) (if (equal since-version "") (setq since-version nil) (unless (condition-case nil diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 82f4455392e..3ee877ee8de 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -153,10 +153,8 @@ the string of command switches used as the third argument of `diff'." (lambda () (set (make-local-variable 'minibuffer-default-add-function) nil) (setq minibuffer-default defaults)) - (read-file-name - (format "Diff %s with%s: " current - (if default (format " (default %s)" default) "")) - target-dir default t)) + (read-file-name (format-prompt "Diff %s with" default current) + target-dir default t)) (if current-prefix-arg (read-string "Options for diff: " (if (stringp diff-switches) diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 05c5a70422c..80a266f7dcd 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -327,21 +327,19 @@ See also the functions: (when file (file-name-extension file)))) (suffix - (read-string (format "%s extension%s: " - (if (equal current-prefix-arg '(4)) - "UNmarking" - "Marking") - (if default - (format " (default %s)" default) - "")) nil nil default)) + (read-string (format-prompt + "%s extension" default + (if (equal current-prefix-arg '(4)) + "UNmarking" + "Marking")) + nil nil default)) (marker (pcase current-prefix-arg ('(4) ?\s) ('(16) (let* ((dflt (char-to-string dired-marker-char)) (input (read-string - (format - "Marker character to use (default %s): " dflt) + (format-prompt "Marker character to use" dflt) nil nil dflt))) (aref input 0))) (_ dired-marker-char)))) diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index deac45892ea..0ebd2741d2e 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -1856,7 +1856,7 @@ function at point for which PREDICATE returns non-nil)." "There are no qualifying advised functions"))) (let* ((function (completing-read - (format "%s (default %s): " (or prompt "Function") default) + (format-prompt (or prompt "Function") default) ad-advised-functions (if predicate (lambda (function) @@ -1884,7 +1884,7 @@ class of FUNCTION)." (cl-return class))) (error "ad-read-advice-class: `%s' has no advices" function))) (let ((class (completing-read - (format "%s (default %s): " (or prompt "Class") default) + (format-prompt (or prompt "Class") default) ad-advice-class-completion-table nil t))) (if (equal class "") default @@ -1902,8 +1902,8 @@ An optional PROMPT is used to prompt for the name." (error "ad-read-advice-name: `%s' has no %s advice" function class) (car (car name-completion-table)))) - (prompt (format "%s (default %s): " (or prompt "Name") default)) - (name (completing-read prompt name-completion-table nil t))) + (name (completing-read (format-prompt (or prompt "Name") default) + name-completion-table nil t))) (if (equal name "") (intern default) (intern name)))) @@ -1923,9 +1923,9 @@ be used to prompt for the function." (defun ad-read-regexp (&optional prompt) "Read a regular expression from the minibuffer." (let ((regexp (read-from-minibuffer - (concat (or prompt "Regular expression") - (if (equal ad-last-regexp "") ": " - (format " (default %s): " ad-last-regexp)))))) + (format-prompt (or prompt "Regular expression") + (and (not (equal ad-last-regexp "")) + ad-last-regexp))))) (setq ad-last-regexp (if (equal regexp "") ad-last-regexp regexp)))) diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index ed28997292f..1bdb2a3d8ca 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -653,9 +653,7 @@ Redefining FUNCTION also cancels it." (when (special-form-p fn) (setq fn nil)) (setq val (completing-read - (if fn - (format "Debug on entry to function (default %s): " fn) - "Debug on entry to function: ") + (format-prompt "Debug on entry to function" fn) obarray #'(lambda (symbol) (and (fboundp symbol) @@ -758,8 +756,7 @@ another symbol also cancels it." (let* ((var-at-point (variable-at-point)) (var (and (symbolp var-at-point) var-at-point)) (val (completing-read - (concat "Debug when setting variable" - (if var (format " (default %s): " var) ": ")) + (format-prompt "Debug when setting variable" var) obarray #'boundp t nil nil (and var (symbol-name var))))) (list (if (equal val "") var (intern val))))) diff --git a/lisp/emacs-lisp/disass.el b/lisp/emacs-lisp/disass.el index 51b7db24f3c..c2faac8085b 100644 --- a/lisp/emacs-lisp/disass.el +++ b/lisp/emacs-lisp/disass.el @@ -57,10 +57,9 @@ If OBJECT is not already compiled, we compile it, but do not redefine OBJECT if it is a symbol." (interactive (let* ((fn (function-called-at-point)) - (prompt (if fn (format "Disassemble function (default %s): " fn) - "Disassemble function: ")) (def (and fn (symbol-name fn)))) - (list (intern (completing-read prompt obarray 'fboundp t nil nil def)) + (list (intern (completing-read (format-prompt "Disassemble function" fn) + obarray 'fboundp t nil nil def)) nil 0 t))) (if (and (consp object) (not (functionp object))) (setq object `(lambda () ,object))) diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 241eece05b6..3c347c0b199 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -1635,9 +1635,7 @@ Signals an error if no test name was read." nil))) (ert-test (setq default (ert-test-name default)))) (when add-default-to-prompt - (setq prompt (if (null default) - (format "%s: " prompt) - (format "%s (default %s): " prompt default)))) + (setq prompt (format-prompt prompt default))) (let ((input (completing-read prompt obarray #'ert-test-boundp t nil history default nil))) ;; completing-read returns an empty string if default was nil and @@ -2023,9 +2021,7 @@ and how to display message." (car ert--selector-history) "t"))) (read - (completing-read (if (null default) - "Run tests: " - (format "Run tests (default %s): " default)) + (completing-read (format-prompt "Run tests" default) obarray #'ert-test-boundp nil nil 'ert--selector-history default nil))) nil)) diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 56b3e32a3e3..9e252d8c529 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -315,9 +315,7 @@ if non-nil)." (thing-at-point 'symbol)))) (when (and def (not (test-completion def table))) (setq def nil)) - (completing-read (if def - (format "Library name (default %s): " def) - "Library name: ") + (completing-read (format-prompt "Library name" def) table nil nil nil nil def))) ;;;###autoload @@ -485,12 +483,10 @@ otherwise uses `variable-at-point'." (prompt-type (cdr (assq type '((nil . "function") (defvar . "variable") (defface . "face"))))) - (prompt (concat "Find " prompt-type - (and symb (format " (default %s)" symb)) - ": ")) (enable-recursive-minibuffers t)) (list (intern (completing-read - prompt obarray predicate + (format-prompt "Find %s" symb prompt-type) + obarray predicate t nil nil (and symb (symbol-name symb))))))) (defun find-function-do-it (symbol type switch-fn) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index e6f54d206d8..a173fc060a4 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2338,10 +2338,7 @@ will be deleted." (setq guess nil)) (setq packages (mapcar #'symbol-name packages)) (let ((val - (completing-read (if guess - (format "Describe package (default %s): " - guess) - "Describe package: ") + (completing-read (format-prompt "Describe package" guess) packages nil t nil nil (when guess (symbol-name guess))))) (list (and (> (length val) 0) (intern val))))))) diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index 0e1618e010a..0672f607523 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -489,7 +489,7 @@ Optional argument SYNTAX must be specified if called non-interactively." (interactive (list (intern (completing-read - (format "Select syntax (default %s): " reb-re-syntax) + (format-prompt "Select syntax" reb-re-syntax) '(read string sregex rx) nil t nil nil (symbol-name reb-re-syntax) 'reb-change-syntax-hist)))) diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index 38a7b8b54c9..1b700afd12d 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el @@ -2120,10 +2120,9 @@ position corresponding to each rule." (throw 'found (list kind token (or (nth 3 rewrite) res))))))))) (default-new (smie-config--guess-value sig)) - (newstr (read-string (format "Adjust rule (%S %S -> %S) to%s: " - (nth 0 sig) (nth 1 sig) (nth 2 sig) - (if (not default-new) "" - (format " (default %S)" default-new))) + (newstr (read-string (format-prompt + "Adjust rule (%S %S -> %S) to" default-new + (nth 0 sig) (nth 1 sig) (nth 2 sig)) nil nil (format "%S" default-new))) (new (car (read-from-string newstr)))) (let ((old (rassoc sig smie-config--buffer-local))) diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el index 4ebb7ff711d..627305689c7 100644 --- a/lisp/emacs-lisp/trace.el +++ b/lisp/emacs-lisp/trace.el @@ -265,20 +265,13 @@ be printed along with the arguments in the trace." If `current-prefix-arg' is non-nil, also read a buffer and a \"context\" \(Lisp expression). Return (FUNCTION BUFFER FUNCTION-CONTEXT)." (cons - (let ((default (function-called-at-point)) - (beg (string-match ":[ \t]*\\'" prompt))) - (intern (completing-read (if default - (format - "%s (default %s)%s" - (substring prompt 0 beg) - default - (if beg (substring prompt beg) ": ")) - prompt) + (let ((default (function-called-at-point))) + (intern (completing-read (format-prompt prompt default) obarray 'fboundp t nil nil (if default (symbol-name default))))) (when current-prefix-arg (list - (read-buffer "Output to buffer: " trace-buffer) + (read-buffer (format-prompt "Output to buffer" trace-buffer)) (let ((exp (let ((minibuffer-completing-symbol t)) (read-from-minibuffer "Context expression: " @@ -308,7 +301,7 @@ functions that switch buffers, or do any other display-oriented stuff - use `trace-function-background' instead. To stop tracing a function, use `untrace-function' or `untrace-all'." - (interactive (trace--read-args "Trace function: ")) + (interactive (trace--read-args "Trace function")) (trace-function-internal function buffer nil context)) ;;;###autoload @@ -316,7 +309,7 @@ To stop tracing a function, use `untrace-function' or `untrace-all'." "Trace calls to function FUNCTION, quietly. This is like `trace-function-foreground', but without popping up the output buffer or changing the window configuration." - (interactive (trace--read-args "Trace function in background: ")) + (interactive (trace--read-args "Trace function in background")) (trace-function-internal function buffer t context)) ;;;###autoload diff --git a/lisp/emulation/edt-mapper.el b/lisp/emulation/edt-mapper.el index 2fffcbb154a..5dd81fab3b6 100644 --- a/lisp/emulation/edt-mapper.el +++ b/lisp/emulation/edt-mapper.el @@ -510,7 +510,8 @@ (if window-system (concat "-" (upcase (symbol-name window-system)))) "-keys"))) (set-visited-file-name - (read-file-name (format "Save key mapping to file (default %s): " file) nil file))) + (read-file-name (format-prompt "Save key mapping to file" file) + nil file))) (save-buffer) (message "That's it! Press any key to exit") diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index 477f148197b..1bce986a806 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -516,8 +516,8 @@ PROC is the server process." (filename (or file (plist-get elt :file) "unknown"))) (if elt (let* ((file (read-file-name - (format "Local filename (default %s): " - (file-name-nondirectory filename)) + (format-prompt "Local filename" + (file-name-nondirectory filename)) (or erc-dcc-get-default-directory default-directory) (expand-file-name (file-name-nondirectory filename) diff --git a/lisp/facemenu.el b/lisp/facemenu.el index 419b76101b5..3ed4b54d223 100644 --- a/lisp/facemenu.el +++ b/lisp/facemenu.el @@ -445,7 +445,7 @@ sets the CHARSET property of the character at point." (interactive (list (progn (barf-if-buffer-read-only) (read-charset - (format "Use charset (default %s): " (charset-after)) + (format-prompt "Use charset" (charset-after)) (charset-after))) (if (and mark-active (not current-prefix-arg)) (region-beginning)) diff --git a/lisp/faces.el b/lisp/faces.el index ba85973bf10..7c23e58fd9d 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1212,10 +1212,7 @@ Value is the new attribute value." (setq name (concat (upcase (substring name 0 1)) (substring name 1))) (let* ((completion-ignore-case t) (value (completing-read - (format-message (if default - "%s for face `%s' (default %s): " - "%s for face `%s': ") - name face default) + (format-prompt "%s for face `%s'" default name face) completion-alist nil nil nil nil default))) (if (equal value "") default value))) diff --git a/lisp/ffap.el b/lisp/ffap.el index af7d84cd099..3e65c687af6 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1751,7 +1751,7 @@ Function CONT is applied to the entry chosen by the user." ;; Bug: prompting may assume unique strings, no "". (setq choice (completing-read - (format "%s (default %s): " title (car (car alist))) + (format-prompt title (car (car alist))) alist nil t ;; (cons (car (car alist)) 0) nil))) diff --git a/lisp/files-x.el b/lisp/files-x.el index 5d863626fa5..911e7ba9e3d 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -45,9 +45,7 @@ Intended to be used in the `interactive' spec of (symbol-name default))) (variable (completing-read - (if default - (format "%s (default %s): " prompt default) - (format "%s: " prompt)) + (format-prompt prompt default) obarray (lambda (sym) (or (custom-variable-p sym) @@ -65,9 +63,7 @@ Intended to be used in the `interactive' spec of (let* ((default (and (symbolp major-mode) (symbol-name major-mode))) (value (completing-read - (if default - (format "Add %s with value (default %s): " variable default) - (format "Add %s with value: " variable)) + (format-prompt "Add %s with value" default variable) obarray (lambda (sym) (string-match-p "-mode\\'" (symbol-name sym))) @@ -79,11 +75,8 @@ Intended to be used in the `interactive' spec of ((eq variable 'coding) (let ((default (and (symbolp buffer-file-coding-system) (symbol-name buffer-file-coding-system)))) - (read-coding-system - (if default - (format "Add %s with value (default %s): " variable default) - (format "Add %s with value: " variable)) - default))) + (read-coding-system (format-prompt "Add %s with value" default variable) + default))) (t (let ((default (format "%S" (cond ((eq variable 'unibyte) t) @@ -102,9 +95,7 @@ Intended to be used in the `interactive' spec of (let* ((default (and (symbolp major-mode) (symbol-name major-mode))) (mode (completing-read - (if default - (format "Mode or subdirectory (default %s): " default) - (format "Mode or subdirectory: ")) + (format-prompt "Mode or subdirectory" default) obarray (lambda (sym) (and (string-match-p "-mode\\'" (symbol-name sym)) diff --git a/lisp/files.el b/lisp/files.el index 5f5902d0cb6..e6629d2a21a 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1563,8 +1563,8 @@ use with M-x." (and (not (memq 'eight-bit-control charsets)) (not (memq 'eight-bit-graphic charsets))))) (setq from-coding (read-coding-system - (format "Recode filename %s from (default %s): " - filename default-coding) + (format-prompt "Recode filename %s from" + filename default-coding) default-coding)) (setq from-coding (read-coding-system (format "Recode filename %s from: " filename)))) @@ -1576,8 +1576,8 @@ use with M-x." (format "Recode filename %s from %s to: " filename from-coding))) (setq to-coding (read-coding-system - (format "Recode filename %s from %s to (default %s): " - filename from-coding default-coding) + (format-prompt "Recode filename %s from %s to" + default-coding filename from-coding) default-coding))) (list filename from-coding to-coding))) diff --git a/lisp/format.el b/lisp/format.el index f3559ba9b21..905ca2d9ec9 100644 --- a/lisp/format.el +++ b/lisp/format.el @@ -342,8 +342,8 @@ for identifying regular expressions at the beginning of the region." FORMAT defaults to `buffer-file-format'. It is a symbol naming one of the formats defined in `format-alist', or a list of such symbols." (interactive - (list (format-read (format "Translate buffer to format (default %s): " - buffer-file-format)))) + (list (format-read (format-prompt "Translate buffer to format" + buffer-file-format)))) (format-encode-region (point-min) (point-max) format)) (defun format-encode-region (beg end &optional format) @@ -352,8 +352,8 @@ FORMAT defaults to `buffer-file-format'. It is a symbol naming one of the formats defined in `format-alist', or a list of such symbols." (interactive (list (region-beginning) (region-end) - (format-read (format "Translate region to format (default %s): " - buffer-file-format)))) + (format-read (format-prompt "Translate region to format" + buffer-file-format)))) (if (null format) (setq format buffer-file-format)) (if (symbolp format) (setq format (list format))) (save-excursion diff --git a/lisp/frame.el b/lisp/frame.el index 081d3010e9b..70088545a68 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -733,7 +733,7 @@ argument PARAMETERS specifies additional frame parameters." (list (let* ((default (cdr (assq 'name (frame-monitor-attributes))))) (completing-read - (format "Make frame on monitor (default %s): " default) + (format-prompt "Make frame on monitor" default) (or (delq nil (mapcar (lambda (a) (cdr (assq 'name a))) (display-monitor-attributes-list))) @@ -760,7 +760,7 @@ If DISPLAY is nil, that stands for the selected frame's display." (list (let* ((default (frame-parameter nil 'display)) (display (completing-read - (format "Close display (default %s): " default) + (format-prompt "Close display" default) (delete-dups (mapcar (lambda (frame) (frame-parameter frame 'display)) @@ -1130,7 +1130,7 @@ If there is no frame by that name, signal an error." (let* ((frame-names-alist (make-frame-names-alist)) (default (car (car frame-names-alist))) (input (completing-read - (format "Select Frame (default %s): " default) + (format-prompt "Select Frame" default) frame-names-alist nil t nil 'frame-name-history))) (if (= (length input) 0) (list default) diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index ad6e0e30bca..cafaf69a96b 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -2416,9 +2416,8 @@ the bug number, and browsing the URL must return mbox output." ;; Pass DEF as the value of COLLECTION instead of DEF because: ;; a) null input should not cause DEF to be returned and ;; b) TAB and M-n still work this way. - (or (completing-read-multiple - (format "Bug IDs%s: " (if def (format " (default %s)" def) "")) - (and def (list (format "%s" def)))) + (or (completing-read-multiple (format-prompt "Bug IDs" def) + (and def (list (format "%s" def)))) def))) (defun gnus-read-ephemeral-bug-group (ids mbox-url &optional window-conf) @@ -3744,9 +3743,8 @@ Uses the process/prefix convention." (error "No group on the current line")) (string-to-number (let ((s (read-string - (format "Level (default %s): " - (or (gnus-group-group-level) - gnus-level-default-subscribed))))) + (format-prompt "Level" (or (gnus-group-group-level) + gnus-level-default-subscribed))))) (if (string-match "^\\s-*$" s) (int-to-string (or (gnus-group-group-level) gnus-level-default-subscribed)) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 8f37fc88284..0cde893d215 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -9389,10 +9389,10 @@ default." (cond ((= (length urls) 1) (car urls)) ((> (length urls) 1) - (completing-read (format "URL to browse (default %s): " - (gnus-shorten-url (car urls) 40)) - urls nil t nil nil - (car urls))))) + (completing-read + (format-prompt "URL to browse" + (gnus-shorten-url (car urls) 40)) + urls nil t nil nil (car urls))))) (if target (if external (funcall browse-url-secondary-browser-function target) diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 7f8ab5f9ef5..a01fd2729af 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -1364,10 +1364,7 @@ PROMPT overrides the default one used to ask user for a file name." (setq file (read-file-name (or prompt - (format "Save MIME part to%s: " - (if filename - (format " (default %s)" filename) - ""))) + (format-prompt "Save MIME part to" filename)) (or directory mm-default-directory default-directory) (expand-file-name (or filename "") diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 617f6ae5e80..a9943ccd7f4 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -922,10 +922,7 @@ it is displayed along with the global value." (orig-buffer (current-buffer)) val) (setq val (completing-read - (if (symbolp v) - (format - "Describe variable (default %s): " v) - "Describe variable: ") + (format-prompt "Describe variable" (and (symbolp v) v)) #'help--symbol-completion-table (lambda (vv) ;; In case the variable only exists in the buffer @@ -1422,10 +1419,8 @@ current buffer and the selected frame, respectively." (v-or-f (if found v-or-f (function-called-at-point))) (found (or found v-or-f)) (enable-recursive-minibuffers t) - (val (completing-read (if found - (format - "Describe symbol (default %s): " v-or-f) - "Describe symbol: ") + (val (completing-read (format-prompt "Describe symbol" + (and found v-or-f)) #'help--symbol-completion-table (lambda (vv) (cl-some (lambda (x) (funcall (nth 1 x) vv)) @@ -1601,7 +1596,7 @@ keymap value." (interactive (let* ((km (help-fns--most-relevant-active-keymap)) (val (completing-read - (format "Keymap (default %s): " km) + (format-prompt "Keymap" km) obarray (lambda (m) (and (boundp m) (keymapp (symbol-value m)))) t nil 'keymap-name-history diff --git a/lisp/help.el b/lisp/help.el index 1b0149616f2..45159d44779 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -364,7 +364,7 @@ With argument, display info only for the selected version." (sort (delete-dups res) #'string>))) (current (car all-versions))) (setq version (completing-read - (format "Read NEWS for the version (default %s): " current) + (format-prompt "Read NEWS for the version" current) all-versions nil nil nil nil current)) (if (integerp (string-to-number version)) (setq version (string-to-number version)) @@ -533,12 +533,9 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer." (let ((fn (function-called-at-point)) (enable-recursive-minibuffers t) val) - (setq val (completing-read - (if fn - (format "Where is command (default %s): " fn) - "Where is command: ") - obarray 'commandp t nil nil - (and fn (symbol-name fn)))) + (setq val (completing-read (format-prompt "Where is command" fn) + obarray 'commandp t nil nil + (and fn (symbol-name fn)))) (list (unless (equal val "") (intern val)) current-prefix-arg))) (unless definition (error "No command")) diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index 0ffe77d2763..0fe651ace34 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -657,10 +657,7 @@ then remove all hi-lock highlighting." (car pattern))) hi-lock-interactive-patterns)))) (list - (completing-read (if (null defaults) - "Regexp to unhighlight: " - (format "Regexp to unhighlight (default %s): " - (car defaults))) + (completing-read (format-prompt "Regexp to unhighlight" (car defaults)) (mapcar (lambda (pattern) (cons (or (car (rassq pattern hi-lock-interactive-lighters)) (car pattern)) @@ -747,8 +744,7 @@ with completion and history." (if (and hi-lock-auto-select-face (not current-prefix-arg)) (setq face (or (pop hi-lock--unused-faces) (car defaults))) (setq face (completing-read - (format "Highlight using face (default %s): " - (car defaults)) + (format-prompt "Highlight using face" (car defaults)) obarray 'facep t nil 'face-name-history defaults)) ;; Update list of un-used faces. (setq hi-lock--unused-faces (remove face hi-lock--unused-faces)) diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index c9ca1f87424..80c5b073985 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -1234,14 +1234,12 @@ Called interactively, accept a comma separated list of mode names." (symbol-name (buffer-local-value 'major-mode buf))))) (mapcar #'intern - (completing-read-multiple - (if default - (format "Filter by major mode (default %s): " default) - "Filter by major mode: ") - obarray - (lambda (e) - (string-match "-mode\\'" (if (symbolp e) (symbol-name e) e))) - t nil nil default))) + (completing-read-multiple + (format-prompt "Filter by major mode" default) + obarray + (lambda (e) + (string-match "-mode\\'" (if (symbolp e) (symbol-name e) e))) + t nil nil default))) :accept-list t) (eq qualifier (buffer-local-value 'major-mode buf))) @@ -1259,11 +1257,9 @@ currently used by buffers." (symbol-name (buffer-local-value 'major-mode buf))))) (mapcar #'intern - (completing-read-multiple - (if default - (format "Filter by major mode (default %s): " default) - "Filter by major mode: ") - (ibuffer-list-buffer-modes) nil t nil nil default))) + (completing-read-multiple + (format-prompt "Filter by major mode" default) + (ibuffer-list-buffer-modes) nil t nil nil default))) :accept-list t) (eq qualifier (buffer-local-value 'major-mode buf))) @@ -1881,9 +1877,7 @@ Otherwise buffers whose name matches an element of 'major-mode buf))))) (list (intern (completing-read - (if default - (format "Mark by major mode (default %s): " default) - "Mark by major mode: ") + (format-prompt "Mark by major mode" default) (ibuffer-list-buffer-modes) nil t nil nil default))))) (ibuffer-mark-on-buffer #'(lambda (buf) diff --git a/lisp/imenu.el b/lisp/imenu.el index 3a16dcb9ac3..8fdacb0214d 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -765,10 +765,13 @@ Return one of the entries in index-alist or nil." index-alist)))) (when (stringp name) (setq name (or (imenu-find-default name prepared-index-alist) name))) - (cond (prompt) - ((and name (imenu--in-alist name prepared-index-alist)) - (setq prompt (format "Index item (default %s): " name))) - (t (setq prompt "Index item: "))) + (unless prompt + (setq prompt (format-prompt + "Index item" + (and name + (imenu--in-alist name prepared-index-alist) + ;; Default to `name' if it's in the alist. + name)))) (let ((minibuffer-setup-hook minibuffer-setup-hook)) ;; Display the completion buffer. (if (not imenu-eager-completion-buffer) diff --git a/lisp/info-look.el b/lisp/info-look.el index 40f7f6003e7..bcc2930ffc0 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -297,9 +297,7 @@ If optional argument QUERY is non-nil, query for the help mode." (completion-ignore-case (info-lookup->ignore-case topic mode)) (enable-recursive-minibuffers t) (value (completing-read - (if default - (format "Describe %s (default %s): " topic default) - (format "Describe %s: " topic)) + (format-prompt "Describe %s" default topic) completions nil nil nil 'info-lookup-history default))) (list (if (equal value "") default value) mode))) diff --git a/lisp/info.el b/lisp/info.el index ab678c26b62..dc1102aab30 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1995,12 +1995,9 @@ the Top node in FILENAME." "Search for REGEXP, starting from point, and select node it's found in. If DIRECTION is `backward', search in the reverse direction." (interactive (list (read-string - (if Info-search-history - (format "Regexp search%s (default %s): " - (if case-fold-search "" " case-sensitively") - (car Info-search-history)) - (format "Regexp search%s: " - (if case-fold-search "" " case-sensitively"))) + (format-prompt + "Regexp search%s" (car Info-search-history) + (if case-fold-search "" " case-sensitively")) nil 'Info-search-history))) (deactivate-mark) (when (equal regexp "") @@ -2124,12 +2121,9 @@ If DIRECTION is `backward', search in the reverse direction." (defun Info-search-backward (regexp &optional bound noerror count) "Search for REGEXP in the reverse direction." (interactive (list (read-string - (if Info-search-history - (format "Regexp search%s backward (default %s): " - (if case-fold-search "" " case-sensitively") - (car Info-search-history)) - (format "Regexp search%s backward: " - (if case-fold-search "" " case-sensitively"))) + (format-prompt + "Regexp search%s backward" (car Info-search-history) + (if case-fold-search "" " case-sensitively")) nil 'Info-search-history))) (Info-search regexp bound noerror count 'backward)) @@ -2816,10 +2810,7 @@ new buffer." (while (null item) (setq item (let ((completion-ignore-case t) (Info-complete-menu-buffer (current-buffer))) - (completing-read (if default - (format "Menu item (default %s): " - default) - "Menu item: ") + (completing-read (format-prompt "Menu item" default) #'Info-complete-menu-item nil t nil nil default)))) (list item current-prefix-arg)))) diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 75d1c611e62..ccc8ac9f9e6 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -325,9 +325,7 @@ wrong, use this command again to toggle back to the right mode." 'undecided)) buffer-file-coding-system))) (list (read-coding-system - (if default - (format "Coding system for following command (default %s): " default) - "Coding system for following command: ") + (format-prompt "Coding system for following command" default) default)))) (prefix-command-preserve-state) (setq mule-cmds--prefixed-command-next-coding-system coding-system) @@ -613,9 +611,8 @@ When called from a program, the value is the position of the unencodable character found, or nil if all characters are encodable." (interactive (list (let ((default (or buffer-file-coding-system 'us-ascii))) - (read-coding-system - (format "Coding-system (default %s): " default) - default)))) + (read-coding-system (format-prompt "Coding-system" default) + default)))) (let ((pos (unencodable-char-position (point) (point-max) coding-system))) (if pos (goto-char (1+ pos)) @@ -804,9 +801,8 @@ or specify any other coding system (and risk losing\n\ ;; Read a coding system. (setq coding-system - (read-coding-system - (format "Select coding system (default %s): " default) - default)) + (read-coding-system (format-prompt "Select coding system" default) + default)) (setq last-coding-system-specified coding-system)) (kill-buffer "*Warning*") diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 092abc09b05..c4febb26d4f 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -1247,7 +1247,7 @@ Internal use only.") (concat "\\(?:" completion-pcm--delim-wild-regex "\\|\\([[:alpha:]]\\)[[:digit:]]\\)")) (cs (completing-read - (format "Coding system for saving file (default %s): " default) + (format-prompt "Coding system for saving file" default) combined-table nil t nil 'coding-system-history (if default (symbol-name default))))) @@ -1350,8 +1350,7 @@ graphical terminals." default-terminal-coding-system) default-terminal-coding-system))) (read-coding-system - (format "Coding system for terminal display (default %s): " - default) + (format-prompt "Coding system for terminal display" default) default)))) (if (and (not coding-system) (not (terminal-coding-system))) @@ -1384,8 +1383,7 @@ graphical terminals." (default (if (eq (coding-system-type coding) 'raw-text) default-keyboard-coding-system))) (read-coding-system - (format "Coding system for keyboard input (default %s): " - default) + (format-prompt "Coding system for keyboard input" default) default)))) (let ((coding-type (coding-system-type coding-system)) (saved-meta-mode @@ -1480,10 +1478,8 @@ the text is encoded or decoded by CODING-SYSTEM." This setting is effective for the next communication only." (interactive (list (read-coding-system - (if last-next-selection-coding-system - (format "Coding system for the next selection (default %S): " - last-next-selection-coding-system) - "Coding system for the next selection: ") + (format-prompt "Coding system for the next selection" + last-next-selection-coding-system) last-next-selection-coding-system))) (if coding-system (setq last-next-selection-coding-system coding-system) @@ -2170,8 +2166,7 @@ Part of the job of this function is setting `buffer-undo-list' appropriately." (read-coding-system "Text was really in: ") (let ((coding (or buffer-file-coding-system last-coding-system-used))) (read-coding-system - (concat "But was interpreted as" - (if coding (format " (default %S): " coding) ": ")) + (format-prompt "But was interpreted as" coding) coding)))) (or (and new-coding coding) (error "Coding system not specified")) diff --git a/lisp/international/ogonek.el b/lisp/international/ogonek.el index 9ab9e3b0f65..37fcda70b37 100644 --- a/lisp/international/ogonek.el +++ b/lisp/international/ogonek.el @@ -300,9 +300,8 @@ The functions come in the following groups. Store the name in the parameter-variable DEFAULT-NAME-VAR. PROMPT is a string to be shown when the user is asked for a name." (let ((encoding - (completing-read - (format "%s (default %s): " prompt (symbol-value default-name-var)) - ogonek-name-encoding-alist nil t))) + (completing-read (format-prompt prompt (symbol-value default-name-var)) + ogonek-name-encoding-alist nil t))) ;; change the default name to the one just read, and ;; return the new default as the name you read (set default-name-var @@ -314,8 +313,7 @@ The result is stored in the variable DEFAULT-PREFIX-VAR. PROMPT is a string to be shown when the user is asked for a new prefix." (let ((prefix-string (read-string - (format "%s (default %s): " prompt - (char-to-string (eval default-prefix-var)))))) + (format-prompt prompt (char-to-string (eval default-prefix-var)))))) (if (> (length prefix-string) 1) (error "! Only one character expected") ;; set the default prefix character to the one just read diff --git a/lisp/isearch.el b/lisp/isearch.el index 81e83d79509..7fb1d8a3ca6 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2337,7 +2337,7 @@ characters in that string." (with-isearch-suspended (setq regexp-collect (read-regexp - (format "Regexp to collect (default %s): " default) + (format-prompt "Regexp to collect" default) default 'occur-collect-regexp-history))) regexp-collect)) ;; Otherwise normal occur takes numerical prefix argument. diff --git a/lisp/locate.el b/lisp/locate.el index 9f402716d02..bc78e06eab2 100644 --- a/lisp/locate.el +++ b/lisp/locate.el @@ -267,9 +267,7 @@ that is, with a prefix arg, you get the default behavior." (let* ((default (locate-word-at-point)) (input (read-from-minibuffer - (if (> (length default) 0) - (format "Locate (default %s): " default) - (format "Locate: ")) + (format-prompt "Locate" default) nil nil nil 'locate-history-list default t))) (and (equal input "") default (setq input default)) diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el index a6a606828f9..09afad7aa47 100644 --- a/lisp/mail/mailabbrev.el +++ b/lisp/mail/mailabbrev.el @@ -534,8 +534,7 @@ of a mail alias. The value is set up, buffer-local, when first needed.") (default-directory (expand-file-name "~/")) (def mail-personal-alias-file)) (read-file-name - (format "Read additional aliases from file (default %s): " - def) + (format-prompt "Read additional aliases from file" def) default-directory (expand-file-name def default-directory) t)))) @@ -548,7 +547,7 @@ of a mail alias. The value is set up, buffer-local, when first needed.") (default-directory (expand-file-name "~/")) (def mail-personal-alias-file)) (read-file-name - (format "Read mail aliases from file (default %s): " def) + (format-prompt "Read mail aliases from file" def) default-directory (expand-file-name def default-directory) t)))) diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el index 8e7aaf94937..1f688734d47 100644 --- a/lisp/mail/mailalias.el +++ b/lisp/mail/mailalias.el @@ -255,9 +255,9 @@ removed from alias expansions." By default, this is the file specified by `mail-personal-alias-file'." (interactive (list - (read-file-name (format "Read mail alias file (default %s): " - mail-personal-alias-file) - nil mail-personal-alias-file t))) + (read-file-name + (format-prompt "Read mail alias file" mail-personal-alias-file) + nil mail-personal-alias-file t))) (setq file (expand-file-name (or file mail-personal-alias-file))) ;; In case mail-aliases is t, make sure define-mail-alias ;; does not recursively call build-mail-aliases. diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 65d598c3bac..dd6eecbfd09 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -529,7 +529,7 @@ This also saves the value of `send-mail-function' via Customize." (display-buffer (current-buffer)) (let ((completion-ignore-case t)) (completing-read - (format "Send mail via (default %s): " (caar options)) + (format-prompt "Send mail via" (caar options)) options nil 'require-match nil nil (car options)))))) ;; Return the choice. (cdr (assoc-string choice options t)))) diff --git a/lisp/man.el b/lisp/man.el index da8a15f69b9..64272415411 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1014,10 +1014,9 @@ to auto-complete your input based on the installed manual pages." (completion-ignore-case t) Man-completion-cache ;Don't cache across calls. (input (completing-read - (format "Manual entry%s" - (if (string= default-entry "") - ": " - (format " (default %s): " default-entry))) + (format-prompt "Manual entry" + (and (not (equal default-entry "")) + default-entry)) 'Man-completion-table nil nil nil 'Man-topic-history default-entry))) (if (string= input "") diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 2b8d4d0ce62..e7dad48cf4a 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -922,7 +922,7 @@ opposite of the browser kind of `browse-url-browser-function'." 'external 'internal)) (k (intern (completing-read - (format "Browser kind (default %s): " default) + (format-prompt "Browser kind" default) '(internal external) nil t nil nil default)))) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 4b897fa34e6..b720edc7fef 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -307,11 +307,10 @@ If BUFFER, the data to be rendered is in that buffer. In that case, this function doesn't actually fetch URL. BUFFER will be killed after rendering." (interactive - (let* ((uris (eww-suggested-uris)) - (prompt (concat "Enter URL or keywords" - (if uris (format " (default %s)" (car uris)) "") - ": "))) - (list (read-string prompt nil 'eww-prompt-history uris) + (let ((uris (eww-suggested-uris))) + (list (read-string (format-prompt "Enter URL or keywords" + (and uris (car uris))) + nil 'eww-prompt-history uris) (prefix-numeric-value current-prefix-arg)))) (setq url (eww--dwim-expand-url url)) (pop-to-buffer-same-window diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 1766e192f2d..f296ae3afe1 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -625,7 +625,7 @@ SERVER-PLIST is the property list for the server." (default (or (plist-get server-plist :encryption) "plain"))) (intern - (completing-read (format "Encryption (default %s): " default) + (completing-read (format-prompt "Encryption" default) choices nil t nil nil default)))) (defun rcirc-keepalive () diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 1b1920bf195..13b672bd53b 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -2913,11 +2913,8 @@ attempts to find a file whose name is produced by (format FMT FILENAME)." (and w (progn (compilation-set-window w marker) (compilation-set-overlay-arrow w)))) (let* ((name (read-file-name - (format "Find this %s in%s: " - compilation-error - (if filename - (format " (default %s)" filename) - "")) + (format-prompt "Find this %s in" + filename compilation-error) spec-dir filename t nil ;; The predicate below is fine when called from ;; minibuffer-complete-and-exit, but it's too diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 7a1c2e4d24e..af179e2797e 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -6306,8 +6306,7 @@ Customized by setting variables `cperl-shrink-wrap-info-frame', (interactive (let* ((default (cperl-word-at-point)) (read (read-string - (format "Find doc for Perl function (default %s): " - default)))) + (format-prompt "Find doc for Perl function" default)))) (list (if (equal read "") default read)))) @@ -8266,10 +8265,7 @@ the appropriate statement modifier." (interactive (list (let* ((default-entry (cperl-word-at-point)) (input (read-string - (format "perldoc entry%s: " - (if (string= default-entry "") - "" - (format " (default %s)" default-entry)))))) + (format-prompt "perldoc entry" default-entry)))) (if (string= input "") (if (string= default-entry "") (error "No perldoc args given") diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el index 9f34a377f4a..59db646ff32 100644 --- a/lisp/progmodes/inf-lisp.el +++ b/lisp/progmodes/inf-lisp.el @@ -554,10 +554,7 @@ Used by these commands to determine defaults." ;;; Reads a string from the user. (defun lisp-symprompt (prompt default) - (list (let* ((prompt (if default - (format "%s (default %s): " prompt default) - (concat prompt ": "))) - (ans (read-string prompt))) + (list (let ((ans (read-string (format-prompt prompt default)))) (if (zerop (length ans)) default ans)))) diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 3dd9b8dae6a..55a78c6cc85 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -1048,10 +1048,9 @@ directory and makes this the current buffer's default directory." (save-excursion (skip-syntax-backward "-(") (thing-at-point 'symbol))))) - (completing-read - (format (if def "Function (default %s): " "Function: ") def) - (inferior-octave-completion-table) - nil nil nil nil def))) + (completing-read (format-prompt "Function" def) + (inferior-octave-completion-table) + nil nil nil nil def))) (defun octave-goto-function-definition (fn) "Go to the function definition of FN in current buffer." @@ -1172,10 +1171,7 @@ q: Don't fix\n" func file)) (min (line-end-position 4) end) t) (match-string 1)))) - (old-func (read-string (format (if old-func - "Name to replace (default %s): " - "Name to replace: ") - old-func) + (old-func (read-string (format-prompt "Name to replace" old-func) nil nil old-func))) (if (and func old-func (not (equal func old-func))) (perform-replace old-func func 'query @@ -1454,7 +1450,7 @@ The block marked is the one that contains point or follows point." Prompt for the function's name, arguments and return values (to be entered without parens)." (let* ((defname (file-name-sans-extension (buffer-name))) - (name (read-string (format "Function name (default %s): " defname) + (name (read-string (format-prompt "Function name" defname) nil nil defname)) (args (read-string "Arguments: ")) (vals (read-string "Return values: "))) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index d83af83b32e..ccbcb081305 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -4585,9 +4585,7 @@ Interactively, prompt for symbol." (interactive (let ((symbol (python-eldoc--get-symbol-at-point)) (enable-recursive-minibuffers t)) - (list (read-string (if symbol - (format "Describe symbol (default %s): " symbol) - "Describe symbol: ") + (list (read-string (format-prompt "Describe symbol" symbol) nil nil symbol)))) (message (python-eldoc--get-doc-at-point symbol))) diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 5a47594878e..3c249b7bc0e 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -2206,8 +2206,7 @@ Shell script files can cause this function be called automatically when the file is visited by having a `sh-shell' file-local variable whose value is the shell name (don't quote it)." (interactive (list (completing-read - (format "Shell (default %s): " - sh-shell-file) + (format-prompt "Shell" sh-shell-file) ;; This used to use interpreter-mode-alist, but that is ;; no longer appropriate now that uses regexps. ;; Maybe there could be a separate variable that lists diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index 7ffa6d41dac..33aad2d39f7 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el @@ -1346,9 +1346,8 @@ Prefix argument means invert sense of `tcl-use-smart-word-finder'." (not tcl-use-smart-word-finder) tcl-use-smart-word-finder)))) (completing-read - (if (or (null word) (string= word "")) - "Help on Tcl command: " - (format "Help on Tcl command (default %s): " word)) + (format-prompt "Help on Tcl command: " + (and (not (equal word "")) word)) tcl-help-alist nil t nil nil word))) current-prefix-arg)) (if (not (equal tcl-help-directory-list tcl-help-saved-dirs)) diff --git a/lisp/rect.el b/lisp/rect.el index 9922aac9ec9..ebf309a88fe 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -521,8 +521,9 @@ Called from a program, takes three args; START, END and STRING." #'rectangle--string-erase-preview nil t) (add-hook 'post-command-hook #'rectangle--string-preview nil t)) - (read-string (format "String rectangle (default %s): " - (or (car string-rectangle-history) "")) + (read-string (format-prompt + "String rectangle" + (or (car string-rectangle-history) "")) nil 'string-rectangle-history (car string-rectangle-history) 'inherit-input-method)))))) @@ -549,8 +550,8 @@ This command does not delete or overwrite any existing text." (list (region-beginning) (region-end) - (read-string (format "String insert rectangle (default %s): " - (or (car string-rectangle-history) "")) + (read-string (format-prompt "String insert rectangle" + (or (car string-rectangle-history) "")) nil 'string-rectangle-history (car string-rectangle-history))))) (apply-on-rectangle 'string-rectangle-line start end string nil)) diff --git a/lisp/replace.el b/lisp/replace.el index 69092c16f96..a751822c79a 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -208,12 +208,15 @@ wants to replace FROM with TO." (minibuffer-allow-text-properties t) ; separator uses text-properties (prompt (cond ((and query-replace-defaults separator) - (format "%s (default %s): " prompt (car minibuffer-history))) + (format-prompt prompt (car minibuffer-history))) (query-replace-defaults - (format "%s (default %s -> %s): " prompt - (query-replace-descr (caar query-replace-defaults)) - (query-replace-descr (cdar query-replace-defaults)))) - (t (format "%s: " prompt)))) + (format-prompt + prompt (format "%s -> %s" + (query-replace-descr + (caar query-replace-defaults)) + (query-replace-descr + (cdar query-replace-defaults))))) + (t (format-prompt prompt nil)))) (from ;; The save-excursion here is in case the user marks and copies ;; a region in order to specify the minibuffer input. @@ -1487,7 +1490,7 @@ which means to discard all text properties." ;; Get the regexp for collection pattern. (let ((default (car occur-collect-regexp-history))) (read-regexp - (format "Regexp to collect (default %s): " default) + (format-prompt "Regexp to collect" default) default 'occur-collect-regexp-history))) ;; Otherwise normal occur takes numerical prefix argument. (when current-prefix-arg diff --git a/lisp/ses.el b/lisp/ses.el index 96b219fc601..5707067e765 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -2540,10 +2540,8 @@ cell formula was unsafe and user declined confirmation." (if (equal initial "\"") (progn (if (not (stringp curval)) (setq curval nil)) - (read-string (if curval - (format "String Cell %s (default %s): " - ses--curcell curval) - (format "String Cell %s: " ses--curcell)) + (read-string (format-prompt "String Cell %s" + curval ses--curcell) nil 'ses-read-string-history curval)) (read-from-minibuffer (format "Cell %s: " ses--curcell) @@ -3007,9 +3005,9 @@ inserts a new row if at bottom of print area. Repeat COUNT times." (list col (if current-prefix-arg (prefix-numeric-value current-prefix-arg) - (read-from-minibuffer (format "Column %s width (default %d): " - (ses-column-letter col) - (ses-col-width col)) + (read-from-minibuffer (format-prompt "Column %s width" + (ses-col-width col) + (ses-column-letter col)) nil ; No initial contents. nil ; No override keymap. t ; Convert to Lisp object. diff --git a/lisp/simple.el b/lisp/simple.el index eedbff2d087..376585d8e82 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2129,11 +2129,9 @@ See also `minibuffer-history-case-insensitive-variables'." (interactive (let* ((enable-recursive-minibuffers t) (regexp (read-from-minibuffer - (format "Previous element matching regexp%s: " - (if minibuffer-history-search-history - (format " (default %s)" - (car minibuffer-history-search-history)) - "")) + (format-prompt "Previous element matching regexp" + (and minibuffer-history-search-history + (car minibuffer-history-search-history))) nil minibuffer-local-map nil 'minibuffer-history-search-history (car minibuffer-history-search-history)))) @@ -8312,7 +8310,7 @@ makes it easier to edit it." (interactive (let* ((default-var (variable-at-point)) (var (if (custom-variable-p default-var) - (read-variable (format "Set variable (default %s): " default-var) + (read-variable (format-prompt "Set variable" default-var) default-var) (read-variable "Set variable: "))) (minibuffer-help-form `(describe-variable ',var)) diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 5b98eb36bb9..aab6a3a1283 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -1759,8 +1759,9 @@ This is based on `speedbar-initial-expansion-list-name' referencing "Change speedbar's default expansion list to NEW-DEFAULT." (interactive (list - (completing-read (format "Speedbar Mode (default %s): " - speedbar-previously-used-expansion-list-name) + (completing-read (format-prompt + "Speedbar Mode" + speedbar-previously-used-expansion-list-name) speedbar-initial-expansion-mode-alist nil t "" nil speedbar-previously-used-expansion-list-name))) diff --git a/lisp/term.el b/lisp/term.el index e77c2c1331b..f0470d806cd 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -4278,8 +4278,7 @@ well as the newer ports COM10 and higher." ;; `prompt': The most recently used port is provided as ;; the default value, which is used when the user ;; simply presses return. - (if (stringp h) (format "Serial port (default %s): " h) - "Serial port: ") + (format-prompt "Serial port" h) ;; `directory': Most systems have their serial ports ;; in the same directory, so start in the directory ;; of the most recently used port, or in a reasonable @@ -4294,8 +4293,7 @@ well as the newer ports COM10 and higher." ;; serial port. "") (read-from-minibuffer - (if (stringp h) (format "Serial port (default %s): " h) - "Serial port: ") + (format-prompt "Serial port" h) nil nil nil '(file-name-history . 1) nil nil)))) (if (or (null x) (and (stringp x) (zerop (length x)))) (setq x h) @@ -4317,7 +4315,7 @@ Try to be nice by providing useful defaults and history." (cond ((string= h serial-no-speed) "Speed (default nil = set by port): ") (h - (format "Speed (default %s b/s): " h)) + (format-prompt "Speed" (format "%s b/s" h))) (t (format "Speed (b/s): "))) nil nil nil '(history . 1) nil nil))) diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index cc5879880c8..8c824461d22 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -1883,12 +1883,9 @@ on what is seen near point." (list (let* ((sym (css--mdn-find-symbol)) (enable-recursive-minibuffers t) - (value (completing-read - (if sym - (format "Describe CSS symbol (default %s): " sym) - "Describe CSS symbol: ") - css--mdn-completion-list nil nil nil - 'css--mdn-lookup-history sym))) + (value (completing-read (format-prompt "Describe CSS symbol" sym) + css--mdn-completion-list nil nil nil + 'css--mdn-lookup-history sym))) (if (equal value "") sym value)))) (when symbol ;; If we see a single-colon pseudo-element like ":after", turn it diff --git a/lisp/textmodes/refer.el b/lisp/textmodes/refer.el index 8d8223a7326..c8fd0bea004 100644 --- a/lisp/textmodes/refer.el +++ b/lisp/textmodes/refer.el @@ -336,9 +336,9 @@ found on the last `refer-find-entry' or `refer-find-next-entry'." (list (expand-file-name (if (eq major-mode 'bibtex-mode) (read-file-name - (format ".bib file (default %s): " - (file-name-nondirectory - (buffer-file-name))) + (format-prompt ".bib file" + (file-name-nondirectory + (buffer-file-name))) (file-name-directory (buffer-file-name)) (file-name-nondirectory (buffer-file-name)) t) diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el index b79bb292c8a..4c780d8d8c3 100644 --- a/lisp/textmodes/reftex-ref.el +++ b/lisp/textmodes/reftex-ref.el @@ -861,9 +861,7 @@ Optional prefix argument OTHER-WINDOW goes to the label in another window." (default (when (looking-back "\\\\\\(?:page\\)?ref{[-a-zA-Z0-9_*.:]*" (line-beginning-position)) (reftex-this-word "-a-zA-Z0-9_*.:"))) - (label (completing-read (if default - (format "Label (default %s): " default) - "Label: ") + (label (completing-read (format-prompt "Label" default) docstruct (lambda (x) (stringp (car x))) t nil nil default)) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 04f1dddf5fc..e0ef786953e 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -779,7 +779,7 @@ If you like tags and attributes in uppercase, customize (setq sgml-tag-last (completing-read (if (> (length sgml-tag-last) 0) - (format "Tag (default %s): " sgml-tag-last) + (format-prompt "Tag" sgml-tag-last) "Tag: ") sgml-tag-alist nil nil nil 'sgml-tag-history sgml-tag-last))) ?< str | @@ -878,9 +878,7 @@ With prefix argument, only self insert." (list (let ((def (save-excursion (if (eq (following-char) ?<) (forward-char)) (sgml-beginning-of-tag)))) - (completing-read (if def - (format "Tag (default %s): " def) - "Tag: ") + (completing-read (format-prompt "Tag" def) sgml-tag-alist nil nil nil 'sgml-tag-history def)))) (or (and tag (> (length tag) 0)) diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 33f181b80c3..cfe6ce5ce61 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el @@ -1824,11 +1824,11 @@ See `table-insert-row' and `table-insert-column'." (list (intern (let ((completion-ignore-case t) (default (car table-insert-row-column-history))) (downcase (completing-read - (format "Insert %s row%s/column%s (default %s): " - (if (> n 1) (format "%d" n) "a") - (if (> n 1) "s" "") - (if (> n 1) "s" "") - default) + (format-prompt + "Insert %s row%s/column%s" default + (if (> n 1) (format "%d" n) "a") + (if (> n 1) "s" "") + (if (> n 1) "s" "")) '(("row") ("column")) nil t nil 'table-insert-row-column-history default)))) n))) @@ -2534,7 +2534,7 @@ DIRECTION is one of symbols; right, left, above or below." (caar direction-list))) (completion-ignore-case t)) (intern (downcase (completing-read - (format "Span into (default %s): " default-direction) + (format-prompt "Span into" default-direction) direction-list nil t nil 'table-cell-span-direction-history default-direction)))))) (unless (memq direction '(right left above below)) @@ -2697,7 +2697,7 @@ Creates a cell on the left and a cell on the right of the current point location ("Title" ("Split" . "split") ("Left" . "left") ("Right" . "right")))) (downcase (completing-read - (format "Existing cell contents to (default %s): " default) + (format-prompt "Existing cell contents to" default) '(("split") ("left") ("right")) nil t nil 'table-cell-split-contents-to-history default))))))) (unless (eq contents-to 'split) @@ -2769,7 +2769,7 @@ ORIENTATION is a symbol either horizontally or vertically." (completion-ignore-case t) (default (car table-cell-split-orientation-history))) (intern (downcase (completing-read - (format "Split orientation (default %s): " default) + (format-prompt "Split orientation" default) '(("horizontally") ("vertically")) nil t nil 'table-cell-split-orientation-history default)))))) (unless (memq orientation '(horizontally vertically)) @@ -2789,7 +2789,7 @@ WHAT is a symbol `cell', `row' or `column'. JUSTIFY is a symbol (completion-ignore-case t) (default (car table-target-history))) (intern (downcase (completing-read - (format "Justify what (default %s): " default) + (format-prompt "Justify what" default) '(("cell") ("row") ("column")) nil t nil 'table-target-history default)))) (table--query-justification))) @@ -2943,7 +2943,7 @@ CALS (DocBook DTD): (completion-ignore-case t) (default (car table-source-language-history)) (language (downcase (completing-read - (format "Language (default %s): " default) + (format-prompt "Language" default) table-source-languages nil t nil 'table-source-language-history default)))) (list @@ -3366,7 +3366,7 @@ Example: (let* ((completion-ignore-case t) (default (car table-sequence-justify-history))) (intern (downcase (completing-read - (format "Justify (default %s): " default) + (format-prompt "Justify" default) '(("left") ("center") ("right")) nil t nil 'table-sequence-justify-history default))))))) (unless (or (called-interactively-p 'interactive) (table--probe-cell)) @@ -3668,7 +3668,7 @@ companion command to `table-capture' this way. (if (and (string= col-delim-regexp "") (string= row-delim-regexp "")) 'left (intern (downcase (completing-read - (format "Justify (default %s): " default) + (format-prompt "Justify" default) '(("left") ("center") ("right")) nil t nil 'table-capture-justify-history default))))) (if (and (string= col-delim-regexp "") (string= row-delim-regexp "")) "1" @@ -4253,9 +4253,8 @@ cache buffer into the designated cell in the table buffer." PROMPT-HISTORY is a cons cell which car is the prompt string and the cdr is the history symbol." (let ((default (car (symbol-value (cdr prompt-history))))) - (read-from-minibuffer - (format "%s (default %s): " (car prompt-history) default) - "" nil nil (cdr prompt-history) default)) + (read-from-minibuffer (format-prompt (car prompt-history) default) + "" nil nil (cdr prompt-history) default)) (car (symbol-value (cdr prompt-history)))) (defun table--buffer-substring-and-trim (beg end) @@ -4312,7 +4311,7 @@ Returns the coordinate of the final point location." (let* ((completion-ignore-case t) (default (car table-justify-history))) (intern (downcase (completing-read - (format "Justify (default %s): " default) + (format-prompt "Justify" default) '(("left") ("center") ("right") ("top") ("middle") ("bottom") ("none")) nil t nil 'table-justify-history default))))) diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el index d302fb16eda..54bb3569788 100644 --- a/lisp/vc/add-log.el +++ b/lisp/vc/add-log.el @@ -667,7 +667,7 @@ With a numeric prefix ARG, go back ARG comments." "Prompt for a change log name." (let* ((default (change-log-name)) (name (expand-file-name - (read-file-name (format "Log file (default %s): " default) + (read-file-name (format-prompt "Log file" default) nil default)))) ;; Handle something that is syntactically a directory name. ;; Look for ChangeLog or whatever in that directory. diff --git a/lisp/vc/ediff-mult.el b/lisp/vc/ediff-mult.el index 2b1b07927f8..c977291a524 100644 --- a/lisp/vc/ediff-mult.el +++ b/lisp/vc/ediff-mult.el @@ -1807,11 +1807,9 @@ all marked sessions must be active." (ediff-show-meta-buffer session-buf) (setq regexp (read-string - (if (stringp default-regexp) - (format - "Filter filenames through regular expression (default %s): " - default-regexp) - "Filter filenames through regular expression: ") + (format-prompt + "Filter filenames through regular expression" + default-regexp) nil 'ediff-filtering-regexp-history (eval ediff-default-filtering-regexp t))) diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index f56d31c7136..52878bad8a7 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -2181,19 +2181,18 @@ a regular expression typed in by the user." (setq ediff-skip-diff-region-function ediff-hide-regexp-matches-function regexp-A (read-string - (format - "Ignore A-regions matching this regexp (default %s): " - ediff-regexp-hide-A)) + (format-prompt + "Ignore A-regions matching this regexp" ediff-regexp-hide-A)) regexp-B (read-string - (format - "Ignore B-regions matching this regexp (default %s): " + (format-prompt + "Ignore B-regions matching this regexp" ediff-regexp-hide-B))) (if ediff-3way-comparison-job (setq regexp-C (read-string - (format - "Ignore C-regions matching this regexp (default %s): " + (format-prompt + "Ignore C-regions matching this regexp" ediff-regexp-hide-C)))) (if (eq ediff-hide-regexp-connective 'and) (setq msg-connective "BOTH" @@ -2220,20 +2219,18 @@ a regular expression typed in by the user." ediff-focus-on-regexp-matches-function regexp-A (read-string - (format - "Focus on A-regions matching this regexp (default %s): " - ediff-regexp-focus-A)) + (format-prompt + "Focus on A-regions matching this regexp" ediff-regexp-focus-A)) regexp-B (read-string - (format - "Focus on B-regions matching this regexp (default %s): " - ediff-regexp-focus-B))) + (format-prompt + "Focus on B-regions matching this regexp" ediff-regexp-focus-B))) (if ediff-3way-comparison-job (setq regexp-C (read-string - (format - "Focus on C-regions matching this regexp (default %s): " - ediff-regexp-focus-C)))) + (format-prompt + "Focus on C-regions matching this regexp" + ediff-regexp-focus-C)))) (if (eq ediff-focus-regexp-connective 'and) (setq msg-connective "BOTH" alt-msg-connective "ONE OF" diff --git a/lisp/vc/ediff.el b/lisp/vc/ediff.el index 133d2109f5b..ae2f8ad6c1c 100644 --- a/lisp/vc/ediff.el +++ b/lisp/vc/ediff.el @@ -566,10 +566,8 @@ expression; only file names that match the regexp are considered." (ediff-strip-last-dir f)) nil 'must-match) (read-string - (if (stringp default-regexp) - (format "Filter filenames through regular expression (default %s): " - default-regexp) - "Filter filenames through regular expression: ") + (format-prompt "Filter filenames through regular expression" + default-regexp) nil 'ediff-filtering-regexp-history (eval ediff-default-filtering-regexp)) @@ -594,10 +592,8 @@ names. Only the files that are under revision control are taken into account." (list (read-directory-name "Directory to compare with revision:" dir-A nil 'must-match) (read-string - (if (stringp default-regexp) - (format "Filter filenames through regular expression (default %s): " - default-regexp) - "Filter filenames through regular expression: ") + (format-prompt + "Filter filenames through regular expression" default-regexp) nil 'ediff-filtering-regexp-history (eval ediff-default-filtering-regexp)) @@ -632,10 +628,8 @@ regular expression; only file names that match the regexp are considered." (ediff-strip-last-dir f)) nil 'must-match) (read-string - (if (stringp default-regexp) - (format "Filter filenames through regular expression (default %s): " - default-regexp) - "Filter filenames through regular expression: ") + (format-prompt "Filter filenames through regular expression" + default-regexp) nil 'ediff-filtering-regexp-history (eval ediff-default-filtering-regexp)) @@ -665,10 +659,8 @@ MERGE-AUTOSTORE-DIR is the directory in which to store merged files." (ediff-strip-last-dir f)) nil 'must-match) (read-string - (if (stringp default-regexp) - (format "Filter filenames through regular expression (default %s): " - default-regexp) - "Filter filenames through regular expression: ") + (format-prompt "Filter filenames through regular expression" + default-regexp) nil 'ediff-filtering-regexp-history (eval ediff-default-filtering-regexp)) @@ -707,10 +699,8 @@ MERGE-AUTOSTORE-DIR is the directory in which to store merged files." (ediff-strip-last-dir f)) nil 'must-match) (read-string - (if (stringp default-regexp) - (format "Filter filenames through regular expression (default %s): " - default-regexp) - "Filter filenames through regular expression: ") + (format-prompt "Filter filenames through regular expression" + default-regexp) nil 'ediff-filtering-regexp-history (eval ediff-default-filtering-regexp)) @@ -735,10 +725,8 @@ MERGE-AUTOSTORE-DIR is the directory in which to store merged files." (list (read-directory-name "Directory to merge with revisions:" dir-A nil 'must-match) (read-string - (if (stringp default-regexp) - (format "Filter filenames through regular expression (default %s): " - default-regexp) - "Filter filenames through regular expression: ") + (format-prompt "Filter filenames through regular expression" + default-regexp) nil 'ediff-filtering-regexp-history (eval ediff-default-filtering-regexp)) @@ -767,10 +755,8 @@ MERGE-AUTOSTORE-DIR is the directory in which to store merged files." "Directory to merge with revisions and ancestors:" dir-A nil 'must-match) (read-string - (if (stringp default-regexp) - (format "Filter filenames through regular expression (default %s): " - default-regexp) - "Filter filenames through regular expression: ") + (format-prompt "Filter filenames through regular expression" + default-regexp) nil 'ediff-filtering-regexp-history (eval ediff-default-filtering-regexp)) @@ -1353,16 +1339,18 @@ the merge buffer." (let (rev1 rev2) (setq rev1 (read-string - (format-message - "Version 1 to merge (default %s's working version): " - (if (stringp file) - (file-name-nondirectory file) "current buffer"))) + (format-prompt "Version 1 to merge" + (concat + (if (stringp file) + (file-name-nondirectory file) + "current buffer") + "'s working version"))) rev2 (read-string - (format - "Version 2 to merge (default %s): " - (if (stringp file) - (file-name-nondirectory file) "current buffer")))) + (format-prompt "Version 2 to merge" + (if (stringp file) + (file-name-nondirectory file) + "current buffer")))) (ediff-load-version-control) ;; ancestor-revision=nil (funcall @@ -1388,22 +1376,26 @@ the merge buffer." (let (rev1 rev2 ancestor-rev) (setq rev1 (read-string - (format-message - "Version 1 to merge (default %s's working version): " - (if (stringp file) - (file-name-nondirectory file) "current buffer"))) + (format-prompt "Version 1 to merge" + (concat + (if (stringp file) + (file-name-nondirectory file) + "current buffer") + "'s working version"))) rev2 (read-string - (format - "Version 2 to merge (default %s): " - (if (stringp file) - (file-name-nondirectory file) "current buffer"))) + (format-prompt "Version 2 to merge" + (if (stringp file) + (file-name-nondirectory file) + "current buffer"))) ancestor-rev - (read-string - (format-message - "Ancestor version (default %s's base revision): " - (if (stringp file) - (file-name-nondirectory file) "current buffer")))) + (read-string (format-prompt + "Ancestor version" + (concat + (if (stringp file) + (file-name-nondirectory file) + "current buffer") + "'s base revision")))) (ediff-load-version-control) (funcall (intern (format "ediff-%S-merge-internal" ediff-version-control-package)) @@ -1503,13 +1495,14 @@ arguments after setting up the Ediff buffers." (save-buffer (current-buffer))) (let (rev1 rev2) (setq rev1 - (read-string - (format "Revision 1 to compare (default %s's latest revision): " - (file-name-nondirectory file))) + (read-string (format-prompt "Revision 1 to compare" + (concat (file-name-nondirectory file) + "'s latest revision"))) rev2 (read-string - (format "Revision 2 to compare (default %s's current state): " - (file-name-nondirectory file)))) + (format-prompt "Revision 2 to compare" + (concat (file-name-nondirectory file) + "'s current state")))) (ediff-load-version-control) (funcall (intern (format "ediff-%S-internal" ediff-version-control-package)) diff --git a/lisp/vc/emerge.el b/lisp/vc/emerge.el index fc8c318e3af..d2d419ac786 100644 --- a/lisp/vc/emerge.el +++ b/lisp/vc/emerge.el @@ -2757,15 +2757,14 @@ Otherwise, signal an error." alternative-default-dir (not (string-equal alternative-default-dir (file-name-directory A-file)))) - (read-file-name (format "%s (default %s): " - prompt (file-name-nondirectory A-file)) + (read-file-name (format-prompt prompt (file-name-nondirectory A-file)) alternative-default-dir (concat alternative-default-dir (file-name-nondirectory A-file)) (and must-match 'confirm))) ;; If there is a default file, use it. (default-file - (read-file-name (format "%s (default %s): " prompt default-file) + (read-file-name (format-prompt prompt default-file) ;; If emerge-default-last-directories is set, use the ;; directory from the same argument of the last call of ;; Emerge as the default for this argument. diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el index d82cadc70dd..18bcc6c2f10 100644 --- a/lisp/vc/vc-annotate.el +++ b/lisp/vc/vc-annotate.el @@ -403,7 +403,7 @@ should be applied to the background or to the foreground." (let ((def (vc-working-revision buffer-file-name))) (if (null current-prefix-arg) def (vc-read-revision - (format "Annotate from revision (default %s): " def) + (format-prompt "Annotate from revision" def) (list buffer-file-name) nil def))) (if (null current-prefix-arg) vc-annotate-display-mode diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index f0a08044e28..4cbd2658f80 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2516,11 +2516,8 @@ with its diffs (if the underlying VCS supports that)." (cond ((eq current-prefix-arg 1) (let* ((default (thing-at-point 'word t)) - (revision (read-string - (if default - (format "Revision to show (default %s): " default) - "Revision to show: ") - nil nil default))) + (revision (read-string (format-prompt "Revision to show" default) + nil nil default))) (list 1 revision))) ((numberp current-prefix-arg) (list current-prefix-arg)) diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el index c252c0b18f8..e159d1888e5 100644 --- a/lisp/w32-fns.el +++ b/lisp/w32-fns.el @@ -202,8 +202,7 @@ This function is provided for backward compatibility, since (interactive (list (let ((default locale-coding-system)) (read-coding-system - (format "Coding system for system calls (default %s): " - default) + (format-prompt "Coding system for system calls" default) default)))) (check-coding-system coding-system) (setq locale-coding-system coding-system)) diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index f58a0fb7a3a..e9799dc00fd 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -3181,11 +3181,10 @@ It reads a file name from an editable text field." (abbreviate-file-name (if unbound (read-file-name prompt) - (let ((prompt2 (format "%s (default %s): " prompt value)) - (dir (file-name-directory value)) + (let ((dir (file-name-directory value)) (file (file-name-nondirectory value)) (must-match (widget-get widget :must-match))) - (read-file-name prompt2 dir nil must-match file))))) + (read-file-name (format-prompt prompt value) dir nil must-match file))))) ;;;(defun widget-file-action (widget &optional event) ;;; ;; Read a file name from the minibuffer. @@ -3297,10 +3296,10 @@ It reads a directory name from an editable text field." "Read coding-system from minibuffer." (if (widget-get widget :base-only) (intern - (completing-read (format "%s (default %s): " prompt value) + (completing-read (format-prompt prompt value) (mapcar #'list (coding-system-list t)) nil nil nil coding-system-history)) - (read-coding-system (format "%s (default %s): " prompt value) value))) + (read-coding-system (format-prompt prompt value) value))) (defun widget-coding-system-action (widget &optional event) (let ((answer diff --git a/lisp/woman.el b/lisp/woman.el index 891a1263ace..eeacceadc27 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -1277,14 +1277,11 @@ cache to be re-read." (test-completion word-at-point woman-topic-all-completions)) word-at-point))) - (completing-read - (if default - (format "Manual entry (default %s): " default) - "Manual entry: ") - woman-topic-all-completions nil 1 - nil - 'woman-topic-history - default)))) + (completing-read (format-prompt "Manual entry" default) + woman-topic-all-completions nil 1 + nil + 'woman-topic-history + default)))) ;; Note that completing-read always returns a string. (unless (= (length topic) 0) (cond From d7197f9d99ca6aa326d38e64ca9eb1d13e18d664 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Sun, 6 Sep 2020 15:56:32 +0100 Subject: [PATCH 14/73] Fix formatting of recent Gnus nnselect changes * doc/misc/gnus.texi (Finding the Parent, Selection Groups) (Searching, Basic Usage): Heed sentence-end-double-space. Fix formatting of prose and examples. * etc/NEWS: Fix typo. * lisp/gnus/gnus-srvr.el: Remove disabled autoload. * lisp/gnus/gnus-cloud.el (gnus-cloud-available-chunks): * lisp/gnus/gnus-group.el (gnus-group-read-ephemeral-search-group): * lisp/gnus/gnus-sum.el (gnus-refer-thread-use-search) (gnus-summary-refer-thread): * lisp/gnus/gnus.el (gnus-kill-ephemeral-group): * lisp/gnus/nnheader.el (nnheader-head-make-header) (nnheader-parse-head): * lisp/gnus/nnir.el: (nnir-hyrex-remove-prefix, nnir-run-notmuch): * lisp/gnus/nnselect.el: Fix formatting/indentation of commentary, docstring, and/or code. --- doc/misc/gnus.texi | 138 ++++++++++++++++++++-------------------- etc/NEWS | 4 +- lisp/gnus/gnus-cloud.el | 3 +- lisp/gnus/gnus-group.el | 22 +++---- lisp/gnus/gnus-srvr.el | 1 - lisp/gnus/gnus-sum.el | 23 ++++--- lisp/gnus/gnus.el | 2 +- lisp/gnus/nnheader.el | 29 ++++----- lisp/gnus/nnir.el | 6 +- lisp/gnus/nnselect.el | 14 ++-- 10 files changed, 118 insertions(+), 124 deletions(-) diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index de5e8f33b54..789b1dea52a 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -10417,12 +10417,12 @@ article (@code{gnus-summary-refer-references}). @findex gnus-summary-refer-thread @kindex A T @r{(Summary)} Display the full thread where the current article appears -(@code{gnus-summary-refer-thread}). By default this command looks for -articles only in the current group. Some backends (currently only -'nnimap) know how to find articles in the thread directly. In other -cases each header in the current group must be fetched and examined, -so it usually takes a while. If you do it often, you may consider -setting @code{gnus-fetch-old-headers} to @code{invisible} +(@code{gnus-summary-refer-thread}). By default this command looks for +articles only in the current group. Some backends (currently only +@code{nnimap}) know how to find articles in the thread directly. In +other cases each header in the current group must be fetched and +examined, so it usually takes a while. If you do it often, you may +consider setting @code{gnus-fetch-old-headers} to @code{invisible} (@pxref{Filling In Threads}). This won't have any visible effects normally, but it'll make this command work a whole lot faster. Of course, it'll make group entry somewhat slow. @@ -10441,12 +10441,13 @@ by giving the @kbd{A T} command a numerical prefix. @vindex gnus-refer-thread-limit-to-thread In most cases @code{gnus-refer-thread} adds any articles it finds to -the current summary buffer. (When @code{gnus-refer-thread-use-search} +the current summary buffer. (When @code{gnus-refer-thread-use-search} is true and the initial referral starts from a summary buffer for a -non-virtual group this may not be possible. In this case a new summary -buffer is created holding a virtual group with the result of the thread -search). If @code{gnus-refer-thread-limit-to-thread} is non-nil then -the summary buffer will be limited to articles in the thread. +non-virtual group this may not be possible. In this case a new +summary buffer is created holding a virtual group with the result of +the thread search.) If @code{gnus-refer-thread-limit-to-thread} is +non-nil then the summary buffer will be limited to articles in the +thread. @item M-^ (Summary) @findex gnus-summary-refer-article @@ -17869,7 +17870,7 @@ whole groups together into virtual groups. @menu * Selection Groups:: Combining articles from many groups. -* Combined Groups:: Combining multiple groups. +* Combined Groups:: Combining multiple groups. @end menu @@ -17882,36 +17883,35 @@ whole groups together into virtual groups. Gnus provides the @dfn{nnselect} method for creating virtual groups composed of collections of messages, even when these messages come -from groups that span multiple servers and backends. For the most part -these virtual groups behave like any other group: messages may be +from groups that span multiple servers and backends. For the most +part these virtual groups behave like any other group: messages may be threaded, marked, moved, deleted, copied, etc.; groups may be ephemeral or persistent; groups may be created via @code{gnus-group-make-group} or browsed as foreign via @code{gnus-group-browse-foreign-server}. The key to using an nnselect group is specifying the messages to -include. Each nnselect group has a group parameter +include. Each nnselect group has a group parameter @code{nnselect-specs} which is an alist with two elements: a function @code{nnselect-function}; and arguments @code{nnselect-args} to be passed to the function, if any. -The function @code{nnselect-function} must return a vector. Each +The function @code{nnselect-function} must return a vector. Each element of this vector is in turn a 3-element vector corresponding to -one message. The 3 elements are: the fully-qualified group name; the -message number; and a "score" that can be used for additional -sorting. The values for the score are arbitrary, and are not used -directly by the nnselect method---they may, for example, all be set to -100. +one message. The 3 elements are: the fully-qualified group name; the +message number; and a "score" that can be used for additional sorting. +The values for the score are arbitrary, and are not used directly by +the nnselect method---they may, for example, all be set to 100. Here is an example: @lisp - (nnselect-specs - (nnselect-function . identity) - (nnselect-args . - [["nnimap+work:mail" 595 100] - ["nnimap+home:sent" 223 100] - ["nntp+news.gmane.org:gmane.emacs.gnus.general" 23666 100]])) +(nnselect-specs + (nnselect-function . identity) + (nnselect-args + . [["nnimap+work:mail" 595 100] + ["nnimap+home:sent" 223 100] + ["nntp+news.gmane.org:gmane.emacs.gnus.general" 23666 100]])) @end lisp The function is the identity and the argument is just the list of @@ -17920,21 +17920,21 @@ messages to include in the virtual group. Or we may wish to create a group from the results of a search query: @lisp - (nnselect-specs - (nnselect-function . nnir-run-query) - (nnselect-args - (nnir-query-spec - (query . "FLAGGED") - (criteria . "")) - (nnir-group-spec - ("nnimap:home") - ("nnimap:work")))) +(nnselect-specs + (nnselect-function . nnir-run-query) + (nnselect-args + (nnir-query-spec + (query . "FLAGGED") + (criteria . "")) + (nnir-group-spec + ("nnimap:home") + ("nnimap:work")))) @end lisp This creates a group including all flagged messages from all groups on -two imap servers, "home" and "work". +two IMAP servers, "home" and "work". -And one last example. Here is a function that runs a search query to +And one last example. Here is a function that runs a search query to find all message that have been received recently from certain groups: @lisp @@ -17946,45 +17946,44 @@ find all message that have been received recently from certain groups: (time-subtract (current-time) (days-to-time (car args))))) (cons 'criteria ""))) - (group-spec (cadr args))) - (nnir-run-query (cons 'nnir-specs - (list (cons 'nnir-query-spec query-spec) - (cons 'nnir-group-spec group-spec)))))) + (group-spec (cadr args))) + (nnir-run-query (cons 'nnir-specs + (list (cons 'nnir-query-spec query-spec) + (cons 'nnir-group-spec group-spec)))))) @end lisp -Then an nnselect-specs +Then the following @code{nnselect-specs}: @lisp - (nnselect-specs - (nnselect-function . my-recent-email) - (nnselect-args . (7 (("nnimap:home") ("nnimap:work"))))) +(nnselect-specs + (nnselect-function . my-recent-email) + (nnselect-args . (7 (("nnimap:home") ("nnimap:work"))))) @end lisp will provide a group composed of all messages on the home and work servers received in the last 7 days. Refreshing the selection of an nnselect group by running the -@code{nnselect-function} may take a long time to -complete. Consequently nnselect groups are not refreshed by default -when @code{gnus-group-get-new-news} is invoked. In those cases where -running the function is not too time-consuming, a non-nil group -parameter of @code{nnselect-rescan} will allow automatic refreshing. A -refresh can always be invoked manually through +@code{nnselect-function} may take a long time to complete. +Consequently nnselect groups are not refreshed by default when +@code{gnus-group-get-new-news} is invoked. In those cases where +running the function is not too time-consuming, a non-@code{nil} group +parameter of @code{nnselect-rescan} will allow automatic refreshing. +A refresh can always be invoked manually through @code{gnus-group-get-new-news-this-group}. The nnir interface (@pxref{nnir}) includes engines for searching a -variety of backends. While the details of each search engine vary, the -result of an nnir search is always a vector of the sort used by the -nnselect method, and the results of nnir queries are usually viewed -using an nnselect group. Indeed the standard search function +variety of backends. While the details of each search engine vary, +the result of an nnir search is always a vector of the sort used by +the nnselect method, and the results of nnir queries are usually +viewed using an nnselect group. Indeed the standard search function @code{gnus-group-read-ephemeral-search-group} just creates an ephemeral nnselect group with the appropriate nnir query as the @code{nnselect-specs}. nnir originally included both the search -engines and the glue to connect search results to gnus. Over time this -glue evolved into the nnselect method. The two had -a mostly amicable parting so that nnselect could pursue its dream of -becoming a fully functioning backend, but occasional conflicts may -still linger. +engines and the glue to connect search results to gnus. Over time +this glue evolved into the nnselect method. The two had a mostly +amicable parting so that nnselect could pursue its dream of becoming a +fully functioning backend, but occasional conflicts may still linger. @node Combined Groups @subsection Combined Groups @@ -21383,22 +21382,21 @@ FIXME: A brief comparison of nnir, nnmairix, contrib/gnus-namazu would be nice. Gnus has various ways of finding articles that match certain criteria -(from a particular author, on a certain subject, etc). The simplest +(from a particular author, on a certain subject, etc.). The simplest method is to enter a group and then either "limit" the summary buffer to the desired articles using the limiting commands (@xref{Limiting}), or searching through messages in the summary buffer (@xref{Searching for Articles}). Limiting commands and summary buffer searching work on subsets of the -articles already fetched from the servers, and these commands won’t +articles already fetched from the servers, and these commands won't query the server for additional articles. While simple, these methods are therefore inadequate if the desired articles span multiple groups, -or if the group is so large that fetching all articles is -impractical. Many backends (such as imap, notmuch, namazu, etc.) -provide their own facilities to search for articles directly on the -server and gnus can take advantage of these methods. This chapter -describes tools for searching groups and servers for articles matching -a query. +or if the group is so large that fetching all articles is impractical. +Many backends (such as imap, notmuch, namazu, etc.) provide their own +facilities to search for articles directly on the server and Gnus can +take advantage of these methods. This chapter describes tools for +searching groups and servers for articles matching a query. @menu * nnir:: Searching with various engines. @@ -21446,7 +21444,7 @@ The @code{nnselect} group made in this way is an @code{ephemeral} group, and will disappear upon exit from the group. However changes made in the group are permanently reflected in the real groups from which the articles are drawn. It is occasionally convenient to view -articles found through searching in their original group. You can +articles found through searching in their original group. You can @emph{warp} (i.e., jump) to the original group for the article on the current line with @kbd{A W}, aka @code{gnus-warp-to-article}. diff --git a/etc/NEWS b/etc/NEWS index 749b28ac3f7..f0644c8ea94 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -328,8 +328,8 @@ obtaining the list of articles as a result of a search: 'gnus-group-make-search-group' ('G g') that will prompt for an 'nnir' search query and create a dedicated group for that search. As part of this addition, the user option 'nnir-summary-line-format' has been -removed; it's functionality is now available directly in the -'gnus-summary-line-format' '%G' and '%g' specs. The user option +removed; its functionality is now available directly in the +'gnus-summary-line-format' specs '%G' and '%g'. The user option 'gnus-refer-thread-use-nnir' has been renamed to 'gnus-refer-thread-use-search'. diff --git a/lisp/gnus/gnus-cloud.el b/lisp/gnus/gnus-cloud.el index e40b2eb418d..3e23e263262 100644 --- a/lisp/gnus/gnus-cloud.el +++ b/lisp/gnus/gnus-cloud.el @@ -414,8 +414,7 @@ When FULL is t, upload everything, not just a difference from the last full." (while (setq head (nnheader-parse-head)) (when gnus-alter-header-function (funcall gnus-alter-header-function head)) - (push head headers)) - )) + (push head headers)))) (sort (nreverse headers) (lambda (h1 h2) (> (gnus-cloud-chunk-sequence (mail-header-subject h1)) diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index cafaf69a96b..a90243b8b6c 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -3185,23 +3185,23 @@ mail messages or news articles in files that have numeric names." (cons 'nnselect-args (nnir-make-specs nnir-extra-parms specs))))))))) -(defun gnus-group-read-ephemeral-search-group (nnir-extra-parms &optional specs) - "Create an nnselect group based on a search. Prompt for a -search query and determine the groups to search as follows: if -called from the *Server* buffer search all groups belonging to -the server on the current line; if called from the *Group* buffer -search any marked groups, or the group on the current line, or -all the groups under the current topic. Calling with a prefix-arg -prompts for additional search-engine specific constraints. A -non-nil `specs' arg must be an alist with `nnir-query-spec' and -`nnir-group-spec' keys, and skips all prompting." +(defun gnus-group-read-ephemeral-search-group (nnir-extra-parms &optional specs) + "Create an nnselect group based on a search. +Prompt for a search query and determine the groups to search as +follows: if called from the *Server* buffer search all groups +belonging to the server on the current line; if called from the +*Group* buffer search any marked groups, or the group on the +current line, or all the groups under the current topic. Calling +with a prefix arg prompts for additional search-engine specific +constraints. A non-nil SPECS arg must be an alist with +`nnir-query-spec' and `nnir-group-spec' keys, and skips all +prompting." (interactive "P") (gnus-group-read-ephemeral-group (concat "nnselect-" (message-unique-id)) (list 'nnselect "nnselect") nil (cons (current-buffer) gnus-current-window-configuration) - ; nil nil nil (list (cons 'nnselect-specs diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el index 8cb80b2f520..6beb543e5a1 100644 --- a/lisp/gnus/gnus-srvr.el +++ b/lisp/gnus/gnus-srvr.el @@ -35,7 +35,6 @@ (require 'gnus-cloud) (autoload 'gnus-group-read-ephemeral-search-group "nnselect") -;;(autoload 'gnus-group-make-permanent-search-group "nnselect") (defcustom gnus-server-exit-hook nil "Hook run when exiting the server buffer." diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 0cde893d215..dc4f1c6a386 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -145,8 +145,8 @@ If t, fetch all the available old headers." (sexp :menu-tag "other" t))) (defcustom gnus-refer-thread-use-search nil - "Search an entire server when referring threads. A -nil value will only search for thread-related articles in the + "Search an entire server when referring threads. +A nil value will only search for thread-related articles in the current group." :version "24.1" :group 'gnus-thread @@ -8984,16 +8984,15 @@ Return the number of articles fetched." result)) (defun gnus-summary-refer-thread (&optional limit) - "Fetch all articles in the current thread. For backends that -know how to search for threads (currently only 'nnimap) a -non-numeric prefix arg will search the entire -server; without a prefix arg only the current group is -searched. If the variable `gnus-refer-thread-use-search' is -non-nil the prefix arg has the reverse meaning. If no -backend-specific 'request-thread function is available fetch -LIMIT (the numerical prefix) old headers. If LIMIT is -non-numeric or nil fetch the number specified by the -`gnus-refer-thread-limit' variable." + "Fetch all articles in the current thread. +For backends that know how to search for threads (currently only +`nnimap') a non-numeric prefix arg will search the entire server; +without a prefix arg only the current group is searched. If the +variable `gnus-refer-thread-use-search' is non-nil the prefix arg +has the reverse meaning. If no backend-specific `request-thread' +function is available fetch LIMIT (the numerical prefix) old +headers. If LIMIT is non-numeric or nil fetch the number +specified by the `gnus-refer-thread-limit' variable." (interactive "P") (let* ((header (gnus-summary-article-header)) (id (mail-header-id header)) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 561e6b8cf4b..8cd35e3d7b7 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -3159,7 +3159,7 @@ that that variable is buffer-local to the summary buffers." (defun gnus-kill-ephemeral-group (group) "Remove ephemeral GROUP from relevant structures." (remhash group gnus-newsrc-hashtb) - (setq gnus-newsrc-alist + (setq gnus-newsrc-alist (delq (assoc group gnus-newsrc-alist) gnus-newsrc-alist))) diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el index 1a50697bf5d..67dc379ef81 100644 --- a/lisp/gnus/nnheader.el +++ b/lisp/gnus/nnheader.el @@ -195,8 +195,8 @@ on your system, you could say something like: (defsubst nnheader-head-make-header (number) - "Using data of type 'head in the current buffer - return a full mail header with article NUMBER." + "Return a full mail header with article NUMBER. +Do this using data of type `head' in the current buffer." (let ((p (point-min)) (cur (current-buffer)) in-reply-to chars lines end ref) @@ -306,14 +306,13 @@ on your system, you could say something like: out))))) (defun nnheader-parse-head (&optional naked temp) - "Parse data of type 'header in the current buffer and return a - mail header, modifying the buffer contents in the process. The - buffer is assumed to begin each header with an \"Article - retrieved\" line with an article number; If NAKED is non-nil - this line is assumed absent, and the buffer should contain a - single header's worth of data. If TEMP is non-nil the data is - first copied to a temporary buffer leaving the original buffer - untouched." + "Parse data of type `header' in the current buffer and return a mail header. +Modify the buffer contents in the process. The buffer is assumed +to begin each header with an \"Article retrieved\" line with an +article number; if NAKED is non-nil this line is assumed absent, +and the buffer should contain a single header's worth of data. +If TEMP is non-nil the data is first copied to a temporary buffer +leaving the original buffer untouched." (let ((cur (current-buffer)) (num 0) (beg (point-min)) @@ -326,22 +325,22 @@ on your system, you could say something like: (setq num (read cur) beg (point) end (if (search-forward "\n.\n" nil t) - (goto-char (- (point) 2)) + (goto-char (- (point) 2)) (point))))) - ;; When TEMP copy the data to a temporary buffer + ;; When TEMP copy the data to a temporary buffer. (if temp (progn (set-buffer (setq buf (generate-new-buffer " *nnheader-temp*"))) (insert-buffer-substring cur beg end)) - ;; Otherwise just narrow to the data + ;; Otherwise just narrow to the data. (narrow-to-region beg end)) (let ((case-fold-search t) (buffer-read-only nil) header) (nnheader-remove-cr-followed-by-lf) (ietf-drums-unfold-fws) - (subst-char-in-region (point-min) (point-max) ?\t ? t) - (subst-char-in-region (point-min) (point-max) ?\r ? t) + (subst-char-in-region (point-min) (point-max) ?\t ?\s t) + (subst-char-in-region (point-min) (point-max) ?\r ?\s t) (goto-char (point-min)) (insert "\n") (setq header (nnheader-head-make-header num)) diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 2ec39cf34c9..6ba0334ceb8 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -55,7 +55,7 @@ ;; 'nnir-group-spec is a list with the specification of the ;; groups/servers to search. The format of the 'nnir-group-spec is ;; (("server1" ("group11" "group12")) ("server2" ("group21" -;; "group22"))). If any of the group lists is absent then all groups +;; "group22"))). If any of the group lists is absent then all groups ;; on that server are searched. ;; The output of `nnir-run-query' is a vector, each element of which @@ -335,7 +335,7 @@ Instead, use this: (defcustom nnir-hyrex-remove-prefix (concat (getenv "HOME") "/Mail/") "The prefix to remove from HyREX file names to get group names. -Restulting names have '/' in place of '.'. +Resulting names have '/' in place of '.'. For example, suppose that HyREX returns file names such as \"/home/john/Mail/mail/misc/42\". For this example, use the following @@ -1094,7 +1094,7 @@ Tested with Namazu 2.0.6 on a GNU/Linux system." (nnir-artitem-rsv y))))))))) (defun nnir-run-notmuch (query server &optional groups) - "Run QUERY with GROUPS from SERVER against notmuch. + "Run QUERY with GROUPS from SERVER against notmuch. Returns a vector of (group name, file name) pairs (also vectors, actually). If GROUPS is a list of group names, use them to construct path: search terms (see the variable diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index 460bc63132c..1965a2614f7 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -18,16 +18,16 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . +;; along with GNU Emacs. If not, see . ;;; Commentary: -;; This is a "virtual" backend that allows an aribtrary list of -;; articles to be treated as a gnus group. An nnselect group uses an -;; nnselect-spec group parameter to specify this list of -;; articles. nnselect-spec is an alist with two keys: -;; nnselect-function, whose value should be a function that returns -;; the list of articles, and nnselect-args. The function will be +;; This is a "virtual" backend that allows an arbitrary list of +;; articles to be treated as a Gnus group. An nnselect group uses an +;; `nnselect-spec' group parameter to specify this list of +;; articles. `nnselect-spec' is an alist with two keys: +;; `nnselect-function', whose value should be a function that returns +;; the list of articles, and `nnselect-args'. The function will be ;; applied to the arguments to generate the list of articles. The ;; return value should be a vector, each element of which should in ;; turn be a vector of three elements: a real prefixed group name, an From b2f41a8a18688a3d7eeea94c19864268c9eaf4c8 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 6 Sep 2020 18:34:18 +0200 Subject: [PATCH 15/73] Disable display-warning buttons when doing batch compiles * lisp/emacs-lisp/warnings.el (display-warning): Don't output the buttons when we're not interactive (bug#43244). --- lisp/emacs-lisp/warnings.el | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el index 3a568cb834c..e10c149d89c 100644 --- a/lisp/emacs-lisp/warnings.el +++ b/lisp/emacs-lisp/warnings.el @@ -292,14 +292,17 @@ entirely by setting `warning-suppress-types' or (insert (format (nth 1 level-info) (format warning-type-format typename)) message) - (insert " ") - (insert-button "Disable showing" - 'type 'warning-suppress-warning - 'warning-type type) - (insert " ") - (insert-button "Disable logging" - 'type 'warning-suppress-log-warning - 'warning-type type) + ;; Don't output the buttons when doing batch compilation + ;; and similar. + (unless noninteractive + (insert " ") + (insert-button "Disable showing" + 'type 'warning-suppress-warning + 'warning-type type) + (insert " ") + (insert-button "Disable logging" + 'type 'warning-suppress-log-warning + 'warning-type type)) (funcall newline) (when (and warning-fill-prefix (not (string-match "\n" message))) (let ((fill-prefix warning-fill-prefix) From 3444f397c7d20ca59f7b18f6fe95aa79b33727e5 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 6 Sep 2020 19:04:00 +0200 Subject: [PATCH 16/73] Use a popup menu for