GNU bug report logs - #52980
elide-head and revert-buffer interaction stops elide-head-show from working

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Mon, 3 Jan 2022 16:49:02 UTC

Severity: normal

Tags: patch

Fixed in version 29.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Kangas <stefan <at> marxist.se>
To: jakanakaevangeli <at> chiru.no, 52980 <at> debbugs.gnu.org
Subject: bug#52980: elide-head and revert-buffer interaction stops elide-head-show from working
Date: Wed, 5 Jan 2022 01:30:51 -0800
[Message part 1 (text/plain, inline)]
<jakanakaevangeli <at> chiru.no> writes:

>> +  (if elide-head-mode
>> +      (progn
>> +        (elide-head--hide)
>> +        (add-hook 'before-revert-hook 'elide-head--delete-overlay nil 'local))
>> +    (elide-head--show)
>> +    (remove-hook 'before-revert-hook 'elide-head--delete-overlay 'local)))
>
> Perhaps change-major-mode-hook would be more appropriate as suggested by
> "(elisp) Creating Buffer-Local". That would make the minor mode clean up
> its overlay if the user executes M-x normal-mode in addition to M-x
> revert-buffer.

I think you're right, thanks!  Updated patch attached.
[0001-New-minor-mode-elide-head-mode.patch (text/x-diff, attachment)]

This bug report was last modified 3 years and 192 days ago.

Previous Next


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