[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is there a way to convert a keyboard macro to a string?
From: |
Marcin Borkowski |
Subject: |
Re: Is there a way to convert a keyboard macro to a string? |
Date: |
Thu, 27 Jul 2017 08:22:52 +0200 |
User-agent: |
mu4e 0.9.19; emacs 26.0.50 |
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
- Re: Is there a way to convert a keyboard macro to a string?, (continued)
Re: Is there a way to convert a keyboard macro to a string?, Marcin Borkowski, 2017/07/26