[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 909931cb9a 2/2: Further lisp-current-defun-name tweaks

From: Lars Ingebrigtsen
Subject: master 909931cb9a 2/2: Further lisp-current-defun-name tweaks
Date: Mon, 8 Aug 2022 09:53:48 -0400 (EDT)

branch: master
commit 909931cb9ad7251393a81076e9020225fe82845e
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
 lisp/emacs-lisp/lisp-mode.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 2e7f019aa9..82afa31ef1 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)))))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]