[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: |
martin rudalics |
Subject: |
Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action' |
Date: |
Mon, 3 Jan 2022 19:21:51 +0100 |
>> Perhaps the customized value structure should simply refer to major mode(s)?
>>
>> Then there won't be a need to create a predefined list with mappings.
>
> Indeed, this is what I use for the outbound buffer:
It's not sufficiently general. For example, 'shell' first pops up the
buffer and then sets its major mode with an explanation that goes as
;; The buffer's window must be correctly set when we call comint
;; (so that comint sets the COLUMNS env var properly).
(pop-to-buffer buffer)
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))))
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)))))
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?
martin
- Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action', Madhu, 2022/01/02
- Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action', Juri Linkov, 2022/01/02
- Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action', martin rudalics, 2022/01/02
- Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action', Dmitry Gutov, 2022/01/02
- Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action', Juri Linkov, 2022/01/03
- Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action',
martin rudalics <=
- Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action', Stefan Monnier, 2022/01/03
- Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action', martin rudalics, 2022/01/04
- Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action', Stefan Monnier, 2022/01/04
- Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action', Juri Linkov, 2022/01/03
- Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action', martin rudalics, 2022/01/04
- Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action', martin rudalics, 2022/01/06
- Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action', Juri Linkov, 2022/01/06
- Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action', martin rudalics, 2022/01/07
- Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action', Sam Steingold, 2022/01/07
- Re: master 18b680cfd1: Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action', Eli Zaretskii, 2022/01/07