GNU bug report logs -
#7541
24.0.50; define-key error message for non-prefix M-[char]
Previous Next
Reported by: Don March <don <at> ohspite.net>
Date: Fri, 3 Dec 2010 16:45:02 UTC
Severity: minor
Tags: fixed, patch
Found in version 24.0.50
Fixed in version 24.1
Done: Lars Magne Ingebrigtsen <larsi <at> gnus.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 7541 in the body.
You can then email your comments to 7541 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7541
; Package
emacs
.
(Fri, 03 Dec 2010 16:45:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Don March <don <at> ohspite.net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 03 Dec 2010 16:45:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Typing and evaluating the following code in the scratch
buffer results in an (appropriate) error, but with an incorrect
message:
(setq new-kmap (make-sparse-keymap))
(define-key new-kmap [?a 27] 'command)
(define-key new-kmap [?a ?\M-x] 'command)
;; Debugger entered--Lisp error:
;; (error "Key sequence a M-x starts with non-prefix key a")
;; (should be:
;; "Key sequence a M-x starts with non-prefix key a ESC")
The code in keymap.c loops over the characters in the key sequence and
says to report everything before the current character as the
non-prefix key. But that misses the case when M-x is converted into
[27 ?x] and it's the `27' part that causes the error.
Please see the attached patch.
A few other cases that show the problem:
(setq a (make-sparse-keymap))
(define-key a [27] 'command)
(define-key a [?\M-x] 'command)
;; Debugger entered--Lisp error:
;; (error "Key sequence M-x starts with non-prefix key ")
;; (should be:
;; "Key sequence M-x starts with non-prefix key ESC")
(setq new-kmap (make-sparse-keymap))
(define-key new-kmap [?a 27] 'command)
(define-key new-kmap [?a 27 ?x] 'command)
;; Debugger entered--Lisp error:
;; (error "Key sequence a M-x starts with non-prefix key a ESC")
;; (error text is correct)
(setq new-kmap (make-sparse-keymap))
(define-key new-kmap [?a] 'command)
(define-key new-kmap [?a ?\M-x] 'command)
;; Debugger entered--Lisp error:
;; (error "Key sequence a M-x starts with non-prefix key a")
;; (error text is correct)
In GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.22.0)
of 2010-12-03 on lappy
Windowing system distributor `The X.Org Foundation', version 11.0.10900000
[define-key_diff (application/octet-stream, attachment)]
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7541
; Package
emacs
.
(Sun, 03 Jul 2011 13:41:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 7541 <at> debbugs.gnu.org (full text, mbox):
Don March <don <at> ohspite.net> writes:
> Typing and evaluating the following code in the scratch
> buffer results in an (appropriate) error, but with an incorrect
> message:
>
> (setq new-kmap (make-sparse-keymap))
> (define-key new-kmap [?a 27] 'command)
> (define-key new-kmap [?a ?\M-x] 'command)
> ;; Debugger entered--Lisp error:
> ;; (error "Key sequence a M-x starts with non-prefix key a")
> ;; (should be:
> ;; "Key sequence a M-x starts with non-prefix key a ESC")
>
> The code in keymap.c loops over the characters in the key sequence and
> says to report everything before the current character as the
> non-prefix key. But that misses the case when M-x is converted into
> [27 ?x] and it's the `27' part that causes the error.
Your patch for this bug looks correct, but it's more than 10 lines long,
so the FSF needs copyright assignment papers for the code.
Do you have such paperwork on file with the FSF?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7541
; Package
emacs
.
(Sun, 03 Jul 2011 16:25:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 7541 <at> debbugs.gnu.org (full text, mbox):
I just sent an email to assign <at> gnu.org. I'll report back when the
process is complete.
On Sun, Jul 3, 2011 at 9:39 AM, Lars Magne Ingebrigtsen <larsi <at> gnus.org> wrote:
> Don March <don <at> ohspite.net> writes:
>
>> Typing and evaluating the following code in the scratch
>> buffer results in an (appropriate) error, but with an incorrect
>> message:
>>
>> (setq new-kmap (make-sparse-keymap))
>> (define-key new-kmap [?a 27] 'command)
>> (define-key new-kmap [?a ?\M-x] 'command)
>> ;; Debugger entered--Lisp error:
>> ;; (error "Key sequence a M-x starts with non-prefix key a")
>> ;; (should be:
>> ;; "Key sequence a M-x starts with non-prefix key a ESC")
>>
>> The code in keymap.c loops over the characters in the key sequence and
>> says to report everything before the current character as the
>> non-prefix key. But that misses the case when M-x is converted into
>> [27 ?x] and it's the `27' part that causes the error.
>
> Your patch for this bug looks correct, but it's more than 10 lines long,
> so the FSF needs copyright assignment papers for the code.
>
> Do you have such paperwork on file with the FSF?
>
> --
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog http://lars.ingebrigtsen.no/
>
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7541
; Package
emacs
.
(Sun, 03 Jul 2011 16:31:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 7541 <at> debbugs.gnu.org (full text, mbox):
Don March <don <at> ohspite.net> writes:
> I just sent an email to assign <at> gnu.org. I'll report back when the
> process is complete.
Great!
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7541
; Package
emacs
.
(Mon, 01 Aug 2011 21:26:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 7541 <at> debbugs.gnu.org (full text, mbox):
Okay, I just got an email saying my copyright assignment papers have
been received and executed.
On Sun, Jul 3, 2011 at 12:30 PM, Lars Magne Ingebrigtsen <larsi <at> gnus.org> wrote:
> Don March <don <at> ohspite.net> writes:
>
>> I just sent an email to assign <at> gnu.org. I'll report back when the
>> process is complete.
>
> Great!
>
> --
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog http://lars.ingebrigtsen.no/
>
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#7541
; Package
emacs
.
(Tue, 02 Aug 2011 15:30:03 GMT)
Full text and
rfc822 format available.
Message #20 received at 7541 <at> debbugs.gnu.org (full text, mbox):
Don March <don <at> ohspite.net> writes:
> Okay, I just got an email saying my copyright assignment papers have
> been received and executed.
Thanks; I've now applied the patch.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
Added tag(s) fixed.
Request was from
Lars Magne Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Tue, 02 Aug 2011 15:30:04 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 24.1, send any further explanations to
7541 <at> debbugs.gnu.org and Don March <don <at> ohspite.net>
Request was from
Lars Magne Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Tue, 02 Aug 2011 15:30:04 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 31 Aug 2011 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 14 years and 9 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.