Skip to content

Commit e861069

Browse files
committed
Drop variable gnuplot-eldoc-mode and gnuplot-tab-completion
Toggle the local eldoc-mode instead. Set tab-always-indent to 'complete instead.
1 parent 2a77249 commit e861069

File tree

3 files changed

+14
-49
lines changed

3 files changed

+14
-49
lines changed

README.org

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ more specific help topic lookup in the gnuplot info file.
8383

8484
If the context-sensitivity annoys you, you can get simple
8585
non-context-sensitive completion back by toggling
86-
=gnuplot-context-sensitive-mode=. See also the variable
87-
=gnuplot-tab-completion=.
86+
=gnuplot-context-sensitive-mode=.
8887

8988
By its nature, the completion code has to know a fair bit about the
9089
structure of the gnuplot language. If you use it with an old version

gnuplot-context.el

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@
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
@@ -53,18 +52,9 @@
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
;; ================
@@ -231,7 +221,6 @@
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
21952184
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'.
21992186
22002187
\\[gnuplot-info-at-point] will try to find the most relevant
22012188
Gnuplot 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
22052192
syntax at point in the minibuffer. To have one-line syntax
22062193
summaries appear in the echo area as you type, toggle
2207-
`eldoc-mode' or customize `gnuplot-eldoc-mode'.
2194+
`eldoc-mode'.
22082195
22092196
To choose whether to use this mode by default in Gnuplot buffers,
22102197
customize 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)

gnuplot.el

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -275,21 +275,6 @@ suggestions."
275275
(gnuplot-context-sensitive-mode (if value 1 0))))))
276276
:link '(emacs-commentary-link "gnuplot-context"))
277277

278-
(defcustom gnuplot-eldoc-mode t
279-
"Non-nil if ElDoc mode should be enabled by default in Gnuplot buffers.
280-
ElDoc support requires `gnuplot-context-sensitive-mode' to be
281-
on."
282-
:group 'gnuplot
283-
:type 'boolean)
284-
285-
(defcustom gnuplot-tab-completion nil
286-
"Non-nil if TAB should perform completion in `gnuplot-mode' buffers.
287-
288-
Setting this to non-nil sets the `tab-always-indent' variable to the
289-
symbol `complete' in `gnuplot-mode' buffers."
290-
:group 'gnuplot
291-
:type 'boolean)
292-
293278
(defun gnuplot--set-display-mode (variable value &rest _args)
294279
"Customize :set function for `gnuplot-inline-image-mode'.
295280
Set VARIABLE to VALUE. ARGS is optional args."
@@ -2065,6 +2050,8 @@ following in your .emacs file:
20652050
(define-obsolete-function-alias 'gnuplot-setup-info-look #'gnuplot--setup-info-look "0.8.1")
20662051
(define-obsolete-function-alias 'gnuplot-split-string #'gnuplot--split-string "0.8.1")
20672052
(define-obsolete-function-alias 'gnuplot-syntax-propertize-extend-region #'gnuplot--syntax-propertize-extend-region "0.8.1")
2053+
(make-obsolete-variable 'gnuplot-eldoc-mode "Toggle eldoc-mode" "0.8.1")
2054+
(make-obsolete-variable 'gnuplot-tab-completion "Set tab-always-indent to 'complete" "0.8.1")
20682055

20692056
(provide 'gnuplot)
20702057
;; Local Variables:

0 commit comments

Comments
 (0)