unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Joe Corneli <jcorneli@math.utexas.edu>
Subject: Re: How to automatically write *Messages" buffer to a file?
Date: Wed, 24 Nov 2004 14:28:21 -0600	[thread overview]
Message-ID: <E1CX3kT-0004gj-00@linux183.ma.utexas.edu> (raw)
In-Reply-To: <jwv7jobc8o4.fsf-monnier+gnu.emacs.help@gnu.org> (message from Stefan Monnier on Wed, 24 Nov 2004 20:16:30 GMT)

   >   (make-variable-buffer-local 'after-change-functions)

   Never use `make-variable-buffer-local' on a variable which belongs to some
   other package.  You want to use `make-local-variable' instead.

   Note that in the above case you don't need either of them because
   after-change-functions is already automatically made buffer-local.  And even
   if you wanted to make it buffer-local manually, you shouldn't use
   make-local-variable but make-local-hook since after-change-functions is
   a hook.

   >   (setq after-change-functions
   >          '(log-message))
   [...]
   >   (setq after-change-functions nil)

   Never use `setq' on a hook.  Use `add-hook' or `remove-hook'.

I didn't know it was a hook (though I did think to myself that it was
very hook-like).  The variable name is not descriptive.  Maybe it
should be aliased to or renamed `after-change-hook'.

   As for your question, don't use `append-to-file', use `write-region'
   instead, and pass `quiet' as the VISIT argument to prevent the message.

Shouldn't advice to `write-region' be sufficient?  `append-to-file'
just calls this function.  True, using `write-region' is more
transparent (and I had an error in my advice to this function), but I
don't see why advising `write-region' and then calling
`append-to-file' wouldn't work.

  reply	other threads:[~2004-11-24 20:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1150.1101268518.27204.help-gnu-emacs@gnu.org>
2004-11-24 14:06 ` How to automatically write *Messages" buffer to a file? Pascal Bourguignon
2004-11-24 15:52   ` Eli Zaretskii
2004-11-24 19:01     ` Joe Corneli
     [not found]     ` <mailman.1295.1101323448.27204.help-gnu-emacs@gnu.org>
2004-11-24 20:16       ` Stefan Monnier
2004-11-24 20:28         ` Joe Corneli [this message]
     [not found]         ` <mailman.1305.1101328729.27204.help-gnu-emacs@gnu.org>
2004-11-24 20:55           ` Stefan Monnier
2004-11-24 21:52             ` Joe Corneli
2004-11-24 22:19             ` Drew Adams
2004-11-25  4:56             ` Joe Corneli
     [not found]             ` <mailman.1370.1101359173.27204.help-gnu-emacs@gnu.org>
2004-11-25 20:20               ` Stefan Monnier
2004-11-24 22:00           ` Thien-Thi Nguyen
2004-11-25  4:52             ` Joe Corneli
2004-12-01 19:08 ` Kevin Rodgers
2004-11-24  3:43 Brad Collins

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=E1CX3kT-0004gj-00@linux183.ma.utexas.edu \
    --to=jcorneli@math.utexas.edu \
    /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).