From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: cpio-mode Date: Fri, 02 Feb 2018 17:30:29 +0100 Message-ID: <87lggb5p7e.fsf@gmx.de> References: <87tvuzh597.fsf@gmx.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1517594911 17647 195.159.176.226 (2 Feb 2018 18:08:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Feb 2018 18:08:31 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Douglas Lewan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 02 19:08:26 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehfl7-00044J-SZ for ged-emacs-devel@m.gmane.org; Fri, 02 Feb 2018 19:08:22 +0100 Original-Received: from localhost ([::1]:45309 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehfn9-0005NO-2S for ged-emacs-devel@m.gmane.org; Fri, 02 Feb 2018 13:10:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehexH-0000DY-O2 for emacs-devel@gnu.org; Fri, 02 Feb 2018 12:17:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehewD-0001fw-3B for emacs-devel@gnu.org; Fri, 02 Feb 2018 12:16:51 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:42357) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehebY-0000gh-5P for emacs-devel@gnu.org; Fri, 02 Feb 2018 11:54:24 -0500 Original-Received: from detlef.gmx.de ([212.86.43.48]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M55BC-1ewQGW1Jhm-00zEYm; Fri, 02 Feb 2018 17:30:30 +0100 In-Reply-To: (Douglas Lewan's message of "Fri, 2 Feb 2018 10:47:54 -0500") X-Provags-ID: V03:K0:k8/2FjB1zdUpR/9n8ZhWE9DaXkmFseCknsTsxgpOtVSKRRaZIcs EtmugjH4rrEuaZB361vLfMzgT0ZpTwaidzWa7jMkcGhE5jwEH1eulkWUk8YbnRze7bi2ATZ TrZfHFFizMUT/TBOReg2yEk3jeY5X4aDPmGKoYzxuQaMgTg04Qr7h32qESKbJsfh5o+OkHH JpFgfPH+KrD0mb4sBubPA== X-UI-Out-Filterresults: notjunk:1;V01:K0:M08fpvH7eE8=:Fglq6fKgWQefO6njGlhGf0 elluhyckc5txcy5FdUWsV1KLM/Ppz0NQPJ7ayDe1XgZTjf9HXfQgB3Y4tWMbvDNLBc0yV5ujZ Lo3mXfvcsXKQLySxNdd3/UjcrPwxF6tU4OzLLfGSGj8vG7rk1NuxhZmYTLxNVgbDr7jh7uWtK P9yUlgetu45uibP1k4/UYiQd7njyl6wCiTeOUDerYGDpnGyLV1HCgJfw4fgmWzQwMvMFXXghn LgZz2YVLjQtKfBL6ShkWGltyMOxt2kuS7Lh67559fAO7yYBtQ+uENcwhKSwxLLEOFn7eHOmDU hwmBRwxSpQ23nOCbwUTNnPafJKtMMU6FHyrx4aaJ2lWT/HWhthZlnGWDa3DmI9FwkUDWFuzKC CjSuOD0V/kqLuhB3ptxEDol71CsKPvB+4fKEu+dNfCwQCcPNUEzzhmbwSCIcRpAtyJ10nlEJx IP3ZBbrgjSuWhMQ3k/6GjOyCODs5DM4DkYw0ebtiBkFNhWm0c/wcHvbPHppMetdrLL+EaQyxT gYiDyj1CG4eBcFnRRE/fA4o3MenRaP8lUMD9orJzWig0oqLwGeNFmH72o6JoxQDy96b3G4P/G BQMx8hP7otd5MbVLseWn4uHRUuEaoQrxkKrXmias0B7RcfEkczkO+xfq7lNyyGwr4fIr32ygn uu0T/xdO+X3KkQ2Tn+NO74H0qamrPBB2uPyokNrgVTQWuhfGuVg2sOZ4IKq+Y2urafHYWL3RX umyHFpJpegXT67oE8ALC3/FTW56CG8V678FqbUQ9R0IpitD6xfPJpG5yGGhtvzBS/4IwYap2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:222420 Archived-At: Douglas Lewan 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 | | | | | | > ;; | | +------------+ | | | | | > ;; | +-| =C2=B7=C2=B7=C2=B7 | | | | | = | > ;; | +------------+ | | | | | > ;; +----------------------+ +-------------+ +-------------+ > ;; =CE=9B =CE=9B =CE=9B > ;; | | | > ;; V V V > ;; +----------------------------------------------------------+ > ;; | generic code | > ;; | +------------+ +--------------+ +-----+ | > ;; | | cpio-modes | | cpio-generic | | =C2=B7=C2=B7=C2=B7 | = | > ;; | +------------+ +--------------+ +-----+ | > ;; +----------------------------------------------------------+ > > 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.