all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Francesco Potorti` <pot@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 3907@emacsbugs.donarmstrong.com
Subject: bug#3907: bad result for insert-kbd-macro
Date: Wed, 29 Jul 2009 13:44:56 +0200	[thread overview]
Message-ID: <E1MW7aa-0005pr-PU@tucano.isti.cnr.it> (raw)
In-Reply-To: <jwvmy6vgk0n.fsf-monnier+emacsbugreports@gnu.org>

>> I created a macro and called insert-kbd-macro on it.  This is the
>> result:
>
>> (fset 'allegati
>>    [?e ?\C-[ ?< ?\C-s ?t ?e ?x ?t ?/ ?h ?t ?m ?l ?\C-m ?\C-[ ?{ ?\C-[ ?{ ?\C-[ ?} ?\C-x ?q ?\C-[ ?x ?k ?e ?e ?p ?\C-m ?f ?i ?l ?e ?n ?a ?m ?e ?= ?\C-m ?\C-m ?\C-m ?\C-[ ?% ?. ?* ?f ?i ?l ?e ?n ?a ?m ?e ?= ?\" ?\\ ?( ?[ ?^ ?\" ?] ?+ ?\\ ?) ?\" ?\C-m ?  ?[ ?  ?\\ ?1 ?  ?] ?\C-m ?! ?\C-m ?\C-m ?\C-m ?\C-x ?q ?\C-c ?\C-c ?o ?\C-[ ?\C-? ?i ?s ?i ?\C-m ?\C-[ ?p ?  ?d ?\C-[ ?> up ?\C-c ?\C-c ?\C-m])
>
>> 1) first, if I go to the end of the macro and hit C-x C-e, it appears
>>    that the sexp is not correctly evaluated, as the parser sees
>>    unbalanced parentheses
>
>This is a bug in the emacs-lisp-mode, mostly.  But indeed, the printer
>should also be more careful to escape the chars that cause problem for
>the emacs-lisp-mode (i.e. print ?\[ rather than ?[ in your above
>example).
>This said, IIUC the printer used in Emacs-23 does pay attention this
>problem and insert-kbd-macro gave me (for example):
>
>   (setq last-kbd-macro
>      [?a left ?\[])
>
>so the problem seems to be fixed in Emacs-23.  Can you confirm?

Yes.  In fact, I thought I had tried in Emacs 23, but by error I was
running Emacs 22...

>> 2) second, insert-kbd-macro used to write the strings between double
>>    quotes, which is generally more readable and allows for easy editing;
>>    I do not know wht it used the vector style here
>
>There's an `up' symbol in there, which couldn't fit in a string.
>In general an event is not a char any more (it used to be, back in the
>tty days when bytes and chars were the same thing), so a sequence of
>events should preferably always be represented as an array of events,
>rather than as a string (although, insert-kbd-macro still appears to use
>a string when possible).

Right, thank you for the explanation.





      reply	other threads:[~2009-07-29 11:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-23 16:04 bug#3907: bad result for insert-kbd-macro Francesco Potorti`
2009-07-23 21:55 ` Stefan Monnier
2009-07-29 11:44   ` Francesco Potorti` [this message]

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

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

  git send-email \
    --in-reply-to=E1MW7aa-0005pr-PU@tucano.isti.cnr.it \
    --to=pot@gnu.org \
    --cc=3907@emacsbugs.donarmstrong.com \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.