Subject: 28.2; insert-kbd-macro creates a unicode character for Alt prefixed keysequences

From: Johnathan Mantey <[email-masked]>
Date: Thu, 27 Jul 2023 10:47:24 -0700

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

In GNU Emacs 28.2 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 
3.24.38, cairo version 1.17.8)
  of 2023-06-05 built on 3a1e14a14abc4d83ad165670c8101e90
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: Fedora Linux 38 (Workstation Edition)

Configured using:
  'configure --build=x86_64-redhat-linux-gnu
  --host=x86_64-redhat-linux-gnu --program-prefix=
  --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
  --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
  --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
  --libexecdir=/usr/libexec --localstatedir=/var --runstatedir=/run
  --sharedstatedir=/var/lib --mandir=/usr/share/man
  --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-png
  --with-rsvg --with-tiff --with-xpm --with-x-toolkit=gtk3 --with-gpm=no
  --with-xwidgets --with-modules --with-harfbuzz --with-cairo --with-json
  --with-native-compilation build_alias=x86_64-redhat-linux-gnu
  host_alias=x86_64-redhat-linux-gnu CC=gcc 'CFLAGS=-DMAIL_USE_LOCKF -O2
  -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches
  -pipe -Wall -Werror=format-security
  -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS
  -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
  -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
  -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
  LDFLAGS=-Wl,-z,relro
  PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
X11 XDBE XIM XPM XWIDGETS GTK3 ZLIB

Important settings:
   value of $LANG: en_US.UTF-8
   value of $XMODIFIERS: @im=none
   locale-coding-system: utf-8-unix

Major mode: Org

Minor modes in effect:
   hexl-follow-ascii: t
   org-roam-db-autosync-mode: t
   global-git-commit-mode: t
   magit-auto-revert-mode: t
   global-undo-tree-mode: t
   undo-tree-mode: t
   selectrum-prescient-mode: t
   org-bullets-mode: t
   yas-global-mode: t
   yas-minor-mode: t
   shell-dirtrack-mode: t
   global-auto-complete-mode: t
   ace-window-display-mode: t
   global-dash-fontify-mode: t
   override-global-mode: t
   selectrum-mode: t
   tooltip-mode: t
   global-eldoc-mode: t
   show-paren-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   global-prettify-symbols-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   column-number-mode: t
   line-number-mode: t
   auto-fill-function: yas--auto-fill
   transient-mark-mode: t
   auto-fill-mode: t

Load-path shadows:
/home/jmanteyx/.emacs.d/site-lisp/paredit hides 
/home/jmanteyx/.emacs.d/elpa/paredit-20221127.1452/paredit
/home/jmanteyx/.emacs.d/elpa/xcscope-20230626.2109/xcscope hides 
/usr/share/emacs/site-lisp/xcscope
/home/jmanteyx/.emacs.d/elpa/clang-format-20191106.950/clang-format 
hides /usr/share/emacs/site-lisp/site-start.d/clang-format
/home/jmanteyx/.emacs.d/elpa/transient-20230602.2121/transient hides 
/usr/share/emacs/28.2/lisp/transient

