Function: tar-subfile-mode
tar-subfile-mode is an interactive and byte-compiled function defined
in tar-mode.el.gz.
Signature
(tar-subfile-mode &optional ARG)
Documentation
Minor mode for editing an element of a tar-file.
This mode arranges for "saving" this buffer to write the data into the tar-file buffer that it came from. The changes will actually appear on disk when you save the tar-file's buffer.
This is a minor mode. If called interactively, toggle the
Tar-Subfile mode mode. If the prefix argument is positive,
enable the mode, and if it is zero or negative, disable the mode.
If called from Lisp, toggle the mode if ARG is toggle. Enable
the mode if ARG is nil, omitted, or is a positive number.
Disable the mode if ARG is a negative number.
To check whether the minor mode is enabled in the current buffer,
evaluate tar-subfile-mode(var)/tar-subfile-mode(fun).
The mode's hook is called both when the mode is enabled and when it is disabled.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/tar-mode.el.gz
(define-minor-mode tar-subfile-mode
"Minor mode for editing an element of a tar-file.
This mode arranges for \"saving\" this buffer to write the data
into the tar-file buffer that it came from. The changes will
actually appear on disk when you save the tar-file's buffer."
;; Don't do this, because it is redundant and wastes mode line space.
;; :lighter " TarFile"
:lighter nil
(or (and (boundp 'tar-superior-buffer) tar-superior-buffer)
(error "This buffer is not an element of a tar file"))
(cond (tar-subfile-mode
(add-hook 'write-file-functions #'tar-subfile-save-buffer nil t)
;; turn off auto-save.
(auto-save-mode -1)
(setq buffer-auto-save-file-name nil))
(t
(remove-hook 'write-file-functions #'tar-subfile-save-buffer t))))