41
41
; ;
42
42
; ; Gnuplot's context sensitive mode is best controlled using Customize
43
43
; ; (M-x customize-group gnuplot): simply enable the
44
- ; ; `gnuplot-context-sensitive-mode' setting. You may also want to turn
45
- ; ; on `gnuplot-tab-completion' so that the TAB key does auto-completion
46
- ; ; on lines which are already indented. (This just sets the Emacs
47
- ; ; variable `tab-always-indent' to `complete' in Gnuplot buffers).
44
+ ; ; `gnuplot-context-sensitive-mode' setting. You may also want to set
45
+ ; ; the Emacs variable `tab-always-indent' to `complete' so that the
46
+ ; ; TAB key does auto-completion on lines which are already indented.
48
47
; ;
49
48
; ; If you need to turn context sensitivity on or off from Lisp code
50
49
; ; for some reason, call the function
53
52
; ; With `eldoc-mode' support, gnuplot-mode will show one-line syntax
54
53
; ; hints automatically in the echo area. Whether eldoc-mode is active
55
54
; ; or not, you can always pop up a longer description of syntax using
56
- ; ; `gnuplot-help-function' (C-c C-/ or C-c M-h). ElDoc support also
57
- ; ; requires an additional file of help strings, `gnuplot-eldoc.el' ,
58
- ; ; which should be included in recent Gnuplot releases. If it didn't
59
- ; ; come with your Gnuplot installation, you'll need to grab a recent
60
- ; ; source distribution of Gnuplot from http://gnuplot.info, and use
61
- ; ; the `doc2texi.el' program in the docs/ directory to create it. So
62
- ; ; long as the file is on your Emacs load path somewhere it will be
63
- ; ; loaded automatically when needed.
64
- ; ;
65
- ; ; You can customize gnuplot-mode to turn on eldoc mode automatically
66
- ; ; using variable `gnuplot-eldoc-mode' . Simply calling `eldoc-mode'
67
- ; ; will also work.
55
+ ; ; `gnuplot-help-function' (C-c C-/ or C-c M-h). ElDoc uses an additional
56
+ ; ; file of help strings, `gnuplot-eldoc.el' , which is provided with this
57
+ ; ; package.
68
58
; ;
69
59
; ; Internal details
70
60
; ; ================
231
221
232
222
(require 'cl-lib )
233
223
(require 'gnuplot )
234
- (require 'eldoc )
235
224
(require 'info )
236
225
(require 'info-look )
237
226
@@ -2193,9 +2182,7 @@ Key bindings:
2193
2182
2194
2183
\\ [completion-at-point] will complete the keyword at point based
2195
2184
on its context in the command. To make keyword completion work on
2196
- pressing TAB, set `tab-always-indent' to `complete' , or customize
2197
- `gnuplot-tab-completion' to make this automatic in gnuplot-mode
2198
- buffers.
2185
+ pressing TAB, set `tab-always-indent' to `complete' .
2199
2186
2200
2187
\\ [gnuplot-info-at-point] will try to find the most relevant
2201
2188
Gnuplot info node for the construction at point, prompting for a
@@ -2204,7 +2191,7 @@ node name if nothing is found.
2204
2191
\\ [gnuplot-help-function] will pop up a brief summary of the
2205
2192
syntax at point in the minibuffer. To have one-line syntax
2206
2193
summaries appear in the echo area as you type, toggle
2207
- `eldoc-mode' or customize `gnuplot-eldoc-mode' .
2194
+ `eldoc-mode' .
2208
2195
2209
2196
To choose whether to use this mode by default in Gnuplot buffers,
2210
2197
customize the variable
@@ -2223,18 +2210,10 @@ distribution. See gnuplot-context.el for details."
2223
2210
; ; Turn on
2224
2211
(progn
2225
2212
(setq gnuplot-completion-at-point-function #'gnuplot-context-completion-at-point )
2226
-
2227
- ; ; Setup Eldoc
2213
+ ; ; Setup Eldoc and try to load Eldoc strings
2228
2214
(add-hook 'eldoc-documentation-functions #'gnuplot-eldoc-function nil 'local )
2229
- (eldoc-add-command 'completion-at-point ) ; Check for eldoc after completion
2230
-
2231
- ; ; Try to load Eldoc strings
2232
- (when (and gnuplot-eldoc-mode (not gnuplot-eldoc-hash))
2233
- (load " gnuplot-eldoc" nil t ))
2234
-
2235
- ; ; Set up tab-to-complete
2236
- (when gnuplot-tab-completion
2237
- (setq-local tab-always-indent 'complete )))
2215
+ (unless gnuplot-eldoc-hash
2216
+ (load " gnuplot-eldoc" nil t )))
2238
2217
2239
2218
; ; Turn off
2240
2219
(setq gnuplot-completion-at-point-function #'gnuplot-completion-at-point-info-look )
0 commit comments