-;;; tar-mode.el --- simple editing of tar files from GNU Emacs
+;;; tar-mode.el --- simple editing of tar files from GNU Emacs -*- lexical-binding:t -*-
;; Copyright (C) 1990-1991, 1993-2019 Free Software Foundation, Inc.
matter much. The only noticeable difference is that if a tar file does not
have a blocksize of 20, tar will tell you that; all this really controls is
how many null padding bytes go on the end of the tar file."
- :type '(choice integer (const nil))
- :group 'tar)
+ :type '(choice integer (const nil)))
(defcustom tar-update-datestamp nil
"Non-nil means Tar mode should play fast and loose with sub-file datestamps.
in a tar archive has been changed, but it is bad for the same reason that
editing a file in the tar archive at all is bad - the changed version of
the file never exists on disk."
- :type 'boolean
- :group 'tar)
+ :type 'boolean)
(defcustom tar-mode-show-date nil
"Non-nil means Tar mode should show the date/time of each subfile.
This information is useful, but it takes screen space away from file names."
- :type 'boolean
- :group 'tar)
+ :type 'boolean)
(defvar tar-parse-info nil)
(defvar tar-superior-buffer nil
n)))
(define-obsolete-function-alias 'tar-parse-octal-long-integer
- 'tar-parse-octal-integer "27.1")
+ #'tar-parse-octal-integer "27.1")
(defun tar-parse-octal-integer-safe (string)
(if (zerop (length string)) (error "empty string"))
(let ((create-lockfiles nil) ; avoid changing dir mtime by lock_file
(inhibit-read-only t)
(total-summaries
- (mapconcat 'tar-header-block-summarize tar-parse-info "\n")))
+ (mapconcat #'tar-header-block-summarize tar-parse-info "\n")))
(insert total-summaries "\n")
(goto-char (point-min))
(restore-buffer-modified-p modified))))
;; Now move the Tar data into an auxiliary buffer, so we can use the main
;; buffer for the summary.
(cl-assert (not (tar-data-swapped-p)))
- (set (make-local-variable 'revert-buffer-function) 'tar-mode-revert)
+ (set (make-local-variable 'revert-buffer-function) #'tar-mode-revert)
;; We started using write-contents-functions, but this hook is not
;; used during auto-save, so we now use
;; write-region-annotate-functions which hooks at a lower-level.
- (add-hook 'write-region-annotate-functions 'tar-write-region-annotate nil t)
- (add-hook 'kill-buffer-hook 'tar-mode-kill-buffer-hook nil t)
- (add-hook 'change-major-mode-hook 'tar-change-major-mode-hook nil t)
+ (add-hook 'write-region-annotate-functions #'tar-write-region-annotate nil t)
+ (add-hook 'kill-buffer-hook #'tar-mode-kill-buffer-hook nil t)
+ (add-hook 'change-major-mode-hook #'tar-change-major-mode-hook nil t)
;; Tar data is made of bytes, not chars.
(set-buffer-multibyte nil) ;Hopefully a no-op.
(set (make-local-variable 'tar-data-buffer)
(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)
+ (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))))
+ (remove-hook 'write-file-functions #'tar-subfile-save-buffer t))))
;; Revert the buffer and recompute the dired-like listing.
(defun tar-new-entry (filename &optional index)
"Insert a new empty regular file before point."
(interactive "*sFile name: ")
- (let* ((buffer (current-buffer))
- (index (or index (tar-current-position)))
+ (let* ((index (or index (tar-current-position)))
(d-list (and (not (zerop index))
(nthcdr (+ -1 index) tar-parse-info)))
(pos (if d-list
With a prefix argument, mark that many files."
(interactive "p")
(beginning-of-line)
- (dotimes (i (abs p))
+ (dotimes (_ (abs p))
(if (tar-current-descriptor unflag) ; barf if we're not on an entry-line.
(progn
(delete-char 1)