]> git.eshelyaron.com Git - emacs.git/commitdiff
Further lisp-current-defun-name tweaks
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 8 Aug 2022 13:52:53 +0000 (15:52 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 8 Aug 2022 13:53:41 +0000 (15:53 +0200)
* 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

index 2e7f019aa9ef6abea91b8184dd1cc936eada3a75..82afa31ef12e1a2e2a11d57de68ef4d68def9ee1 100644 (file)
@@ -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)))))))