unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eduardo Ochs <eduardoochs@gmail.com>
Cc: mattiase@acm.org, 61647@debbugs.gnu.org
Subject: bug#61647: edit-kbd-macro: Wrong type argument: characterp, 134217785
Date: Mon, 20 Feb 2023 12:39:25 +0100	[thread overview]
Message-ID: <m14jrg8t1u.fsf@yahoo.es> (raw)
In-Reply-To: <CADs++6iqR6KrTz3LTeEm3yoHwQqF2M_5_L7V_ZQ8x8d-Gxzsnw@mail.gmail.com> (Eduardo Ochs's message of "Mon, 20 Feb 2023 02:31:25 -0300")

Eduardo Ochs <eduardoochs@gmail.com> writes:

> Hi all, I found a keyboard macro on which edit-kbd-macro fails with
> this error:
>
>   edit-kbd-macro: Wrong type argument: characterp, 134217785
>
> To reproduce the error run any of these two setqs - they should be
> equivalent -
>
>   (setq last-kbd-macro [134217847 134217785 134217785 134217834 5 32
>     25 1 67108896 down 134217847 134217777 134217834 return 25
>     134217803 134217803])
>
>   (setq last-kbd-macro (kbd "M-w M-99 M-j C-e SPC C-y C-a C-SPC <down>
>     M-w M-1 M-j RET C-y 2*M-K"))
>
> and then run `M-x edit-kbd-macro C-x e'.
>

This is the commit that introduced this regression:

commit e5695faec4a43f10be3b56fa7fd436d5f54a5761
Author: Mattias Engdegård <mattiase@acm.org>
Date:   Fri Aug 19 13:27:53 2022 +0200

    * lisp/edmacro.el (edmacro-sanitize-for-string): Fix condition.
    
    This is of little consequence in practice since the input is always a
    vector of keys representing a prefix, where bit 7 isn't likely to be
    set when higher bits are set, but it silences a (justified) warning.

diff --git a/lisp/edmacro.el b/lisp/edmacro.el
index efffab9b30b..26a5d2347f0 100644
--- a/lisp/edmacro.el
+++ b/lisp/edmacro.el
@@ -626,7 +626,7 @@ edmacro-sanitize-for-string
 This function assumes that the events can be stored in a string."
   (setq seq (copy-sequence seq))
   (cl-loop for i below (length seq) do
-           (when (logand (aref seq i) 128)
+           (when (/= (logand (aref seq i) 128) 0)
              (setf (aref seq i) (logand (aref seq i) 127))))
   seq)
 
Adding Mattias to the CC.





  reply	other threads:[~2023-02-20 11:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20  5:31 bug#61647: edit-kbd-macro: Wrong type argument: characterp, 134217785 Eduardo Ochs
2023-02-20 11:39 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-02-20 12:18   ` Mattias Engdegård
2023-02-20 13:05     ` Eli Zaretskii
2023-02-21  9:33       ` Mattias Engdegård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m14jrg8t1u.fsf@yahoo.es \
    --to=bug-gnu-emacs@gnu.org \
    --cc=61647@debbugs.gnu.org \
    --cc=eduardoochs@gmail.com \
    --cc=mardani29@yahoo.es \
    --cc=mattiase@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).