help-gnu-emacs
[Top][All Lists]
Advanced

[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: Tue, 01 Jul 2008 20:29:29 -0600
User-agent: Thunderbird 2.0.0.14 (Macintosh/20080421)

address@hidden wrote:
I asked this question when emacs 21 was current and if I recall there
was some horribly complicated (requiring coding and good knowledge of
elisp) way to do it.

I wondered if with 22 or even 23 one can write the \*Messages\* buffer
to disc as a session progresses any easier than before?

I vaguely remember that thread, but I couldn't find it on the web.  In
any case, I think it's not too complicated (everything worth doing in
Emacs requires a basic knowledge of Emacs Lisp):

(setq message-log-max t); Emacs Lisp!!!

(with-current-buffer (get-buffer "*Messages*")
  (setq buffer-file-name "~/.emacs_messages")
  (setq buffer-offer-save t)) ; just in case

(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)

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

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