I would like to catch popup buffers with display-buffer-alist
by their major-mode instead of matching the buffer name with a regexp.
For example I have dired-mode buffers that popup and I can't come up with proper regexp that would only match dired-mode buffer names.
It would be nice if I could instead do something like this:
(setq display-buffer-alist
'((string= major-mode "dired-mode")
(display-buffer-same-window)))
I understand that their are packages such as popwin and shackle that can do this but these packages do not work for my use case.
regexp
and a custom function that handles all incoming buffers that are processed through thedisplay-buffer-alist
-- if the buffer coming through has a particular major-mode that my custom function looks for, then it is handled according to my pre-programmed method. I will probably not write up a minimal answer for this particular thread, but if you would like to see a more complex example of how this works, see my previous question/answer on stackoverflow.com: stackoverflow.com/q/18346785/2112489(eq major-mode 'dired-mode)