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: Thu, 03 Jul 2008 14:32:46 -0600	[thread overview]
Message-ID: <g4jd1d$m97$1@ger.gmane.org> (raw)
In-Reply-To: <87aa006d-ef83-4521-989d-90520ab82513@j22g2000hsf.googlegroups.com>

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
	       (buffer-modified-p))
       (write-region (point-min) (point-max) buffer-file-name
		    nil 'quiet))))

-- 
Kevin Rodgers
Denver, Colorado, USA





      parent reply	other threads:[~2008-07-03 20:32 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
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 [this message]

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='g4jd1d$m97$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).