Skip to content

Commit 9848d22

Browse files
committed
Cleanup mode setup
1 parent 9bc80ce commit 9848d22

File tree

1 file changed

+18
-29
lines changed

1 file changed

+18
-29
lines changed

gnuplot.el

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ region, a buffer, or a file."
108108
:group 'gnuplot-hooks
109109
:type 'hook)
110110

111-
(defvar-local gnuplot-recently-sent nil
111+
(defvar gnuplot-recently-sent nil
112112
"This is a record of the most recent kind of text sent to gnuplot.
113113
It takes as its value nil, `line', `region', `buffer', or `file'. It is
114114
useful for functions included in `gnuplot-after-plot-hook'.")
@@ -1248,21 +1248,18 @@ This sets font-lock and keyword completion in the comint/gnuplot
12481248
buffer."
12491249
:interactive nil
12501250

1251-
(set-syntax-table gnuplot-mode-syntax-table)
1252-
1253-
(setq font-lock-defaults gnuplot-font-lock-defaults)
1254-
(setq-local parse-sexp-lookup-properties t)
1255-
(setq-local syntax-propertize-function #'gnuplot--syntax-propertize)
1251+
(setq-local font-lock-defaults gnuplot-font-lock-defaults
1252+
parse-sexp-lookup-properties t
1253+
syntax-propertize-function #'gnuplot--syntax-propertize)
12561254

1255+
(set-syntax-table gnuplot-mode-syntax-table)
12571256
(add-hook 'kill-buffer-hook #'gnuplot--close-down nil t)
1258-
12591257
(add-hook 'comint-output-filter-functions
12601258
#'comint-postoutput-scroll-to-bottom
12611259
nil t)
12621260
(add-hook 'comint-output-filter-functions
12631261
#'gnuplot--protect-prompt-fn
12641262
nil t)
1265-
12661263
(add-hook 'completion-at-point-functions #'gnuplot-completion-at-point-info-look nil t)
12671264

12681265
;; Set up menu (see below)
@@ -1880,31 +1877,23 @@ a list:
18801877
text.
18811878
5. The GUI handling of \"hidden3d\" is flaky and \"cntrparam\" is
18821879
unsupported."
1883-
(setq-local comment-start "# ")
1884-
(setq-local comment-end "")
1885-
(setq-local comment-column 32)
1886-
(setq-local comment-start-skip "#[ \t]*")
1887-
(setq-local indent-line-function #'gnuplot-indent-line)
1888-
1889-
(setq-local beginning-of-defun-function #'gnuplot--beginning-of-defun)
1890-
(setq-local end-of-defun-function #'gnuplot--end-of-continuation)
1891-
1892-
(add-hook 'completion-at-point-functions #'gnuplot-completion-at-point-info-look nil t)
1893-
1880+
(setq-local comment-start "# "
1881+
comment-end ""
1882+
comment-column 32
1883+
comment-start-skip "#[ \t]*"
1884+
indent-line-function #'gnuplot-indent-line
1885+
beginning-of-defun-function #'gnuplot--beginning-of-defun
1886+
end-of-defun-function #'gnuplot--end-of-continuation
1887+
syntax-propertize-function #'gnuplot--syntax-propertize
1888+
font-lock-defaults gnuplot-font-lock-defaults
1889+
font-lock-multiline t
1890+
parse-sexp-lookup-properties t
1891+
comint-process-echoes gnuplot-echo-command-line-flag)
18941892
(set-syntax-table gnuplot-mode-syntax-table)
1895-
1896-
;; Add syntax-propertizing functions to search for strings and comments
1897-
(setq-local syntax-propertize-function #'gnuplot--syntax-propertize)
1893+
(add-hook 'completion-at-point-functions #'gnuplot-completion-at-point-info-look nil t)
18981894
(add-hook 'syntax-propertize-extend-region-functions
18991895
#'gnuplot--syntax-propertize-extend-region nil t)
1900-
1901-
;; Set up font-lock
1902-
(setq font-lock-defaults gnuplot-font-lock-defaults)
1903-
(setq-local font-lock-multiline t)
1904-
(setq-local parse-sexp-lookup-properties t)
1905-
19061896
(setq gnuplot--comint-recent-buffer (current-buffer))
1907-
(setq-local comint-process-echoes gnuplot-echo-command-line-flag)
19081897
(gnuplot--setup-menubar))
19091898

19101899
;;;###autoload

0 commit comments

Comments
 (0)