[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can emacs be made to right Messages buffer to disc?

From: Kevin Rodgers
Subject: Re: Can emacs be made to right Messages buffer to disc?
Date: Thu, 03 Jul 2008 14:32:46 -0600
User-agent: Thunderbird (Macintosh/20080421)

Nordlöw wrote:
(defun save-messages-buffer ()
   (with-current-buffer (get-buffer "*Messages*")
     (save-buffer 0))) ; or just (basic-save-buffer)

(add-hook 'pre-command-hook 'save-messages-buffer)
(add-hook 'post-command-hook 'save-messages-buffer)

This behaviour is not that useable as it constantly clutters the
minibuffer with the message "Wrote ~/.emacs_message". Can we make save-
buffer() silent perhaps?

It also writes to disc every time every time we navigate in the source
code which I believe is not that good for performance. I believe a
better solution would be to auto-save the buffer reguarly using a time
interval. Somebody know how?

That message comes from write-region, which fortunately provide a way to
silence it:

(defun save-messages-buffer ()
  (with-current-buffer (get-buffer "*Messages*")
    ;; (save-buffer 0) or even just (basic-save-buffer) is too noisy, so
    ;; we lose their functionality (including basic-save-buffer-1 and
    ;; basic-save-buffer-2):
    (when (and buffer-file-name
      (write-region (point-min) (point-max) buffer-file-name
                    nil 'quiet))))

Kevin Rodgers
Denver, Colorado, USA

reply via email to

[Prev in Thread] Current Thread [Next in Thread]