From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: 23.0.50; hexl-mode and auto-revert-mode incompatibilities Date: Mon, 21 Jan 2008 14:38:24 +0100 Message-ID: <4794A050.3000902@gmx.at> References: <8663xouegy.fsf@simias.hd.free.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040202060405070604090003" X-Trace: ger.gmane.org 1200922667 3427 80.91.229.12 (21 Jan 2008 13:37:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Jan 2008 13:37:47 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org To: Simias Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 21 14:38:05 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JGwqi-0001Qw-TO for ged-emacs-devel@m.gmane.org; Mon, 21 Jan 2008 14:38:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JGwqJ-00053H-Fq for ged-emacs-devel@m.gmane.org; Mon, 21 Jan 2008 08:37:39 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JGwqE-00052R-C7 for emacs-devel@gnu.org; Mon, 21 Jan 2008 08:37:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JGwqC-00051z-Jj for emacs-devel@gnu.org; Mon, 21 Jan 2008 08:37:33 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JGwqC-00051w-Eq for emacs-devel@gnu.org; Mon, 21 Jan 2008 08:37:32 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JGwqC-0005Nh-2J for emacs-devel@gnu.org; Mon, 21 Jan 2008 08:37:32 -0500 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JGwqB-0002id-QM for emacs-pretest-bug@gnu.org; Mon, 21 Jan 2008 08:37:31 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JGwq8-0005MV-GI for emacs-pretest-bug@gnu.org; Mon, 21 Jan 2008 08:37:31 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JGwq8-0005M1-20 for emacs-pretest-bug@gnu.org; Mon, 21 Jan 2008 08:37:28 -0500 Original-Received: (qmail invoked by alias); 21 Jan 2008 13:37:26 -0000 Original-Received: from N953P009.adsl.highway.telekom.at (EHLO [62.47.63.9]) [62.47.63.9] by mail.gmx.net (mp024) with SMTP; 21 Jan 2008 14:37:26 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19nKzghbX9nkwEWC9VthW7fJtmyRCC1uwuOULG5R+ cQHoU9iIVyVVV5 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: <8663xouegy.fsf@simias.hd.free.fr> X-Y-GMX-Trusted: 0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:87212 gmane.emacs.pretest.bugs:20714 Archived-At: This is a multi-part message in MIME format. --------------040202060405070604090003 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit > 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? --------------040202060405070604090003 Content-Type: text/plain; name="hexl.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="hexl.patch" *** 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) "\\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) --------------040202060405070604090003 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --------------040202060405070604090003--