From ffd97a5a3663103aa96945bb1d2f03481ab6229f Mon Sep 17 00:00:00 2001 From: Lars Tveito Date: Sun, 6 Nov 2016 16:02:58 +0100 Subject: [PATCH] Fix bug related to `post-command-hook` The `post-command-hook` was made `permanent-local` in order to keep focus mode enabled when changing major mode. Other modes relies on the `post-command-hook` to be cleared on major mode change, causing problems. This fix rather uses the `permanent-local-hook` to tag functions that should not be removed from hooks. This fixes abo-abo/swiper#755. It might fix bugs I have not been able to reproduce, namely #10, #8 and a followup in #7. --- focus.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/focus.el b/focus.el index 5ec37aa..0bd5a5a 100644 --- a/focus.el +++ b/focus.el @@ -95,9 +95,15 @@ The timer calls `focus-read-only-hide-cursor' after (dolist (var '(focus-current-thing focus-pre-overlay focus-post-overlay - post-command-hook)) + focus-mode + focus-read-only-mode)) (put var 'permanent-local t)) +(dolist (var '(focus-read-only-cursor-blink + focus-read-only-terminate + focus-move-focus)) + (put var 'permanent-local-hook t)) + (defun focus-any (f lst) "Apply F to each element of LST and return first NON-NIL." (when lst