GNU bug report logs - #28229
26.0.50; outline-minor-mode-hook run twice when reverting buffer

Previous Next

Package: emacs;

Reported by: Kaushal Modi <kaushal.modi <at> gmail.com>

Date: Fri, 25 Aug 2017 12:15:01 UTC

Severity: normal

Found in version 26.0.50

Done: Kaushal Modi <kaushal.modi <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kaushal Modi <kaushal.modi <at> gmail.com>
Cc: 28229 <at> debbugs.gnu.org
Subject: bug#28229: 26.0.50; outline-minor-mode-hook run twice when reverting buffer
Date: Fri, 25 Aug 2017 16:08:01 +0300
> From: Kaushal Modi <kaushal.modi <at> gmail.com>
> Date: Fri, 25 Aug 2017 12:14:23 +0000
> 
> I recently discovered an anomaly with my outline mode customization and it boiled down to this unexplained
> behavior.. the outline-minor-mode-hook was getting triggered twice on doing revert-buffer.

Isn't this expected behavior?  revert-buffer calls normal-mode, which
first kills all local variables, which involves turning off
outline-minor-mode by calling

  (outline-minor-mode -1)

And that calls your hook.

The other time is when normal-mode turns outline-minor-mode ON.

The doc string of outline-minor-mode-hook (and any other hook created
by define-minor-mode) clearly says:

  Hook run after entering or leaving ‘outline-minor-mode’.




This bug report was last modified 7 years and 353 days ago.

Previous Next


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