GNU bug report logs - #55079
28.1; kp-decimal not working in vhdl-stutter-mode

Previous Next

Package: emacs;

Reported by: Cyril Arnould <cyril.arnould <at> outlook.com>

Date: Sat, 23 Apr 2022 09:53:01 UTC

Severity: normal

Tags: moreinfo

Found in version 28.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Cyril Arnould <cyril.arnould <at> outlook.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 55079 <at> debbugs.gnu.org
Subject: bug#55079: 28.1; kp-decimal not working in vhdl-stutter-mode
Date: Sat, 23 Apr 2022 14:28:05 +0300
> From: Cyril Arnould <cyril.arnould <at> outlook.com>
> Date: Sat, 23 Apr 2022 09:47:03 +0000
> 
> This bug has been around forever, it just never occurred to me to file
> a report for it. To reproduce the error:
> 
> 1. Open an empty .vhd file
> 2. Enable vhdl-stutter-mode (C-c RET C-s)
> 3. With Num Lock on, press the kp-decimal key.
> 
> Instead of it printing a dot, I receive the following error message:
> 
> funcall-interactively: Wrong type argument: number-or-marker-p,
> kp-decimal
> 
> If vhdl-stutter-mode is off, the key will print a dot as expected. As a
> workaround, I have remapped [kp-decimal] to [?.] in my .emacs file.

Does the patch below give good results?

Stefan, is this too kludgey? if so, is there a more elegant way?

diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 642aad5..76eb801 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -8785,7 +8785,13 @@ vhdl-electric-comma
 (defun vhdl-electric-period (count) "`..' --> ` => '"
   (interactive "p")
   (if (and vhdl-stutter-mode (= count 1) (not (vhdl-in-literal)))
-      (cond ((= (preceding-char) vhdl-last-input-event)
+      (cond ((or (and (integerp vhdl-last-input-event)
+                      (= (preceding-char) vhdl-last-input-event))
+                 (and (eq vhdl-last-input-event 'kp-decimal)
+                      (equal (lookup-key local-function-key-map
+                                         (vector vhdl-last-input-event))
+                             [?.])
+                      (= (preceding-char) ?.)))
 	     (progn (delete-char -1)
 		    (unless (eq (preceding-char) ? ) (insert " "))
 		    (insert "=> ")))




This bug report was last modified 3 years and 24 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.