[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Custom dependencies
From: |
Kai Großjohann |
Subject: |
Re: Custom dependencies |
Date: |
Tue, 08 Apr 2003 14:56:09 +0200 |
User-agent: |
Gnus/5.090018 (Oort Gnus v0.18) Emacs/21.3.50 (gnu/linux) |
Dave Love <address@hidden> writes:
> "Stefan Monnier" <monnier+gnu/emacs/address@hidden> writes:
>
>> - 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?
So, let's see. We have (defcustom A ... :set-after '(B) ... :set
...something.long.here...). And Dave suggests to call the :set
function from A after B has changed. So whenever a variable X is
changed, we have to look through all other variables Y to see if they
mention X in the :set-after list.
>> 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.
My thinking was as follows: (utf-translate-cjk-mode -1) clears the
hash table so that CJK unification is not done. A subsequent
(utf-translate-cjk-mode 1) statement would then look at
current-language-environment and populate the hash table accordingly.
Of course, it is better to just populate the hash table in the right
way, without clearing it first.
>> 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.
So to look through all variables Y to see if their :set-after list
mentions X, and if so, to call the :set function?
That's a good idea.
(It would be nice to be able to do without the (custom-set-variables
...) block that's now used by Customize, because of the conditionals
I mentioned.)
--
A preposition is not a good thing to end a sentence with.
Re: Custom dependencies (was: utf-translate-cjk-mode), Dave Love, 2003/04/08
- Re: Custom dependencies,
Kai Großjohann <=