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.