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

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

Re: hexl-mode bug in Emacs 20.7


From: Eli Zaretskii
Subject: Re: hexl-mode bug in Emacs 20.7
Date: Tue, 9 Jan 2001 10:14:08 +0200 (IST)

On Mon, 8 Jan 2001, Seth Tisue wrote:

> Hi... at this URL:
> 
>   http://mail.gnu.org/pipermail/bug-gnu-emacs/2000-October/000288.html
> 
> Eli Zaretskii claimed (recently!) that the bug in hexl-mode that
> garbles the contents of most small binary files has been fixed in
> Emacs 20.7, but this seems not to be the case; I am running 20.7 as
> shipped with RedHat Linux 7.0:
> 
>   % emacs --version
>   GNU Emacs 20.7.1
>   Copyright (C) 1999 Free Software Foundation, Inc.
> 
> and I am experiencing the exact same problem.

The message you cited above had a followup (in private email) which made 
it clear that indeed this specific problem is not related to bugs fixed 
between v20.2 and v20.7.  The changes below (checked into the development 
sources in October) should fix this particular problem.  If they don't 
fix the problem for you, please report the details.

2000-10-11  Eli Zaretskii  <address@hidden>

        * hexl.el (hexlify-buffer): Bind coding-system-for-write to
        buffer-file-coding-system, instead of raw-text.
        (dehexlify-buffer): Bind coding-system-for-read to
        buffer-file-coding-system, instead of raw-text.


Index: lisp/hexl.el
===================================================================
RCS file: /cvs/emacs/lisp/hexl.el,v
retrieving revision 1.61
retrieving revision 1.62
diff -c -r1.61 -r1.62
*** lisp/hexl.el        2000/04/19 19:10:46     1.61
--- lisp/hexl.el        2000/10/11 17:08:28     1.62
***************
*** 600,616 ****
    (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))))
        (buffer-undo-list t))
      (shell-command-on-region (point-min) (point-max) hexlify-command t)
      (if (> (point) (hexl-address-to-marker hexl-max-address))
--- 600,606 ----
    (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)
        (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,639 ****
           (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))))
        (buffer-undo-list t))
      (shell-command-on-region (point-min) (point-max) dehexlify-command t)))
  
--- 615,621 ----
           (error "Aborted")))
    (setq buffer-undo-list nil)
    (let ((coding-system-for-write 'raw-text)
!       (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]