# HG changeset patch # User Juri Linkov # Date 1112886961 0 # Node ID eebed65dbe97aad0576f4a7cd45687f375a1b0b0 # Parent 0c7ec8f85244294da2bb7e38832c9f0663a7588d (Info-mode): Add `Info-kill-buffer' to `kill-buffer-hook' locally instead of adding it to the global hook. (Info-kill-buffer): Move up. diff -r 0c7ec8f85244 -r eebed65dbe97 lisp/info.el --- a/lisp/info.el Thu Apr 07 15:15:38 2005 +0000 +++ b/lisp/info.el Thu Apr 07 15:16:01 2005 +0000 @@ -3240,6 +3240,7 @@ (setq line-move-ignore-invisible t) (make-local-variable 'desktop-save-buffer) (setq desktop-save-buffer 'Info-desktop-buffer-misc-data) + (add-hook 'kill-buffer-hook 'Info-kill-buffer nil t) (add-hook 'clone-buffer-hook 'Info-clone-buffer-hook nil t) (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) (add-hook 'isearch-mode-hook 'Info-isearch-start nil t) @@ -3254,6 +3255,13 @@ (Info-set-mode-line) (run-hooks 'Info-mode-hook)) +;; When an Info buffer is killed, make sure the associated tags buffer +;; is killed too. +(defun Info-kill-buffer () + (and (eq major-mode 'Info-mode) + Info-tag-table-buffer + (kill-buffer Info-tag-table-buffer))) + (defun Info-clone-buffer-hook () (when (bufferp Info-tag-table-buffer) (setq Info-tag-table-buffer @@ -3887,16 +3895,6 @@ (set-buffer-modified-p nil)))) - -;; When an Info buffer is killed, make sure the associated tags buffer -;; is killed too. -(defun Info-kill-buffer () - (and (eq major-mode 'Info-mode) - Info-tag-table-buffer - (kill-buffer Info-tag-table-buffer))) - -(add-hook 'kill-buffer-hook 'Info-kill-buffer) - ;;; Speedbar support: ;; These functions permit speedbar to display the "tags" in the ;; current info node.