bug#46727: 27.1; Only the first function from prefix-command-echo-keystrokes-functions is used

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#46727: 27.1; Only the first function from prefix-command-echo-keystrokes-functions is used

Lars Ingebrigtsen
Miha Rihtaršič <[hidden email]> writes:

> Greetings.
>
> Looking at the function internal-echo-keystrokes-prefix, it is heavily
> implied that all functions from
> `prefix-command-echo-keystrokes-functions` should be used and their
> return values concatenated. This isn't the case, however, because
> `run-hook-wrapped` aborts on first non-nil returned value. The following
> simple patch fixes this.

[...]

>              (run-hook-wrapped 'prefix-command-echo-keystrokes-functions
> -                              (lambda (fun) (push (funcall fun) strs)))
> +                              (lambda (fun) (push (funcall fun) strs) nil))

Thanks.

I poked around in the code, and I think your interpretation here must be
correct, and I've applied your patch to Emacs 28.  (Besides, `push' has
an undefined return value...  and always returns non-nil, so the old
code would, as you said, never use more than the first function in
`prefix-command-echo-keystrokes-functions'.)

This change was small enough to apply without assigning copyright to the
FSF, but for future patches you want to submit, it might make sense to
get the paperwork started now, so that subsequent patches can be applied
speedily. Would you be willing to sign such paperwork?

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Reply | Threaded
Open this post in threaded view
|

bug#46727: 27.1; Only the first function from prefix-command-echo-keystrokes-functions is used

Basil L. Contovounesios
Lars Ingebrigtsen <[hidden email]> writes:

> (Besides, `push' has an undefined return value...

(Except it's defined as being equivalent to (setf T (cons H T)) ;)

--
Basil



Reply | Threaded
Open this post in threaded view
|

bug#46727: 27.1; Only the first function from prefix-command-echo-keystrokes-functions is used

Basil L. Contovounesios
Lars Ingebrigtsen <[hidden email]> writes:

> "Basil L. Contovounesios" <[hidden email]> writes:
>
>> Lars Ingebrigtsen <[hidden email]> writes:
>>
>>> (Besides, `push' has an undefined return value...
>>
>> (Except it's defined as being equivalent to (setf T (cons H T)) ;)
>
> The doc string says that it's "morally equivalent", but the return value
> is left undefined by (Stefan M's) choice, if I recall correctly from a
> discussion from some decades ago.

Its manual entry is not as weak in its choice of words.

--
Basil