]> git.eshelyaron.com Git - emacs.git/commitdiff
Further lisp-current-defun-name tweaks
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 9 Aug 2022 17:19:29 +0000 (19:19 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 9 Aug 2022 17:21:36 +0000 (19:21 +0200)
* lisp/emacs-lisp/lisp-mode.el (lisp-current-defun-name): Tweak so
that cl-defmethod and friends work again.

lisp/emacs-lisp/lisp-mode.el

index 1bc2c0ece6d93c1515122da4107f7a9d8f6b4188..c31fbec640c072252382743dccdf3688b6b0f638 100644 (file)
@@ -774,7 +774,7 @@ decided heuristically.)"
           ;; name).  If the symbol starts with \"def\", then it's
           ;; likely that the next symbol is the name.
           (when (and (not name)
-                     (string-match-p "\\`def" (symbol-name symbol)))
+                     (string-match-p "\\(\\`\\|-\\)def" (symbol-name symbol)))
             (when-let ((candidate (ignore-errors (read (current-buffer)))))
               (cond
                ((symbolp candidate)