]> code.delx.au - gnu-emacs/blobdiff - lisp/hexl.el
(latex-run-command): Doc fix.
[gnu-emacs] / lisp / hexl.el
index a58798e8cae7e44eaa6c039d6e430c456f6aa812..40096800d0efb529a1b2d06ae25b5ffbe170c4c8 100644 (file)
@@ -91,7 +91,8 @@ and \"-de\" when dehexlifying a buffer."
 (defcustom hexl-follow-ascii t
   "If non-nil then highlight the ASCII character corresponding to point."
   :type 'boolean
-  :group 'hexl)
+  :group 'hexl
+  :version "20.3")
 
 (defvar hexl-max-address 0
   "Maximum offset into hexl buffer.")
@@ -590,8 +591,8 @@ This discards the buffer's undo information."
        (or (y-or-n-p "Converting to hexl format discards undo info; ok? ")
           (error "Aborted")))
   (setq buffer-undo-list nil)
-  (let ((binary-process-output nil) ; for Ms-Dos
-       (binary-process-input buffer-file-type)
+  ;; Don't decode text in the ASCII part of `hexl' program output.
+  (let ((coding-system-for-read 'raw-text)
        ;; If the buffer was read with EOL conversions, be sure to use the
        ;; same conversions when passing the region to the `hexl' program.
        (coding-system-for-write
@@ -614,9 +615,16 @@ This discards the buffer's undo information."
        (or (y-or-n-p "Converting from hexl format discards undo info; ok? ")
           (error "Aborted")))
   (setq buffer-undo-list nil)
-  (let ((binary-process-output buffer-file-type) ; for Ms-Dos
-       (binary-process-input nil)
-       (coding-system-for-read 'raw-text)
+  (let ((coding-system-for-write 'raw-text)
+       (coding-system-for-read
+        (let ((eol-type (coding-system-eol-type buffer-file-coding-system)))
+          (cond ((eq eol-type 1)
+                 'raw-text-dos)
+                ((eq eol-type 2)
+                 'raw-text-mac)
+                ((eq eol-type 0)
+                 'raw-text-unix)
+                (t 'no-conversion))))
        (buffer-undo-list t))
     (shell-command-on-region (point-min) (point-max) dehexlify-command t)))
 
@@ -804,48 +812,26 @@ Customize the variable `hexl-follow-ascii' to disable this feature."
 
   (define-key hexl-mode-map "\e\C-a" 'hexl-beginning-of-512b-page)
   (define-key hexl-mode-map "\e\C-b" 'hexl-backward-short)
-  (define-key hexl-mode-map "\e\C-c" 'undefined)
   (define-key hexl-mode-map "\e\C-d" 'hexl-insert-decimal-char)
   (define-key hexl-mode-map "\e\C-e" 'hexl-end-of-512b-page)
   (define-key hexl-mode-map "\e\C-f" 'hexl-forward-short)
-  (define-key hexl-mode-map "\e\C-g" 'undefined)
-  (define-key hexl-mode-map "\e\C-h" 'undefined)
   (define-key hexl-mode-map "\e\C-i" 'undefined)
   (define-key hexl-mode-map "\e\C-j" 'undefined)
   (define-key hexl-mode-map "\e\C-k" 'undefined)
-  (define-key hexl-mode-map "\e\C-l" 'undefined)
-  (define-key hexl-mode-map "\e\C-m" 'undefined)
-  (define-key hexl-mode-map "\e\C-n" 'undefined)
   (define-key hexl-mode-map "\e\C-o" 'hexl-insert-octal-char)
-  (define-key hexl-mode-map "\e\C-p" 'undefined)
   (define-key hexl-mode-map "\e\C-q" 'undefined)
-  (define-key hexl-mode-map "\e\C-r" 'undefined)
-  (define-key hexl-mode-map "\e\C-s" 'undefined)
   (define-key hexl-mode-map "\e\C-t" 'undefined)
-  (define-key hexl-mode-map "\e\C-u" 'undefined)
-
-  (define-key hexl-mode-map "\e\C-w" 'undefined)
   (define-key hexl-mode-map "\e\C-x" 'hexl-insert-hex-char)
-  (define-key hexl-mode-map "\e\C-y" 'undefined)
-
-  (define-key hexl-mode-map "\ea" 'undefined)
   (define-key hexl-mode-map "\eb" 'hexl-backward-word)
   (define-key hexl-mode-map "\ec" 'undefined)
   (define-key hexl-mode-map "\ed" 'undefined)
-  (define-key hexl-mode-map "\ee" 'undefined)
   (define-key hexl-mode-map "\ef" 'hexl-forward-word)
   (define-key hexl-mode-map "\eg" 'hexl-goto-hex-address)
-  (define-key hexl-mode-map "\eh" 'undefined)
   (define-key hexl-mode-map "\ei" 'undefined)
   (define-key hexl-mode-map "\ej" 'hexl-goto-address)
   (define-key hexl-mode-map "\ek" 'undefined)
   (define-key hexl-mode-map "\el" 'undefined)
-  (define-key hexl-mode-map "\em" 'undefined)
-  (define-key hexl-mode-map "\en" 'undefined)
-  (define-key hexl-mode-map "\eo" 'undefined)
-  (define-key hexl-mode-map "\ep" 'undefined)
   (define-key hexl-mode-map "\eq" 'undefined)
-  (define-key hexl-mode-map "\er" 'undefined)
   (define-key hexl-mode-map "\es" 'undefined)
   (define-key hexl-mode-map "\et" 'undefined)
   (define-key hexl-mode-map "\eu" 'undefined)