purcell / ibuffer-vc

Let Emacs' ibuffer-mode group files by git project etc., and show file state
171 stars 11 forks source link

default group will fail sometime #16

Closed mut0u closed 8 years ago

mut0u commented 8 years ago

I find that under some condition , the Default group will disappear , so the *Message* buffer and some other buffer will grouped in vc-group.

It is like this :

[ Git:~/workspace/rui/rpc-node/ ]
 *%  *Messages*               820 Messages         
  %  *Help*                   478 Help             
[ Git:~/workspace/rui/service/ ]
   = all4payment.clj        18.7k Clojure          ~/workspace/rui/service/src/rui/core/interaction/all4payment.clj
   = protocol.clj            1.3k Clojure          ~/workspace/rui/service/src/rui/core/payment/protocol.clj

     4 buffers                                     2 files, no processes

I have no idea how to fix it.

purcell commented 8 years ago

I think sometimes the vc code gets confused -- occasionally when operating in buffers I get "this file is not under version control" error messages, when I know that that is not the case. (I haven't found either a pattern to this behaviour, or a fix for it.) This would affect ibuffer-vc in the way you've illustrated. So I don't think there's an ibuffer-vc issue here, really, and will go ahead and close this report.

robario commented 8 years ago

I hope this helps @mut0u .

(advice-add 'ibuffer-vc-generate-filter-groups-by-vc-root
              :filter-return
              #'(lambda (ibuffer-filter-groups)
                  (append '(("*" (name . "^\\*"))) ibuffer-filter-groups)))
mut0u commented 8 years ago

Thanks~

purcell commented 8 years ago

@mut0u Aha, from the fix, I can now better understand what you mean. This probably happens when you kill buffers like *Messages* and they are then re-created with a different default-directory. So ibuffer-vc is working correctly here, but if you always want messages (and magit, compilation) buffers etc. to be grouped separately, @robario's fix is the right one.