1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-17 03:10:58 -08:00

Prefer setq-local in net/*.el

* lisp/net/ange-ftp.el (ange-ftp-process-handle-line):
(internal-ange-ftp-mode):
* lisp/net/imap.el (imap-fetch-safe):
* lisp/net/net-utils.el (net-utils-mode):
(nslookup-mode, network-connection-mode-setup):
* lisp/net/newst-plainview.el (newsticker-mode):
(newsticker-buffer-update):
* lisp/net/newst-treeview.el (newsticker--treeview-item-show):
(newsticker-treeview-mode):
* lisp/net/rlogin.el (rlogin):
* lisp/net/secrets.el (secrets-mode):
* lisp/net/sieve-mode.el (sieve-mode):
* lisp/net/sieve.el (sieve-setup-buffer, sieve-open-server):
* lisp/net/snmp-mode.el (snmp-common-mode, snmp-mode, snmpv2-mode):
* lisp/net/telnet.el (telnet-mode):
* lisp/net/tramp.el (tramp-get-debug-buffer): Prefer setq-local.
This commit is contained in:
Stefan Kangas 2020-12-04 18:43:06 +01:00
parent 7bdc40e8d1
commit f0db9ae213
12 changed files with 73 additions and 106 deletions

View file

@ -1556,7 +1556,7 @@ good, skip, fatal, or unknown."
;; This looks like an error, but we have to keep reading the output ;; This looks like an error, but we have to keep reading the output
;; to see if it was fixed or not. E.g. it may indicate that IPv6 ;; to see if it was fixed or not. E.g. it may indicate that IPv6
;; failed, but maybe a subsequent IPv4 fallback succeeded. ;; failed, but maybe a subsequent IPv4 fallback succeeded.
(set (make-local-variable 'ange-ftp-pending-error-line) line) (setq-local ange-ftp-pending-error-line line)
t) t)
((string-match ange-ftp-fatal-msgs line) ((string-match ange-ftp-fatal-msgs line)
(delete-process proc) (delete-process proc)
@ -1970,30 +1970,24 @@ on the gateway machine to do the FTP instead."
"Major mode for interacting with the FTP process. "Major mode for interacting with the FTP process.
\\{comint-mode-map}" \\{comint-mode-map}"
(make-local-variable 'ange-ftp-process-string) (setq-local ange-ftp-process-string "")
(setq ange-ftp-process-string "")
(make-local-variable 'ange-ftp-process-busy) (make-local-variable 'ange-ftp-process-busy)
(make-local-variable 'ange-ftp-process-result) (make-local-variable 'ange-ftp-process-result)
(make-local-variable 'ange-ftp-process-msg) (make-local-variable 'ange-ftp-process-msg)
(make-local-variable 'ange-ftp-process-multi-skip) (make-local-variable 'ange-ftp-process-multi-skip)
(make-local-variable 'ange-ftp-process-result-line)
(make-local-variable 'ange-ftp-process-continue) (make-local-variable 'ange-ftp-process-continue)
(make-local-variable 'ange-ftp-hash-mark-count)
(make-local-variable 'ange-ftp-binary-hash-mark-size) (make-local-variable 'ange-ftp-binary-hash-mark-size)
(make-local-variable 'ange-ftp-ascii-hash-mark-size) (make-local-variable 'ange-ftp-ascii-hash-mark-size)
(make-local-variable 'ange-ftp-hash-mark-unit) (make-local-variable 'ange-ftp-hash-mark-unit)
(make-local-variable 'ange-ftp-xfer-size)
(make-local-variable 'ange-ftp-last-percent) (make-local-variable 'ange-ftp-last-percent)
(setq ange-ftp-hash-mark-count 0) (setq-local ange-ftp-hash-mark-count 0)
(setq ange-ftp-xfer-size 0) (setq-local ange-ftp-xfer-size 0)
(setq ange-ftp-process-result-line "") (setq-local ange-ftp-process-result-line "")
(setq comint-prompt-regexp "^ftp> ") (setq comint-prompt-regexp "^ftp> ")
(make-local-variable 'comint-password-prompt-regexp)
;; This is a regexp that can't match anything. ;; This is a regexp that can't match anything.
;; ange-ftp has its own ways of handling passwords. ;; ange-ftp has its own ways of handling passwords.
(setq comint-password-prompt-regexp regexp-unmatchable) (setq-local comint-password-prompt-regexp regexp-unmatchable)
(make-local-variable 'paragraph-start) (setq-local paragraph-start comint-prompt-regexp))
(setq paragraph-start comint-prompt-regexp))
(defcustom ange-ftp-raw-login nil (defcustom ange-ftp-raw-login nil
"Use raw FTP commands for login, if account password is not nil. "Use raw FTP commands for login, if account password is not nil.
@ -3662,7 +3656,7 @@ so return the size on the remote host exactly. See RFC 3659."
;; (set-process-sentinel proc 'ange-ftp-copy-file-locally-sentinel) ;; (set-process-sentinel proc 'ange-ftp-copy-file-locally-sentinel)
;; (set-process-query-on-exit-flag proc nil) ;; (set-process-query-on-exit-flag proc nil)
;; (with-current-buffer (process-buffer proc) ;; (with-current-buffer (process-buffer proc)
;; (set (make-local-variable 'copy-cont) cont)))) ;; (setq-local copy-cont cont))))
;; ;;
;; (defun ange-ftp-copy-file-locally-sentinel (proc status) ;; (defun ange-ftp-copy-file-locally-sentinel (proc status)
;; (with-current-buffer (process-buffer proc) ;; (with-current-buffer (process-buffer proc)

View file

@ -1726,8 +1726,7 @@ See `imap-enable-exchange-bug-workaround'."
(string-match "The specified message set is invalid" (string-match "The specified message set is invalid"
(cadr data))) (cadr data)))
(with-current-buffer (or buffer (current-buffer)) (with-current-buffer (or buffer (current-buffer))
(set (make-local-variable 'imap-enable-exchange-bug-workaround) (setq-local imap-enable-exchange-bug-workaround t)
t)
(imap-fetch (cdr uids) props receive nouidfetch)) (imap-fetch (cdr uids) props receive nouidfetch))
(signal (car data) (cdr data)))))) (signal (car data) (cdr data))))))

View file

@ -307,7 +307,7 @@ This variable is only used if the variable
(define-derived-mode net-utils-mode special-mode "NetworkUtil" (define-derived-mode net-utils-mode special-mode "NetworkUtil"
"Major mode for interacting with an external network utility." "Major mode for interacting with an external network utility."
(set (make-local-variable 'font-lock-defaults) (setq-local font-lock-defaults
'((net-utils-font-lock-keywords))) '((net-utils-font-lock-keywords)))
(setq-local revert-buffer-function #'net-utils--revert-function)) (setq-local revert-buffer-function #'net-utils--revert-function))
@ -624,8 +624,7 @@ This command uses `nslookup-program' to look up DNS records."
;; Using a derived mode gives us keymaps, hooks, etc. ;; Using a derived mode gives us keymaps, hooks, etc.
(define-derived-mode nslookup-mode comint-mode "Nslookup" (define-derived-mode nslookup-mode comint-mode "Nslookup"
"Major mode for interacting with the nslookup program." "Major mode for interacting with the nslookup program."
(set (setq-local font-lock-defaults
(make-local-variable 'font-lock-defaults)
'((nslookup-font-lock-keywords))) '((nslookup-font-lock-keywords)))
(setq comint-prompt-regexp nslookup-prompt-regexp) (setq comint-prompt-regexp nslookup-prompt-regexp)
(setq comint-input-autoexpand t)) (setq comint-input-autoexpand t))
@ -971,10 +970,8 @@ The port is deduced from `network-connection-service-alist'."
"Major mode for interacting with the network-connection program.") "Major mode for interacting with the network-connection program.")
(defun network-connection-mode-setup (host service) (defun network-connection-mode-setup (host service)
(make-local-variable 'network-connection-host) (setq-local network-connection-host host)
(setq network-connection-host host) (setq-local network-connection-service service))
(make-local-variable 'network-connection-service)
(setq network-connection-service service))
;;;###autoload ;;;###autoload
(defun network-connection-to-service (host service) (defun network-connection-to-service (host service)

View file

@ -445,17 +445,17 @@ images."
"NewsTicker" "NewsTicker"
"Viewing news feeds in Emacs." "Viewing news feeds in Emacs."
(if (boundp 'tool-bar-map) (if (boundp 'tool-bar-map)
(set (make-local-variable 'tool-bar-map) (setq-local tool-bar-map
newsticker--plainview-tool-bar-map)) newsticker--plainview-tool-bar-map))
(set (make-local-variable 'imenu-sort-function) nil) (setq-local imenu-sort-function nil)
(set (make-local-variable 'scroll-conservatively) 999) (setq-local scroll-conservatively 999)
(setq imenu-create-index-function 'newsticker--imenu-create-index) (setq imenu-create-index-function 'newsticker--imenu-create-index)
(setq imenu-default-goto-function 'newsticker--imenu-goto) (setq imenu-default-goto-function 'newsticker--imenu-goto)
(setq buffer-read-only t) (setq buffer-read-only t)
(auto-fill-mode -1) ;; turn auto-fill off! (auto-fill-mode -1) ;; turn auto-fill off!
(font-lock-mode -1) ;; turn off font-lock!! (font-lock-mode -1) ;; turn off font-lock!!
(set (make-local-variable 'font-lock-defaults) nil) (setq-local font-lock-defaults nil)
(set (make-local-variable 'line-move-ignore-invisible) t) (setq-local line-move-ignore-invisible t)
(setq mode-line-format (setq mode-line-format
(list "-" (list "-"
'mode-line-mule-info 'mode-line-mule-info
@ -533,7 +533,7 @@ Unless FORCE is t this is done only if necessary, i.e. when the
(set-buffer-file-coding-system 'utf-8) (set-buffer-file-coding-system 'utf-8)
(if newsticker-use-full-width (if newsticker-use-full-width
(set (make-local-variable 'fill-column) (1- (window-width)))) (setq-local fill-column (1- (window-width))))
(newsticker--buffer-insert-all-items) (newsticker--buffer-insert-all-items)
;; FIXME: needed for methods buffer in ecb ;; FIXME: needed for methods buffer in ecb

View file

@ -719,9 +719,8 @@ for the button."
(window-width (newsticker--treeview-item-window)) (window-width (newsticker--treeview-item-window))
fill-column)))) fill-column))))
(if newsticker-use-full-width (if newsticker-use-full-width
(set (make-local-variable 'fill-column) wwidth)) (setq-local fill-column wwidth))
(set (make-local-variable 'fill-column) (min fill-column (setq-local fill-column (min fill-column wwidth)))
wwidth)))
(let ((desc (newsticker--desc item))) (let ((desc (newsticker--desc item)))
(insert "\n" (or desc "[No Description]"))) (insert "\n" (or desc "[No Description]")))
(set-marker marker1 (1+ (point-min))) (set-marker marker1 (1+ (point-min)))
@ -2024,7 +2023,7 @@ Return t if groups have changed, nil otherwise."
"Major mode for Newsticker Treeview. "Major mode for Newsticker Treeview.
\\{newsticker-treeview-mode-map}" \\{newsticker-treeview-mode-map}"
(if (boundp 'tool-bar-map) (if (boundp 'tool-bar-map)
(set (make-local-variable 'tool-bar-map) (setq-local tool-bar-map
newsticker-treeview-tool-bar-map)) newsticker-treeview-tool-bar-map))
(setq buffer-read-only t (setq buffer-read-only t
truncate-lines t)) truncate-lines t))

View file

@ -208,10 +208,8 @@ variable."
(unless (comint-check-proc buffer-name) (unless (comint-check-proc buffer-name)
(comint-exec buffer buffer-name rlogin-program nil args) (comint-exec buffer buffer-name rlogin-program nil args)
(rlogin-mode) (rlogin-mode)
(make-local-variable 'rlogin-host) (setq-local rlogin-host host)
(setq rlogin-host host) (setq-local rlogin-remote-user user)
(make-local-variable 'rlogin-remote-user)
(setq rlogin-remote-user user)
(ignore-errors (ignore-errors
(cond ((eq rlogin-directory-tracking-mode t) (cond ((eq rlogin-directory-tracking-mode t)
;; Do this here, rather than calling the tracking mode ;; Do this here, rather than calling the tracking mode

View file

@ -792,7 +792,7 @@ In this mode, widgets represent the search results.
\\{secrets-mode-map}" \\{secrets-mode-map}"
(setq buffer-undo-list t) (setq buffer-undo-list t)
(set (make-local-variable 'revert-buffer-function) (setq-local revert-buffer-function
#'secrets-show-collections) #'secrets-show-collections)
;; When we toggle, we must set temporary widgets. ;; When we toggle, we must set temporary widgets.
(add-hook 'tree-widget-after-toggle-functions (add-hook 'tree-widget-after-toggle-functions

View file

@ -185,15 +185,14 @@ inherits from C mode's and it has the same variables for customizing
indentation. It has its own abbrev table and its own syntax table. indentation. It has its own abbrev table and its own syntax table.
Turning on Sieve mode runs `sieve-mode-hook'." Turning on Sieve mode runs `sieve-mode-hook'."
(set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter)) (setq-local paragraph-start (concat "$\\|" page-delimiter))
(set (make-local-variable 'paragraph-separate) paragraph-start) (setq-local paragraph-separate paragraph-start)
(set (make-local-variable 'comment-start) "#") (setq-local comment-start "#")
(set (make-local-variable 'comment-end) "") (setq-local comment-end "")
;;(set (make-local-variable 'comment-start-skip) "\\(^\\|\\s-\\);?#+ *") ;; (setq-local comment-start-skip "\\(^\\|\\s-\\);?#+ *")
(set (make-local-variable 'comment-start-skip) "#+ *") (setq-local comment-start-skip "#+ *")
(set (make-local-variable 'syntax-propertize-function) (setq-local syntax-propertize-function #'sieve-syntax-propertize)
#'sieve-syntax-propertize) (setq-local font-lock-defaults
(set (make-local-variable 'font-lock-defaults)
'(sieve-font-lock-keywords nil nil ((?_ . "w")))) '(sieve-font-lock-keywords nil nil ((?_ . "w"))))
(easy-menu-add-item nil nil sieve-mode-menu)) (easy-menu-add-item nil nil sieve-mode-menu))

View file

@ -272,8 +272,7 @@ Used to bracket operations which move point in the sieve-buffer."
(let* ((port (or port sieve-manage-default-port)) (let* ((port (or port sieve-manage-default-port))
(header (format "Server : %s:%s\n\n" server port))) (header (format "Server : %s:%s\n\n" server port)))
(insert header)) (insert header))
(set (make-local-variable 'sieve-buffer-header-end) (setq-local sieve-buffer-header-end (point-max)))
(point-max)))
(defun sieve-script-at-point (&optional pos) (defun sieve-script-at-point (&optional pos)
"Return name of sieve script at point POS, or nil." "Return name of sieve script at point POS, or nil."
@ -304,7 +303,7 @@ Used to bracket operations which move point in the sieve-buffer."
"Open SERVER (on PORT) and authenticate." "Open SERVER (on PORT) and authenticate."
(with-current-buffer (with-current-buffer
(or ;; open server (or ;; open server
(set (make-local-variable 'sieve-manage-buffer) (setq-local sieve-manage-buffer
(sieve-manage-open server port)) (sieve-manage-open server port))
(error "Error opening server %s" server)) (error "Error opening server %s" server))
(sieve-manage-authenticate))) (sieve-manage-authenticate)))

View file

@ -304,46 +304,34 @@ This is used during Tempo template completion."
(setq local-abbrev-table abbrev) (setq local-abbrev-table abbrev)
;; Set up paragraphs (?) ;; Set up paragraphs (?)
(make-local-variable 'paragraph-start) (setq-local paragraph-start (concat "$\\|" page-delimiter))
(setq paragraph-start (concat "$\\|" page-delimiter)) (setq-local paragraph-separate paragraph-start)
(make-local-variable 'paragraph-separate) (setq-local paragraph-ignore-fill-prefix t)
(setq paragraph-separate paragraph-start)
(make-local-variable 'paragraph-ignore-fill-prefix)
(setq paragraph-ignore-fill-prefix t)
;; Set up comments ;; Set up comments
(make-local-variable 'comment-start) (setq-local comment-start "-- ")
(setq comment-start "-- ") (setq-local comment-start-skip "--+[ \t]*")
(make-local-variable 'comment-start-skip) (setq-local comment-column 40)
(setq comment-start-skip "--+[ \t]*") (setq-local parse-sexp-ignore-comments t)
(make-local-variable 'comment-column)
(setq comment-column 40)
(make-local-variable 'parse-sexp-ignore-comments)
(setq parse-sexp-ignore-comments t)
;; Set up indentation ;; Set up indentation
(if snmp-special-indent (if snmp-special-indent
(set (make-local-variable 'indent-line-function) 'snmp-indent-line)) (setq-local indent-line-function 'snmp-indent-line))
(set (make-local-variable 'tab-always-indent) snmp-tab-always-indent) (setq-local tab-always-indent snmp-tab-always-indent)
;; Font Lock ;; Font Lock
(make-local-variable 'font-lock-defaults) (setq-local font-lock-defaults (cons font-keywords '(nil nil ((?- . "w 1234")))))
(setq font-lock-defaults (cons font-keywords '(nil nil ((?- . "w 1234")))))
;; Imenu ;; Imenu
(make-local-variable 'imenu-create-index-function) (setq-local imenu-create-index-function imenu-index)
(setq imenu-create-index-function imenu-index)
;; Tempo ;; Tempo
(tempo-use-tag-list tempo-tags) (tempo-use-tag-list tempo-tags)
(make-local-variable 'tempo-match-finder) (setq-local tempo-match-finder "\\b\\(.+\\)\\=")
(setq tempo-match-finder "\\b\\(.+\\)\\=") (setq-local tempo-interactive t)
(make-local-variable 'tempo-interactive)
(setq tempo-interactive t)
;; Miscellaneous customization ;; Miscellaneous customization
(make-local-variable 'require-final-newline) (setq-local require-final-newline mode-require-final-newline))
(setq require-final-newline mode-require-final-newline))
;; SNMPv1 MIB Editing Mode. ;; SNMPv1 MIB Editing Mode.
@ -370,14 +358,11 @@ Turning on snmp-mode runs the hooks in `snmp-common-mode-hook', then
'snmp-tempo-tags) 'snmp-tempo-tags)
;; Completion lists ;; Completion lists
(make-local-variable 'snmp-mode-syntax-list) (setq-local snmp-mode-syntax-list (append snmp-rfc1155-types
(setq snmp-mode-syntax-list (append snmp-rfc1155-types
snmp-rfc1213-types snmp-rfc1213-types
snmp-mode-syntax-list)) snmp-mode-syntax-list))
(make-local-variable 'snmp-mode-access-list) (setq-local snmp-mode-access-list snmp-rfc1155-access)
(setq snmp-mode-access-list snmp-rfc1155-access) (setq-local snmp-mode-status-list snmp-rfc1212-status)
(make-local-variable 'snmp-mode-status-list)
(setq snmp-mode-status-list snmp-rfc1212-status)
;; Run hooks ;; Run hooks
(run-mode-hooks 'snmp-common-mode-hook 'snmp-mode-hook)) (run-mode-hooks 'snmp-common-mode-hook 'snmp-mode-hook))
@ -405,14 +390,11 @@ then `snmpv2-mode-hook'."
'snmpv2-tempo-tags) 'snmpv2-tempo-tags)
;; Completion lists ;; Completion lists
(make-local-variable 'snmp-mode-syntax-list) (setq-local snmp-mode-syntax-list (append snmp-rfc1902-types
(setq snmp-mode-syntax-list (append snmp-rfc1902-types
snmp-rfc1903-types snmp-rfc1903-types
snmp-mode-syntax-list)) snmp-mode-syntax-list))
(make-local-variable 'snmp-mode-access-list) (setq-local snmp-mode-access-list snmp-rfc1902-access)
(setq snmp-mode-access-list snmp-rfc1902-access) (setq-local snmp-mode-status-list snmp-rfc1902-status)
(make-local-variable 'snmp-mode-status-list)
(setq snmp-mode-status-list snmp-rfc1902-status)
;; Run hooks ;; Run hooks
(run-mode-hooks 'snmp-common-mode-hook 'snmpv2-mode-hook)) (run-mode-hooks 'snmp-common-mode-hook 'snmpv2-mode-hook))

View file

@ -253,9 +253,9 @@ There is a variable `telnet-interrupt-string' which is the character
sent to try to stop execution of a job on the remote host. sent to try to stop execution of a job on the remote host.
Data is sent to the remote host when RET is typed." Data is sent to the remote host when RET is typed."
(setq-local revert-buffer-function 'telnet-revert-buffer) (setq-local revert-buffer-function 'telnet-revert-buffer)
(set (make-local-variable 'window-point-insertion-type) t) (setq-local window-point-insertion-type t)
(set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern) (setq-local comint-prompt-regexp telnet-prompt-pattern)
(set (make-local-variable 'comint-use-prompt-regexp) t)) (setq-local comint-use-prompt-regexp t))
;;;###autoload ;;;###autoload
(defun rsh (host) (defun rsh (host)

View file

@ -1740,8 +1740,8 @@ The outline level is equal to the verbosity of the Tramp message."
;; in the traces. ;; in the traces.
(let ((default-directory (tramp-compat-temporary-file-directory))) (let ((default-directory (tramp-compat-temporary-file-directory)))
(outline-mode)) (outline-mode))
(set (make-local-variable 'outline-level) 'tramp-debug-outline-level) (setq-local outline-level 'tramp-debug-outline-level)
(set (make-local-variable 'font-lock-keywords) (setq-local font-lock-keywords
`(t (eval ,tramp-debug-font-lock-keywords) `(t (eval ,tramp-debug-font-lock-keywords)
,(eval tramp-debug-font-lock-keywords))) ,(eval tramp-debug-font-lock-keywords)))
;; Do not edit the debug buffer. ;; Do not edit the debug buffer.