1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-16 10:50:49 -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
;; to see if it was fixed or not. E.g. it may indicate that IPv6
;; 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)
((string-match ange-ftp-fatal-msgs line)
(delete-process proc)
@ -1970,30 +1970,24 @@ on the gateway machine to do the FTP instead."
"Major mode for interacting with the FTP process.
\\{comint-mode-map}"
(make-local-variable 'ange-ftp-process-string)
(setq ange-ftp-process-string "")
(setq-local ange-ftp-process-string "")
(make-local-variable 'ange-ftp-process-busy)
(make-local-variable 'ange-ftp-process-result)
(make-local-variable 'ange-ftp-process-msg)
(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-hash-mark-count)
(make-local-variable 'ange-ftp-binary-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-xfer-size)
(make-local-variable 'ange-ftp-last-percent)
(setq ange-ftp-hash-mark-count 0)
(setq ange-ftp-xfer-size 0)
(setq ange-ftp-process-result-line "")
(setq-local ange-ftp-hash-mark-count 0)
(setq-local ange-ftp-xfer-size 0)
(setq-local ange-ftp-process-result-line "")
(setq comint-prompt-regexp "^ftp> ")
(make-local-variable 'comint-password-prompt-regexp)
;; This is a regexp that can't match anything.
;; ange-ftp has its own ways of handling passwords.
(setq comint-password-prompt-regexp regexp-unmatchable)
(make-local-variable 'paragraph-start)
(setq paragraph-start comint-prompt-regexp))
(setq-local comint-password-prompt-regexp regexp-unmatchable)
(setq-local paragraph-start comint-prompt-regexp))
(defcustom ange-ftp-raw-login 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-query-on-exit-flag proc nil)
;; (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)
;; (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"
(cadr data)))
(with-current-buffer (or buffer (current-buffer))
(set (make-local-variable 'imap-enable-exchange-bug-workaround)
t)
(setq-local imap-enable-exchange-bug-workaround t)
(imap-fetch (cdr uids) props receive nouidfetch))
(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"
"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)))
(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.
(define-derived-mode nslookup-mode comint-mode "Nslookup"
"Major mode for interacting with the nslookup program."
(set
(make-local-variable 'font-lock-defaults)
(setq-local font-lock-defaults
'((nslookup-font-lock-keywords)))
(setq comint-prompt-regexp nslookup-prompt-regexp)
(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.")
(defun network-connection-mode-setup (host service)
(make-local-variable 'network-connection-host)
(setq network-connection-host host)
(make-local-variable 'network-connection-service)
(setq network-connection-service service))
(setq-local network-connection-host host)
(setq-local network-connection-service service))
;;;###autoload
(defun network-connection-to-service (host service)

View file

@ -445,17 +445,17 @@ images."
"NewsTicker"
"Viewing news feeds in Emacs."
(if (boundp 'tool-bar-map)
(set (make-local-variable 'tool-bar-map)
(setq-local tool-bar-map
newsticker--plainview-tool-bar-map))
(set (make-local-variable 'imenu-sort-function) nil)
(set (make-local-variable 'scroll-conservatively) 999)
(setq-local imenu-sort-function nil)
(setq-local scroll-conservatively 999)
(setq imenu-create-index-function 'newsticker--imenu-create-index)
(setq imenu-default-goto-function 'newsticker--imenu-goto)
(setq buffer-read-only t)
(auto-fill-mode -1) ;; turn auto-fill off!
(font-lock-mode -1) ;; turn off font-lock!!
(set (make-local-variable 'font-lock-defaults) nil)
(set (make-local-variable 'line-move-ignore-invisible) t)
(setq-local font-lock-defaults nil)
(setq-local line-move-ignore-invisible t)
(setq mode-line-format
(list "-"
'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)
(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)
;; FIXME: needed for methods buffer in ecb

View file

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

View file

@ -208,10 +208,8 @@ variable."
(unless (comint-check-proc buffer-name)
(comint-exec buffer buffer-name rlogin-program nil args)
(rlogin-mode)
(make-local-variable 'rlogin-host)
(setq rlogin-host host)
(make-local-variable 'rlogin-remote-user)
(setq rlogin-remote-user user)
(setq-local rlogin-host host)
(setq-local rlogin-remote-user user)
(ignore-errors
(cond ((eq rlogin-directory-tracking-mode t)
;; 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}"
(setq buffer-undo-list t)
(set (make-local-variable 'revert-buffer-function)
(setq-local revert-buffer-function
#'secrets-show-collections)
;; When we toggle, we must set temporary widgets.
(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.
Turning on Sieve mode runs `sieve-mode-hook'."
(set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter))
(set (make-local-variable 'paragraph-separate) paragraph-start)
(set (make-local-variable 'comment-start) "#")
(set (make-local-variable 'comment-end) "")
;;(set (make-local-variable 'comment-start-skip) "\\(^\\|\\s-\\);?#+ *")
(set (make-local-variable 'comment-start-skip) "#+ *")
(set (make-local-variable 'syntax-propertize-function)
#'sieve-syntax-propertize)
(set (make-local-variable 'font-lock-defaults)
(setq-local paragraph-start (concat "$\\|" page-delimiter))
(setq-local paragraph-separate paragraph-start)
(setq-local comment-start "#")
(setq-local comment-end "")
;; (setq-local comment-start-skip "\\(^\\|\\s-\\);?#+ *")
(setq-local comment-start-skip "#+ *")
(setq-local syntax-propertize-function #'sieve-syntax-propertize)
(setq-local font-lock-defaults
'(sieve-font-lock-keywords nil nil ((?_ . "w"))))
(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))
(header (format "Server : %s:%s\n\n" server port)))
(insert header))
(set (make-local-variable 'sieve-buffer-header-end)
(point-max)))
(setq-local sieve-buffer-header-end (point-max)))
(defun sieve-script-at-point (&optional pos)
"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."
(with-current-buffer
(or ;; open server
(set (make-local-variable 'sieve-manage-buffer)
(setq-local sieve-manage-buffer
(sieve-manage-open server port))
(error "Error opening server %s" server))
(sieve-manage-authenticate)))

View file

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

View file

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