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

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

Re: hexl-find-file and moding


From: Eli Zaretskii
Subject: Re: hexl-find-file and moding
Date: Sat, 12 Jan 2002 15:28:25 +0200

> From: john <address@hidden>
> Date: Sat, 12 Jan 2002 10:01:48 GMT
> 
> Open a file in hexl-mode
>     M-x hexl-find-file <RET>  ALPHABET <RET>
> 
> On the assumption that the file has changed, try to refresh it
>     C-x C-f <RET>
> 
> to which emacs says
>     Revisit non-literally? (y or n)
> 
> and we answer
>             y
> 
> The file now claims to be in hexl-mode, but is desplayed as straight text.
> 
> Change to fundamental mode
>     M-x fundamental-mode <RET>
> 
> to which emacs says
>     Convert contents back to binary format? (y or n)
> 
> and we answer
>         y
> 
> The entire contents of the buffer ALPHABET are deleted.

Please try the patch below.  Note that, since files.el is preloaded,
you will need to rebuild Emacs (or manually load files.elc) after
byte-compiling file.el, fior the change to take effect.


2002-01-12  Eli Zaretskii  <address@hidden>

        * files.el (find-file-noselect): Don't consider a buffer as
        visiting a file literally if it is in hexl-mode.

*** lisp/files.e~0      Fri Jan  4 11:52:14 2002
--- lisp/files.el       Sat Jan 12 15:23:20 2002
***************
*** 1078,1085 ****
                      (setq buffer-read-only read-only)))
                  (setq buffer-file-read-only read-only))
  
!               (when (not (eq (not (null rawfile))
!                              (not (null find-file-literally))))
                  (if (buffer-modified-p)
                      (if (y-or-n-p (if rawfile
                                        "Save file and revisit literally? "
--- 1078,1089 ----
                      (setq buffer-read-only read-only)))
                  (setq buffer-file-read-only read-only))
  
!               (when (and (not (eq (not (null rawfile))
!                                   (not (null find-file-literally))))
!                          ;; It is confusing to ask whether to visit
!                          ;; non-literally if they have the file in
!                          ;; hexl-mode.
!                          (not (eq major-mode 'hexl-mode)))
                  (if (buffer-modified-p)
                      (if (y-or-n-p (if rawfile
                                        "Save file and revisit literally? "



reply via email to

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