bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17759: 24.4.50; Missing 'ascii-character props


From: Juri Linkov
Subject: bug#17759: 24.4.50; Missing 'ascii-character props
Date: Fri, 13 Jun 2014 09:30:13 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)

> In the current development version this:
>
>     (get 'kp-7 'ascii-character)
>
> no longer works.  It seems to have been removed in what git shows as
> revision 7f3c6d9a:
>
>   Author: Juri Linkov <juri@jurta.org>
>   Date:   2013-12-13 03:03:04 +0200
>
>   * lisp/simple.el <Keypad support>: Remove key bindings duplicated
>     with bindings.el.
>
> Perhaps the intention is to use only key definitions as the mappings,
> but there is surely code that broke with the change.  (At least
> "calculator.el" did, but I'll fix it if it was intentional.)

Thanks for noticing.  This should be fixed by this patch:

=== modified file 'lisp/bindings.el'
--- lisp/bindings.el    2014-03-20 17:14:45 +0000
+++ lisp/bindings.el    2014-06-13 06:30:04 +0000
@@ -1076,9 +1076,13 @@ (let ((modifiers '(nil (control) (meta)
              (kp-add ?+) (kp-subtract ?-) (kp-multiply ?*) (kp-divide ?/))))
   (dolist (pair keys)
     (dolist (mod modifiers)
-      (define-key function-key-map
-       (vector (append mod (list (nth 0 pair))))
-       (vector (append mod (list (nth 1 pair))))))))
+      (let ((keypad (nth 0 pair))
+           (normal (nth 1 pair)))
+       (when (and (characterp normal) (eq (char-charset normal) 'ascii))
+         (put keypad 'ascii-character normal))
+       (define-key function-key-map
+         (vector (append mod (list keypad)))
+         (vector (append mod (list normal))))))))
 
 (define-key function-key-map [backspace] [?\C-?])
 (define-key function-key-map [delete] [?\C-?])






reply via email to

[Prev in Thread] Current Thread [Next in Thread]