Function: tar-expunge

tar-expunge is an interactive and byte-compiled function defined in tar-mode.el.gz.

Signature

(tar-expunge &optional NOCONFIRM)

Documentation

In Tar mode, delete all the archived files flagged for deletion.

This does not modify the disk image; you must save the tar file itself for this to be permanent.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/tar-mode.el.gz
(defun tar-expunge (&optional noconfirm)
  "In Tar mode, delete all the archived files flagged for deletion.
This does not modify the disk image; you must save the tar file itself
for this to be permanent."
  (interactive)
  (if (or noconfirm
	  (y-or-n-p "Expunge files marked for deletion? "))
      (let ((n 0))
	(save-excursion
	  (goto-char (point-min))
	  (while (not (eobp))
	    (if (= (following-char) ?D)
		(progn (tar-expunge-internal)
		       (setq n (1+ n)))
		(forward-line 1)))
	  ;; after doing the deletions, add any padding that may be necessary.
	  (tar-pad-to-blocksize))
	(if (zerop n)
	    (message "Nothing to expunge.")
	    (message "%s files expunged.  Be sure to save this buffer." n)))))