all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: peter <peter@pg-consultants.com>
To: bug-gnu-emacs@gnu.org
Subject: Viewing compressed files in tar mode
Date: Sun, 13 Dec 2009 03:00:17 -0800 (PST)	[thread overview]
Message-ID: <ae545c47-a2ae-4904-96e9-736bcb3922aa@p8g2000yqb.googlegroups.com> (raw)

I have a tar file a.tar, which contains two files, b.gz and c.jpg.
The jpeg file is opened correctly, but the gz file is opened in binary
mode, whereas it should be uncompressed and shown in text mode.

I have run this with emacs -Q with the same results.

Below is a copy of an email from Peter Dyballa:

I have this customisation for GNU Emacs 22:

         '(jka-compr-compression-info-list (quote (["\\.Z\\(~\\|\\.~
[0-9]+~\
\)?\\'" "compressing" "compress" ("-c") "uncompressing" "gzip" ("-c"
"-
q" "-d") nil t "\x1f\x9d"] ["\\.bz2\\(~\\|\\.~[0-9]+~\\)?\\'"
"bzip2ing"
"bzip2" nil "bunzip2ing" "bzip2" ("-d") nil t "BZh"] ["\\.tbz\\(\\|2\
\)
\\'" "bzip2ing" "bzip2" nil "bunzip2ing" "bzip2" ("-d") nil nil
"BZh"]
["\\.\\(?:tgz\\|svgz\\)\\'" "compressing" "gzip" ("-c" "-q")
"uncompressing" "gzip" ("-c" "-q" "-d") t nil "\x1f\x8b"] ["\\.g?z\\(~\\|
\
\.~[0-9]+~\\)?\\'" "compressing" "gzip" ("-c" "-q") "uncompressing"
"gzip" ("-c" "-q" "-d") t t "\x1f\x8b"] ["\\.dz\\'" nil nil nil
"uncompressing" "gzip" ("-c" "-q" "-d") nil t "\x1f\x8b"])))
/Users/pete/.emacs-Abrichtung-AquaMacs.el: '(auto-compression-mode t
nil (jka-compr))

and I had this for its variant Aquamacs Emacs (Mac OS X only):

         '(auto-compression-mode t nil (jka-compr))

>
> I suspect this is a tar-mode.el bug. Should I report it on the bugs
> list?


Yes, please do! I tried it this morning by creating an archive
comprised of other archives and I then tested a newly compiled
version
of GNU Emacs 23.1.90 from CVS. When I visited the included TAR type
archives they were opened in fundamental mode (instead of tar-mode)
and unreadable. It worked well with ZIP files: their contents was
shown. But when I tried to view/visit an archive member it failed:

        unzip: cannot find or open /Volumes/Halde/_neu/
Beispiel.tar.bz2!./
random.zip, /Volumes/Halde/_neu/Beispiel.tar.bz2!./random.zip.zip
or /
Volumes/Halde/_neu/Beispiel.tar.bz2!./random.zip.ZIP.

(/Volumes/Halde/_neu/Beispiel.tar.bz2 is my archive of archives,
random.zip is the member mentioned.)

When I tried to switch to tar-mode I received:

        byte-code: ^_\300\213^H^H\301\246\322\201H has size -362276419
-
corrupted

This echos the first ten bytes of the archive file. Before
*Messages*
buffer recorded:

        File mode specification error: (error "^_\213\^H^H\346ҁH has
size
-362276419 - corrupted")

Similiar reports were output when I tried to visit other TAR files
in
this archive.


Compressed "text-like" files in the archive were not decompressed.
With a GZipped file I received:

        Error during redisplay: (wrong-type-argument number-or-marker-
p nil)
        File mode specification error: (wrong-type-argument wholenump
nil)

With ncurses-5.4-20040711-patch.sh.bz2 I received:

        Setting up indent for shell type sh
        setting up indent stuff
        Indentation variables are now local.
        Indentation setup for shell type sh

but I saw only the compressed "text," easily recognisable by the
file's header "BZh"...


With GNU Emacs 22.3 I get a "File mode specification error"...


The common failure is that tar-mode is not activated in the TAR file
inside the TAR file and that to unzip is passed a wrong file name,
one
that is concatenated of the archive file's path name, a "!" and the
ZIP file's relative path name – although it does exist in the file
system! (Adding .zip or .ZIP is an automatism of unzip when it fails
to find "file name.")


                 reply	other threads:[~2009-12-13 11:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=ae545c47-a2ae-4904-96e9-736bcb3922aa@p8g2000yqb.googlegroups.com \
    --to=peter@pg-consultants.com \
    --cc=bug-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.