diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-09-10 10:45:02 +0200 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-09-10 10:45:02 +0200 |
commit | a26b14733bba6659548f00db634bc45ccd222447 (patch) | |
tree | 4b0e1d39334c03a90ce718a3e051be60ca28822b /lisp/emacs-lisp/advice.el | |
parent | 107514a6e21f2c434cdae0eca76fe0a60e287ac8 (diff) | |
parent | 931b9f5953013c1e8844d0c723411b87ccfedb1a (diff) | |
download | emacs-a26b14733bba6659548f00db634bc45ccd222447.tar.gz emacs-a26b14733bba6659548f00db634bc45ccd222447.tar.bz2 emacs-a26b14733bba6659548f00db634bc45ccd222447.zip |
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'lisp/emacs-lisp/advice.el')
-rw-r--r-- | lisp/emacs-lisp/advice.el | 14 |
1 files changed, 7 insertions, 7 deletions
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)))) |