summaryrefslogtreecommitdiff
path: root/lisp/hexl.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-03-09 03:05:51 +0000
committerRichard M. Stallman <rms@gnu.org>1995-03-09 03:05:51 +0000
commitc3de2bf0018ce0bb6e147dbbc010ae02869c64d5 (patch)
tree1429f214577aab2e53d020f8e059ccf2ec990ff6 /lisp/hexl.el
parentb7e6e61235d74fca9b597e6ea8eac42265d429f5 (diff)
downloademacs-c3de2bf0018ce0bb6e147dbbc010ae02869c64d5.tar.gz
(hexl-mode): Make after-revert-hook rehexlify.
(hexl-after-revert-hook): New function.
Diffstat (limited to 'lisp/hexl.el')
-rw-r--r--lisp/hexl.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/hexl.el b/lisp/hexl.el
index 669724506b0..806312b0bba 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -170,6 +170,9 @@ You can use \\[hexl-find-file] to visit a file in hexl-mode.
(make-local-variable 'write-contents-hooks)
(add-hook 'write-contents-hooks 'hexl-save-buffer)
+ (make-local-hook 'after-revert-hook)
+ (add-hook 'after-revert-hook 'hexl-after-revert-hook nil t)
+
(make-local-variable 'hexl-max-address)
(make-local-variable 'change-major-mode-hook)
@@ -186,6 +189,10 @@ You can use \\[hexl-find-file] to visit a file in hexl-mode.
(set-buffer-modified-p modified)
(hexl-goto-address original-point)))))
+(defun hexl-after-revert-hook ()
+ (hexlify-buffer)
+ (set-buffer-modified-p nil))
+
(defvar hexl-in-save-buffer nil)
(defun hexl-save-buffer ()