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

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

bug#54100: 29.0.50; Allow project-buffers to ignore some buffers


From: Manuel Uberti
Subject: bug#54100: 29.0.50; Allow project-buffers to ignore some buffers
Date: Fri, 25 Feb 2022 07:44:51 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 25/02/22 03:33, Dmitry Gutov wrote:
Doesn't this mean that it won't do the (memq ... buffers) check and thus ignore the result of the (project-buffers pr) call?

Instead, it could be a lambda like

           (lambda (buffer)
             ;; BUFFER is an entry (BUF-NAME . BUF-OBJ) of Vbuffer_alist.
             (and (memq (cdr buffer) buffers)
                  (funcall predicate buffer)))

Does that make sense?

Totally, thank you!

(I would also try to shorten the new defcustom's docstring by referring to the existing one, but I can make that change myself.)

Done.

Or if you wanted to stay on "or" but make it easier for certain usage pattern, you could call the var 'project-ignore-buffer-conditions' (or "hide" or etc), and change its use appropriately. Then the value could contain

   '((not mu-project-buffer-p)
     (derived-mode . comint-mode))

...and (not mu-project-buffer-p) could obviously be rewritten in a negated way in the function's definition.

I followed your suggestion and used `project-ignore-buffer-conditions' in the attached patch.

Now everything works as expected when I use this:

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

(setq-default project-ignore-buffer-conditions '(mu-project-ignore-buffer-p
                                                 (derived-mode . dired-mode)))


Again, thank you for the help on this.

--
Manuel Uberti
www.manueluberti.eu

Attachment: 0001-Add-project-ignore-buffer-conditions.patch
Description: Text Data


reply via email to

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