Skip to content

Commit

Permalink
Cleanup: Use setq-local instead of (set (make-local-variable ...))
Browse files Browse the repository at this point in the history
  • Loading branch information
vspinu committed May 10, 2019
1 parent 0c0a44c commit a1e318c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 24 deletions.
35 changes: 17 additions & 18 deletions lisp/ess-gretl.el
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ end keywords as associated values.")
(defun gretl-indent-line ()
"Indent current line of gretl code."
(interactive)
; (save-excursion
(end-of-line)
(indent-line-to
(or (and (ess-inside-string-p (point-at-bol)) 0)
Expand All @@ -397,16 +396,16 @@ end keywords as associated values.")
(if endtok (- gretl-basic-offset) 0)))))
;; previous line ends in =
(save-excursion
(if (and (not (equal (point-min) (line-beginning-position)))
(progn
(forward-line -1)
(end-of-line) (backward-char 1)
(equal (char-after (point)) ?=)))
(+ gretl-basic-offset (current-indentation))
nil))
(if (and (not (equal (point-min) (line-beginning-position)))
(progn
(forward-line -1)
(end-of-line) (backward-char 1)
(equal (char-after (point)) ?=)))
(+ gretl-basic-offset (current-indentation))
nil))
;; take same indentation as previous line
(save-excursion (forward-line -1)
(current-indentation))
(current-indentation))
0))
(when (gretl-at-keyword gretl-block-end-keywords)
(forward-word 1)))
Expand Down Expand Up @@ -544,16 +543,16 @@ to gretl, put them in the variable `inferior-gretl-args'."
"\n(Gretl): ess-dialect=%s, buf=%s"
ess-dialect (current-buffer)))
(let* ((r-start-args
(concat inferior-gretl-args " " ; add space just in case
(if start-args
(read-string
(concat "Starting Args [other than `"
inferior-gretl-args
"'] ? "))
nil)))
(concat inferior-gretl-args " " ; add space just in case
(if start-args
(read-string
(concat "Starting Args [other than `"
inferior-gretl-args
"'] ? "))
nil)))
(inf-buf (inferior-ess r-start-args gretl-customize-alist)))
(set (make-local-variable 'indent-line-function) 'gretl-indent-line)
(set (make-local-variable 'gretl-basic-offset) 4)
(setq-local indent-line-function 'gretl-indent-line)
(setq-local gretl-basic-offset 4)
(setq indent-tabs-mode nil)
(goto-char (point-max))
;; (if inferior-ess-language-start
Expand Down
2 changes: 1 addition & 1 deletion lisp/ess-r-completion.el
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ Return format suitable for `completion-at-point-functions'."
(ess-process-live-p))
(let ((args (nth 2 (ess-function-arguments (car ess--fn-name-start-cache)))))
(if args
(set (make-local-variable 'ac-use-comphist) nil)
(setq-local ac-use-comphist nil)
(kill-local-variable 'ac-use-comphist))
(delete "..." args)
(mapcar (lambda (a) (concat a ess-R-argument-suffix))
Expand Down
4 changes: 2 additions & 2 deletions lisp/ess-toolbar.el
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ X should be a list, see `ess-toolbar-items' for the format."
"Add the ESS toolbar to a particular mode.
The toolbar is added iff `ess-toolbar-global' is nil, else the toolbar
is added globally when ess-toolbar.el is loaded."
(if (and ess-toolbar (not ess-toolbar-global))
(set (make-local-variable 'tool-bar-map) ess-toolbar)))
(when (and ess-toolbar (not ess-toolbar-global))
(setq-local tool-bar-map ess-toolbar)))

;; Make the toolbars. Each toolbar is hopefully made only when this file
;; is loaded; we don't need it to be remade every time.
Expand Down
3 changes: 1 addition & 2 deletions lisp/ess-tracebug.el
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,7 @@ ESS internal code assumes default R prompts.")
(with-current-buffer (process-buffer (get-process ess-local-process-name))
(unless ess-error-regexp-alist
(error "Can not activate the traceback for %s dialect" ess-dialect))
(set (make-local-variable 'compilation-error-regexp-alist)
ess-error-regexp-alist)
(setq-local compilation-error-regexp-alist ess-error-regexp-alist)
(let (compilation-mode-font-lock-keywords)
(compilation-setup t))
(setq next-error-function 'ess-tracebug-next-error-function)
Expand Down
2 changes: 1 addition & 1 deletion lisp/essd-els.el
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ DIALECT is the desired ess-dialect. If nil, ask for dialect"
(current-buffer)))
(ess-setq-vars-local customize-alist)
(inferior-ess--set-major-mode ess-dialect)
(set (make-local-variable 'ess-remote) t)
(setq-local ess-remote t)
(setq ess-local-process-name (or proc-name ess-current-process-name))

(goto-char (point-max))
Expand Down

0 comments on commit a1e318c

Please sign in to comment.