GNU bug report logs - #64912
28.2; insert-kbd-macro creates a unicode character for Alt prefixed keysequences

Previous Next

Package: emacs;

Reported by: Johnathan Mantey <johnathanx.mantey <at> intel.com>

Date: Fri, 28 Jul 2023 07:12:01 UTC

Severity: normal

Tags: fixed

Found in version 28.2

Fixed in version 29.1

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Robert Pluim <rpluim <at> gmail.com>
To: Johnathan Mantey <johnathanx.mantey <at> intel.com>
Cc: 64912 <at> debbugs.gnu.org
Subject: Re: bug#64912: 28.2; insert-kbd-macro creates a unicode character
 for Alt prefixed keysequences
Date: Fri, 28 Jul 2023 11:57:13 +0200
>>>>> On Thu, 27 Jul 2023 10:47:24 -0700, Johnathan Mantey <johnathanx.mantey <at> intel.com> said:

    Johnathan> I created a keyboard macro that used the zap-to-char (Alt-z) keyboard
    Johnathan> sequence.
    Johnathan> The macro functions correctly in the session in which it was created.
    Johnathan> The macro is given a name.
    Johnathan> The macro is inserted into an elisp file using insert-kbd-macro.
    Johnathan> The macro, abbreviated here, creates an invalid character.
    Johnathan>    (fset 'test-macro
    Johnathan>    (kmacro-lambda-form [?\C-a ?ú ?\; ?\C-k] 0 "%d"))
    Johnathan> Evaluating this form causes the named macro to quit working.
    Johnathan> Instead of performing zap-to-char ';' it inserts the unicode char.
    Johnathan> Rerecording the macro using ESC, naming, and saving results in:
    Johnathan> macro to function correctly.
    Johnathan>    (fset 'test-macro
    Johnathan>    (kmacro-lambda-form [?\C-a escape ?z ?\; ?\C-k] 0 "%d"))
    Johnathan> Re-evaluating this source results in the macro functioning correctly.

This works correctly in emacs-29, where the resulting macro form now
uses the `key-parse' syntax instead of the internal vector syntax, so
you get:

    (defalias 'test-macro
       (kmacro "C-a M-z ; C-k"))

From etc/NEWS:

** Kmacro
Kmacros are now OClosures and have a new constructor 'kmacro' which
uses the 'key-parse' syntax.  It replaces the old 'kmacro-lambda-form'
(which is now declared obsolete).

Robert
-- 




This bug report was last modified 2 years and 25 days ago.

Previous Next


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