From 9e7b93f2da8ef3676fb9923278ee1e721dfc17d9 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 8 Dec 2020 08:52:57 +0100 Subject: [PATCH] Prefer setq-local in term.el * lisp/term.el (term-mode, term-exec, term-emulate-terminal) (term-process-pager): Prefer setq-local. --- lisp/term.el | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/lisp/term.el b/lisp/term.el index 34dc2870f21..545185064dd 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -1005,12 +1005,12 @@ Entry to this mode runs the hooks on `term-mode-hook'." ;; we do not want indent to sneak in any tabs (setq indent-tabs-mode nil) (setq buffer-display-table term-display-table) - (set (make-local-variable 'term-home-marker) (copy-marker 0)) - (set (make-local-variable 'term-height) (floor (window-screen-lines))) - (set (make-local-variable 'term-width) (window-max-chars-per-line)) - (set (make-local-variable 'term-last-input-start) (make-marker)) - (set (make-local-variable 'term-last-input-end) (make-marker)) - (set (make-local-variable 'term-last-input-match) "") + (setq-local term-home-marker (copy-marker 0)) + (setq-local term-height (floor (window-screen-lines))) + (setq-local term-width (window-max-chars-per-line)) + (setq-local term-last-input-start (make-marker)) + (setq-local term-last-input-end (make-marker)) + (setq-local term-last-input-match "") ;; These local variables are set to their local values: (make-local-variable 'term-saved-home-marker) @@ -1028,9 +1028,9 @@ Entry to this mode runs the hooks on `term-mode-hook'." ;; a properly configured ange-ftp, I've decided to be conservative ;; and put them in. -mm - (set (make-local-variable 'term-ansi-at-host) (system-name)) - (set (make-local-variable 'term-ansi-at-dir) default-directory) - (set (make-local-variable 'term-ansi-at-message) nil) + (setq-local term-ansi-at-host (system-name)) + (setq-local term-ansi-at-dir default-directory) + (setq-local term-ansi-at-message nil) ;; For user tracking purposes -mm (make-local-variable 'ange-ftp-default-user) @@ -1073,15 +1073,15 @@ Entry to this mode runs the hooks on `term-mode-hook'." (make-local-variable 'term-scroll-to-bottom-on-output) (make-local-variable 'term-scroll-show-maximum-output) (make-local-variable 'term-ptyp) - (set (make-local-variable 'term-vertical-motion) 'vertical-motion) - (set (make-local-variable 'term-pending-delete-marker) (make-marker)) + (setq-local term-vertical-motion 'vertical-motion) + (setq-local term-pending-delete-marker (make-marker)) (make-local-variable 'term-current-face) (term-ansi-reset) - (set (make-local-variable 'term-pending-frame) nil) + (setq-local term-pending-frame nil) ;; Cua-mode's keybindings interfere with the term keybindings, disable it. - (set (make-local-variable 'cua-mode) nil) + (setq-local cua-mode nil) - (set (make-local-variable 'font-lock-defaults) '(nil t)) + (setq-local font-lock-defaults '(nil t)) (add-function :filter-return (local 'filter-buffer-substring-function) @@ -1423,8 +1423,7 @@ buffer. The hook `term-exec-hook' is run after each exec." (when proc (delete-process proc))) ;; Crank up a new process (let ((proc (term-exec-1 name buffer command switches))) - (make-local-variable 'term-ptyp) - (setq term-ptyp process-connection-type) ; t if pty, nil if pipe. + (setq-local term-ptyp process-connection-type) ; t if pty, nil if pipe. ;; Jump to the end, and set the process mark. (goto-char (point-max)) (set-marker (process-mark proc) (point)) @@ -3067,8 +3066,7 @@ See `term-prompt-regexp'." (aset term-terminal-undecoded-bytes 0 ?\r)) (goto-char (point-max))) ;; FIXME: Use (add-function :override (process-filter proc) - (make-local-variable 'term-pager-old-filter) - (setq term-pager-old-filter (process-filter proc)) + (setq-local term-pager-old-filter (process-filter proc)) ;; FIXME: Where is `term-pager-filter' set to a function?! (set-process-filter proc term-pager-filter) (setq i str-length)) @@ -3537,8 +3535,7 @@ The top-most line is line 0." ;; (stop-process process)) (setq term-pager-old-local-map (current-local-map)) (use-local-map term-pager-break-map) - (make-local-variable 'term-old-mode-line-format) - (setq term-old-mode-line-format mode-line-format) + (setq-local term-old-mode-line-format mode-line-format) (setq mode-line-format (list "-- **MORE** " mode-line-buffer-identification -- 2.39.2