unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dave Love <d.love@dl.ac.uk>
Cc: emacs-devel@gnu.org
Subject: Re: Custom dependencies (was: utf-translate-cjk-mode)
Date: 08 Apr 2003 10:34:28 +0100	[thread overview]
Message-ID: <rzq7ka5qqmz.fsf@albion.dl.ac.uk> (raw)
In-Reply-To: 200304041519.h34FJa9n007445@rum.cs.yale.edu

"Stefan Monnier" <monnier+gnu/emacs/pretest@rum.cs.yale.edu> writes:

> [ Since the :set-after thingy is now (hopefully) finally properly
>   handled by define-minor-mode, I assume that you now agree that Kai's
>   change was good. ]

Sure (but not the rationale).

> I think the issue of dependencies is important, so let's try and improve
> it, rather than keep working around it.

Is there much attempt to work around it?

> Especially since you
> mention that it is crucial in order to customize calendar properly.

I think it's only really important if the current system of options is
maintained, but I don't know how much trouble it would cause to change
the currently-defined options.  The problem there is the multiple
levels of customized options, such that if I want to default things
appropriate to the locale, it's a real mess in ways I can't remember
the details of.

> - The case as above where variable A has a non-trivial :set function
>   which depends on variable B, so that when B is changed something
>   should be done to A.
>   It seems that the :set-after thingy is a good way to specify the
>   dependency, but it doesn't describe what should be done to A
>   when B changes.

I think it does.  A should be re-set from its current value, since
something it depends on has changed.  Are there cases in which that
would be wrong?

>   Kai suggests turn A off and back on, but you
>   seem object to it.

I don't remember that, and it's not anything I thought I was objecting
to.  It's not a question of off and on in this case anyhow -- the
state that changes is the contents of a hash table.

>   I believe that you object only to
>   set-language-environment doing it, not to the off&on thing: it
>   should be done by custom without set-language-environment
>   (or current-language-environment for that matter) knowing anything
>   about utf-translate-cjk-mode.

Yes, if I understand correctly.

> - The case where A is set to "the value of E" where E is a sexp
>   that refers to B.  In such a case, the dependency is not part of
>   A but of A's current setting, so :set-after is not a good solution.

That's strictly true, but in most cases I can think of, it is the
right thing.  You'd have :set-after's for the Custom options which are
`usually' involved in E -- not strictly right, but unlikely to cause
trouble, I guess.

This probably means that the customization of those options isn't done
the way it should be, i.e. A shouldn't really be set with `defcustom'
but in some new way which is also aware of Custom's dependency
information.  (I haven't thought very much about implementing such a
thing, but I've often run into this issue.)

Take `display-time-string-forms' as an example that I recently worked
on (rather surprised that people could live with the distraction in
the new about-face mode line).  It's unlikely that a naive Custom user
would want to mess with the sexp as such, and probably unlikely that
anyone would unless they were adding new options.  I'd expect them
just to set `display-time-use-mail-icon' &c.  If
`display-time-string-forms' was re-set when
`display-time-use-mail-icon' & al were set, it would be less confusing
for users and the mode-line update could be more efficient.

Does that make sense?

  parent reply	other threads:[~2003-04-08  9:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <rzqvfxvh7wj.fsf@albion.dl.ac.uk>
     [not found] ` <8465pvpnhy.fsf@lucy.is.informatik.uni-duisburg.de>
     [not found]   ` <rzqadf6fr4h.fsf@albion.dl.ac.uk>
2003-04-04 15:19     ` Custom dependencies (was: utf-translate-cjk-mode) Stefan Monnier
2003-04-04 19:42       ` Custom dependencies Kai Großjohann
2003-04-04 20:33         ` Stefan Monnier
2003-04-05 15:49           ` Kai Großjohann
2003-04-06 20:55             ` Stefan Monnier
2003-04-07  9:05               ` Kai Großjohann
2003-04-08  9:34       ` Dave Love [this message]
2003-04-08 12:56         ` Kai Großjohann
2003-04-08 18:35           ` Stefan Monnier

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=rzq7ka5qqmz.fsf@albion.dl.ac.uk \
    --to=d.love@dl.ac.uk \
    --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).