GNU bug report logs - #10773
define-derived-mode/define-minor-mode to declare hook variables

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Thu, 9 Feb 2012 09:50:02 UTC

Severity: wishlist

Tags: fixed

Found in version 24.0.93

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 10773 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 10773 <at> debbugs.gnu.org
Subject: Re: bug#10773: set-variable can't change values of user options
Date: Fri, 10 Feb 2012 12:18:56 +0200
>> 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.

Currently William Stevenson is working on converting minor modes to use
`define-minor-mode', so more minor mode hooks will lose an ability to be
changed using `set-variable'.  I don't have an opinion whether this is
good or bad.  I just discovered the inconsistency between `outline-mode-hook'
and `outline-minor-mode-hook' when trying to set temporarily them
to the same value with `set-variable'.

What I still don't understand is why some hooks have "*" in the docstring.




This bug report was last modified 4 years and 326 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.