unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Can emacs be made to right Messages buffer to disc?
Date: Tue, 01 Jul 2008 20:29:29 -0600	[thread overview]
Message-ID: <g4ep6a$7m0$1@ger.gmane.org> (raw)
In-Reply-To: <87y74ouxqq.fsf@newsguy.com>

reader@newsguy.com 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	other threads:[~2008-07-02  2:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-29 14:22 Can emacs be made to right Messages buffer to disc? reader
2008-07-02  2:29 ` Kevin Rodgers [this message]
2008-07-03  3:56   ` Harry Putnam
2008-07-03  9:37     ` Thien-Thi Nguyen
     [not found] ` <mailman.14105.1214965793.18990.help-gnu-emacs@gnu.org>
2008-07-03 15:18   ` Nordlöw
2008-07-03 19:48     ` Xah
2008-07-03 20:32     ` Kevin Rodgers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='g4ep6a$7m0$1@ger.gmane.org' \
    --to=kevin.d.rodgers@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).