4141; ;
4242; ; Gnuplot's context sensitive mode is best controlled using Customize
4343; ; (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.
4847; ;
4948; ; If you need to turn context sensitivity on or off from Lisp code
5049; ; for some reason, call the function
5352; ; With `eldoc-mode' support, gnuplot-mode will show one-line syntax
5453; ; hints automatically in the echo area. Whether eldoc-mode is active
5554; ; 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.
6858; ;
6959; ; Internal details
7060; ; ================
231221
232222(require 'cl-lib )
233223(require 'gnuplot )
234- (require 'eldoc )
235224(require 'info )
236225(require 'info-look )
237226
@@ -2193,9 +2182,7 @@ Key bindings:
21932182
21942183\\ [completion-at-point] will complete the keyword at point based
21952184on 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' .
21992186
22002187\\ [gnuplot-info-at-point] will try to find the most relevant
22012188Gnuplot info node for the construction at point, prompting for a
@@ -2204,7 +2191,7 @@ node name if nothing is found.
22042191\\ [gnuplot-help-function] will pop up a brief summary of the
22052192syntax at point in the minibuffer. To have one-line syntax
22062193summaries appear in the echo area as you type, toggle
2207- `eldoc-mode' or customize `gnuplot-eldoc-mode' .
2194+ `eldoc-mode' .
22082195
22092196To choose whether to use this mode by default in Gnuplot buffers,
22102197customize the variable
@@ -2223,18 +2210,10 @@ distribution. See gnuplot-context.el for details."
22232210 ; ; Turn on
22242211 (progn
22252212 (setq gnuplot-completion-at-point-function #'gnuplot-context-completion-at-point )
2226-
2227- ; ; Setup Eldoc
2213+ ; ; Setup Eldoc and try to load Eldoc strings
22282214 (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 )))
22382217
22392218 ; ; Turn off
22402219 (setq gnuplot-completion-at-point-function #'gnuplot-completion-at-point-info-look )
0 commit comments