GNU bug report logs - #17759
24.4.50; Missing 'ascii-character props

Previous Next

Package: emacs;

Reported by: Eli Barzilay <eli <at> barzilay.org>

Date: Thu, 12 Jun 2014 10:34:01 UTC

Severity: normal

Found in version 24.4.50

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17759 in the body.
You can then email your comments to 17759 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#17759; Package emacs. (Thu, 12 Jun 2014 10:34:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eli Barzilay <eli <at> barzilay.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 12 Jun 2014 10:34:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Eli Barzilay <eli <at> barzilay.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4.50; Missing 'ascii-character props
Date: Thu, 12 Jun 2014 06:32:37 -0400
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 <at> 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.)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17759; Package emacs. (Fri, 13 Jun 2014 06:33:02 GMT) Full text and rfc822 format available.

Message #8 received at 17759 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Eli Barzilay <eli <at> barzilay.org>
Cc: 17759 <at> debbugs.gnu.org
Subject: Re: bug#17759: 24.4.50; Missing 'ascii-character props
Date: Fri, 13 Jun 2014 09:30:13 +0300
> 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 <at> 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-?])





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17759; Package emacs. (Fri, 13 Jun 2014 12:48:02 GMT) Full text and rfc822 format available.

Message #11 received at 17759 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> jurta.org>
Cc: Eli Barzilay <eli <at> barzilay.org>, 17759 <at> debbugs.gnu.org
Subject: Re: bug#17759: 24.4.50; Missing 'ascii-character props
Date: Fri, 13 Jun 2014 08:46:48 -0400
> +	(when (and (characterp normal) (eq (char-charset normal) 'ascii))

Do you really need the (eq (char-charset normal) 'ascii) test?

The `ascii-character' property doesn't have to be "ascii", really (the
name is just a historical accident which dates back to many moons ago
when ascii meant "plain text"), IIRC it just has to be a "real"
character as opposed to something with modifiers like ?\M-\A-x.


        Stefan




Reply sent to Juri Linkov <juri <at> jurta.org>:
You have taken responsibility. (Sat, 14 Jun 2014 09:52:02 GMT) Full text and rfc822 format available.

Notification sent to Eli Barzilay <eli <at> barzilay.org>:
bug acknowledged by developer. (Sat, 14 Jun 2014 09:52:03 GMT) Full text and rfc822 format available.

Message #16 received at 17759-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Barzilay <eli <at> barzilay.org>, 17759-done <at> debbugs.gnu.org
Subject: Re: bug#17759: 24.4.50; Missing 'ascii-character props
Date: Sat, 14 Jun 2014 12:50:35 +0300
>> +	(when (and (characterp normal) (eq (char-charset normal) 'ascii))
>
> Do you really need the (eq (char-charset normal) 'ascii) test?
>
> The `ascii-character' property doesn't have to be "ascii", really (the
> name is just a historical accident which dates back to many moons ago
> when ascii meant "plain text"), IIRC it just has to be a "real"
> character as opposed to something with modifiers like ?\M-\A-x.

Yes, the name is confusing, so I installed it without the ascii test.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17759; Package emacs. (Sat, 14 Jun 2014 21:16:01 GMT) Full text and rfc822 format available.

Message #19 received at 17759-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> jurta.org>
Cc: Eli Barzilay <eli <at> barzilay.org>, 17759-done <at> debbugs.gnu.org
Subject: Re: bug#17759: 24.4.50; Missing 'ascii-character props
Date: Sat, 14 Jun 2014 17:15:18 -0400
>>> +	(when (and (characterp normal) (eq (char-charset normal) 'ascii))
>> Do you really need the (eq (char-charset normal) 'ascii) test?
>> The `ascii-character' property doesn't have to be "ascii", really (the
>> name is just a historical accident which dates back to many moons ago
>> when ascii meant "plain text"), IIRC it just has to be a "real"
>> character as opposed to something with modifiers like ?\M-\A-x.

> Yes, the name is confusing, so I installed it without the ascii test.

I think we could largely get rid of this ascii-character property: it's
only used in `read-char' and in 99% of the case we could advantageously
replace `read-char' with something that uses `read-key' instead (where
the translation from an event to a character is done via
function-key-map instead of ascii-character).


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 13 Jul 2014 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 312 days ago.

Previous Next


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