aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/hexl.el29
1 files changed, 8 insertions, 21 deletions
diff --git a/lisp/hexl.el b/lisp/hexl.el
index c8f1a79b185..176def81026 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -65,25 +65,8 @@ and \"-de\" when dehexlifying a buffer."
65 :group 'hexl) 65 :group 'hexl)
66 66
67(defcustom hexl-options (format "-hex %s" hexl-iso) 67(defcustom hexl-options (format "-hex %s" hexl-iso)
68 "Options to `hexl-program' that suit your needs." 68 "Space separated options to `hexl-program' that suit your needs.
69 :type 'string 69Quoting cannot be used, so the arguments cannot themselves contain spaces."
70 :group 'hexl)
71
72(defcustom hexlify-command
73 (format "%s %s"
74 (shell-quote-argument
75 (expand-file-name hexl-program exec-directory))
76 hexl-options)
77 "The command to use to hexlify a buffer."
78 :type 'string
79 :group 'hexl)
80
81(defcustom dehexlify-command
82 (format "%s -de %s"
83 (shell-quote-argument
84 (expand-file-name hexl-program exec-directory))
85 hexl-options)
86 "The command to use to unhexlify a buffer."
87 :type 'string 70 :type 'string
88 :group 'hexl) 71 :group 'hexl)
89 72
@@ -627,7 +610,9 @@ This discards the buffer's undo information."
627 (let ((coding-system-for-read 'raw-text) 610 (let ((coding-system-for-read 'raw-text)
628 (coding-system-for-write buffer-file-coding-system) 611 (coding-system-for-write buffer-file-coding-system)
629 (buffer-undo-list t)) 612 (buffer-undo-list t))
630 (shell-command-on-region (point-min) (point-max) hexlify-command t) 613 (apply 'call-process-region (point-min) (point-max)
614 (expand-file-name hexl-program exec-directory)
615 t t nil (split-string hexl-options))
631 (if (> (point) (hexl-address-to-marker hexl-max-address)) 616 (if (> (point) (hexl-address-to-marker hexl-max-address))
632 (hexl-goto-address hexl-max-address)))) 617 (hexl-goto-address hexl-max-address))))
633 618
@@ -642,7 +627,9 @@ This discards the buffer's undo information."
642 (let ((coding-system-for-write 'raw-text) 627 (let ((coding-system-for-write 'raw-text)
643 (coding-system-for-read buffer-file-coding-system) 628 (coding-system-for-read buffer-file-coding-system)
644 (buffer-undo-list t)) 629 (buffer-undo-list t))
645 (shell-command-on-region (point-min) (point-max) dehexlify-command t))) 630 (apply 'call-process-region (point-min) (point-max)
631 (expand-file-name hexl-program exec-directory)
632 t t nil "-de" (split-string hexl-options))))
646 633
647(defun hexl-char-after-point () 634(defun hexl-char-after-point ()
648 "Return char for ASCII hex digits at point." 635 "Return char for ASCII hex digits at point."