Subject: Re: bug#76756: 31.0.50; Cannot insert 'n' in customize-dirlocals's Lisp expr field

From: Mauro Aranda <[email-masked]>
Date: Wed, 5 Mar 2025 06:30:17 -0300

tags 76756 patch
quit

Visuwesh <[email-masked]> writes:

 > To reproduce,
 >
 >     1. emacs -Q
 >     2. M-x customize-dirlocals RET
 >     3. Press INS button
 >     4. Click on "i" in nil in the Lisp expression field
 >     5. Say 'n'
 >     6. Observe how it moves forward widget than inserting the character
 >        n.
 >
 >

Thanks.  Looks like some widgets are not picking up the right keymap.

I think the attached patch fixes it.

From d446b2f4290c68be8b056207124d48c21456668b Mon Sep 17 00:00:00 2001
From: Mauro Aranda <[email-masked]>
Date: Wed, 5 Mar 2025 06:23:16 -0300
Subject: [PATCH] Fix some widgets in customize-dirlocals

* lisp/cus-edit.el (custom-dynamic-cons-value-create): Make sure
to eval the keymap property.  (Bug#76756)
---
 lisp/cus-edit.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 5ce940bd0e5..e0e39b72c76 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -5992,7 +5992,7 @@ custom-dynamic-cons-value-create
          (val (car value)))
     (cond
      ((eq val 'mode) (setf (nth 1 args)
-                           '(symbol :keymap custom-dirlocals-field-map
+                           `(symbol :keymap ,custom-dirlocals-field-map
                                     :tag "Minor mode")))
      ((eq val 'unibyte) (setf (nth 1 args) '(boolean)))
      ((eq val 'subdirs) (setf (nth 1 args) '(boolean)))
@@ -6001,7 +6001,7 @@ custom-dynamic-cons-value-create
         (when (custom--editable-field-p w)
           (widget-put w :keymap custom-dirlocals-field-map))
         (setf (nth 1 args) w)))
-     (t (setf (nth 1 args) '(sexp :keymap custom-dirlocals-field-map))))
+     (t (setf (nth 1 args) `(sexp :keymap ,custom-dirlocals-field-map))))
     (widget-put (nth 0 args) :keymap custom-dirlocals-field-map)
     (widget-group-value-create widget)))
 
-- 
2.34.1