minad / consult

:mag: consult.el - Consulting completing-read
GNU General Public License v3.0
1.12k stars 98 forks source link

additional set of buffers in consult-buffer-sources #959

Closed TitusMu closed 2 months ago

TitusMu commented 2 months ago

I would love to have the ephemeral buffers sorted in an extra category below the regular buffers when calling consult-buffer. The following definition doesn't work. It does sort them as wanted, but when I choose them, the buffer doesn't switch to Messages or scratch, it just stays as the current buffer. (The regular buffers can be chosen in the upper part of the consult-menu as usual.)

What did I do wrong?

    (setq consult-buffer-sources
          '(consult--source-hidden-buffer 
            consult--source-modified-buffer
            consult--source-buffer
            (:name "Ephemeral" :narrow 109
                 :category buffer :items
                   ("*Messages*"
                    "*scratch*"
                    "*Async-native-compile-log*"
                    "*Bookmark List*"))))

    (setq consult-buffer-filter
          '("\\` "
            "\\`\\*Completions\\*\\'"
            "\\`\\*scratch\\*\\'"
            "\\`\\*Messages\\*\\'"
            "\\`\\*Bookmark List\\*\\'"
            "\\`\\*EMMS-Log\\*\\'"
            "\\`\\*Flymake log\\*\\'"
            "\\`\\*Semantic SymRef\\*\\'"
            "\\`\\*tramp/.*\\*\\'"))

I need to filter them, so they are not listed twice, but just in the extra category. And neither :category buffer nor :category 'buffer works.

I am grateful for any advice.

I am using Emacs 30.0.50 and Consult 1.3.