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: customize-style
Date: Tue, 18 Mar 2003 18:05:44 -0600 (CST)	[thread overview]
Message-ID: <200303190005.SAA20377@eel.dms.auburn.edu> (raw)
In-Reply-To: <rjk7ewx1ob.fsf@zuse.dina.kvl.dk> (message from Per Abrahamsen on Tue, 18 Mar 2003 14:08:20 +0100)

Per Abrahamsen wrote:

   Richard Stallman <rms@gnu.org> writes:

   > Perhaps we could add a general feature whereby a custom theme
   > can be put into effect buffer-locally.  

   I haven't tried it, but binding custom-local-buffer might do just
   that.

What binding `custom-local-buffer' does is completely up to what the
author of the :set function wants it to do.  That is, assuming that the
author of the :set function knows about it, it is not documented in the
documentation string of defcustom, nor in the Elisp manual.  The
documentation string of `custom-local-buffer' is ambiguous about what
is actually expected and the documentation strings of its two users in
custom.el, which an author of a :set function is likely to use as
guidance, are also ambiguous and seem to contradict the actual
behavior.  I personally have no idea which behavior is intended: the
actual one or the one I would infer from the documentation.

Concrete problems:

Do:

(setq custom-local-buffer "buf")
C-h v custom-local-buffer

Result:

custom-local-buffer's value is "buf"

Non-nil, in a Customization buffer, means customize a specific buffer.
If this variable is non-nil, it should be a buffer, and it means
customize the local bindings of that buffer.  This variable is a
permanent local, and it normally has a local binding in every
Customization buffer.

My remarks:

Note, that the global value got set, unlike what is claimed in the
documentation string.  The line:
(put 'custom-local-buffer 'permanent-local t)
in custom.el is not sufficient to actually make `custom-local-buffer'
buffer-local.

Second problem:

"and it means customize the local bindings of that buffer."

Does this mean: *if* the variable *already* has a buffer-local binding
or no matter what?  I believe that this should be clearly specified.
The quoted sentence suggests (to me) the latter, the actual behavior
is the former, for the two important :set functions described below:

C-h f custom-set-default

Result:

custom-set-default is a compiled Lisp function in `custom'.
(custom-set-default VARIABLE VALUE)

Default :set function for a customizable variable.
Normally, this sets the default value of VARIABLE to VALUE,
but if `custom-local-buffer' is non-nil,
this sets the local binding in that buffer instead.
 
My remarks:

"this sets the local binding in that buffer instead."

Actual behavior: sets the local binding *if* it already has one.
Again, I believe this should be clarified.  The way I would read it:
unconditionally sets the local binding.

C-h f custom-set-minor-mode

Result:

custom-set-minor-mode is a compiled Lisp function in `custom'.
(custom-set-minor-mode VARIABLE VALUE)

:set function for minor mode variables.
Normally, this sets the default value of VARIABLE to nil if VALUE
is nil and to t otherwise,
but if `custom-local-buffer' is non-nil,
this sets the local binding in that buffer instead.

My remarks:

Actual behavior: sets the local "binding" (kind of, we are calling a
function not just setting a variable, but that is OK, at least to me)
for "local" minor modes, the default value for "global" minor modes.
As it is actually possible, and sometimes useful, to give some
"global" minor modes buffer local values, I believe that it should be
clarified that setting `custom-local-buffer' and using Custom is not
going to do that for you.

Sincerely,

Luc.

  reply	other threads:[~2003-03-19  0:05 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-17 14:22 customize-style Stephan Stahl
2003-03-17 15:43 ` customize-style Stefan Monnier
2003-03-17 23:25   ` customize-style Richard Stallman
2003-03-18  0:09     ` customize-style Alex Schroeder
2003-03-19  8:49       ` customize-style Richard Stallman
2003-03-19 20:30         ` customize-style Alex Schroeder
2003-03-21  8:10           ` customize-style Stephan Stahl
2003-03-21 19:06           ` customize-style Richard Stallman
2003-03-22 21:43         ` customize-style John Paul Wallington
2003-03-24  2:04           ` customize-style Richard Stallman
2003-03-17 23:28   ` customize-style Alex Schroeder
2003-03-17 21:16 ` customize-style David Masterson
2003-03-17 23:24 ` customize-style Richard Stallman
2003-03-18 13:08   ` customize-style Per Abrahamsen
2003-03-19  0:05     ` Luc Teirlinck [this message]
2003-03-20  8:45       ` customize-style Richard Stallman
2003-03-20 10:44         ` customize-style Per Abrahamsen
2003-03-20 18:39           ` customize-style Luc Teirlinck
2003-03-21  8:49             ` customize-style Per Abrahamsen
2003-03-23  2:53               ` customize-style Richard Stallman
2003-03-20 15:56         ` customize-style Luc Teirlinck
2003-03-20 17:32           ` customize-style, alternative patch Luc Teirlinck
2003-03-23  2:52             ` Richard Stallman
2003-03-23  3:45               ` Luc Teirlinck

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=200303190005.SAA20377@eel.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).