|
From: | Dmitry Gutov |
Subject: | bug#59153: List project buffers |
Date: | Sun, 13 Nov 2022 04:37:15 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 |
On 12.11.2022 20:02, Juri Linkov wrote:
+ (display-buffer (list-buffers-noselect arg nil filter-predicate))))I suppose we'll need an arity check here? So that this command also works in older emacsen with an install of project.el from ELPA.Ah, I forgot about older emacsen.Alternatively, the command could set the value of Buffer-menu-filter-predicate inside the resulting buffer, rather than pass it as an argument to list-buffers-noselect.Setting a buffer-local variable looks like a safer option since Stefan M. warned many times that an arity check is not reliable.
Catching the wrong-number-of-arguments error is a established way of handling this.
But we could also, for example, introduce a new function which receives a predicate, instead of adding a new arg to list-buffers-noselect.
Or just use an Emacs version check. It doesn't feel as nice, but should work fine nevertheless.
But then need to display buffer twice: first call list-buffers-noselect without an argument, then set buffer-local Buffer-menu-filter-predicate, then programmatically revert the buffer.
[Prev in Thread] | Current Thread | [Next in Thread] |