以hexl模式查看gzip存档的内容

时间:2010-08-28 16:23:04

标签: emacs gzip hexdump

我想编写一个类似hexl-find-file的函数,它将打开一个gzip压缩文件并以hexl-mode显示内容。我该怎么做?

2 个答案:

答案 0 :(得分:2)

这对你有用吗?

(require 'jka-compr)
(defun hexl-find-file ()
  "call find file and then jump into hexl mode"
  (interactive)
  (call-interactively 'find-file)
  (hexl-mode 1))

'jka-compr提供无缝压缩文件处理,'hexl-find-file只需打开文件并启用hexl-mode

答案 1 :(得分:0)

在运行hexl-find-file之前打开自动压缩模式?

,----[ C-h f auto-compression-mode RET ]
| `auto-compression-mode' is an interactive compiled Lisp function
|   -- loaded from "/usr/share/xemacs21/xemacs-packages/lisp/os-utils/auto-autoloads"
| (auto-compression-mode &optional ARG)
| 
| Documentation:
| Toggle automatic file compression and uncompression.
| With prefix argument ARG, turn auto compression on if positive, else off.
| Returns the new status of auto compression (non-nil means on).
| 
| Invoked with:
| 
| M-x auto-compression-mode
`----