From 909931cb9ad7251393a81076e9020225fe82845e Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 8 Aug 2022 15:52:53 +0200 Subject: [PATCH] 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 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))))))) -- 2.39.2