summaryrefslogtreecommitdiff
path: root/lisp/progmodes/grep.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2020-12-07 16:56:15 +0100
committerStefan Kangas <stefan@marxist.se>2020-12-08 11:26:33 +0100
commitbdf8dd25e658eb5b1921f5e386eac0a0285707fc (patch)
tree1ee133eb45f7cafe803f39ec9d3d78e50a77960e /lisp/progmodes/grep.el
parentafe1605939a538b05ff0ad2f1c861ce857eb463f (diff)
downloademacs-bdf8dd25e658eb5b1921f5e386eac0a0285707fc.tar.gz
Prefer setq-local in grep.el
* lisp/progmodes/grep.el (grep-process-setup, grep-mode): Prefer setq-local.
Diffstat (limited to 'lisp/progmodes/grep.el')
-rw-r--r--lisp/progmodes/grep.el31
1 files changed, 15 insertions, 16 deletions
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index dafba22f777..7c8acedaf3d 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -568,8 +568,7 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
;; GREP_COLORS is used in GNU grep 2.5.2 and later versions
(setenv "GREP_COLORS" "mt=01;31:fn=:ln=:bn=:se=:sl=:cx=:ne"))
(setq-local grep-num-matches-found 0)
- (set (make-local-variable 'compilation-exit-message-function)
- #'grep-exit-message)
+ (setq-local compilation-exit-message-function #'grep-exit-message)
(run-hooks 'grep-setup-hook))
(defun grep-exit-message (status code msg)
@@ -880,22 +879,22 @@ The value depends on `grep-command', `grep-template',
(define-compilation-mode grep-mode "Grep"
"Sets `grep-last-buffer' and `compilation-window-height'."
(setq grep-last-buffer (current-buffer))
- (set (make-local-variable 'tool-bar-map) grep-mode-tool-bar-map)
- (set (make-local-variable 'compilation-error-face)
- grep-hit-face)
- (set (make-local-variable 'compilation-error-regexp-alist)
- grep-regexp-alist)
- (set (make-local-variable 'compilation-mode-line-errors)
- grep-mode-line-matches)
+ (setq-local tool-bar-map grep-mode-tool-bar-map)
+ (setq-local compilation-error-face
+ grep-hit-face)
+ (setq-local compilation-error-regexp-alist
+ grep-regexp-alist)
+ (setq-local compilation-mode-line-errors
+ grep-mode-line-matches)
;; compilation-directory-matcher can't be nil, so we set it to a regexp that
;; can never match.
- (set (make-local-variable 'compilation-directory-matcher)
- (list regexp-unmatchable))
- (set (make-local-variable 'compilation-process-setup-function)
- #'grep-process-setup)
- (set (make-local-variable 'compilation-disable-input) t)
- (set (make-local-variable 'compilation-error-screen-columns)
- grep-error-screen-columns)
+ (setq-local compilation-directory-matcher
+ (list regexp-unmatchable))
+ (setq-local compilation-process-setup-function
+ #'grep-process-setup)
+ (setq-local compilation-disable-input t)
+ (setq-local compilation-error-screen-columns
+ grep-error-screen-columns)
(add-hook 'compilation-filter-hook #'grep-filter nil t))
(defun grep--save-buffers ()