all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Customize enforcing data relationships?
@ 2003-02-17  4:24 Galen Boyer
  2003-02-17 15:24 ` Galen Boyer
  0 siblings, 1 reply; 12+ messages in thread
From: Galen Boyer @ 2003-02-17  4:24 UTC (permalink / raw)


Is there anyway to use customize to enforce that variable B is dependent
on variable A.

Is there anyway to use customize to enforce an ordering dependency on
the setting of variables?

-- 
Galen deForest Boyer
Sweet dreams and flying machines in pieces on the ground.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Customize enforcing data relationships?
  2003-02-17  4:24 Customize enforcing data relationships? Galen Boyer
@ 2003-02-17 15:24 ` Galen Boyer
  2003-02-17 16:04   ` Stefan Monnier <foo@acm.com>
  0 siblings, 1 reply; 12+ messages in thread
From: Galen Boyer @ 2003-02-17 15:24 UTC (permalink / raw)


On 16 Feb 2003, galenboyer@hotpop.com wrote:
> Is there anyway to use customize to enforce that variable B is
> dependent on variable A.

More thoughts are that, of course, it would be the package developer's
responsibility to define the relationships.  He could define through
some custom function, say, "defcustomrel", that B must be set if A is
set.  Then customize could see the user set A and immediately jump the
user to B and the setting of A isn't complete until the user has set B,
thus enforcing the dependency.  Even better would be displaying them
together as well, with the dependency mapped out visually.

> Is there anyway to use customize to enforce an ordering dependency on
> the setting of variables?

Same sort of dependency interface here.

Has this been something already discussed lots and I'm late to the
party?

My main thought is that one of the things that seems to be lacking in
Emacs is the user must read all documentation or at least the user must
find and read the correct documentation all in their quest to gleam the
dependencys of variables and functionality.  Its usually many trial and
errors and rereads of the documentation to get going with particular
packages.  Could customize help by allowing more stringency if the
package developer so deemed?

-- 
Galen deForest Boyer
Sweet dreams and flying machines in pieces on the ground.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Customize enforcing data relationships?
  2003-02-17 15:24 ` Galen Boyer
@ 2003-02-17 16:04   ` Stefan Monnier <foo@acm.com>
  2003-02-17 17:24     ` Kai Großjohann
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2003-02-17 16:04 UTC (permalink / raw)


> More thoughts are that, of course, it would be the package developer's
> responsibility to define the relationships.  He could define through
> some custom function, say, "defcustomrel", that B must be set if A is
> set.  Then customize could see the user set A and immediately jump the
> user to B and the setting of A isn't complete until the user has set B,
> thus enforcing the dependency.  Even better would be displaying them
> together as well, with the dependency mapped out visually.

The problem is that dependency is typically of the form

  (defcustom a foo)
  (defcustom b (bar a))

and people think "Aha! B depends on A", but then some user comes along
and changes her setting for B from (bar a) to (baz c) and maybe she
even changes A's setting to (foz b) and we now have a completely
different dependency.

So I don't think the dependency should be specified as part of the
`defcustom' but as part of the value instead.


        Stefan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Customize enforcing data relationships?
  2003-02-17 16:04   ` Stefan Monnier <foo@acm.com>
@ 2003-02-17 17:24     ` Kai Großjohann
  2003-02-17 19:03       ` Stefan Monnier <foo@acm.com>
  0 siblings, 1 reply; 12+ messages in thread
From: Kai Großjohann @ 2003-02-17 17:24 UTC (permalink / raw)


"Stefan Monnier <foo@acm.com>" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> writes:

> So I don't think the dependency should be specified as part of the
> `defcustom' but as part of the value instead.

Can somebody give me the skinny on what you're talking about?  I hear
your words, but the meaning escapes me :-/  What kind of dependency
is it?

(I just couldn't resist mentioning the skinny.  What *is* it, anyway?  ;-)
Excuse my meagre attempt at humor...)
-- 
A turnip curses Elvis

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Customize enforcing data relationships?
  2003-02-17 17:24     ` Kai Großjohann
