Subject: bug#53540: 29.0.50; Completion support for the NAME field of cl-defmethod

From: Michael Heerdegen <[email-masked]>
Date: Sat, 29 Jan 2022 01:17:32 +0100

Michael Heerdegen <[email-masked]> writes:

>   (cl-defmethod foo|
>
> and try completion at point (M-TAB) at the position indicated with the
> "|" meta marker.

Is this ok?

From 826cf267ba8d65110ef6d338e30033f6cb79d66f Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <[email-masked]>
Date: Thu, 27 Jan 2022 02:56:17 +0100
Subject: [PATCH] Elisp-mode: Fix completion of cl-defmethod NAME arg

Fixes Bug#53540.

* lisp/progmodes/elisp-mode.el (elisp--expect-function-p):
Add "defmethod" to recognized parent expression types.
---
 lisp/progmodes/elisp-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 0dfff32f20..914e4e3836 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -449,7 +449,7 @@ elisp--expect-function-p
                               (regexp-opt '("declare-function"
                                             "function" "defadvice"
                                             "callf" "callf2"
-                                            "defsetf"))
+                                            "defsetf" "defmethod"))
                               "[ \t\r\n]+"))
           (eq (match-end 0) pos)))))))

--
2.30.2

Michael.