From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Custom dependencies (was: utf-translate-cjk-mode) Date: Fri, 04 Apr 2003 10:19:36 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200304041519.h34FJa9n007445@rum.cs.yale.edu> References: <8465pvpnhy.fsf@lucy.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1049469676 7967 80.91.224.249 (4 Apr 2003 15:21:16 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 4 Apr 2003 15:21:16 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Apr 04 17:21:13 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 191T0D-00023r-00 for ; Fri, 04 Apr 2003 17:21:13 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 191T2J-00027Q-00 for ; Fri, 04 Apr 2003 17:23:23 +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 191Szv-0002uN-04 for emacs-devel@quimby.gnus.org; Fri, 04 Apr 2003 10:20:55 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 191Syw-0002Jw-00 for emacs-devel@gnu.org; Fri, 04 Apr 2003 10:19:54 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 191Syj-00024i-00 for emacs-devel@gnu.org; Fri, 04 Apr 2003 10:19:41 -0500 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.10.13) id 191Syf-00022T-00; Fri, 04 Apr 2003 10:19:37 -0500 Original-Received: from rum.cs.yale.edu (localhost [127.0.0.1]) by rum.cs.yale.edu (8.12.8/8.12.8) with ESMTP id h34FJax6007447; Fri, 4 Apr 2003 10:19:36 -0500 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.12.8/8.12.8/Submit) id h34FJa9n007445; Fri, 4 Apr 2003 10:19:36 -0500 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: fx@gnu.org 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:12899 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:12899 [ 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. ] > > set-language-environment could holler if utf-translate-cjk-mode was > > set when it is called. That might be useful in some way or other. > > Or it could look if utf-translate-cjk-mode is on, and if so, turn it > > off then on again. That would exhibit more dwimishness. > > I think that would be wrong, apart from being very unclean. Custom > supports at least the declaration of dependencies, even if it doesn't > use them fully. Why do you want to avoid that, presumably at the > expense of the less sophisticated users Custom is particularly aimed at? I think the issue of dependencies is important, so let's try and improve it, rather than keep working around it. Especially since you mention that it is crucial in order to customize calendar properly. I see two different cases: - 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. Kai suggests turn A off and back on, but you seem object to it. 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. Still, how should custom know that turning the thing off&on is the right way to refresh A's setting after B was changed ? - 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. Stefan