GNU bug report logs - #23460
25.1.50; Strange behavior in local variables like start-comment

Previous Next

Package: emacs;

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

Date: Thu, 5 May 2016 20:37:02 UTC

Severity: normal

Merged with 23463

Found in version 25.1.50

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: 23460 <at> debbugs.gnu.org, Alan Mackenzie <acm <at> muc.de>
Subject: bug#23460: 25.1.50; Strange behavior in local variables like start-comment
Date: Thu, 05 May 2016 22:20:27 +0000
[Message part 1 (text/plain, inline)]
>
>
> I'll keep you posted.
>
>
OK, I was able to get a minimum working example sooner than I thought :)

Please save the below as test.el (or some file name; else revert-buffer
will not work), open it in emacs -Q and evaluate it.

===== test.el =====
(progn
  (defun my/print-comment-start-value ()
    (interactive)
    (message (format "`comment-start' = `%s'" comment-start)))

  (defun my/repeat-revert-buffer-noconfirm (count)
    (interactive "p")
    (dotimes (i count)
      (revert-buffer nil :noconfirm)))

  (add-hook 'outline-minor-mode-hook #'my/print-comment-start-value)
;  (remove-hook 'outline-minor-mode-hook #'my/print-comment-start-value)

  (global-set-key (kbd "<f5>") #'my/repeat-revert-buffer-noconfirm))

;; Local Variables:
;; eval: (outline-minor-mode 1)
;; End:
=====

In emacs 25.0.93 (emacs-25 build), after opening test.el, evaluating it and
hitting F5, I get below (which is good, expected):

‘comment-start’ = ‘;’ [2 times]

But in emacs 25.1.50 (master build), after opening test.el, evaluating it
and hitting F5, I get:

‘comment-start’ = ‘;’
‘comment-start’ = ‘nil’ [2 times]
‘comment-start’ = ‘;’

So it looks like the outline-minor-mode-hook is called twice more in the
master branch and also intermittently, the comment-start loses its buffer
local value.

Hope this mini test helps debug this.

> --

-- 
Kaushal Modi
[Message part 2 (text/html, inline)]

This bug report was last modified 9 years and 76 days ago.

Previous Next


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