;;; hexl.el --- edit a file in a hex dump format using the hexl filter
-;; Copyright (C) 1989, 1994, 1998, 2001, 2002 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 1994, 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
;; Author: Keith Gabryelski <ag@wheaties.ai.mit.edu>
;; Maintainer: FSF
00000050: 6162 6c65 2041 5343 4949 2063 6861 7261 able ASCII chara
00000060: 6374 6572 732e 2020 416e 7920 636f 6e74 cters. Any cont
00000070: 726f 6c20 6f72 206e 6f6e 2d41 5343 4949 rol or non-ASCII
- 00000080: 2063 6861 7261 6374 6572 730a 6172 6520 characters.are
+ 00000080: 2063 6861 7261 6374 6572 730a 6172 6520 characters.are
00000090: 6469 7370 6c61 7965 6420 6173 2070 6572 displayed as per
000000a0: 696f 6473 2069 6e20 7468 6520 7072 696e iods in the prin
- 000000b0: 7461 626c 6520 6368 6172 6163 7465 7220 table character
+ 000000b0: 7461 626c 6520 6368 6172 6163 7465 7220 table character
000000c0: 7265 6769 6f6e 2e0a region..
Movement is as simple as movement in a normal emacs text buffer. Most
(list
(let ((completion-ignored-extensions nil))
(read-file-name "Filename: " nil nil 'ret-must-match))))
- (find-file-literally filename)
+ ;; Ignore the user's setting of default-major-mode.
+ (let ((default-major-mode 'fundamental-mode))
+ (find-file-literally filename))
(if (not (eq major-mode 'hexl-mode))
(hexl-mode)))
element under the point is highlighted.
Customize the variable `hexl-follow-ascii' to disable this feature."
(interactive "P")
- (let ((on-p (if arg
+ (let ((on-p (if arg
(> (prefix-numeric-value arg) 0)
(not hexl-ascii-overlay))))
;; 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 (current-global-map))
+ (define-key hexl-mode-map [remap self-insert-command] 'hexl-self-insert-command)
+ (define-key hexl-mode-map "\C-m" 'hexl-self-insert-command)
(define-key hexl-mode-map [left] 'hexl-backward-char)
(define-key hexl-mode-map [right] 'hexl-forward-char)
(define-key hexl-mode-map [up] 'hexl-previous-line)