@ 2003-02-17 19:03       ` Stefan Monnier <foo@acm.com>
  2003-02-17 19:52         ` Kai Großjohann
  2003-02-19  2:10         ` Galen Boyer
  0 siblings, 2 replies; 12+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2003-02-17 19:03 UTC (permalink / raw)


>> So I don't think the dependency should be specified as part of the
>> `defcustom' but as part of the value instead.
> Can somebody give me the skinny on what you're talking about?  I hear
> your words, but the meaning escapes me :-/  What kind of dependency

If you custom-set A to (bar b) then you'd better make sure that
custom sets B before setting A otherwise you might not get the
result you want.  I.e. in such a case B depends on A.


        Stefan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Customize enforcing data relationships?
  2003-02-17 19:03       ` Stefan Monnier <foo@acm.com>
@ 2003-02-17 19:52         ` Kai Großjohann
  2003-02-17 20:04           ` Stefan Monnier <foo@acm.com>
  2003-02-19  2:10         ` Galen Boyer
  1 sibling, 1 reply; 12+ messages in thread
From: Kai Großjohann @ 2003-02-17 19:52 UTC (permalink / raw)


"Stefan Monnier <foo@acm.com>" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> writes:

>>> So I don't think the dependency should be specified as part of the
>>> `defcustom' but as part of the value instead.
>> Can somebody give me the skinny on what you're talking about?  I hear
>> your words, but the meaning escapes me :-/  What kind of dependency
>
> If you custom-set A to (bar b) then you'd better make sure that
> custom sets B before setting A otherwise you might not get the
> result you want.  I.e. in such a case B depends on A.

You mean, use the value of variable B as (part of) the value of A?

I didn't know that was possible.  How to do that?
-- 
A turnip curses Elvis

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Customize enforcing data relationships?
  2003-02-17 19:52         ` Kai Großjohann
@ 2003-02-17 20:04           ` Stefan Monnier <foo@acm.com>
  2003-02-18  8:01             ` Kai Großjohann
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2003-02-17 20:04 UTC (permalink / raw)


> You mean, use the value of variable B as (part of) the value of A?
> I didn't know that was possible.  How to do that?

Middle-click on `state', select "show as lisp expression" and then
enter an expression.  The value returned by the evaluation of the
expression will be used.
But of course, the question is then "when is it evaluated" and that's
where dependencies come into play.


        Stefan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Customize enforcing data relationships?
  2003-02-17 20:04           ` Stefan Monnier <foo@acm.com>
@ 2003-02-18  8:01             ` Kai Großjohann
  2003-02-18 15:56               ` Stefan Monnier <foo@acm.com>
  0 siblings, 1 reply; 12+ messages in thread
From: Kai Großjohann @ 2003-02-18  8:01 UTC (permalink / raw)


"Stefan Monnier <foo@acm.com>" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> writes:

> Middle-click on `state', select "show as lisp expression" and then
> enter an expression.  The value returned by the evaluation of the
> expression will be used.

Hey, cool.  I thought the expression was just read, not evaled.
Thanks!
-- 
A turnip curses Elvis

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Customize enforcing data relationships?
  2003-02-18  8:01             ` Kai Großjohann
@ 2003-02-18 15:56               ` Stefan Monnier <foo@acm.com>
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2003-02-18 15:56 UTC (permalink / raw)


>> Middle-click on `state', select "show as lisp expression" and then
>> enter an expression.  The value returned by the evaluation of the
>> expression will be used.
> Hey, cool.  I thought the expression was just read, not evaled.

Well, I never used it, so you'd better double check,


        Stefan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Customize enforcing data relationships?
  2003-02-17 19:03       ` Stefan Monnier <foo@acm.com>
  2003-02-17 19:52         ` Kai Großjohann
