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

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

Re: Saving the Messages buffer


From: Emanuel Berg
Subject: Re: Saving the Messages buffer
Date: Tue, 21 Jan 2014 23:18:55 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Sivaram Neelakantan <nsivaram.net@gmail.com> writes:

> Is there an option to simply save the messages buffer
> after certain number of lines/chars?  I'm running
> into some strange issues when ntemacs kicks off
> openssl in cygwin and I'd like to save the messages
> buffer to debug the issue.
>
> Simply saving the buffer to the same named file with
> overwrite option?

One way to do it would be to use the auto-save which
Emacs already uses.

;; These are my values (which are probably default) but
;; even if you already have them, and the mode enabled,
;; it might be interesting to see - use `C-x e' with
;; point to the right of the symbol's names to echo
;; their values. (Otherwise just setup as you please.)

(auto-save-mode)              ; enable auto-save
(setq auto-save-interval 300) ; auto-save every 300 keydowns
(setq auto-save-timeout 30)   ; or after 30 seconds of idle

;; whenever so, save the messages buffer
(add-hook 'auto-save-hook
          (lambda ()
            (with-current-buffer "*Messages*"
              (write-file "~/emacs_messages" nil) ))) ; nil: no confirm

-- 
underground experts united:
http://user.it.uu.se/~embe8573


reply via email to

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