From: Michael Albinus <michael.albinus@gmx.de>
To: Douglas Lewan <d.lewan2000@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: cpio-mode
Date: Fri, 02 Feb 2018 17:30:29 +0100 [thread overview]
Message-ID: <87lggb5p7e.fsf@gmx.de> (raw)
In-Reply-To: <CAAn-m8AJ7+v-Z-pzxo4tYY7G3_RSd4Jpi21DxxKBeV9bySEXAg@mail.gmail.com> (Douglas Lewan's message of "Fri, 2 Feb 2018 10:47:54 -0500")
Douglas Lewan <d.lewan2000@gmail.com> writes:
> Michael,
Hi Doug,
> First: Oh, my! I've been reading about a missing cpio mode in the
> emacs TODO file for years, I'd sort of assumed that there was little
> work on it. (I do admit that when I'd last joined this list, I did
> receive a few attempts to start such a project.)
I haven't updated the TODO file yet, so you wouldn't still know it ...
> Your work sounds similar to mine. Indeed, my goal is to write
> something like a dired front end to all the cpio formats, with
> relatively easy extensibility to others.
That fits perfectly. I have written a *back end*, based on the file name
handler approach of Emacs. See (info "(elisp) Magic File Names")
In fact, most of the basic operations mentioned there got a new
implementation in file .../lisp/net/tramp-archive.el. You don't need to
configure anything in your Emacs, those alternative implementations come
into play based on the file name. Just open the virtual file
"/path/to/file.cpio/", and you have a dired buffer with the contents of
the archive. Call (copy-file "/path/to/file.cpio/foo" "/tmp") etc pp.
I have written something about in the Tramp manual, check
(info "(tramp) Archive file names")
There are also test cases which could give you an impression what's
possible, see .../test/lisp/net/tramp-archive-tests.el.
This implementation has some limitations, though. It is based on GVFS,
the Gnome Virtual File System. In practice, it works only for GNU/Linux
systems. Another drawback is, that the Gnome folks haven't implemented
write access for archives, although it would be possible. Here I'm still
a little bit undecided how to continue.
> This should include editing,
> adding and deleting archive members. That's turned out to be a little
> more than I was expecting. Once I started looking more closely, dired
> is much larger that I was expecting.
>
> FYI The design is coarsely given in this diagram.
>
> ;; +----------------------+ +-------------+ +-------------+
> ;; | Format specific code | | | | |
> ;; | +---------------+ | | | | |
> ;; | | cpio-bin | | | | | |
> ;; | | +--------------+ | | CPIO | | dired-like |
> ;; | +-|cpio-crc | |<->| Logic |<->| UI |
> ;; | | +-------------+ | | | | |
> ;; | +-| hpbin | | | | | |
> ;; | | +------------+ | | | | |
> ;; | +-| ··· | | | | | |
> ;; | +------------+ | | | | |
> ;; +----------------------+ +-------------+ +-------------+
> ;; Λ Λ Λ
> ;; | | |
> ;; V V V
> ;; +----------------------------------------------------------+
> ;; | generic code |
> ;; | +------------+ +--------------+ +-----+ |
> ;; | | cpio-modes | | cpio-generic | | ··· | |
> ;; | +------------+ +--------------+ +-----+ |
> ;; +----------------------------------------------------------+
>
> Could you point me to your code? Thanks.
At a first glance, what you call "generic code" could be based on the
back end. Maybe there's something missing, but it could be a starter.
Best regards, Michael.
prev parent reply other threads:[~2018-02-02 16:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-02 4:14 cpio-mode Douglas Lewan
2018-02-02 13:48 ` cpio-mode Michael Albinus
2018-02-02 15:47 ` cpio-mode Douglas Lewan
2018-02-02 16:30 ` Michael Albinus [this message]
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=87lggb5p7e.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=d.lewan2000@gmail.com \
--cc=emacs-devel@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.