bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#39149: 27.0.50; describe-buffer-bindings is calling :filter function


From: Andreas Schwab
Subject: bug#39149: 27.0.50; describe-buffer-bindings is calling :filter function in wrong buffer
Date: Fri, 30 Oct 2020 16:16:27 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

On Jan 16 2020, yyoncho wrote:

> To reproduce (eval in scratch buffer)
>
> (define-key global-map (kbd "C-c C-l r")
>   `(menu-item "2" switch-to-buffer
>               :filter ,(lambda (cmd)
>                          (print (format "Called in %s" (current-buffer)))
>                          cmd)))
> (with-temp-buffer
>   (with-output-to-string
>     (describe-buffer-bindings (get-buffer "*scratch*") [3 12] t)))
>
> This outputs:
>
> \"Called in  *temp*\"
>
> Expected: the filter function must be called in *scratch* since this is
> the buffer you want to check the bindings.

The problem is that describe-buffer-bindings only changes the buffer to
look up the bindings, but everything that generates the description
(starting with describe-map-tree) doesn't know about that other buffer.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."





reply via email to

[Prev in Thread] Current Thread [Next in Thread]