GNU bug report logs - #7252
hexl-revert-buffer

Previous Next

Package: emacs;

Reported by: Daiki Ueno <ueno <at> unixuser.org>

Date: Wed, 20 Oct 2010 06:01:02 UTC

Severity: normal

Done: Daiki Ueno <ueno <at> unixuser.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Daiki Ueno <ueno <at> unixuser.org>
Subject: bug#7252: closed (Re: bug#7252: hexl-revert-buffer)
Date: Thu, 21 Oct 2010 02:35:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#7252: hexl-revert-buffer

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 7252 <at> debbugs.gnu.org.

-- 
7252: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7252
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Daiki Ueno <ueno <at> unixuser.org>
To: 7252-done <at> debbugs.gnu.org
Subject: Re: bug#7252: hexl-revert-buffer
Date: Thu, 21 Oct 2010 11:42:14 +0900
Done as r102027.

Regards,
-- 
Daiki Ueno

[Message part 3 (message/rfc822, inline)]
From: Daiki Ueno <ueno <at> unixuser.org>
To: bug-gnu-emacs <at> gnu.org
Subject: hexl-revert-buffer
Date: Wed, 20 Oct 2010 14:57:13 +0900
[Message part 4 (text/plain, inline)]
If I open a ZIP file with M-x hexl-find-file and then M-x revert-buffer,
I see hexified file list generated by arc-mode, instead of raw ZIP data.

This behavior is surprising for me and it is cumbersome to do M-x
kill-buffer and M-x hexl-find-file each time.

How about adding M-x hexl-revert-buffer?

[hexl-revert-buffer.diff (text/x-patch, inline)]
=== modified file 'lisp/hexl.el'
--- lisp/hexl.el	2010-10-10 23:12:30 +0000
+++ lisp/hexl.el	2010-10-20 05:46:47 +0000
@@ -189,6 +189,7 @@
     (define-key map "\C-x\C-p" 'undefined)
     (define-key map "\C-x\C-s" 'hexl-save-buffer)
     (define-key map "\C-x\C-t" 'undefined)
+    (define-key map "\C-xg" 'hexl-revert-buffer)
     map))
 
 ;; Variable declarations for suppressing warnings from the byte-compiler.
@@ -464,6 +465,16 @@
   (if (not (eq major-mode 'hexl-mode))
       (hexl-mode)))
 
+(defun hexl-revert-buffer ()
+  "Revert the buffer previously opened with `hexl-find-file'."
+  (interactive)
+  (if (eq major-mode 'hexl-mode)
+      (let ((coding-system-for-read 'no-conversion))
+	(revert-buffer nil nil t)
+	(setq major-mode 'fundamental-mode)
+	(hexl-mode))
+    (call-interactively #'revert-buffer)))
+
 (defun hexl-mode-exit (&optional arg)
   "Exit Hexl mode, returning to previous mode.
 With arg, don't unhexlify buffer."

[Message part 6 (text/plain, inline)]
Regards,
-- 
Daiki Ueno

This bug report was last modified 14 years and 274 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.