[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/mentor f48aeeb8be 2/3: Prefer defvar-local
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/mentor f48aeeb8be 2/3: Prefer defvar-local |
Date: |
Thu, 22 Sep 2022 08:59:16 -0400 (EDT) |
branch: elpa/mentor
commit f48aeeb8be00bb15d7ddd03e7d970a6f9235a125
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>
Prefer defvar-local
---
mentor-data.el | 3 +--
mentor-files.el | 3 +--
mentor.el | 30 ++++++++++--------------------
3 files changed, 12 insertions(+), 24 deletions(-)
diff --git a/mentor-data.el b/mentor-data.el
index 36852ea4d7..49aa4ccb49 100644
--- a/mentor-data.el
+++ b/mentor-data.el
@@ -37,11 +37,10 @@
This could be a torrent, file, directory, peer, etc."
id data marked type)
-(defvar mentor-items nil
+(defvar-local mentor-items nil
"Hash table containing all items for the current buffer.
This can be torrents, files, peers etc. All values should be made
using `make-mentor-item'.")
-(make-variable-buffer-local 'mentor-items)
(defun mentor-get-item (id)
(gethash id mentor-items))
diff --git a/mentor-files.el b/mentor-files.el
index ad4daddd12..3dea699bfd 100644
--- a/mentor-files.el
+++ b/mentor-files.el
@@ -57,8 +57,7 @@ integer index used by rtorrent to identify this file."
name show marked size completed_chunks
size_chunks priority files type id)
-(defvar mentor-files-selected-download nil)
-(make-variable-buffer-local 'mentor-files-selected-download)
+(defvar-local mentor-files-selected-download nil)
(put 'mentor-files-selected-download 'permanent-local t)
(defvar mentor-selected-torrent-info '())
diff --git a/mentor.el b/mentor.el
index 9d13a0cf77..41e8c1eb2b 100644
--- a/mentor.el
+++ b/mentor.el
@@ -215,8 +215,7 @@ This will only work with rTorrent 0.9.7 or later."
(defvar mentor-current-view)
(defvar mentor-home-dir (expand-file-name (locate-user-emacs-file "mentor/"))
"Where Mentor should put its files.")
-(defvar mentor--header-line "")
-(make-variable-buffer-local 'mentor--header-line)
+(defvar-local mentor--header-line "")
(defvar mentor-rtorrent-client-version)
(defvar mentor-rtorrent-library-version)
@@ -227,14 +226,11 @@ This will only work with rTorrent 0.9.7 or later."
(defvar mentor-rtorrent-name)
-(defvar mentor-sort-list '(name))
-(make-variable-buffer-local 'mentor-sort-list)
+(defvar-local mentor-sort-list '(name))
-(defvar mentor-last-used-view)
-(make-variable-buffer-local 'mentor-last-used-view)
+(defvar-local mentor-last-used-view nil)
-(defvar mentor-last-move-target "~")
-(make-variable-buffer-local 'mentor-last-move-target)
+(defvar-local mentor-last-move-target "~")
(defvar mentor-view-torrent-list nil
"A list of torrents in given views.")
@@ -255,14 +251,11 @@ This will only work with rTorrent 0.9.7 or later."
;; Variables that should be changed by sub-modes
-(defvar mentor-item-update-this-fun)
-(make-variable-buffer-local 'mentor-item-update-this-fun)
+(defvar-local mentor-item-update-this-fun nil)
-(defvar mentor-set-priority-fun)
-(make-variable-buffer-local 'mentor-set-priority-fun)
+(defvar-local mentor-set-priority-fun nil)
-(defvar mentor--columns-var 'mentor-view-columns)
-(make-variable-buffer-local 'mentor--columns-var)
+(defvar-local mentor--columns-var 'mentor-view-columns)
;;;; Mentor major-mode
@@ -928,11 +921,9 @@ expensive operation."
(setq mentor--header-line
(mentor-process-view-header-columns (eval mentor--columns-var))))
-(defvar mentor-highlight-overlay nil)
-(make-variable-buffer-local 'mentor-highlight-overlay)
+(defvar-local mentor-highlight-overlay nil)
-(defvar mentor-highlighted-torrent nil)
-(make-variable-buffer-local 'mentor-highlighted-torrent)
+(defvar-local mentor-highlighted-torrent nil)
(defun mentor-highlight-torrent ()
(let ((cur (mentor-item-id-at-point)))
@@ -1711,8 +1702,7 @@ Only use when you are the first and only seeder so far
for the download."
;;;; View functions
-(defvar mentor-download-views)
-(make-variable-buffer-local 'mentor-download-views)
+(defvar-local mentor-download-views nil)
(defconst mentor-custom-view-prefix "mentor-"
"String to add to view name before adding it to rTorrent.")