comparison lisp/hexl.el @ 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 8fcc1d6b9fde
children ee5932bf781d
comparison
equal deleted inserted replaced
94378:c3290fb56366 94379:154aba86b686
118 (defvar hexl-mode-old-ruler-function) 118 (defvar hexl-mode-old-ruler-function)
119 (defvar hexl-mode-old-isearch-search-fun-function) 119 (defvar hexl-mode-old-isearch-search-fun-function)
120 (defvar hexl-mode-old-require-final-newline) 120 (defvar hexl-mode-old-require-final-newline)
121 (defvar hexl-mode-old-syntax-table) 121 (defvar hexl-mode-old-syntax-table)
122 (defvar hexl-mode-old-font-lock-keywords) 122 (defvar hexl-mode-old-font-lock-keywords)
123 (defvar hexl-mode-old-eldoc-documentation-function)
123 124
124 (defvar hexl-ascii-overlay nil 125 (defvar hexl-ascii-overlay nil
125 "Overlay used to highlight ASCII element corresponding to current point.") 126 "Overlay used to highlight ASCII element corresponding to current point.")
126 (make-variable-buffer-local 'hexl-ascii-overlay) 127 (make-variable-buffer-local 'hexl-ascii-overlay)
127 128
286 (add-hook 'after-revert-hook 'hexl-after-revert-hook nil t) 287 (add-hook 'after-revert-hook 'hexl-after-revert-hook nil t)
287 288
288 (add-hook 'change-major-mode-hook 'hexl-maybe-dehexlify-buffer nil t) 289 (add-hook 'change-major-mode-hook 'hexl-maybe-dehexlify-buffer nil t)
289 290
290 ;; Set a callback function for eldoc. 291 ;; Set a callback function for eldoc.
292 (make-local-variable 'hexl-mode-old-eldoc-documentation-function)
293 (setq hexl-mode-old-eldoc-documentation-function
294 (bound-and-true-p eldoc-documentation-function))
295
291 (set (make-local-variable 'eldoc-documentation-function) 296 (set (make-local-variable 'eldoc-documentation-function)
292 'hexl-print-current-point-info) 297 'hexl-print-current-point-info)
293 (eldoc-add-command-completions "hexl-") 298 (eldoc-add-command-completions "hexl-")
294 (eldoc-remove-command "hexl-save-buffer" 299 (eldoc-remove-command "hexl-save-buffer"
295 "hexl-current-address") 300 "hexl-current-address")
402 (hl-line-mode 0)) 407 (hl-line-mode 0))
403 (when (boundp 'hexl-mode-old-hl-line-range-function) 408 (when (boundp 'hexl-mode-old-hl-line-range-function)
404 (setq hl-line-range-function hexl-mode-old-hl-line-range-function)) 409 (setq hl-line-range-function hexl-mode-old-hl-line-range-function))
405 (when (boundp 'hexl-mode-old-hl-line-face) 410 (when (boundp 'hexl-mode-old-hl-line-face)
406 (setq hl-line-face hexl-mode-old-hl-line-face)) 411 (setq hl-line-face hexl-mode-old-hl-line-face))
412
413 (when (boundp 'hexl-mode-old-eldoc-documentation-function)
414 (setq eldoc-documentation-function
415 hexl-mode-old-eldoc-documentation-function))
407 416
408 (setq require-final-newline hexl-mode-old-require-final-newline) 417 (setq require-final-newline hexl-mode-old-require-final-newline)
409 (setq mode-name hexl-mode-old-mode-name) 418 (setq mode-name hexl-mode-old-mode-name)
410 (setq isearch-search-fun-function hexl-mode-old-isearch-search-fun-function) 419 (setq isearch-search-fun-function hexl-mode-old-isearch-search-fun-function)
411 (use-local-map hexl-mode-old-local-map) 420 (use-local-map hexl-mode-old-local-map)