Subject: bug#71313: [PATCH] Allow insert other elisp keywords in auto-insert

From: "Elijah G." <[email-masked]>
Date: Sun, 02 Jun 2024 21:14:34 -0600

Eli Zaretskii <[email-masked]> writes:

>> From: "Elijah G." <[email-masked]>
>> Date: Sat, 01 Jun 2024 18:17:42 -0600
>> 
>> this little patch allow insert any package keywords when using
>> auto-insert for insert elisp header lines.
>> 
>> This is more a bugfix, since there is a bug when using Vertico that get
>> stuck in the keywords part, that bug can also apply to other completion
>> UIs or frameworks.
>> 
>> Also there are some packages that uses non-standard keywords, i think it
>> would be better allowing insert other keywords.
>
> I'm not sure why it makes sense to allow keywords that are not in
> finder-known-keywords.  Such a keyword will never be used by any
> finder commands.

You are right, I think I've found a better way for this bugfix.
Please see the new patch attached below, thanks.

>From 2f7f3647e2f623f3fc20fab4d130a66e191f360d Mon Sep 17 00:00:00 2001
From: "Elias G. Perez" <[email-masked]>
Date: Sun, 2 Jun 2024 20:59:23 -0600
Subject: [PATCH] * lisp/autoinsert.el (auto-insert-alist): Allow empty input
 in elisp

Allow insert empty string as initial input.
This should fix bugs from 3rd-party completion UI.
---
 lisp/autoinsert.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el
index f2631422c62..9418590aaee 100644
--- a/lisp/autoinsert.el
+++ b/lisp/autoinsert.el
@@ -212,7 +212,7 @@ auto-insert-alist
 	   finder-known-keywords
 	   "\n"))
  ((let ((minibuffer-help-form v2))
-    (completing-read "Keyword, C-h: " v1 nil t))
+    (completing-read "Keyword, C-h: " v1 nil t nil nil ""))
     str ", ")
  & -2 "
 
-- 
2.44.0.windows.1