|
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 09:45:59 +0200 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) |
>> > Then a condition predicate could check for this tag: >> > >> > (defun display-buffer-comint (buffer-name action) >> > (assq 'comint action)) >> > >> If we do that we should first make a list of possible tags like 'occur' >> or 'info' and check whether we should provide similar functions for them >> too. > > 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: #+begin_src emacs-lisp (defun display-buffer-from-grep-p (_buffer-name _action) (with-current-buffer (window-buffer) (or (derived-mode-p 'compilation-mode) (derived-mode-p 'xref--xref-buffer-mode)))) (add-to-list 'display-buffer-alist '(display-buffer-from-grep-p (display-buffer-same-window (inhibit-same-window . nil)))) #+end_src So it's possible to do the same for the inbound buffer: #+begin_src emacs-lisp (defun display-buffer-to-comint-p (buffer-name _action) (with-current-buffer (get-buffer buffer-name) (derived-mode-p 'comint-mode))) (add-to-list 'display-buffer-alist '(display-buffer-to-comint-p (display-buffer-same-window (inhibit-same-window . nil)))) #+end_src
[Prev in Thread] | Current Thread | [Next in Thread] |