From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: customize-style Date: Tue, 18 Mar 2003 18:05:44 -0600 (CST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200303190005.SAA20377@eel.dms.auburn.edu> References: <20030317152226.E536@WINPC174> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1048032544 32212 80.91.224.249 (19 Mar 2003 00:09:04 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 19 Mar 2003 00:09:04 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Mar 19 01:09:00 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 18vR8e-0008Mt-00 for ; Wed, 19 Mar 2003 01:09:00 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18vR99-0001fx-00 for ; Wed, 19 Mar 2003 01:09:31 +0100 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 18vR71-0001zR-06 for emacs-devel@quimby.gnus.org; Tue, 18 Mar 2003 19:07:19 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18vR69-0001hv-00 for emacs-devel@gnu.org; Tue, 18 Mar 2003 19:06:25 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18vR4x-0001NA-00 for emacs-devel@gnu.org; Tue, 18 Mar 2003 19:05:12 -0500 Original-Received: from manatee.dms.auburn.edu ([131.204.53.104]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18vR4c-0001Bg-00 for emacs-devel@gnu.org; Tue, 18 Mar 2003 19:04:50 -0500 Original-Received: from eel.dms.auburn.edu (eel.dms.auburn.edu [131.204.53.108]) h2J04lB12034; Tue, 18 Mar 2003 18:04:47 -0600 (CST) Original-Received: (from teirllm@localhost) by eel.dms.auburn.edu (8.9.3+Sun/8.9.3) id SAA20377; Tue, 18 Mar 2003 18:05:44 -0600 (CST) X-Authentication-Warning: eel.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: abraham@dina.kvl.dk In-reply-to: (message from Per Abrahamsen on Tue, 18 Mar 2003 14:08:20 +0100) 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:12452 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:12452 Per Abrahamsen wrote: Richard Stallman writes: > Perhaps we could add a general feature whereby a custom theme > can be put into effect buffer-locally. I haven't tried it, but binding custom-local-buffer might do just that. What binding `custom-local-buffer' does is completely up to what the author of the :set function wants it to do. That is, assuming that the author of the :set function knows about it, it is not documented in the documentation string of defcustom, nor in the Elisp manual. The documentation string of `custom-local-buffer' is ambiguous about what is actually expected and the documentation strings of its two users in custom.el, which an author of a :set function is likely to use as guidance, are also ambiguous and seem to contradict the actual behavior. I personally have no idea which behavior is intended: the actual one or the one I would infer from the documentation. Concrete problems: Do: (setq custom-local-buffer "buf") C-h v custom-local-buffer Result: custom-local-buffer's value is "buf" Non-nil, in a Customization buffer, means customize a specific buffer. If this variable is non-nil, it should be a buffer, and it means customize the local bindings of that buffer. This variable is a permanent local, and it normally has a local binding in every Customization buffer. My remarks: Note, that the global value got set, unlike what is claimed in the documentation string. The line: (put 'custom-local-buffer 'permanent-local t) in custom.el is not sufficient to actually make `custom-local-buffer' buffer-local. Second problem: "and it means customize the local bindings of that buffer." Does this mean: *if* the variable *already* has a buffer-local binding or no matter what? I believe that this should be clearly specified. The quoted sentence suggests (to me) the latter, the actual behavior is the former, for the two important :set functions described below: C-h f custom-set-default Result: custom-set-default is a compiled Lisp function in `custom'. (custom-set-default VARIABLE VALUE) Default :set function for a customizable variable. Normally, this sets the default value of VARIABLE to VALUE, but if `custom-local-buffer' is non-nil, this sets the local binding in that buffer instead. My remarks: "this sets the local binding in that buffer instead." Actual behavior: sets the local binding *if* it already has one. Again, I believe this should be clarified. The way I would read it: unconditionally sets the local binding. C-h f custom-set-minor-mode Result: custom-set-minor-mode is a compiled Lisp function in `custom'. (custom-set-minor-mode VARIABLE VALUE) :set function for minor mode variables. Normally, this sets the default value of VARIABLE to nil if VALUE is nil and to t otherwise, but if `custom-local-buffer' is non-nil, this sets the local binding in that buffer instead. My remarks: Actual behavior: sets the local "binding" (kind of, we are calling a function not just setting a variable, but that is OK, at least to me) for "local" minor modes, the default value for "global" minor modes. As it is actually possible, and sometimes useful, to give some "global" minor modes buffer local values, I believe that it should be clarified that setting `custom-local-buffer' and using Custom is not going to do that for you. Sincerely, Luc.