@ 2003-02-19  2:10         ` Galen Boyer
  2003-02-19  8:11           ` Oliver Scholz
  2003-02-19 10:47           ` Kai Großjohann
  1 sibling, 2 replies; 12+ messages in thread
From: Galen Boyer @ 2003-02-19  2:10 UTC (permalink / raw)


On 17 Feb 2003, monnier+gnu.emacs.help/news/@flint.cs.yale.edu wrote:
>>> So I don't think the dependency should be specified as part of the
>>> `defcustom' but as part of the value instead.
>> Can somebody give me the skinny on what you're talking about?  I hear
>> your words, but the meaning escapes me :-/  What kind of dependency
> 
> If you custom-set A to (bar b) then you'd better make sure that
> custom sets B before setting A otherwise you might not get the
> result you want.  I.e. in such a case B depends on A.


I was talking more about, if you set variable B, then you will need to
set variable A.

Or, you should set these variables in this particular order.

It would be a way for customize to mimic those interactive installing
programs.  Let the author define the dependency (how bout requirements
as the term?) and customize could continue to take care of the setup
interface.

It would also be a way to get some of the nice windowy setup dialogs
where they make it difficult for one to muck up their environment.  If a
certain dialog box is clicked off, a whole particular section of
variables gets grayed out.

-- 
Galen deForest Boyer
Sweet dreams and flying machines in pieces on the ground.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Customize enforcing data relationships?
  2003-02-19  2:10         ` Galen Boyer
@ 2003-02-19  8:11           ` Oliver Scholz
  2003-02-19 10:47           ` Kai Großjohann
  1 sibling, 0 replies; 12+ messages in thread
From: Oliver Scholz @ 2003-02-19  8:11 UTC (permalink / raw)


Galen Boyer <galenboyer@hotpop.com> writes:
[...]
> I was talking more about, if you set variable B, then you will need to
> set variable A.
>
> Or, you should set these variables in this particular order.
>
> It would be a way for customize to mimic those interactive installing
> programs.  Let the author define the dependency (how bout requirements
> as the term?) and customize could continue to take care of the setup
> interface.
>
> It would also be a way to get some of the nice windowy setup dialogs
> where they make it difficult for one to muck up their environment.  If a
> certain dialog box is clicked off, a whole particular section of
> variables gets grayed out.
[...]

You could at least do something like this, if it is applicable:

(defvar my-variable-A nil)

(defcustom my-variable-B "test"
  "A variable."
  :type 'string
  :set (lambda (symbol value)
	 (set symbol value)
	 (if (equal value "schubi")
	     (setq my-variable-A "dubi")
	   (setq my-variable-A nil))))

It would be nice, if this could be used to "gray out" some sections in
the customization buffer.

    Oliver
-- 
1 Ventôse an 211 de la Révolution
Liberté, Egalité, Fraternité!

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Customize enforcing data relationships?
  2003-02-19  2:10         ` Galen Boyer
  2003-02-19  8:11           ` Oliver Scholz
@ 2003-02-19 10:47           ` Kai Großjohann
  1 sibling, 0 replies; 12+ messages in thread
From: Kai Großjohann @ 2003-02-19 10:47 UTC (permalink / raw)


Galen Boyer <galenboyer@hotpop.com> writes:

> I was talking more about, if you set variable B, then you will need to
> set variable A.

You mean something like this?  People can't set
font-lock-support-mode unless they've previously enabled font-lock?

Ah, that makes sense.

But on the other hand, it reduces flexibility: people may wish to
manually enable font-lock from time to time, but not enable it by
default.  Then it makes sense for them to set font-lock-support-mode
even if font-lock is off.

(The above is just an example.)
-- 
A turnip curses Elvis

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2003-02-19 10:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-17  4:24 Customize enforcing data relationships? Galen Boyer
2003-02-17 15:24 ` Galen Boyer
2003-02-17 16:04   ` Stefan Monnier <foo@acm.com>
2003-02-17 17:24     ` Kai Großjohann
2003-02-17 19:03       ` Stefan Monnier <foo@acm.com>
2003-02-17 19:52         ` Kai Großjohann
2003-02-17 20:04           ` Stefan Monnier <foo@acm.com>
2003-02-18  8:01             ` Kai Großjohann
2003-02-18 15:56               ` Stefan Monnier <foo@acm.com>
2003-02-19  2:10         ` Galen Boyer
2003-02-19  8:11           ` Oliver Scholz
2003-02-19 10:47           ` Kai Großjohann

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.