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

From: Juri Linkov <[email-masked]>
Date: Mon, 25 Mar 2024 19:12:45 +0200

>> What these variables are trying to achieve is already possible
>> to do by using a 'category' in 'display-buffer-alist'.
>
> Please proceed as carefully as possible, here might be dragons.

Ok, but before proceeding I propose the following change.
To simplify a complicated lambda condition in

(add-to-list 'display-buffer-alist
             `(,(lambda (_buffer-name action)
                  (eq (alist-get 'category action) 'comint))
               (display-buffer-in-direction)
	       (direction . top)))

let's use a symbol instead of the lambda:

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

Then like strings are used as regexp to match a buffer name
symbols will match a category.