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 #8 received at 10773 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Juri Linkov <juri <at> jurta.org>
Cc: 10773 <at> debbugs.gnu.org
Subject: Re: bug#10773: set-variable can't change values of user options
Date: Thu, 09 Feb 2012 13:28:16 -0500
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.




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.