(setq require-final-newline nil)
;; Add hooks to rehexlify or dehexlify on various events.
- (make-local-hook 'after-revert-hook)
(add-hook 'after-revert-hook 'hexl-after-revert-hook nil t)
- (make-local-hook 'change-major-mode-hook)
(add-hook 'change-major-mode-hook 'hexl-maybe-dehexlify-buffer nil t)
(if hexl-follow-ascii (hexl-follow-ascii 1)))
(hexl-insert-char ch num))
((eq charset 'unknown)
(error
- "0x%x -- invalid character code; use \\[hexl-insert-hex-string]."
+ "0x%x -- invalid character code; use \\[hexl-insert-hex-string]"
ch))
(t
(let ((encoded (encode-coding-char ch coding))
ch internal-hex))
(setq encoded internal)
(error
- "Can't encode `0x%x' with this buffer's coding system; try \\[hexl-insert-hex-string]."
+ "Can't encode `0x%x' with this buffer's coding system; try \\[hexl-insert-hex-string]"
ch)))
(while (> num 0)
(mapc
CH must be a unibyte character whose value is between 0 and 255."
(if (or (< ch 0) (> ch 255))
- (error "Invalid character 0x%x -- must be in the range [0..255]."))
+ (error "Invalid character 0x%x -- must be in the range [0..255]"))
(let ((address (hexl-current-address t)))
(while (> num 0)
(let ((hex-position
(> (prefix-numeric-value arg) 0)
(not hexl-ascii-overlay))))
- (make-local-hook 'post-command-hook)
-
(if on-p
;; turn it on
(if (not hexl-ascii-overlay)
(if hexl-mode-map
nil
- (setq hexl-mode-map (copy-keymap (current-global-map)))
+ (setq hexl-mode-map (make-keymap))
;; Make all self-inserting keys go through hexl-self-insert-command,
;; because we need to convert them to unibyte characters before
;; inserting them into the buffer.
(substitute-key-definition 'self-insert-command 'hexl-self-insert-command
- hexl-mode-map)
+ hexl-mode-map (current-global-map))
(define-key hexl-mode-map [left] 'hexl-backward-char)
(define-key hexl-mode-map [right] 'hexl-forward-char)