From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: bug#10773: set-variable can't change values of user options Date: Fri, 10 Feb 2012 01:18:06 -0700 Message-ID: References: <87r4y4fik0.fsf@mail.jurta.org> <5w1uq3lv3z.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1328861883 28088 80.91.229.3 (10 Feb 2012 08:18:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Feb 2012 08:18:03 +0000 (UTC) To: 10773@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 10 09:18:02 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RvlgA-0004A8-7r for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Feb 2012 09:18:02 +0100 Original-Received: from localhost ([::1]:48413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvlg9-0001wQ-MS for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Feb 2012 03:18:01 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:36740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvlg6-0001vZ-GY for bug-gnu-emacs@gnu.org; Fri, 10 Feb 2012 03:17:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rvlfz-0003c8-3S for bug-gnu-emacs@gnu.org; Fri, 10 Feb 2012 03:17:58 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvlfy-0003c4-U9 for bug-gnu-emacs@gnu.org; Fri, 10 Feb 2012 03:17:51 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Rvlh8-0002El-I1 for bug-gnu-emacs@gnu.org; Fri, 10 Feb 2012 03:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kevin Rodgers Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Feb 2012 08:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10773 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13288619338584 (code B ref -1); Fri, 10 Feb 2012 08:19:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Feb 2012 08:18:53 +0000 Original-Received: from localhost ([127.0.0.1]:34493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rvlgz-0002EO-9P for submit@debbugs.gnu.org; Fri, 10 Feb 2012 03:18:53 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:38833) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rvlgr-0002E7-E3 for submit@debbugs.gnu.org; Fri, 10 Feb 2012 03:18:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvlfY-0003Z2-6D for submit@debbugs.gnu.org; Fri, 10 Feb 2012 03:17:28 -0500 Original-Received: from lists.gnu.org ([140.186.70.17]:45720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvlfY-0003Yy-4a for submit@debbugs.gnu.org; Fri, 10 Feb 2012 03:17:24 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:36573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvlfT-0001ez-Rj for bug-gnu-emacs@gnu.org; Fri, 10 Feb 2012 03:17:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvlfM-0003Wc-1P for bug-gnu-emacs@gnu.org; Fri, 10 Feb 2012 03:17:19 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:49750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvlfL-0003WH-LI for bug-gnu-emacs@gnu.org; Fri, 10 Feb 2012 03:17:12 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1RvlfI-0003i9-42 for bug-gnu-emacs@gnu.org; Fri, 10 Feb 2012 09:17:08 +0100 Original-Received: from c-71-237-25-24.hsd1.co.comcast.net ([71.237.25.24]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 Feb 2012 09:17:08 +0100 Original-Received: from kevin.d.rodgers by c-71-237-25-24.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 Feb 2012 09:17:08 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 61 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-25-24.hsd1.co.comcast.net User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.26) Gecko/20120129 Thunderbird/3.1.18 In-Reply-To: <5w1uq3lv3z.fsf@fencepost.gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:56750 Archived-At: On 2/9/12 11:28 AM, Glenn Morris wrote: > Juri Linkov wrote: > >> Why users are allowed to change the value of `outline-mode-hook', >> but not `outline-minor-mode-hook'? > > The former is defined with (defvar ... "*..."). > The latter is not defined anywhere, but as define-derived-mode says > about hooks and has been covered several times: > > No problems result if this variable is not bound. > `add-hook' automatically binds it. (This is true for all hook variables.) > > I would says it's not very useful to pass a hook to set-variable anyway, > since you need to type a lisp expression, and probably should use > an explicit add-hook statement. Or allow add-hook (and remove-hook) to be called interactively, for convenience: --- - 2012-02-10 01:14:16.000000000 -0700 +++ /tmp/subr.el 2012-02-10 01:13:17.000000000 -0700 @@ -1216,15 +1216,17 @@ unless the optional argument APPEND is non-nil, in which case FUNCTION is added at the end. -The optional fourth argument, LOCAL, if non-nil, says to modify -the hook's buffer-local value rather than its default value. -This makes the hook buffer-local if needed, and it makes t a member -of the buffer-local value. That acts as a flag to run the hook -functions in the default value as well as in the local value. +The optional fourth argument, LOCAL, if non-nil or an interactive +prefix arg, says to modify the hook's buffer-local value rather +than its default value. This makes the hook buffer-local if +needed, and it makes t a member of the buffer-local value. That +acts as a flag to run the hook functions in the default value as +well as in the local value. HOOK should be a symbol, and FUNCTION may be any valid function. If HOOK is void, it is first set to nil. If HOOK's value is a single function, it is changed to a list of functions." + (interactive "SHook: \naFunction: \ni\nP") (or (boundp hook) (set hook nil)) (or (default-boundp hook) (set-default hook nil)) (if local (unless (local-variable-if-set-p hook) @@ -1264,8 +1266,10 @@ FUNCTION isn't the value of HOOK, or, if FUNCTION doesn't appear in the list of hooks to run in HOOK, then nothing is done. See `add-hook'. -The optional third argument, LOCAL, if non-nil, says to modify -the hook's buffer-local value rather than its default value." +The optional third argument, LOCAL, if non-nil (interactively, +with prefix argument) says to modify the hook's buffer-local +value rather than its default value." + (interactive "SHook: \naFunction: \nP") (or (boundp hook) (set hook nil)) (or (default-boundp hook) (set-default hook nil)) ;; Do nothing if LOCAL is t but this hook has no local binding. -- Kevin Rodgers Denver, Colorado, USA