diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-08-08 15:52:53 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-08-08 15:53:41 +0200 |
commit | 909931cb9ad7251393a81076e9020225fe82845e (patch) | |
tree | a5a374dd5f9f01f9440d3c7edc5c93603f56f2cf /lisp/emacs-lisp/lisp-mode.el | |
parent | ffc81ebc4b5d6cfc827e6a08679da55134f73fb5 (diff) | |
download | emacs-909931cb9ad7251393a81076e9020225fe82845e.tar.gz |
Further lisp-current-defun-name tweaks
* lisp/emacs-lisp/lisp-mode.el (lisp-current-defun-name): Further
tweaks to finding the symbol being defined (defalias).
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 2e7f019aa9e..82afa31ef12 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -776,8 +776,12 @@ decided heuristically.)" (when (and (not name) (string-match-p "\\`def" (symbol-name symbol))) (when-let ((candidate (ignore-errors (read (current-buffer))))) - (when (symbolp candidate) - (setq name candidate)))) + (cond + ((symbolp candidate) + (setq name candidate)) + ((and (consp candidate) + (symbolp (car (delete 'quote candidate)))) + (setq name (car (delete 'quote candidate))))))) (when-let ((result (or name symbol))) (symbol-name result))))))) |