comparison lisp/hexl.el @ 5458:0873b536e71d

(dehexlify-buffer): If msdos, bind binary-process. (hexl-find-file): Load as binary.
author Richard M. Stallman <rms@gnu.org>
date Thu, 06 Jan 1994 04:35:56 +0000
parents 9cde7d7fea1f
children bdda7582b8cd
comparison
equal deleted inserted replaced
5457:4fe8a94b0aa6 5458:0873b536e71d
217 ;;;###autoload 217 ;;;###autoload
218 (defun hexl-find-file (filename) 218 (defun hexl-find-file (filename)
219 "Edit file FILENAME in hexl-mode. 219 "Edit file FILENAME in hexl-mode.
220 Switch to a buffer visiting file FILENAME, creating one in none exists." 220 Switch to a buffer visiting file FILENAME, creating one in none exists."
221 (interactive "fFilename: ") 221 (interactive "fFilename: ")
222 (find-file filename) 222 (if (eq system-type 'ms-dos)
223 (find-file-binary filename)
224 (find-file filename))
223 (if (not (eq major-mode 'hexl-mode)) 225 (if (not (eq major-mode 'hexl-mode))
224 (hexl-mode))) 226 (hexl-mode)))
225 227
226 (defun hexl-mode-exit (&optional arg) 228 (defun hexl-mode-exit (&optional arg)
227 "Exit Hexl mode, returning to previous mode. 229 "Exit Hexl mode, returning to previous mode.
502 (shell-command-on-region (point-min) (point-max) hexlify-command t)) 504 (shell-command-on-region (point-min) (point-max) hexlify-command t))
503 505
504 (defun dehexlify-buffer () 506 (defun dehexlify-buffer ()
505 "Convert a hexl format buffer to binary." 507 "Convert a hexl format buffer to binary."
506 (interactive) 508 (interactive)
507 (shell-command-on-region (point-min) (point-max) dehexlify-command t)) 509 (let ((binary-process t)) ; for Ms-Dos
510 (shell-command-on-region (point-min) (point-max) dehexlify-command t)))
508 511
509 (defun hexl-char-after-point () 512 (defun hexl-char-after-point ()
510 "Return char for ASCII hex digits at point." 513 "Return char for ASCII hex digits at point."
511 (hexl-htoi (char-after (point)) 514 (hexl-htoi (char-after (point))
512 (char-after (1+ (point))))) 515 (char-after (1+ (point)))))