[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/posframe fe57b4f 19/40: Don't modify global value of 'k

From: Feng Shu
Subject: [elpa] externals/posframe fe57b4f 19/40: Don't modify global value of 'kill-buffer-hook'
Date: Wed, 5 Feb 2020 04:27:19 -0500 (EST)

branch: externals/posframe
commit fe57b4fcd5fdfb2a6baa3aad445502e66ed9d2cf
Author: Štěpán Němec <address@hidden>
Commit: Štěpán Němec <address@hidden>

    Don't modify global value of 'kill-buffer-hook'
    Move the modification inside 'posframe--create-posframe' and make it
    buffer-local, as we only need to modify the hook for posframe buffers.
 posframe.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/posframe.el b/posframe.el
index 5e81197..4a8ec4b 100644
--- a/posframe.el
+++ b/posframe.el
@@ -245,6 +245,8 @@ This posframe's buffer is BUFFER-OR-NAME."
       (unless respect-header-line
         (setq-local header-line-format nil))
+      (add-hook 'kill-buffer-hook #'posframe-auto-delete nil t)
       ;; Create child-frame
       (unless (and (frame-live-p posframe--frame)
                    ;; For speed reason, posframe will reuse
@@ -736,8 +738,6 @@ BUFFER-OR-NAME can be a buffer or a buffer name."
 This function is used by `kill-buffer-hook'."
   (posframe-delete-frame (current-buffer)))
-(add-hook 'kill-buffer-hook #'posframe-auto-delete)
 ;; Posframe's position handler
 (defun posframe-run-poshandler (info)
   "Run posframe's position handler.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]