unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: emacs-devel@gnu.org
Subject: Re: Defcustom write-file-functions and write-contents-functions?
Date: Wed, 31 Dec 2003 13:27:08 -0600 (CST)	[thread overview]
Message-ID: <200312311927.hBVJR8H29112@raven.dms.auburn.edu> (raw)
In-Reply-To: <iluu13gx5jj.fsf@latte.josefsson.org> (message from Simon Josefsson on Wed, 31 Dec 2003 18:26:08 +0100)

Simon Josefsson wrote:

   The example I gave, copyright-update, appear to be intended for users.

This does not contradict what I said.  From its documentation,
`write-contents-functions' seems to be a mode-specific way to save
files, `write-file-functions' appears to be a file-specific way to do
so.  Custom can not really handle either buffer-local or file-local
customization.  Personally, I believe you need a new _normal_ hook,
intended to be called unconditionally.

   This could work too.  My reason for choosing w-f-f was that
   copyright.el suggested it, and I want to use custom to enable that
   package.

That suggestion was wrong, because w-f-f is _not_ unconditionally run.
It is the third of a bunch of hooks called in an `or' form in
`basic-save-buffer'.  If any of the two prior hooks in the or form
takes care of saving the file, w-f-f is _not_ run.  (I personally
believe that the docstring and the definition in he Elisp manual
should mention this.)  Your patch replaced it with w-c-f.  This is
better, because that is the first hook in the `or' form.  But major
modes would seem free to override anything the user customized using
your defcustom, because the variable is intended to be set
buffer-locally by major modes.

Again, I personally believe that for what you want to do, one needs a
new normal hook, to be called unconditionally, _before_ the `or' form
in `basic-save-buffer'.

Sincerely,

Luc.

  reply	other threads:[~2003-12-31 19:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-31 14:38 Defcustom write-file-functions and write-contents-functions? Simon Josefsson
2003-12-31 16:57 ` Luc Teirlinck
2003-12-31 17:26   ` Simon Josefsson
2003-12-31 19:27     ` Luc Teirlinck [this message]
2003-12-31 19:56       ` Simon Josefsson
2003-12-31 20:10         ` Luc Teirlinck
2004-01-01  5:52         ` Eli Zaretskii
2004-01-01 12:22           ` Simon Josefsson
2004-01-01 14:45             ` Eli Zaretskii
2004-01-04 23:33         ` Stefan Monnier
2004-01-05  0:14           ` Luc Teirlinck
2004-01-05  0:31             ` Miles Bader
2004-01-05  0:46           ` Simon Josefsson
2004-01-05 17:56             ` Richard Stallman
2004-01-05 18:38               ` Simon Josefsson
2004-01-04 14:54   ` Per Abrahamsen
2004-01-05  4:41     ` Luc Teirlinck
2004-01-07  2:07     ` Luc Teirlinck
2004-01-07  3:03       ` Luc Teirlinck
2004-01-07 15:05       ` Richard Stallman

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=200312311927.hBVJR8H29112@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=emacs-devel@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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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