bug#81613: [PATCH] Make vc-dir use display-buffer instead of pop-to-buffer

Juri Linkov <[email protected]>
Newsgroups gmane.emacs.bugs
Organization LINKOV.NET
Message-ID <[email protected]>
> I cannot make it work.

Actually, there are 3 separate problems here.

1. A paren with extra nested level was missing:

    (setq display-buffer-alist
          '(((derived-mode . vc-dir-mode)
             (display-buffer-reuse-mode-window
              display-buffer-in-tab)
             (mode . vc-dir-mode))))

   Maybe we need to create a syntax checker for 'display-buffer-alist'?

2. But still you can't always match mode in 'display-buffer-alist',
   because 'vc-dir' enables 'vc-dir-mode' after displaying the buffer
   for the newly created *vc-dir* buffer.

   So until 'vc-dir' will be changed to enable
   'vc-dir-mode' before displaying the buffer,
   'display-buffer-alist' can reliably match only
   the buffer name (until a category is added
   to its 'pop-to-buffer' call):

    (setq display-buffer-alist
          '(("\\`\\*vc-dir\\*\\'"
             (display-buffer-in-tab))))

3. To disable the effect of selecting the window
with the vc-dir buffer by 'pop-to-buffer', it's possible
to use 'post-command-select-window':

    (setq display-buffer-alist
          '(("\\`\\*vc-dir\\*\\'"
             (display-buffer-below-selected)
             (post-command-select-window . nil))))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.