GNU bug report logs -
#38775
(kbd "C-x ( ... C-x )") gulps "C-x (" and "C-x )"
Previous Next
Reported by: Kritixi Lithos <kritixilithos <at> gmail.com>
Date: Sat, 28 Dec 2019 15:20:01 UTC
Severity: minor
Fixed in version 29.1
Done: Lars 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 38775 in the body.
You can then email your comments to 38775 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#38775
; Package
emacs
.
(Sat, 28 Dec 2019 15:20:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Kritixi Lithos <kritixilithos <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 28 Dec 2019 15:20:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From `emacs -Q`, I write `(kbd "C-x ( C-d C-x )")` in the buffer, then
evaluate it using `C-M-x`, which gives "^D" instead of the expected
"^X(^D^X)". This can be seen more clearly by calling `key-description`
with the result from `kbd`, resulting in "C-d" instead of the expected
original string "C-x ( C-d C-x )". (Thanks to thblt from #emacs for this
minimal example).
The original problem was found when trying to call emacs keystrokes on
an input file (with the goal of achieving something like vim with the
`-c` flag) like so,
`emacs -Q --insert input.txt --eval '(command-execute(kbd"C-x ( C-d M-0
C-x )"))'`
Running this removes only 1 character from the input file instead of
every character being deleted as expected.
Another instance of this bug is https://emacs.stackexchange.com/q/33395
(thanks again to thblt for finding this).
These results were as tested on GNU Emacs 26.3.
In GNU Emacs 26.3 (build 1, x86_64-apple-darwin19.0.0)
of 2019-10-01 built on Catalina.local
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list... [2 times]
Configured using:
'configure --disable-dependency-tracking --disable-silent-rules
--enable-locallisppath=/usr/local/share/emacs/site-lisp
--infodir=/usr/local/Cellar/emacs/26.3/share/info/emacs
--prefix=/usr/local/Cellar/emacs/26.3 --with-gnutls --without-x
--with-xml2 --without-dbus --with-modules --without-ns
--without-imagemagick'
Configured features:
NOTIFY ACL GNUTLS LIBXML2 ZLIB MODULES THREADS
Important settings:
value of $LC_ALL: en_US.UTF-8
value of $LC_CTYPE: UTF-8
locale-coding-system: utf-8-unix
Major mode: Lisp Interaction
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
electric-indent-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail tool-bar rmail-loaddefs mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
regexp-opt rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
term/screen term/xterm xterm time-date elec-pair mule-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type tabulated-list
replace newcomment text-mode elisp-mode lisp-mode prog-mode register
page menu-bar rfn-eshadow isearch timer select mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame 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 charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads kqueue
multi-tty make-network-process emacs)
Memory information:
((conses 16 93401 5763)
(symbols 48 19401 1)
(miscs 40 35 71)
(strings 32 27575 976)
(string-bytes 1 742301)
(vectors 16 11803)
(vector-slots 8 448648 7552)
(floats 8 49 254)
(intervals 56 209 13)
(buffers 992 12))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#38775
; Package
emacs
.
(Sat, 28 Dec 2019 15:47:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 38775 <at> debbugs.gnu.org (full text, mbox):
On Dez 28 2019, Kritixi Lithos wrote:
> From `emacs -Q`, I write `(kbd "C-x ( C-d C-x )")` in the buffer, then
> evaluate it using `C-M-x`, which gives "^D" instead of the expected
> "^X(^D^X)".
That's because kbd is just a wrapper around read-kbd-macro.
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#38775
; Package
emacs
.
(Sat, 28 Dec 2019 17:25:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 38775 <at> debbugs.gnu.org (full text, mbox):
> From: Andreas Schwab <schwab <at> linux-m68k.org>
> Date: Sat, 28 Dec 2019 16:46:25 +0100
> Cc: 38775 <at> debbugs.gnu.org
>
> On Dez 28 2019, Kritixi Lithos wrote:
>
> > From `emacs -Q`, I write `(kbd "C-x ( C-d C-x )")` in the buffer, then
> > evaluate it using `C-M-x`, which gives "^D" instead of the expected
> > "^X(^D^X)".
>
> That's because kbd is just a wrapper around read-kbd-macro.
Yes, and FWIW Emacs always worked like that (I checked a far back as
Emacs 23.1).
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#38775
; Package
emacs
.
(Sat, 28 Dec 2019 18:24:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 38775 <at> debbugs.gnu.org (full text, mbox):
> Yes, and FWIW Emacs always worked like that (I checked a far back as
> Emacs 23.1).
FWIW, I just checked Emacs 20.7, and it's the same.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#38775
; Package
emacs
.
(Sat, 28 Dec 2019 21:56:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 38775 <at> debbugs.gnu.org (full text, mbox):
> That's because kbd is just a wrapper around read-kbd-macro.
Ah, intended behaviour then, read-kbd-macro's help file documents this
so that resolves the issue. Thank you all for your swift replies.
So how would you solve the original problem of calling emacs
keystrokes with potential keyboard macros inside them?
`command-execute` appears to use `execute-kbd-macro` according to the
source, so trying `command-execute` on each keystroke does not work as
intended with `C-x ( ... C-x )` among the commands.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#38775
; Package
emacs
.
(Mon, 30 Aug 2021 02:25:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 38775 <at> debbugs.gnu.org (full text, mbox):
Kritixi Lithos <kritixilithos <at> gmail.com> writes:
> So how would you solve the original problem of calling emacs
> keystrokes with potential keyboard macros inside them?
> `command-execute` appears to use `execute-kbd-macro` according to the
> source, so trying `command-execute` on each keystroke does not work as
> intended with `C-x ( ... C-x )` among the commands.
Good question. More generally, given the textual representations of any
number of Emacs keystrokes, do we have a way to get those replayed
programmatically? I thought we had (on top of `call-last-kbd-macro' or
edmacro), but I can't really find anything now?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#38775
; Package
emacs
.
(Tue, 03 May 2022 14:23:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 38775 <at> debbugs.gnu.org (full text, mbox):
Kritixi Lithos <kritixilithos <at> gmail.com> writes:
> So how would you solve the original problem of calling emacs
> keystrokes with potential keyboard macros inside them?
> `command-execute` appears to use `execute-kbd-macro` according to the
> source, so trying `command-execute` on each keystroke does not work as
> intended with `C-x ( ... C-x )` among the commands.
I've now fixed this in Emacs 29. `key-parse' now returns [24 40 4 24
41] for that sequence, while `kbd' maintains the backwards-compat code.
(This has been broken for half a year and nobody noticed -- in Emacs 29,
(kbd "C-x ( C-d C-x )") returned "" instead of "^D", so it's debatable
whether it makes sense to keep the compat code, but at least we do for
now.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
bug marked as fixed in version 29.1, send any further explanations to
38775 <at> debbugs.gnu.org and Kritixi Lithos <kritixilithos <at> gmail.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Tue, 03 May 2022 14:23:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#38775
; Package
emacs
.
(Tue, 03 May 2022 14:40:01 GMT)
Full text and
rfc822 format available.
Message #28 received at 38775 <at> debbugs.gnu.org (full text, mbox):
Cool, thanks!
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 01 Jun 2022 11:24:07 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 21 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.