emacs-diffs
[Top][All Lists]
Advanced

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

master 90b4ee6575 2/2: Further lisp-current-defun-name tweaks


From: Lars Ingebrigtsen
Subject: master 90b4ee6575 2/2: Further lisp-current-defun-name tweaks
Date: Mon, 15 Aug 2022 01:30:31 -0400 (EDT)

branch: master
commit 90b4ee6575e79da9922433dca17f14e9303676ca
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 make (autoload 'foo) work again.  Perhaps this should
    all be reverted to the original version and then given a new rething.
---
 lisp/emacs-lisp/lisp-mode.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index c31fbec640..c56a9660e7 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -760,7 +760,9 @@ decided heuristically.)"
           ;; If there's an edebug spec, use that to determine what the
           ;; name is.
           (when symbol
-            (let ((spec (get symbol 'edebug-form-spec)))
+            (let ((spec (or (get symbol 'edebug-form-spec)
+                            (and (eq (get symbol 'lisp-indent-function) 'defun)
+                                 (get 'defun 'edebug-form-spec)))))
               (save-excursion
                 (when (and (eq (car-safe spec) '&define)
                            (memq 'name spec))
@@ -768,6 +770,9 @@ decided heuristically.)"
                   (while (and spec (not name))
                     (let ((candidate (ignore-errors (read (current-buffer)))))
                       (when (eq (pop spec) 'name)
+                        (when (and (consp candidate)
+                                   (symbolp (car (delete 'quote candidate))))
+                          (setq candidate (car (delete 'quote candidate))))
                         (setq name candidate
                               spec nil))))))))
           ;; We didn't have an edebug spec (or couldn't find the
@@ -783,7 +788,7 @@ decided heuristically.)"
                      (symbolp (car (delete 'quote candidate))))
                 (setq name (car (delete 'quote candidate)))))))
           (when-let ((result (or name symbol)))
-            (symbol-name result)))))))
+            (and (symbolp result) (symbol-name result))))))))
 
 (defvar-keymap lisp-mode-shared-map
   :doc "Keymap for commands shared by all sorts of Lisp modes."



reply via email to

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