[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#22673: 24.5; global set key neg freaks out emacs
From: |
Noam Postavsky |
Subject: |
bug#22673: 24.5; global set key neg freaks out emacs |
Date: |
Tue, 05 Jun 2018 20:02:53 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
retitle 22673 execute-kbd-macro doesn't handle strings with characters in range
(0x80..0xFF) correctly
quit
Andreas Schwab <schwab@suse.de> writes:
> Thomas Lynch <thomas.lynch@reasoningtechnology.com> writes:
>
>> Evaluate the following
>>
>> (global-set-key (kbd "C-x g neg") "¬")
A more straightforward way is (execute-kbd-macro "¬"). Use
(setq debug-ignored-errors (remq 'user-error debug-ignored-errors)
debug-on-error t)
to get a backtrace.
> This is the same as binding [?\C-x ?g ?n ?e ?g] to [?\M-,]. You should
> use the vector notation instead:
>
> (global-set-key (kbd "C-x g neg") [?¬])
(execute-kbd-macro [?¬]) works, but shouldn't the string version work
too? I see that it fails because of this statement in keyboard.c:
c = Faref (Vexecuting_kbd_macro, make_number (executing_kbd_macro_index));
if (STRINGP (Vexecuting_kbd_macro)
&& (XFASTINT (c) & 0x80) && (XFASTINT (c) <= 0xff))
XSETFASTINT (c, CHAR_META | (XFASTINT (c) & ~0x80));
Which transforms ?¬ (aka #xac) into #x800002c == (event-convert-list '(meta ?,))
- bug#22673: 24.5; global set key neg freaks out emacs,
Noam Postavsky <=