From: Stefan Kangas Date: Sun, 31 Jan 2021 15:30:55 +0000 (+0100) Subject: Prefer defvar-local in net/*.el X-Git-Tag: emacs-28.0.90~3998 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=21d9303c61ce5ecc81fd7ea96aeb94b5b03bee79;p=emacs.git Prefer defvar-local in net/*.el * lisp/net/browse-url.el (browse-url-temp-file-name): * lisp/net/rcirc.el (rcirc-ignore-buffer-activity-flag) (rcirc-low-priority-flag, rcirc-parent-buffer) (rcirc-activity-types, rcirc-last-sender): * lisp/net/soap-inspect.el (soap-inspect-previous-items) (soap-inspect-current-item): * lisp/net/telnet.el (telnet-remote-echoes) (telnet-interrupt-string, telnet-count): Prefer defvar-local. --- diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 7b72a713623..58f01d5bf98 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -481,8 +481,7 @@ Used by the `browse-url-of-file' command." "Hook run after `browse-url-of-file' has asked a browser to load a file." :type 'hook) -(defvar browse-url-temp-file-name nil) -(make-variable-buffer-local 'browse-url-temp-file-name) +(defvar-local browse-url-temp-file-name nil) (defcustom browse-url-xterm-program "xterm" "The name of the terminal emulator used by `browse-url-text-xterm'. diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 22348a1725c..58cc8b1be55 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -178,13 +178,11 @@ If nil, no maximum is applied." :type '(choice (const :tag "No maximum" nil) (integer :tag "Number of characters"))) -(defvar rcirc-ignore-buffer-activity-flag nil +(defvar-local rcirc-ignore-buffer-activity-flag nil "If non-nil, ignore activity in this buffer.") -(make-variable-buffer-local 'rcirc-ignore-buffer-activity-flag) -(defvar rcirc-low-priority-flag nil +(defvar-local rcirc-low-priority-flag nil "If non-nil, activity in this buffer is considered low priority.") -(make-variable-buffer-local 'rcirc-low-priority-flag) (defcustom rcirc-omit-responses '("JOIN" "PART" "QUIT" "NICK") @@ -1328,8 +1326,7 @@ Create the buffer if it doesn't exist." (rcirc-send-string process (concat command " :" args))))))) -(defvar rcirc-parent-buffer nil) -(make-variable-buffer-local 'rcirc-parent-buffer) +(defvar-local rcirc-parent-buffer nil) (put 'rcirc-parent-buffer 'permanent-local t) (defvar rcirc-window-configuration nil) (defun rcirc-edit-multiline () @@ -1501,10 +1498,8 @@ is found by looking up RESPONSE in `rcirc-response-formats'." ((or (rcirc-get-buffer process target) (rcirc-any-buffer process)))))) -(defvar rcirc-activity-types nil) -(make-variable-buffer-local 'rcirc-activity-types) -(defvar rcirc-last-sender nil) -(make-variable-buffer-local 'rcirc-last-sender) +(defvar-local rcirc-activity-types nil) +(defvar-local rcirc-last-sender nil) (defcustom rcirc-omit-threshold 100 "Lines since last activity from a nick before `rcirc-omit-responses' are omitted." diff --git a/lisp/net/soap-inspect.el b/lisp/net/soap-inspect.el index 604e35c07cf..9d4e440719d 100644 --- a/lisp/net/soap-inspect.el +++ b/lisp/net/soap-inspect.el @@ -206,17 +206,13 @@ This is a specialization of `soap-sample-value' for ;;; soap-inspect -(defvar soap-inspect-previous-items nil +(defvar-local soap-inspect-previous-items nil "A stack of previously inspected items in the *soap-inspect* buffer. Used to implement the BACK button.") -(defvar soap-inspect-current-item nil +(defvar-local soap-inspect-current-item nil "The current item being inspected in the *soap-inspect* buffer.") -(progn - (make-variable-buffer-local 'soap-inspect-previous-items) - (make-variable-buffer-local 'soap-inspect-current-item)) - (defun soap-inspect (element) "Inspect a SOAP ELEMENT in the *soap-inspect* buffer. The buffer is populated with information about ELEMENT with links diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el index 67f844428a7..44f535f01c9 100644 --- a/lisp/net/telnet.el +++ b/lisp/net/telnet.el @@ -72,15 +72,12 @@ LOGIN-NAME, which is optional, says what to log in as on that machine.") (defvar telnet-prompt-pattern "^[^#$%>\n]*[#$%>] *") (defvar telnet-replace-c-g nil) -(make-variable-buffer-local - (defvar telnet-remote-echoes t - "True if the telnet process will echo input.")) -(make-variable-buffer-local - (defvar telnet-interrupt-string "\C-c" "String sent by C-c.")) +(defvar-local telnet-remote-echoes t + "True if the telnet process will echo input.") +(defvar-local telnet-interrupt-string "\C-c" "String sent by C-c.") -(defvar telnet-count 0 +(defvar-local telnet-count 0 "Number of output strings from telnet process while looking for password.") -(make-variable-buffer-local 'telnet-count) (defvar telnet-program "telnet" "Program to run to open a telnet connection.")