unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: How do I directly specify a zip file member as a command or  command-line option?
Date: Wed, 24 Dec 2008 01:09:46 -0700	[thread overview]
Message-ID: <gisqo0$fkq$1@ger.gmane.org> (raw)
In-Reply-To: <wihzlioyb7f.fsf@panix5.panix.com>

[-- Attachment #1: Type: text/plain, Size: 1508 bytes --]

R. Bernstein wrote:
> In GNU Emacs there is Zip-Archive mode and from a directory list I can
> run (archive-extract) to view a member of the zip file. But I'd like
> to run an emacs commnad to open the member directly without going
> through the directory listing. (archive-zip-extract) seems to be
> close, but that seems require setup on the outside with buffers.

Hmmm, that reminds me of http://www.emacswiki.org/emacs-en/WishList#toc10

I've written a variation on that, which is attached.  To use it from
the command line to view bar.txt in ~/foo.zip:

emacs --eval '(extract-find-file "~/foo.zip" "bar.txt")

> The particular application I have in mind is a Python debugger where
> sometimes the positions will be a file and line number inside a zip
> file, specifically a Python egg.

(progn (extract-find-file ...) (goto-line N))

> Related to the above is the ability on the *command-line* to go to a
> specific location inside a zip file. Emacs follows a convention for
> editing a file and line number: FILE:LINENUM, but is there a
> convention or way to specify a position inside some sort of archive?

Don't you mean: a position (line number) within a file, within an
archive?

If you really do mean a line number within an archive, you would just
need to arrange for Emacs to visit the archive in Fundamental mode
instead of Archive mode (via auto-mode-alist).

> If so, I'd make sure to arrange the debugger to output backtraces and
> in that format.

-- 
Kevin Rodgers
Denver, Colorado, USA

[-- Attachment #2: archive-find-file.el --]
[-- Type: application/emacs-lisp, Size: 1092 bytes --]

      reply	other threads:[~2008-12-24  8:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-22  6:29 How do I directly specify a zip file member as a command or command-line option? R. Bernstein
2008-12-24  8:09 ` Kevin Rodgers [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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='gisqo0$fkq$1@ger.gmane.org' \
    --to=kevin.d.rodgers@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).