all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marcin Borkowski <mbork@mbork.pl>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Is there a way to convert a keyboard macro to a string?
Date: Thu, 27 Jul 2017 08:22:52 +0200	[thread overview]
Message-ID: <87y3ra2ybn.fsf@jane> (raw)
In-Reply-To: <jwvzibr2gft.fsf-monnier+Inbox@gnu.org>


On 2017-07-26, at 20:40, Stefan Monnier <monnier@IRO.UMontreal.CA> wrote:

>> Thanks, that was _exactly_ what I needed!  This means that what I want
>> is to first use seq-into (wrapped in condition-case), and if that fails,
>> key-description.  Emacs did not disappoint! ;-)
>
> I think that's the wrong approach: the kinds of strings returned
> are different.
>
> E.g for a vector like [?\C-a], seq-into will return a string with
> a single char (the ASCII code 1), whereas key-description will return
> the string "C-a".
>
> The most likely situation is that you always want to use
> `key-description` because the reason for wanting a string is to
> have a human-readable representation of the sequence of events.

Well, I was too concise, sorry.  I mean that if seq-into works, its
result would be fed to insert, and if not, the result of key-description
would be fed into execute-kbd-macro.  This _should_ work, no?

Best,

-- 
Marcin Borkowski



  parent reply	other threads:[~2017-07-27  6:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-26  6:20 Is there a way to convert a keyboard macro to a string? Marcin Borkowski
2017-07-26  6:41 ` Emanuel Berg
2017-07-26  6:43 ` Emanuel Berg
2017-07-26  7:20 ` Héctor Lahoz
2017-07-26  8:52   ` Emanuel Berg
2017-07-26 13:13 ` Stefan Monnier
2017-07-26 16:55   ` Emanuel Berg
2017-07-26 20:22     ` tomas
2017-07-26 20:34       ` Emanuel Berg
2017-07-26 20:51         ` John Mastro
2017-07-26 23:32           ` Emanuel Berg
2017-07-26 18:18   ` Marcin Borkowski
2017-07-26 18:40     ` Stefan Monnier
2017-07-26 20:38       ` Emanuel Berg
2017-07-27  6:22       ` Marcin Borkowski [this message]
2017-07-27 12:54         ` Stefan Monnier
2017-08-08  4:56           ` Marcin Borkowski
2017-08-08  6:32             ` John Ankarström

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=87y3ra2ybn.fsf@jane \
    --to=mbork@mbork.pl \
    --cc=help-gnu-emacs@gnu.org \
    --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.