emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master f0db9ae: Prefer setq-local in net/*.el


From: Stefan Kangas
Subject: master f0db9ae: Prefer setq-local in net/*.el
Date: Fri, 4 Dec 2020 12:43:19 -0500 (EST)

branch: master
commit f0db9ae2139c4a437a9bc08b44d94dbdb3d39c6c
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    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.
---
 lisp/net/ange-ftp.el        | 22 ++++++---------
 lisp/net/imap.el            |  3 +--
 lisp/net/net-utils.el       | 15 +++++------
 lisp/net/newst-plainview.el | 14 +++++-----
 lisp/net/newst-treeview.el  |  9 +++----
 lisp/net/rlogin.el          |  6 ++---
 lisp/net/secrets.el         |  4 +--
 lisp/net/sieve-mode.el      | 19 +++++++------
 lisp/net/sieve.el           |  7 +++--
 lisp/net/snmp-mode.el       | 66 +++++++++++++++++----------------------------
 lisp/net/telnet.el          |  6 ++---
 lisp/net/tramp.el           |  8 +++---
 12 files changed, 73 insertions(+), 106 deletions(-)

diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index e0c162d..c627e1a 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -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)
diff --git a/lisp/net/imap.el b/lisp/net/imap.el
index 22b5908..0394f0e 100644
--- a/lisp/net/imap.el
+++ b/lisp/net/imap.el
@@ -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))))))
 
diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el
index 8777fe4..994a0bf 100644
--- a/lisp/net/net-utils.el
+++ b/lisp/net/net-utils.el
@@ -307,8 +307,8 @@ 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)
-       '((net-utils-font-lock-keywords)))
+  (setq-local font-lock-defaults
+              '((net-utils-font-lock-keywords)))
   (setq-local revert-buffer-function #'net-utils--revert-function))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -624,9 +624,8 @@ 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)
-   '((nslookup-font-lock-keywords)))
+  (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)
diff --git a/lisp/net/newst-plainview.el b/lisp/net/newst-plainview.el
index d4c53b1..98f55a7 100644
--- a/lisp/net/newst-plainview.el
+++ b/lisp/net/newst-plainview.el
@@ -445,17 +445,17 @@ images."
   "NewsTicker"
   "Viewing news feeds in Emacs."
   (if (boundp 'tool-bar-map)
-      (set (make-local-variable '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 tool-bar-map
+                  newsticker--plainview-tool-bar-map))
+  (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
diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el
index ff8a447..30db1a3 100644
--- a/lisp/net/newst-treeview.el
+++ b/lisp/net/newst-treeview.el
@@ -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,8 +2023,8 @@ 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)
-           newsticker-treeview-tool-bar-map))
+      (setq-local tool-bar-map
+                  newsticker-treeview-tool-bar-map))
   (setq buffer-read-only t
         truncate-lines t))
 
diff --git a/lisp/net/rlogin.el b/lisp/net/rlogin.el
index 766d644..6c960a1 100644
--- a/lisp/net/rlogin.el
+++ b/lisp/net/rlogin.el
@@ -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
diff --git a/lisp/net/secrets.el b/lisp/net/secrets.el
index f98ded4..e8ef185 100644
--- a/lisp/net/secrets.el
+++ b/lisp/net/secrets.el
@@ -792,8 +792,8 @@ In this mode, widgets represent the search results.
 
 \\{secrets-mode-map}"
   (setq buffer-undo-list t)
-  (set (make-local-variable 'revert-buffer-function)
-       #'secrets-show-collections)
+  (setq-local revert-buffer-function
+              #'secrets-show-collections)
   ;; When we toggle, we must set temporary widgets.
   (add-hook 'tree-widget-after-toggle-functions
             #'secrets-tree-widget-after-toggle-function nil t))
diff --git a/lisp/net/sieve-mode.el b/lisp/net/sieve-mode.el
index 05e9747..b3d511c 100644
--- a/lisp/net/sieve-mode.el
+++ b/lisp/net/sieve-mode.el
@@ -185,16 +185,15 @@ 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)
-       '(sieve-font-lock-keywords nil nil ((?_ . "w"))))
+  (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))
 
 (provide 'sieve-mode)
diff --git a/lisp/net/sieve.el b/lisp/net/sieve.el
index 75bb4e2..ae96134 100644
--- a/lisp/net/sieve.el
+++ b/lisp/net/sieve.el
@@ -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,8 +303,8 @@ 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)
-           (sieve-manage-open server port))
+       (setq-local sieve-manage-buffer
+                   (sieve-manage-open server port))
        (error "Error opening server %s" server))
     (sieve-manage-authenticate)))
 
diff --git a/lisp/net/snmp-mode.el b/lisp/net/snmp-mode.el
index 76d9ced..df0fd1d 100644
--- a/lisp/net/snmp-mode.el
+++ b/lisp/net/snmp-mode.el
@@ -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
-                                     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-syntax-list (append snmp-rfc1155-types
+                                            snmp-rfc1213-types
+                                            snmp-mode-syntax-list))
+  (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
-                                     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-syntax-list (append snmp-rfc1902-types
+                                            snmp-rfc1903-types
+                                            snmp-mode-syntax-list))
+  (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))
diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el
index 29c415e..872c9f6 100644
--- a/lisp/net/telnet.el
+++ b/lisp/net/telnet.el
@@ -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)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index c367182..b3853aa 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1740,10 +1740,10 @@ 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)
-          `(t (eval ,tramp-debug-font-lock-keywords)
-              ,(eval tramp-debug-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.
       (use-local-map special-mode-map))
     (current-buffer)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]