emacs-devel
[Top][All Lists]
Advanced

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

Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'di


From: Juri Linkov
Subject: Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action'
Date: Mon, 03 Jan 2022 23:07:11 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

> Using the tools we have on board we could do something in the spirit of
>
> (defun display-buffer-match-comint (_buffer action)
>   (cadr (assq 'comint (cdr action))))
>
> (customize-set-variable
>  'display-buffer-alist
>  '((display-buffer-match-comint
>     display-buffer-same-window (nil))))
>
> (pop-to-buffer "*shell*" '(nil . ((comint t))))

Or to add more semantics:

  (pop-to-buffer "*shell*" '(nil . ((caller . comint))))

> which means that customizing 'display-buffer-alist' with that value on
> Emacs 28 will report a mismatch but that's the only mishap that should
> happen.
>
> We also could have 'display-buffer-assq-regexp' do
>
>       (when (or (and (stringp key)
>                      (string-match-p key buffer-name))
>                 (and (functionp key)
>                      (funcall key buffer-name action))
>                   (and (symbolp key)
>                        (cadr (assq key (cdr action)))))

That will shorten the above example to

  (customize-set-variable
   'display-buffer-alist
   '((comint
      display-buffer-same-window (nil))))

?

> so we could do away with 'display-buffer-match-comint' but then we would
> have to change the custom type of 'display-buffer-alist' - no great deal
> either.  WDYT?

The obvious downside is the need to tag hundreds of existing calls of
display-buffer, pop-to-buffer, etc.



reply via email to

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