Subject: Re: bug#10773: set-variable can't change values of user options

From: Juri Linkov <[email-masked]>
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.