unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Making `kbd` always return a vector (was: [elpa] externals/transient 022f20e: Explicitly require edmacro)
       [not found] ` <20211023131557.C6FB7207D5@vcs0.savannah.gnu.org>
@ 2021-10-23 14:01   ` Stefan Monnier
  2021-10-24  2:12     ` Making `kbd` always return a vector Po Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2021-10-23 14:01 UTC (permalink / raw)
  To: emacs-devel; +Cc: Jonas Bernoulli

BTW, the patch below is because `transient` needs to manipulate the
return value of `kbd` and in order to avoid the complexity of having to
deal with "sometimes a string sometimes a vector" it passes the
`need-vector` argument to `edmacro-parse-keys`.


        Stefan "who still hasn't encountered a piece of code which
                requires `kbd` to return a string rather than a vector"


Jonas Bernoulli [2021-10-23 09:15:56] wrote:
> branch: externals/transient
> commit 022f20e9581b317bffe3457a2422b3a7075761f6
> Author: Jonas Bernoulli <jonas@bernoul.li>
> Commit: Jonas Bernoulli <jonas@bernoul.li>
>
>     Explicitly require edmacro
>     
>     Changes in Emacs' "master" branch make it necessary for
>     use to require edmacro explicitly.
>     
>     Closes #168.
>     Closes #166.
>     Fixes https://github.com/hlissner/doom-emacs/issues/5670.
> ---
>  lisp/transient.el | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/lisp/transient.el b/lisp/transient.el
> index 8752827..c10db31 100644
> --- a/lisp/transient.el
> +++ b/lisp/transient.el
> @@ -54,6 +54,7 @@
>  
>  (require 'cl-lib)
>  (require 'eieio)
> +(require 'edmacro)
>  (require 'format-spec)
>  (require 'seq)
>  




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Making `kbd` always return a vector
  2021-10-23 14:01   ` Making `kbd` always return a vector (was: [elpa] externals/transient 022f20e: Explicitly require edmacro) Stefan Monnier
@ 2021-10-24  2:12     ` Po Lu
  2021-10-24  2:44       ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Po Lu @ 2021-10-24  2:12 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel, Jonas Bernoulli

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> BTW, the patch below is because `transient` needs to manipulate the
> return value of `kbd` and in order to avoid the complexity of having to
> deal with "sometimes a string sometimes a vector" it passes the
> `need-vector` argument to `edmacro-parse-keys`.
>
>
>         Stefan "who still hasn't encountered a piece of code which
>                 requires `kbd` to return a string rather than a vector"

I think I've seen code that needs that.  I can't remember where though.

(It was probably one of the few packages that display help information
for key sequences as they are being entered.)

But IMO the extra complexity is not a problem, compared to the problems
that can result from breakage in code relying on such vital
functionality.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Making `kbd` always return a vector
  2021-10-24  2:12     ` Making `kbd` always return a vector Po Lu
@ 2021-10-24  2:44       ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2021-10-24  2:44 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel, Jonas Bernoulli

Po Lu [2021-10-24 10:12:08] wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> BTW, the patch below is because `transient` needs to manipulate the
>> return value of `kbd` and in order to avoid the complexity of having to
>> deal with "sometimes a string sometimes a vector" it passes the
>> `need-vector` argument to `edmacro-parse-keys`.
>>
>>
>>         Stefan "who still hasn't encountered a piece of code which
>>                 requires `kbd` to return a string rather than a vector"
>
> I think I've seen code that needs that.  I can't remember where though.

If you (re)find it, I'd love to hear about it.

> (It was probably one of the few packages that display help information
> for key sequences as they are being entered.)

Hmmm sounds likely (since such code will need to handle those
keysequences which can't be represented as strings, so they should
already handle vector outputs correctly).

One of the possible source of incompatibility is that strings and
vectors behave differently w.r.t `equal`.


        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-24  2:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20211023131555.32174.25131@vcs0.savannah.gnu.org>
     [not found] ` <20211023131557.C6FB7207D5@vcs0.savannah.gnu.org>
2021-10-23 14:01   ` Making `kbd` always return a vector (was: [elpa] externals/transient 022f20e: Explicitly require edmacro) Stefan Monnier
2021-10-24  2:12     ` Making `kbd` always return a vector Po Lu
2021-10-24  2:44       ` Stefan Monnier

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).