all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Simias <simias.n@gmail.com>
Cc: emacs-pretest-bug@gnu.org
Subject: Re: 23.0.50; hexl-mode and auto-revert-mode incompatibilities
Date: Mon, 21 Jan 2008 14:38:24 +0100	[thread overview]
Message-ID: <4794A050.3000902@gmx.at> (raw)
In-Reply-To: <8663xouegy.fsf@simias.hd.free.fr>

[-- Attachment #1: Type: text/plain, Size: 824 bytes --]

 >   If I open a file in emacs, enable both hexl-mode and
 > auto-revert-mode in its buffer and then modify the content of the file
 > externally, the buffer gets refreshed but its content seems... rather
 > littered. C-l doesn't fix it.
 >
 >   I have similar problems with "auto-revert-tail-mode", but not when I
 > revert the buffer "manually" with M-x revert-buffer.
 >
 >   It seems that when the buffer gets refreshed, it behaves as if
 > hexl-mode was not here (for instance with auto-revert-tail-mode, it
 > just appends the text, without printing the hex values) but I'm not
 > sure about what's going on here.

It's because `auto-revert-mode' doesn't reset the major mode when
reverting the buffer and `hexl-mode' does nothing when the buffer is
already in `hexl-mode'.  Does the attached patch give good results?

[-- Attachment #2: hexl.patch --]
[-- Type: text/plain, Size: 1287 bytes --]

*** hexl.el.~1.115.~	Sat Oct 27 12:07:12 2007
--- hexl.el	Mon Jan 21 14:32:58 2008
***************
*** 136,141 ****
--- 136,143 ----
  
  (put 'hexl-mode 'mode-class 'special)
  
+ (defvar hexl-revert nil)
+ 
  ;;;###autoload
  (defun hexl-mode (&optional arg)
    "\\<hexl-mode-map>A mode for editing binary files in hex dump format.
***************
*** 211,217 ****
  
  \\[describe-bindings] for advanced commands."
    (interactive "p")
!   (unless (eq major-mode 'hexl-mode)
      (let ((modified (buffer-modified-p))
  	  (inhibit-read-only t)
  	  (original-point (- (point) (point-min))))
--- 213,219 ----
  
  \\[describe-bindings] for advanced commands."
    (interactive "p")
!   (unless (and (eq major-mode 'hexl-mode) (not hexl-revert))
      (let ((modified (buffer-modified-p))
  	  (inhibit-read-only t)
  	  (original-point (- (point) (point-min))))
***************
*** 322,328 ****
    (remove-hook 'change-major-mode-hook 'hexl-maybe-dehexlify-buffer t))
  
  (defun hexl-after-revert-hook ()
!   (hexl-mode))
  
  (defvar hexl-in-save-buffer nil)
  
--- 324,331 ----
    (remove-hook 'change-major-mode-hook 'hexl-maybe-dehexlify-buffer t))
  
  (defun hexl-after-revert-hook ()
!   (let ((hexl-revert t))
!     (hexl-mode)))
  
  (defvar hexl-in-save-buffer nil)
  

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

  reply	other threads:[~2008-01-21 13:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-21  1:58 23.0.50; hexl-mode and auto-revert-mode incompatibilities Simias
2008-01-21 13:38 ` martin rudalics [this message]
2008-01-22  2:06   ` Simias
2008-01-22 13:50     ` martin rudalics
2008-01-25  8:55       ` Simias
2008-01-25  9:28         ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4794A050.3000902@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=simias.n@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.