changeset 94379:154aba86b686

(hexl-mode): Stash `eldoc-documentation-function' in `hexl-mode-old-eldoc-documentation-function'. (hexl-mode-exit): Restore it. (hexl-mode-old-eldoc-documentation-function): Declare for compiler.
author John Paul Wallington <jpw@pobox.com>
date Sat, 26 Apr 2008 17:04:46 +0000
parents c3290fb56366
children 739a2cae0946
files lisp/hexl.el
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/hexl.el	Sat Apr 26 16:54:44 2008 +0000
+++ b/lisp/hexl.el	Sat Apr 26 17:04:46 2008 +0000
@@ -120,6 +120,7 @@
 (defvar hexl-mode-old-require-final-newline)
 (defvar hexl-mode-old-syntax-table)
 (defvar hexl-mode-old-font-lock-keywords)
+(defvar hexl-mode-old-eldoc-documentation-function)
 
 (defvar hexl-ascii-overlay nil
   "Overlay used to highlight ASCII element corresponding to current point.")
@@ -288,6 +289,10 @@
     (add-hook 'change-major-mode-hook 'hexl-maybe-dehexlify-buffer nil t)
 
     ;; Set a callback function for eldoc.
+    (make-local-variable 'hexl-mode-old-eldoc-documentation-function)
+    (setq hexl-mode-old-eldoc-documentation-function
+	  (bound-and-true-p eldoc-documentation-function))
+
     (set (make-local-variable 'eldoc-documentation-function)
 	 'hexl-print-current-point-info)
     (eldoc-add-command-completions "hexl-")
@@ -405,6 +410,10 @@
   (when (boundp 'hexl-mode-old-hl-line-face)
     (setq hl-line-face hexl-mode-old-hl-line-face))
 
+  (when (boundp 'hexl-mode-old-eldoc-documentation-function)
+    (setq eldoc-documentation-function
+	  hexl-mode-old-eldoc-documentation-function))
+
   (setq require-final-newline hexl-mode-old-require-final-newline)
   (setq mode-name hexl-mode-old-mode-name)
   (setq isearch-search-fun-function hexl-mode-old-isearch-search-fun-function)