diff options
| author | Lars Ingebrigtsen | 2022-08-15 07:30:11 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-08-15 07:30:25 +0200 |
| commit | 90b4ee6575e79da9922433dca17f14e9303676ca (patch) | |
| tree | 6c9eb8061a2ee17fd546184e7c8721a3a5421ff7 | |
| parent | 97da8eeb7c739ca549c9769996fc6da326d587fc (diff) | |
| download | emacs-90b4ee6575e79da9922433dca17f14e9303676ca.tar.gz emacs-90b4ee6575e79da9922433dca17f14e9303676ca.zip | |
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.
| -rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index c31fbec640c..c56a9660e7c 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -760,7 +760,9 @@ decided heuristically.)" | |||
| 760 | ;; If there's an edebug spec, use that to determine what the | 760 | ;; If there's an edebug spec, use that to determine what the |
| 761 | ;; name is. | 761 | ;; name is. |
| 762 | (when symbol | 762 | (when symbol |
| 763 | (let ((spec (get symbol 'edebug-form-spec))) | 763 | (let ((spec (or (get symbol 'edebug-form-spec) |
| 764 | (and (eq (get symbol 'lisp-indent-function) 'defun) | ||
| 765 | (get 'defun 'edebug-form-spec))))) | ||
| 764 | (save-excursion | 766 | (save-excursion |
| 765 | (when (and (eq (car-safe spec) '&define) | 767 | (when (and (eq (car-safe spec) '&define) |
| 766 | (memq 'name spec)) | 768 | (memq 'name spec)) |
| @@ -768,6 +770,9 @@ decided heuristically.)" | |||
| 768 | (while (and spec (not name)) | 770 | (while (and spec (not name)) |
| 769 | (let ((candidate (ignore-errors (read (current-buffer))))) | 771 | (let ((candidate (ignore-errors (read (current-buffer))))) |
| 770 | (when (eq (pop spec) 'name) | 772 | (when (eq (pop spec) 'name) |
| 773 | (when (and (consp candidate) | ||
| 774 | (symbolp (car (delete 'quote candidate)))) | ||
| 775 | (setq candidate (car (delete 'quote candidate)))) | ||
| 771 | (setq name candidate | 776 | (setq name candidate |
| 772 | spec nil)))))))) | 777 | spec nil)))))))) |
| 773 | ;; We didn't have an edebug spec (or couldn't find the | 778 | ;; We didn't have an edebug spec (or couldn't find the |
| @@ -783,7 +788,7 @@ decided heuristically.)" | |||
| 783 | (symbolp (car (delete 'quote candidate)))) | 788 | (symbolp (car (delete 'quote candidate)))) |
| 784 | (setq name (car (delete 'quote candidate))))))) | 789 | (setq name (car (delete 'quote candidate))))))) |
| 785 | (when-let ((result (or name symbol))) | 790 | (when-let ((result (or name symbol))) |
| 786 | (symbol-name result))))))) | 791 | (and (symbolp result) (symbol-name result)))))))) |
| 787 | 792 | ||
| 788 | (defvar-keymap lisp-mode-shared-map | 793 | (defvar-keymap lisp-mode-shared-map |
| 789 | :doc "Keymap for commands shared by all sorts of Lisp modes." | 794 | :doc "Keymap for commands shared by all sorts of Lisp modes." |