[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 478368a 1/9: Prefer setq-local in simple.el
From: |
Stefan Kangas |
Subject: |
master 478368a 1/9: Prefer setq-local in simple.el |
Date: |
Tue, 8 Dec 2020 03:32:12 -0500 (EST) |
branch: master
commit 478368ad4fe43b02b8a7e91c7dbec1ac1afc4d68
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
Prefer setq-local in simple.el
* lisp/simple.el (read-extended-command, goto-history-element)
(minibuffer-history-isearch-setup, read-shell-command)
(visual-line-mode, completion-setup-function, read-only-mode)
(visible-mode): Prefer setq-local.
---
lisp/simple.el | 48 +++++++++++++++++++++++-------------------------
1 file changed, 23 insertions(+), 25 deletions(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index 3c4f756..dd271b0 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1922,7 +1922,7 @@ to get different commands to edit and resubmit."
(setq execute-extended-command--last-typed
(minibuffer-contents)))
nil 'local)
- (set (make-local-variable 'minibuffer-default-add-function)
+ (setq-local minibuffer-default-add-function
(lambda ()
;; Get a command name at point in the original buffer
;; to propose it after M-n.
@@ -2372,10 +2372,10 @@ negative number -N means the Nth entry of \"future
history.\""
(unless (memq last-command '(next-history-element
previous-history-element))
(let ((prompt-end (minibuffer-prompt-end)))
- (set (make-local-variable 'minibuffer-temporary-goal-position)
- (cond ((<= (point) prompt-end) prompt-end)
- ((eobp) nil)
- (t (point))))))
+ (setq-local minibuffer-temporary-goal-position
+ (cond ((<= (point) prompt-end) prompt-end)
+ ((eobp) nil)
+ (t (point))))))
(goto-char (point-max))
(delete-minibuffer-contents)
(setq minibuffer-history-position nabs)
@@ -2548,14 +2548,14 @@ Return 0 if current buffer is not a minibuffer."
(defun minibuffer-history-isearch-setup ()
"Set up a minibuffer for using isearch to search the minibuffer history.
Intended to be added to `minibuffer-setup-hook'."
- (set (make-local-variable 'isearch-search-fun-function)
- 'minibuffer-history-isearch-search)
- (set (make-local-variable 'isearch-message-function)
- 'minibuffer-history-isearch-message)
- (set (make-local-variable 'isearch-wrap-function)
- 'minibuffer-history-isearch-wrap)
- (set (make-local-variable 'isearch-push-state-function)
- 'minibuffer-history-isearch-push-state)
+ (setq-local isearch-search-fun-function
+ #'minibuffer-history-isearch-search)
+ (setq-local isearch-message-function
+ #'minibuffer-history-isearch-message)
+ (setq-local isearch-wrap-function
+ #'minibuffer-history-isearch-wrap)
+ (setq-local isearch-push-state-function
+ #'minibuffer-history-isearch-push-state)
(add-hook 'isearch-mode-end-hook 'minibuffer-history-isearch-end nil t))
(defun minibuffer-history-isearch-end ()
@@ -3585,8 +3585,8 @@ to `shell-command-history'."
(minibuffer-with-setup-hook
(lambda ()
(shell-completion-vars)
- (set (make-local-variable 'minibuffer-default-add-function)
- 'minibuffer-default-add-shell-commands))
+ (setq-local minibuffer-default-add-function
+ #'minibuffer-default-add-shell-commands))
(apply #'read-from-minibuffer prompt initial-contents
minibuffer-local-shell-command-map
nil
@@ -7431,8 +7431,8 @@ Mode' for details."
(if (local-variable-p var)
(push (cons var (symbol-value var))
visual-line--saved-state))))
- (set (make-local-variable 'line-move-visual) t)
- (set (make-local-variable 'truncate-partial-width-windows) nil)
+ (setq-local line-move-visual t)
+ (setq-local truncate-partial-width-windows nil)
(setq truncate-lines nil
word-wrap t
fringe-indicator-alist
@@ -8825,10 +8825,9 @@ Called from `temp-buffer-show-hook'."
(let ((base-position completion-base-position)
(insert-fun completion-list-insert-choice-function))
(completion-list-mode)
- (set (make-local-variable 'completion-base-position) base-position)
- (set (make-local-variable 'completion-list-insert-choice-function)
- insert-fun))
- (set (make-local-variable 'completion-reference-buffer) mainbuf)
+ (setq-local completion-base-position base-position)
+ (setq-local completion-list-insert-choice-function insert-fun))
+ (setq-local completion-reference-buffer mainbuf)
(if base-dir (setq default-directory base-dir))
(when completion-tab-width
(setq tab-width completion-tab-width))
@@ -9288,8 +9287,7 @@ to a non-nil value."
(cond
((and (not buffer-read-only) view-mode)
(View-exit-and-edit)
- (make-local-variable 'view-read-only)
- (setq view-read-only t)) ; Must leave view mode.
+ (setq-local view-read-only t)) ; Must leave view mode.
((and buffer-read-only view-read-only
;; If view-mode is already active, `view-mode-enter' is a nop.
(not view-mode)
@@ -9307,8 +9305,8 @@ and setting it to nil."
(setq buffer-invisibility-spec vis-mode-saved-buffer-invisibility-spec)
(kill-local-variable 'vis-mode-saved-buffer-invisibility-spec))
(when visible-mode
- (set (make-local-variable 'vis-mode-saved-buffer-invisibility-spec)
- buffer-invisibility-spec)
+ (setq-local vis-mode-saved-buffer-invisibility-spec
+ buffer-invisibility-spec)
(setq buffer-invisibility-spec nil)))
(defvar messages-buffer-mode-map
- master updated (0155bd0 -> 1c75ca1), Stefan Kangas, 2020/12/08
- master 0d6fca3 2/9: * lisp/array.el (array-mode): Prefer setq-local., Stefan Kangas, 2020/12/08
- master db001f8 5/9: Prefer setq-local in speedbar.el, Stefan Kangas, 2020/12/08
- master 07b317c 3/9: * lisp/locate.el (locate, locate-mode): Prefer setq-local., Stefan Kangas, 2020/12/08
- master 3b20c03 8/9: Prefer setq-local in tests, Stefan Kangas, 2020/12/08
- master 9e7b93f 7/9: Prefer setq-local in term.el, Stefan Kangas, 2020/12/08
- master 6614b67 4/9: Prefer setq-local in newcomment.el, Stefan Kangas, 2020/12/08
- master 478368a 1/9: Prefer setq-local in simple.el,
Stefan Kangas <=
- master 095a41e 6/9: Prefer setq-local in shell.el, Stefan Kangas, 2020/12/08
- master 1c75ca1 9/9: * admin/nt/dist-build/build-dep-zips.py: Remove unused import., Stefan Kangas, 2020/12/08