diff options
| author | Stefan Monnier | 2020-04-04 22:35:39 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2020-04-04 22:46:42 -0400 |
| commit | 83f9094316de5a5a67ecf41ae93f7950dd27d569 (patch) | |
| tree | 47a4f4bbb47dd642b53e10854cb6fd9f7b1b828d | |
| parent | e6b5cd0edacb5663859f6a6f93d82a0a4d486e83 (diff) | |
| download | emacs-83f9094316de5a5a67ecf41ae93f7950dd27d569.tar.gz emacs-83f9094316de5a5a67ecf41ae93f7950dd27d569.zip | |
* lisp/arc-mode.el: Remove make-(local-variable|variable-buffer-local)
(archive-file-list-start, archive-file-list-end)
(archive-proper-file-start, archive-file-name-indent, archive-remote)
(archive-member-coding-system, archive-alternate-display)
(archive-file-name-coding-system, archive-files): Use `defvar-local`.
(archive-extract): Use `setq-local`.
(archive-get-descr): Use `user-error` when clicking on a directory.
| -rw-r--r-- | lisp/arc-mode.el | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 2cca02665fc..aae6dd684ca 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el | |||
| @@ -362,9 +362,9 @@ file. Archive and member name will be added." | |||
| 362 | ;;; Section: Variables | 362 | ;;; Section: Variables |
| 363 | 363 | ||
| 364 | (defvar archive-subtype nil "Symbol describing archive type.") | 364 | (defvar archive-subtype nil "Symbol describing archive type.") |
| 365 | (defvar archive-file-list-start nil "Position of first contents line.") | 365 | (defvar-local archive-file-list-start nil "Position of first contents line.") |
| 366 | (defvar archive-file-list-end nil "Position just after last contents line.") | 366 | (defvar-local archive-file-list-end nil "Position just after last contents line.") |
| 367 | (defvar archive-proper-file-start nil "Position of real archive's start.") | 367 | (defvar-local archive-proper-file-start nil "Position of real archive's start.") |
| 368 | (defvar archive-read-only nil "Non-nil if the archive is read-only on disk.") | 368 | (defvar archive-read-only nil "Non-nil if the archive is read-only on disk.") |
| 369 | (defvar-local archive-local-name nil "Name of local copy of remote archive.") | 369 | (defvar-local archive-local-name nil "Name of local copy of remote archive.") |
| 370 | (defvar archive-mode-map | 370 | (defvar archive-mode-map |
| @@ -468,18 +468,15 @@ file. Archive and member name will be added." | |||
| 468 | :help "Delete all flagged files from archive")) | 468 | :help "Delete all flagged files from archive")) |
| 469 | map) | 469 | map) |
| 470 | "Local keymap for archive mode listings.") | 470 | "Local keymap for archive mode listings.") |
| 471 | (defvar archive-file-name-indent nil "Column where file names start.") | 471 | (defvar-local archive-file-name-indent nil "Column where file names start.") |
| 472 | 472 | ||
| 473 | (defvar archive-remote nil "Non-nil if the archive is outside file system.") | 473 | (defvar-local archive-remote nil "Non-nil if the archive is outside file system.") |
| 474 | (make-variable-buffer-local 'archive-remote) | ||
| 475 | (put 'archive-remote 'permanent-local t) | 474 | (put 'archive-remote 'permanent-local t) |
| 476 | 475 | ||
| 477 | (defvar archive-member-coding-system nil "Coding-system of archive member.") | 476 | (defvar-local archive-member-coding-system nil "Coding-system of archive member.") |
| 478 | (make-variable-buffer-local 'archive-member-coding-system) | ||
| 479 | 477 | ||
| 480 | (defvar archive-alternate-display nil | 478 | (defvar-local archive-alternate-display nil |
| 481 | "Non-nil when alternate information is shown.") | 479 | "Non-nil when alternate information is shown.") |
| 482 | (make-variable-buffer-local 'archive-alternate-display) | ||
| 483 | (put 'archive-alternate-display 'permanent-local t) | 480 | (put 'archive-alternate-display 'permanent-local t) |
| 484 | 481 | ||
| 485 | (defvar archive-superior-buffer nil "In archive members, points to archive.") | 482 | (defvar archive-superior-buffer nil "In archive members, points to archive.") |
| @@ -490,8 +487,7 @@ file. Archive and member name will be added." | |||
| 490 | Its value is an `archive--file-desc'.") | 487 | Its value is an `archive--file-desc'.") |
| 491 | (put 'archive-subfile-mode 'permanent-local t) | 488 | (put 'archive-subfile-mode 'permanent-local t) |
| 492 | 489 | ||
| 493 | (defvar archive-file-name-coding-system nil) | 490 | (defvar-local archive-file-name-coding-system nil) |
| 494 | (make-variable-buffer-local 'archive-file-name-coding-system) | ||
| 495 | (put 'archive-file-name-coding-system 'permanent-local t) | 491 | (put 'archive-file-name-coding-system 'permanent-local t) |
| 496 | 492 | ||
| 497 | (cl-defstruct (archive--file-desc | 493 | (cl-defstruct (archive--file-desc |
| @@ -522,9 +518,8 @@ Its value is an `archive--file-desc'.") | |||
| 522 | ;; | 518 | ;; |
| 523 | ;; LZH has alternate display (with UID/GID i.s.o MODE/DATE/TIME | 519 | ;; LZH has alternate display (with UID/GID i.s.o MODE/DATE/TIME |
| 524 | 520 | ||
| 525 | (defvar archive-files nil | 521 | (defvar-local archive-files nil |
| 526 | "Vector of `archive--file-desc' objects.") | 522 | "Vector of `archive--file-desc' objects.") |
| 527 | (make-variable-buffer-local 'archive-files) | ||
| 528 | 523 | ||
| 529 | ;; ------------------------------------------------------------------------- | 524 | ;; ------------------------------------------------------------------------- |
| 530 | ;;; Section: Support functions. | 525 | ;;; Section: Support functions. |
| @@ -642,7 +637,7 @@ Does not signal an error if optional argument NOERROR is non-nil." | |||
| 642 | (zerop (logand 16384 mode)))) | 637 | (zerop (logand 16384 mode)))) |
| 643 | item | 638 | item |
| 644 | (if (not noerror) | 639 | (if (not noerror) |
| 645 | (error "Entry is not a regular member of the archive")))) | 640 | (user-error "Entry is not a regular member of the archive")))) |
| 646 | (if (not noerror) | 641 | (if (not noerror) |
| 647 | (error "Line does not describe a member of the archive"))))) | 642 | (error "Line does not describe a member of the archive"))))) |
| 648 | ;; ------------------------------------------------------------------------- | 643 | ;; ------------------------------------------------------------------------- |
| @@ -708,10 +703,6 @@ archive. | |||
| 708 | (run-mode-hooks (archive-name "mode-hook") 'archive-mode-hook) | 703 | (run-mode-hooks (archive-name "mode-hook") 'archive-mode-hook) |
| 709 | (use-local-map archive-mode-map)) | 704 | (use-local-map archive-mode-map)) |
| 710 | 705 | ||
| 711 | (make-local-variable 'archive-proper-file-start) | ||
| 712 | (make-local-variable 'archive-file-list-start) | ||
| 713 | (make-local-variable 'archive-file-list-end) | ||
| 714 | (make-local-variable 'archive-file-name-indent) | ||
| 715 | (setq archive-file-name-coding-system | 706 | (setq archive-file-name-coding-system |
| 716 | (or file-name-coding-system | 707 | (or file-name-coding-system |
| 717 | default-file-name-coding-system | 708 | default-file-name-coding-system |
| @@ -901,6 +892,7 @@ using `make-temp-file', and the generated name is returned." | |||
| 901 | (lno (archive-get-lineno)) | 892 | (lno (archive-get-lineno)) |
| 902 | (inhibit-read-only t)) | 893 | (inhibit-read-only t)) |
| 903 | (if unchanged nil | 894 | (if unchanged nil |
| 895 | ;; FIXME: Use archive-resummarize? | ||
| 904 | (setq archive-files nil) | 896 | (setq archive-files nil) |
| 905 | (erase-buffer) | 897 | (erase-buffer) |
| 906 | (insert-file-contents name) | 898 | (insert-file-contents name) |
| @@ -1021,8 +1013,7 @@ using `make-temp-file', and the generated name is returned." | |||
| 1021 | (abbreviate-file-name buffer-file-name)) | 1013 | (abbreviate-file-name buffer-file-name)) |
| 1022 | ;; Set the default-directory to the dir of the superior buffer. | 1014 | ;; Set the default-directory to the dir of the superior buffer. |
| 1023 | (setq default-directory arcdir) | 1015 | (setq default-directory arcdir) |
| 1024 | (make-local-variable 'archive-superior-buffer) | 1016 | (setq-local archive-superior-buffer archive-buffer) |
| 1025 | (setq archive-superior-buffer archive-buffer) | ||
| 1026 | (add-hook 'write-file-functions #'archive-write-file-member nil t) | 1017 | (add-hook 'write-file-functions #'archive-write-file-member nil t) |
| 1027 | (setq archive-subfile-mode descr) | 1018 | (setq archive-subfile-mode descr) |
| 1028 | (setq archive-file-name-coding-system file-name-coding) | 1019 | (setq archive-file-name-coding-system file-name-coding) |