all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: Davin Pearson <davin.pearson@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Trouble getting archives to load as archives
Date: Fri, 04 Jul 2008 07:38:25 +0200	[thread overview]
Message-ID: <87hcb6b44u.fsf@tux.homenetwork> (raw)
In-Reply-To: <f1ce82e6-59be-4302-888e-c4e7a74cf9ff@f63g2000hsf.googlegroups.com> (Davin Pearson's message of "Thu, 3 Jul 2008 15:59:09 -0700 (PDT)")

Davin Pearson <davin.pearson@gmail.com> writes:

> The following code works for Emacs Version 20.7 and 21.3
> to load archive files as archives:
>
> (setq auto-mode-alist
>       (cons '("\\.\\(arc\\|zip\\|lzh\\|zoo\\)\\'" . archive-mode)
>             auto-mode-alist))
>
> I tried the following code but it only works on ZIP files:
>
> (add-hook 'find-file-hooks 'my-archive-hook)
> (defun my-archive-hook ()
>   (when (or (string-match "\\.zip$" (buffer-name))
>             (string-match "\\.tar$" (buffer-name))
>             (string-match "\\.gz$"  (buffer-name)))
>     (archive-mode 1)
>     ))
>
> So my question is this: how do I get archive-mode to display archives
> correctly for TAR and GZ files?
>
Hi,
an other solution is to use avfs, with that you can open any archives on
read/write mode just as any directory in dired.
So just install avfs and set fuse in your kernel (and install fuse)
I use this code to use it in emacs:

,----[ avfs in dired ]
| (defun tv-dired-browse-archive ()
|   "This function use avfs and fuse, so be sure
| to have these programs and modules installed on your system"
|   (interactive)
|   (let ((file-at-point (dired-get-filename)))
|     (if (or (equal (file-name-extension file-at-point) "gz")
|             (equal (file-name-extension file-at-point) "bz2")
|             (equal (file-name-extension file-at-point) "zip"))
|         (progn
|           (when (not (cddr (directory-files "~/.avfs")))
|             (shell-command "mountavfs"))
|           (find-file (concat "~/.avfs" file-at-point "#")))
|       (find-file file-at-point))))
| (define-key dired-mode-map (kbd "z") 'tv-dired-browse-archive)
`----

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




  reply	other threads:[~2008-07-04  5:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-03 22:59 Trouble getting archives to load as archives Davin Pearson
2008-07-04  5:38 ` Thierry Volpiatto [this message]
2008-07-05  1:37   ` Davin Pearson
2008-07-06 10:59     ` Thierry Volpiatto
2008-07-04 21:57 ` Peter Dyballa
     [not found] ` <mailman.14225.1215208751.18990.help-gnu-emacs@gnu.org>
2008-07-05  1:32   ` Davin Pearson
2008-07-05  2:23     ` Bernardo Bacic
2008-07-05  2:57       ` Davin Pearson
2008-07-05  8:19         ` Peter Dyballa
2008-07-06  8:21           ` Davin Pearson
2008-07-08  7:00             ` Kevin Rodgers
2008-07-08  7:23               ` Peter Dyballa
2008-07-08 10:52               ` Bernardo Bacic
2008-07-08 11:24                 ` Peter Dyballa

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=87hcb6b44u.fsf@tux.homenetwork \
    --to=thierry.volpiatto@gmail.com \
    --cc=davin.pearson@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.