24

Is there a way to disable the Messages buffer? I know I can kill it, but it reappears. I know I can scroll through buffers without passing by Messages, but is there a way I can just disable the creation of it?

Thank you.

David Gomes
  • 5,644
  • 16
  • 60
  • 103
  • 5
    How do you switch buffers? I hope you don't use the horribly inefficient default buffer switching. Check out [iswitchb](http://emacswiki.org/emacs/IswitchBuffers) and then you can go directly to any buffer, so you don't have to pass by *Messages*. The Messages buffer is useful, by the way, you'll learn to appreciate it, for example, when you print out informative messages from elisp. – Tom Apr 15 '12 at 20:01
  • 3
    Don't disable `*Messages*`; it's a bad idea. See http://stackoverflow.com/questions/9536186/emacs-lisp-buffer-out-of-focus-function for some suggestions of ways to stop it (and other such buffers) from getting in your way. – phils Apr 15 '12 at 22:38
  • @Tom, isn't `*Messages*` getting matched when you switch with iswitchb too, adding to the ambiguity of a substring? – katspaugh Aug 27 '12 at 11:04
  • 1
    @katspaugg you can filter out Messages if you want to with the variable iswitchb-buffer-ignore – Tom Aug 27 '12 at 11:33

2 Answers2

26

Based on the answer above, place this in your .emacs to completely disable the messages

;; Forces the messages to 0, and kills the *Messages* buffer - thus disabling it on startup.
(setq-default message-log-max nil)
(kill-buffer "*Messages*")

Also, if you're like me, this is how you remove the Completions buffer that appears when opening a new file from the buffer.

;; Disabled *Completions*
(add-hook 'minibuffer-exit-hook 
      '(lambda ()
         (let ((buffer "*Completions*"))
           (and (get-buffer buffer)
            (kill-buffer buffer)))))
Ole
  • 487
  • 7
  • 20
19

You can customize the variable message-log-max and give a value of nil to disable logging:

Maximum number of lines to keep in the message log buffer.
If nil, disable message logging.  If t, log messages but don't truncate
the buffer when it becomes large.

I tried killing the *Messages* buffer, producing messages (that show on the minibuffer), and no new messages buffer appears.

Juancho
  • 7,207
  • 27
  • 31