File: tar-mode.el.html
This package attempts to make dealing with Unix 'tar' archives easier.
When this code is loaded, visiting a file whose name ends in '.tar' will cause the contents of that archive file to be displayed in a Dired-like listing. It is then possible to use the customary Dired keybindings to extract sub-files from that archive, either by reading them into their own editor buffers, or by copying them directly to arbitrary files on disk. It is also possible to delete sub-files from within the tar file and write the modified archive back to disk, or to edit sub-files within the archive and re-insert the modified files into the archive. See the documentation string of tar-mode for more info.
This code now understands the extra fields that GNU tar adds to tar files.
Do not attempt to use tar-mode.el with crypt.el, you will lose.
*************** TO DO ***************
o chmod should understand "a+x,og-w".
o The code is less efficient that it could be - in a lot of places, I
pull a 512-character string out of the buffer and parse it, when I could
be parsing it in place, not garbaging a string. Should redo that.
o I'd like a command that searches for a string/regexp in every subfile
of an archive, where <esc> would leave you in a subfile-edit buffer.
(Like the Meta-R command of the Zmacs mail reader.)
o Sometimes (but not always) reverting the tar-file buffer does not
re-grind the listing, and you are staring at the binary tar data.
Typing 'g' again immediately after that will always revert and re-grind
it, though. I have no idea why this happens.
o Tar-mode interacts poorly with crypt.el and zcat.el because the tar
write-file-hook actually writes the file. Instead it should remove the
header (and conspire to put it back afterwards) so that other write-file
hooks which frob the buffer have a chance to do their dirty work. There
might be a problem if the tar write-file-hook does not come *first* on
the list.
o Block files, sparse files, continuation files, and the various header
types aren't editable. Actually I don't know that they work at all.
Rationale:
Why does tar-mode edit the file itself instead of using tar?
That means that you can edit tar files which you don't have room for on your local disk.
I don't know about recent features in gnu tar, but old versions of tar can't replace a file in the middle of a tar file with a new version. Tar-mode can. I don't think tar can do things like chmod the subfiles. An implementation which involved unpacking and repacking the file into some scratch directory would be very wasteful, and wouldn't be able to preserve the file owners.
Defined variables (19)
pax-extended-attribute-record-regexp | Regular expression for looking up extended attributes in a |
tar-anal-blocksize | The blocksize of tar files written by Emacs, or nil, meaning don’t care. |
tar-archive-from-tar | Non-nil if an arc-mode archive file is a member of a tar archive. |
tar-copy-preserve-time | Non-nil means that Tar mode preserves the timestamp when copying files. |
tar-data-buffer | Buffer that holds the actual raw tar bytes. |
tar-data-swapped | If non-nil, ‘tar-data-buffer’ indeed holds raw tar bytes. |
tar-mode-abbrev-table | Abbrev table for ‘tar-mode’. |
tar-mode-hook | Hook run after entering ‘tar-mode’. |
tar-mode-immediate-menu | Immediate menu for Tar mode. |
tar-mode-map | Local keymap for Tar mode listings. |
tar-mode-mark-menu | Mark menu for Tar mode. |
tar-mode-operate-menu | Operate menu for Tar mode. |
tar-mode-show-date | Non-nil means Tar mode should show the date/time of each subfile. |
tar-mode-syntax-table | Syntax table for ‘tar-mode’. |
tar-subfile-mode | Non-nil if Tar-Subfile mode is enabled. |
tar-subfile-mode-hook | Hook run after entering or leaving ‘tar-subfile-mode’. |
tar-superior-buffer | Buffer containing the tar archive from which a member was extracted. |
tar-superior-descriptor | Tar descriptor for a member extracted from an archive. |
tar-update-datestamp | Non-nil means Tar mode should play fast and loose with sub-file datestamps. |