Subject: bug#69983: Use category for display-buffer-alist

From: Juri Linkov <[email-masked]>
Date: Wed, 27 Mar 2024 09:15:19 +0200

>> Ok, but before proceeding I propose the following change.
>
> Would this imply a change in 'buffer-match-p'?

Indeed, here it a simple change in 'buffer-match-p'
that will support this case:

(add-to-list 'display-buffer-alist
             `((category . comint)
               (display-buffer-in-direction)
	       (direction . top)))

(display-buffer (get-buffer-create "blablabla")
		'(nil (category . comint)))

diff --git a/lisp/subr.el b/lisp/subr.el
index b68aa073ba0..2d104c545f0 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -7502,6 +7502,8 @@ buffer-match-p
                               (push condition buffer-match-p--past-warnings))
                             (apply condition buffer-or-name
                                    (if args nil '(nil)))))))
+                      (`(category . ,category)
+                       (eq (alist-get 'category (car args)) category))
                       (`(major-mode . ,mode)
                        (eq
                         (buffer-local-value 'major-mode buffer)