all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How do I directly specify a zip file member as a command or command-line option?
@ 2008-12-22  6:29 R. Bernstein
  2008-12-24  8:09 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: R. Bernstein @ 2008-12-22  6:29 UTC (permalink / raw
  To: help-gnu-emacs

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.

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.

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?
If so, I'd make sure to arrange the debugger to output backtraces and
in that format.

Thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How do I directly specify a zip file member as a command or  command-line option?
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2008-12-24  8:09 UTC (permalink / raw
  To: help-gnu-emacs

[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-24  8:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

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.