diff options
author | Robert Pluim <rpluim@gmail.com> | 2024-07-16 16:05:40 +0200 |
---|---|---|
committer | Robert Pluim <rpluim@gmail.com> | 2024-07-17 10:56:17 +0200 |
commit | a1f29998bf49c85c2eddc1201657639fdd494ef2 (patch) | |
tree | 53ead7892e3e508947427a2e66d583f46b1b4d85 /lisp/emacs-lisp/find-func.el | |
parent | 5684fc5207e15adc2647a08bb9e6205fde112fa6 (diff) | |
download | emacs-a1f29998bf49c85c2eddc1201657639fdd494ef2.tar.gz emacs-a1f29998bf49c85c2eddc1201657639fdd494ef2.tar.bz2 emacs-a1f29998bf49c85c2eddc1201657639fdd494ef2.zip |
Add history variables for find-func entry points
* lisp/emacs-lisp/find-func.el (find-function--read-history-library):
New defvar.
(read-library-name): Use it in 'completing-read' calls.
(find-function--read-history-function,
find-function--read-history-variable, find-function--read-history-face):
New defvars.
(find-function-read): Use them in 'completing-read' calls.
Diffstat (limited to 'lisp/emacs-lisp/find-func.el')
-rw-r--r-- | lisp/emacs-lisp/find-func.el | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index ce783983b77..a320a00608d 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -323,6 +323,8 @@ customizing the candidate completions." (switch-to-buffer (find-file-noselect (find-library-name library))) (run-hooks 'find-function-after-hook))) +(defvar find-function--read-history-library nil) + ;;;###autoload (defun read-library-name () "Read and return a library name, defaulting to the one near point. @@ -351,12 +353,14 @@ if non-nil)." (when (and def (not (test-completion def table))) (setq def nil)) (completing-read (format-prompt "Library name" def) - table nil nil nil nil def)) + table nil nil nil + find-function--read-history-library def)) (let ((files (read-library-name--find-files dirs suffixes))) (when (and def (not (member def files))) (setq def nil)) (completing-read (format-prompt "Library name" def) - files nil t nil nil def))))) + files nil t nil + find-function--read-history-library def))))) (defun read-library-name--find-files (dirs suffixes) "Return a list of all files in DIRS that match SUFFIXES." @@ -575,6 +579,10 @@ is non-nil, signal an error instead." (let ((func-lib (find-function-library function lisp-only t))) (find-function-search-for-symbol (car func-lib) nil (cdr func-lib)))) +(defvar find-function--read-history-function nil) +(defvar find-function--read-history-variable nil) +(defvar find-function--read-history-face nil) + (defun find-function-read (&optional type) "Read and return an interned symbol, defaulting to the one near point. @@ -597,7 +605,9 @@ otherwise uses `variable-at-point'." (list (intern (completing-read (format-prompt "Find %s" symb prompt-type) obarray predicate - 'lambda nil nil (and symb (symbol-name symb))))))) + 'lambda nil + (intern (format "find-function--read-history-%s" prompt-type)) + (and symb (symbol-name symb))))))) (defun find-function-do-it (symbol type switch-fn) "Find Emacs Lisp SYMBOL in a buffer and display it. |