all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: find-file-hook as illustration of Custom problems
Date: Sat, 5 Feb 2005 21:16:21 -0600 (CST)	[thread overview]
Message-ID: <200502060316.j163GL216049@raven.dms.auburn.edu> (raw)
In-Reply-To: <200502060207.j1627Kp15685@raven.dms.auburn.edu> (message from Luc Teirlinck on Sat, 5 Feb 2005 20:07:20 -0600 (CST))

>From my previous message:
   
   Code that runs later will override the user's veto and add
   the stuff back anyway.

Note that this is not a problem that would be a consequence of the
discussed changes.  It is a problem that exists right now.  If, in
present code, a non-preloaded Lisp file adds elements to a defcustomed
hook, list or alist, then there is no way that you can presently
override that in your `custom-set-variables' form.  To override it in
your .emacs you have to use `eval-after-load' or similar.

To avoid this, I believe that the following conventions should be
documented and followed.  Is there any objection against any of the
following conventions?

In the following "changing" a defcustomed variable means _changing the
global default value_.  Changing buffer local values or `let' bindings
are OK.

Just _loading_ a non-preloaded file should not change any defcustomed
variable unless "harmless" (like a hook function only used to gather
info and without user visible consequences).  Currently, just loading
autorevert.el adds a function to find-file-hook, but that function is
"harmless" in the above sense.

When changing a defcustomed variable from a function, that function
should be interactively called by the user and either the _only_
effect should be to implement the documented behavior of the function
(for instance by adding a function to a hook that implements that
behavior and does not interfere with anything else), or the fact that
elements are going to be added to the defcustom should be clearly
documented in the docstring and in any manual where the function is
described.

Sincerely,

Luc.

      reply	other threads:[~2005-02-06  3:16 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-04  0:36 find-file-hook as illustration of Custom problems Luc Teirlinck
2005-02-04  7:16 ` Lennart Borgman
2005-02-05 17:38 ` Richard Stallman
2005-02-05 18:54   ` Luc Teirlinck
2005-02-06 21:01     ` Richard Stallman
2005-02-06 22:19       ` Lennart Borgman
2005-02-05 19:43   ` Lennart Borgman
2005-02-05 20:56     ` Popup when buffer file is changed on disk moheb missaghi
2005-02-05 22:57       ` Eli Zaretskii
2005-02-06  0:51         ` Lennart Borgman
2005-02-06  7:20           ` Eli Zaretskii
2005-02-06  9:02             ` Lennart Borgman
2005-02-06  9:53               ` Eli Zaretskii
2005-02-06 10:41                 ` Lennart Borgman
2005-02-06 16:34                   ` Luc Teirlinck
2005-02-06 17:52                     ` Lennart Borgman
2005-02-06 17:04                   ` Luc Teirlinck
2005-02-11  0:33                     ` Luc Teirlinck
2005-02-11 15:40                       ` Eli Zaretskii
2005-02-11 16:51                         ` David Kastrup
2005-02-11 19:38                           ` Luc Teirlinck
2005-02-12 11:03                             ` Eli Zaretskii
2005-02-12  8:37                       ` Richard Stallman
2005-02-13  1:41                         ` Luc Teirlinck
2005-02-13  4:36                           ` Eli Zaretskii
2005-02-15  3:05                             ` Luc Teirlinck
2005-02-15  4:59                               ` Eli Zaretskii
2005-02-16  2:59                                 ` moheb missaghi
2005-02-16  9:31                               ` Richard Stallman
2005-02-16 10:37                                 ` David Kastrup
2005-02-16 15:06                                   ` Luc Teirlinck
2005-02-16 15:21                                     ` David Kastrup
2005-02-17  1:08                                       ` Luc Teirlinck
2005-02-06 12:42               ` Richard Stallman
2005-02-06 18:00                 ` Lennart Borgman
2005-02-06 18:17                   ` Jan D.
2005-02-06 19:59                     ` Lennart Borgman
2005-02-06 20:40                       ` Jan D.
2005-02-07  4:34                         ` Eli Zaretskii
2005-02-07  4:04                   ` Luc Teirlinck
2005-02-06 18:11                 ` Luc Teirlinck
2005-02-06 18:45                   ` Luc Teirlinck
2005-02-06 13:24               ` Jason Rumney
2005-02-06 13:54                 ` Lennart Borgman
2005-02-06  7:23         ` Eli Zaretskii
2005-02-06 21:01     ` find-file-hook as illustration of Custom problems Richard Stallman
2005-02-06  1:50   ` Luc Teirlinck
2005-02-06  3:26     ` Luc Teirlinck
2005-02-06  4:02       ` Luc Teirlinck
2005-02-06 21:02     ` Richard Stallman
2005-02-08  1:50       ` Luc Teirlinck
2005-02-09  8:10         ` Richard Stallman
2005-02-09 10:42           ` Kim F. Storm
2005-02-10 18:39             ` Richard Stallman
2005-02-10 21:42               ` Kim F. Storm
2005-02-12  8:37                 ` Richard Stallman
2005-02-10  5:12           ` Luc Teirlinck
2005-02-10 18:40             ` Richard Stallman
2005-02-11  0:09               ` Luc Teirlinck
2005-02-12  8:37                 ` Richard Stallman
2005-02-11  0:21               ` Luc Teirlinck
2005-02-11 14:59               ` Luc Teirlinck
2005-02-10  5:26           ` Luc Teirlinck
2005-02-06  2:07   ` Luc Teirlinck
2005-02-06  3:16     ` Luc Teirlinck [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

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

  git send-email \
    --in-reply-to=200502060316.j163GL216049@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=emacs-devel@gnu.org \
    --cc=rms@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.