bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error in hexl-mode


From: Eli Zaretskii
Subject: Re: error in hexl-mode
Date: Wed, 07 Feb 2001 19:28:00 +0200

> From: Matt <matt@progsoc.uts.edu.au>
> Date: Thu, 8 Feb 2001 01:25:28 +1100
> 
> guys (inclusive of both sexes naturally),
>       there seems to be a bug in hexl-mode. it seems to insert a
> '0x81' about 5 chars into the file. you might want to check it
> out. attached is a file that triggers the bug.

Thank you for your report.

Please try the change below.  If it works, this problem is already
corrected in the development sources (which is where I produced the
diffs from).

--- lisp/hexl.el        2000/04/19 19:10:46     1.61
+++ lisp/hexl.el        2000/10/11 17:03:58
@@ -600,17 +600,7 @@
   (setq buffer-undo-list nil)
   ;; 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
-        (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))))
+       (coding-system-for-write buffer-file-coding-system)
        (buffer-undo-list t))
     (shell-command-on-region (point-min) (point-max) hexlify-command t)
     (if (> (point) (hexl-address-to-marker hexl-max-address))
@@ -625,15 +615,7 @@
           (error "Aborted")))
   (setq buffer-undo-list nil)
   (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))))
+       (coding-system-for-read buffer-file-coding-system)
        (buffer-undo-list t))
     (shell-command-on-region (point-min) (point-max) dehexlify-command t)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]