When I run M-x ibuffer, it keeps adding [size greater than: 0] into top iBuffer file, which increases its file size. Would it be possible to prevent it?


(add-hook 'ibuffer-hook (lambda ()(ibuffer-filter-by-size-gt 0)))

(add-hook 'ibuffer-mode-hook
          (lambda ()
            (ibuffer-auto-mode 1)
            (ibuffer-switch-to-saved-filter-groups "default")))

// Here first line in the ibuffer keeps appending

IBuffer by recency (Auto) [size greater than: 0] [size greater than: 0] [size greater than: 0] [size greater than: 0] [size greater than: 0] ....
[ project ]

 MRL Name                    Size Mode             Filename/Process
 --- ----                    ---- ----             ----------------
[ Default ]
     *scratch*                145 Lisp Interaction
 *%  *Messages*               [keep increases] Messages

Related questions: How can I prevent empty files from showing up on the Ibuffer list?

  • Cannot reproduce: that message gets added to the header line of the buffer, not to the buffer itself. And it certainly does not grow: it always contains one instance of the [size greater than: 0] message. Do C-h i g (elisp)Header lines to read about the header line. Also try emacs -q -l minimal.el with a minimal.el containing only the above customizations: if it behaves as I describe, the fault is with (the rest of) your init file. That's something that you should always check: 99.9% of all problems I encounter are of my own making.
    – NickD
    Jul 13, 2021 at 1:43
  • @NickD Thanks it is ways nice to learn from experts. I have updated my question with the minimal.el file I was using. The way I run is emacs -q -nw -l ~/personalize/emacs/minimal.el doo.py. I kept doing M-x ibuffer and do it again inside the ibuffer-buffer. And *Messages* 780 Messages should increment and [size greater than: 0] added on the top line. Please note that I am using GNU Emacs 26.3
    – alper
    Jul 13, 2021 at 13:54
  • That's exactly what I mean: you are loading all the packages that you've installed as part of your so-called "minimal" setup: you need to shed all that in order to test what works and what doesn't, then reintroduce them one step at a time to see what breaks it.
    – NickD
    Jul 13, 2021 at 14:34
  • BTW, *Messages* is going to increment in size: everytime anybody uses message it will log a message (by default in the echo area and in the *Messages* buffer). That can be turned off I think, but I would never do that and I recommend that you don't do it either: being able to look at the messages is an indispensable part of figuring out problems. I would suggest you filter the *Messages* buffer from the ibuffer list if you don't want to see it. However, the header line should not change.
    – NickD
    Jul 13, 2021 at 14:50
  • Got it, I have tried again by removing all the packages and the same issue exist. Can the returned string could be changed from [size greater than: 0] to an empty string""? Since we cannot change the header line I will keep everything as it is.
    – alper
    Jul 13, 2021 at 15:24

1 Answer 1


[This is probably a bad answer, but I no longer know what the question is]

  • If you are getting the '[size greater than 0:]` message repeatedly in the header-line and you want to investigate and remove the cause of that, then you need to debug your init file. I cannot reproduce that with a minimal init file containing just the following and I assume that you will find the same behavior if you use this minimal init file:
(add-hook 'ibuffer-hook (lambda ()
                          (ibuffer-filter-by-size-gt 0)))

(add-hook 'ibuffer-mode-hook
      (lambda ()
        (ibuffer-auto-mode 1)
        (ibuffer-switch-to-saved-filter-groups "default")))

(define-key ctl-x-map (kbd "C-b") #'ibuffer)

  • If you are worried about the fact that the *Messages* buffer is increasing, you should filter out that buffer from the ibuffer listing. Interactively, /*/! will get rid of all starred buffers; /n \*Messages\* RET /! will just filter out the *Messages* buffer.

  • If you don't want to see the header line at all, you should customize the ibuffer-use-header-line option.

  • If you want to save a set of filters for future use, you can use /s <name> and you can restore those filters later with /r <name> or add them to whatever filters you have already defined with /a <name>.

  • Do C-h m in an ibuffer-mode buffer to find out more about what you can do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.