Source

text-modes / hexl.el

Diff from to

File hexl.el

   (setq buffer-undo-list nil)
   ;; Don't decode text in the ASCII part of `hexl' program output.
   (let ((coding-system-for-read 'raw-text)
-	(coding-system-for-write buffer-file-coding-system)
+	(coding-system-for-write 
+	 (or (and (boundp 'buffer-file-coding-system)
+		  buffer-file-coding-system)
+	     'raw-text))
 	(buffer-undo-list t))
     (shell-command-on-region (point-min) (point-max) hexlify-command t)
     (if (> (point) (hexl-address-to-marker hexl-max-address))
 	   (error "Aborted")))
   (setq buffer-undo-list nil)
   (let ((coding-system-for-write 'raw-text)
-	(coding-system-for-read buffer-file-coding-system)
+	(coding-system-for-read 
+	 (or (and (boundp 'buffer-file-coding-system)
+		  buffer-file-coding-system)
+	     'raw-text))
 	(buffer-undo-list t))
     (shell-command-on-region (point-min) (point-max) dehexlify-command t)))