From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: kai.grossjohann@gmx.net (Kai =?iso-8859-1?q?Gro=DFjohann?=) Newsgroups: gmane.emacs.devel Subject: Re: Custom dependencies Date: Sat, 05 Apr 2003 17:49:02 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <84k7e9t05t.fsf@lucy.is.informatik.uni-duisburg.de> References: <8465pvpnhy.fsf@lucy.is.informatik.uni-duisburg.de> <200304041519.h34FJa9n007445@rum.cs.yale.edu> <84a3e0qv3x.fsf@lucy.is.informatik.uni-duisburg.de> <200304042033.h34KXwoB008300@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1049563260 21695 80.91.224.249 (5 Apr 2003 17:21:00 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 5 Apr 2003 17:21:00 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sat Apr 05 19:20:58 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 191rLe-0005dE-00 for ; Sat, 05 Apr 2003 19:20:58 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 191rOH-0007yh-00 for ; Sat, 05 Apr 2003 19:23:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 191py8-0005zp-02 for emacs-devel@quimby.gnus.org; Sat, 05 Apr 2003 10:52:36 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 191pxd-0005zM-00 for emacs-devel@gnu.org; Sat, 05 Apr 2003 10:52:05 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 191px6-0005gX-00 for emacs-devel@gnu.org; Sat, 05 Apr 2003 10:52:03 -0500 Original-Received: from mailout11.sul.t-online.com ([194.25.134.85]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 191px5-0005cg-00 for emacs-devel@gnu.org; Sat, 05 Apr 2003 10:51:31 -0500 Original-Received: from fwd03.sul.t-online.de by mailout11.sul.t-online.com with smtp id 191pwl-0002m4-00; Sat, 05 Apr 2003 17:51:11 +0200 Original-Received: from lucy (520080024987-0001@[80.135.125.131]) by fmrl03.sul.t-online.com with esmtp id 191pwW-0L3tGCC; Sat, 5 Apr 2003 17:50:56 +0200 Original-Received: by lucy (Postfix, from userid 1003) id 4891528592; Sat, 5 Apr 2003 17:49:03 +0200 (CEST) Original-To: "Stefan Monnier" In-Reply-To: <200304042033.h34KXwoB008300@rum.cs.yale.edu> (Stefan Monnier's message of "Fri, 04 Apr 2003 15:33:58 -0500") User-Agent: Gnus/5.090018 (Oort Gnus v0.18) Emacs/21.3.50 (gnu/linux) X-Sender: 520080024987-0001@t-dialin.net X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:12919 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:12919 "Stefan Monnier" 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. >> >> Agreed. >> >> > Kai suggests turn A off and back on, but you seem object to it. >> >> No, I suggest to turn utf-translate-cjk-mode off then back on. > > Huh? A is utf-translate-cjk-mode, so I don't understand what's > the difference between what I say and what you say. It seemed to me that you are talking about some general case: whenever there are some options A and B that are dependent, you were suggesting to take a specific action (frob one of them twice). I was only talking about this specific case, only about utf-translate-cjk-mode and the language environment, not about any other option. I have no idea what's the right thing to do about some other dependent pair of options. Maybe I misunderstood you. >> > 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. >> >> I disagree about this. >> >> Suppose somebody turns on utf-translate-cjk-mode (via custom or >> Lisp), then time passes, then they do M-x set-language-environment RET. >> At that time, something special needs to happen. > > It depends on whether you want the dependency to be handled in > elisp or only in custom. As someone who only uses elisp to > configure my Emacs, I wouldn't mind if the dependency handling only > worked in custom (as long as the docstrings make it clear enough > for me to DTRT in elisp if I care to). Well, in this specific case, one of the options can be changed interactively. IMVHO it would be useful for changing the language environment to also change the cjk translation tables appropriately. >> > Still, how should custom know that turning the thing off&on is the >> > right way to refresh A's setting after B was changed ? >> >> It can't. Unless we tell it. And the code will depend on the >> combination of A and B, there will be no general function that will >> do the right thing. (Except, perhaps, run-hooks -- but that's >> cheating :-) > > Maybe we can simply say that custom will call the :set function > again and it's the :set function to make sure that it will > refresh things as needed. That might work. (But only for Customize users.) >> > - 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. >> > I don't know how custom could find out (or be told about) such >> > dependencies. OTOH, "what to do when B changes" is trivial to answer >> > this time. >> >> You mean that you could set next-screen-context-lines to `ten percent >> of the window height'? That doesn't make sense: it needs to be > > Custom currently allows such things. But how does Custom change the code that's used to *access* a variable? I'm getting confused I think. > Obviously, it can't work right unless B is some sort of global > variable. You mean, the window height isn't a variable? Hm. Yes. I couldn't think of another example. Can you think of another example, so that we have something concrete to discuss? -- A preposition is not a good thing to end a sentence with.