Features:
(shadow sort mail-extr repeat emacsbug sendmail allout org-colview
company-tng company picture image-file image-converter ange-ftp dns-mode
ps-print ps-print-loaddefs ps-def lpr semantic/edit thumbs ert
semantic/bovine pcmpl-unix re-builder gnus-kill pcmpl-x rect octave
modula2 ox-odt ox-latex ox-icalendar org-agenda ox-html table ox-ascii
ox-publish ox tex-mode holidays hol-loaddefs url-misc opascal delsel
inf-lisp iimage hi-lock cus-edit cus-start cus-load org-duration
erc-goodies erc erc-backend erc-loaddefs image-dired ucs-normalize
srecode/srt-mode semantic/analyze semantic/sort semantic/scope
semantic/analyze/fcn semantic/db semantic/format srecode/template
srecode/srt-wy semantic/wisent semantic/wisent/wisent semantic/ctxt
srecode/ctxt semantic/tag-ls semantic/find srecode/compile
srecode/dictionary srecode/fields srecode/table srecode
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw mode-local cedet time cwarn cap-words superword subword
org-roam-dailies org-archive lsp-modeline lsp-mode lsp-protocol
tree-widget spinner lv inline ht ewoc macros cl-print debug ediff
ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init
ediff-util magit-extras ruler-mode hexl sh-script smie cal-move
org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id
org-roam-node org-roam-db emacsql-sqlite-builtin org-roam-utils
org-roam-compat org-roam org-capture org-attach org-id org-refile
emacsql-sqlite network-stream url-cache rng-xsd xsd-regexp rng-cmpct
rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt
rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap sgml-mode
facemenu nxml-util nxml-enc xmltok dired-aux helpful cc-langs trace
edebug backtrace info-look f f-shortdoc shortdoc help-fns radix-tree
elisp-refs reveal tramp-cmds rfc2104 tramp-cache epa-file find-dired
ffap vc-mtn vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs vc js
executable mule-util misearch multi-isearch display-line-numbers vc-git
vc-dispatcher org-element avl-tree ol-eww eww xdg url-queue mm-url
ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-search eieio-opt
speedbar ezimage dframe gnus-art mm-uu mml2015 mm-view mml-smime smime
dig gnus-sum shr kinsoku svg dom gnus-group gnus-undo gnus-start
gnus-dbus dbus gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo
gnus-spec gnus-int gnus-range gnus-win gnus nnheader wid-edit ol-docview
doc-view jka-compr image-mode exif ol-bibtex ol-bbdb ol-w3m ol-doi
org-link-doi emacsql-sqlite-module sqlite3 sqlite3-api magit-delta
forge-list forge-commands forge-semi forge-bitbucket buck forge-gogs
gogs forge-gitea gtea forge-gitlab glab forge-github ghub-graphql treepy
gsexp ghub url-http url-gw nsm url-auth gnutls forge-notify
forge-revnote forge-pullreq forge-issue forge-topic yaml bug-reference
forge-post markdown-mode forge-repo forge forge-core forge-db closql
emacsql-sqlite-common emacsql emacsql-compiler eieio-base magit-bookmark
magit-submodule magit-blame magit-stash magit-reflog magit-bisect
magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff
smerge-mode diff-mode git-commit log-edit message rmc puny dired
dired-loaddefs rfc822 mml mml-sec epa epg rfc6068 epg-config gnus-util
rmail rmail-loaddefs mm-decode mm-bodies mm-encode mailabbrev mail-utils
gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert
autorevert filenotify magit-margin magit-transient magit-process
with-editor magit-mode transient magit-git magit-base magit-section
cursor-sensor compat compat-29 server xterm-color wgrep grep try
rainbow-delimiters elisp-demos info-colors vterm bookmark face-remap
color term ehelp vterm-module term/xterm xterm man sdcv pos-tip showtip
slime-fancy slime-indentation slime-cl-indent cl-indent
slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references
slime-compiler-notes-tree slime-scratch slime-presentations bridge
slime-macrostep macrostep slime-mdot-fu slime-enclosing-context
slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c
slime-editing-commands slime-autodoc slime-repl elp slime-parse slime
derived lisp-mnt mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums
mail-prsvr gud apropos etags fileloop generator xref arc-mode
archive-mode pp hyperspec slime-autoloads web-mode disp-table undo-tree
diff queue rcirc move-text iedit iedit-lib selectrum-prescient selectrum
minibuf-eldef crm prescient char-fold em-smart esh-mode eshell esh-cmd
esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util
paredit org-bullets ob-clojure ob-C cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs ob-scheme ob-python
python tramp-sh ob-shell ob-perl ob-lisp org org-macro org-footnote
org-pcomplete org-list org-faces org-entities org-version ob-emacs-lisp
org-table oc-basic bibtex org-loaddefs find-func cal-menu calendar
cal-loaddefs ob-tcl ob-restclient ob ob-tangle ol org-src ob-ref ob-lob
ob-table ob-exp ob-comint ob-core ob-eval org-keys oc org-compat
org-macs restclient noutline outline yasnippet-snippets yasnippet advice
flymake-proc flymake project compile text-property-search thingatpt
auto-complete-c-headers tramp tramp-loaddefs trampver tramp-integration
files-x tramp-compat shell pcomplete comint ansi-color parse-time
iso8601 time-date ls-lisp format-spec cl ac-c-headers find-file
auto-complete-config auto-complete popup xcscope ace-window avy ring
edmacro kmacro hl-line comp comp-cstr warnings rx s dash cl-extra
help-mode use-package use-package-ensure use-package-delight
use-package-diminish use-package-bind-key bind-key use-package-core
finder-inf clang-rename clang-include-fixer let-alist clang-format xml
pcase easy-mmode info package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq
byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl
tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads
xwidget-internal dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 2714714 398990)
  (symbols 48 77110 21)
  (strings 32 466298 33825)
  (string-bytes 1 11776448)
  (vectors 16 780296)
  (vector-slots 8 7072092 389334)
  (floats 8 1162 931)
  (intervals 56 59543 9093)
  (buffers 992 53))

-- 
<span style="font-family:&quot;Century
Gothic&quot;,&quot;sans-serif&quot;;color:#1F497D">Johnathan
Mantey<br></span><span style="font-size:10.0pt;font-family:&quot;Century
Gothic&quot;,&quot;sans-serif&quot;;color:#1F497D">Senior Software
Engineer</span><span style="font-family:&quot;Century
Gothic&quot;,&quot;sans-serif&quot;;color:#1F497D"></span><b><span
style="font-size:12.0pt;font-family:&quot;Century
Gothic&quot;,&quot;sans-serif&quot;;color:#555555">azad technology
partners</span></b><b><span
style="font-size:12.0pt;color:#555555"></span></b><b><span
style="font-size:10.0pt;font-family:&quot;Century
Gothic&quot;,&quot;sans-serif&quot;;color:#1F497D">Contributing to
Technology Innovation since 1992</span></b><span
style="font-size:10.0pt;font-family:&quot;Century
Gothic&quot;,&quot;sans-serif&quot;;color:#1F497D"></span><span
style="font-size:10.0pt;font-family:&quot;Century
Gothic&quot;,&quot;sans-serif&quot;;color:#1F497D">Phone: (503)
&nbsp;712-6764<br>Email: &nbsp;</span><span
style="font-size:10.0pt;font-family:&quot;Century
Gothic&quot;,&quot;sans-serif&quot;"><a
href="mailto:[email-masked]">[email-masked]</a></span>