GNU bug report logs - #54100
29.0.50; Allow project-buffers to ignore some buffers

Previous Next

Package: emacs;

Reported by: Manuel Uberti <manuel.uberti <at> inventati.org>

Date: Tue, 22 Feb 2022 08:28:01 UTC

Severity: normal

Found in version 29.0.50

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 54100 <at> debbugs.gnu.org (full text, mbox):

From: Manuel Uberti <manuel.uberti <at> inventati.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>, 54100 <at> debbugs.gnu.org
Subject: Re: bug#54100: 29.0.50; Allow project-buffers to ignore some buffers
Date: Wed, 23 Feb 2022 10:48:37 +0100
[Message part 1 (text/plain, inline)]
On 23/02/22 07:56, Manuel Uberti wrote:
> On 23/02/22 03:49, Dmitry Gutov wrote:
>> I suppose we can add a var similar to project-kill-buffer-conditions, call it 
>> project-switch-[to-]buffer-conditions, and have project-switch-to-buffer use it.
>>
>> Care to write a patch?
>>
>> You're already the best person to evaluate its performance, so... ;-)

I attached a patch. Let me know if I missed something or am approach the matter 
in a wrong way.

To try my code I used the following predicate (mu-ignored-buffers is in the 
first message of this ticket):

(defun mu-buffer-predicate (buffer)
  "Check if BUFFER is NOT a member of `mu-ignored-buffers'."
  (not (seq-contains-p mu-ignored-buffers
                       (buffer-name (cdr buffer))
                       #'string-match-p)))

And this setting:

(setq-default project-switch-to-buffer-conditions '(mu-buffer-predicate))

Note that I didn't bump the package-version on 
`project-switch-to-buffer-conditions' because I don't know if it is required.

-- 
Manuel Uberti
www.manueluberti.eu
[0001-Add-project-switch-to-buffer-conditions.patch (text/x-patch, attachment)]

This bug report was last modified 3 years and 143 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.