|
219 | 219 | ;;; Code:
|
220 | 220 |
|
221 | 221 | (require 'gnuplot)
|
| 222 | +(require 'gnuplot-eldoc) |
222 | 223 |
|
223 | 224 |
|
224 | 225 | ;;;; The tokenizer.
|
@@ -1737,12 +1738,6 @@ token list just after the end of the capture group.")
|
1737 | 1738 | Set by `gnuplot-context--match-pattern'. See also
|
1738 | 1739 | `gnuplot-context-info-at-point'.")
|
1739 | 1740 |
|
1740 |
| -(defvar gnuplot-eldoc-hash nil |
1741 |
| - "ElDoc strings for `gnuplot-mode'. |
1742 |
| -
|
1743 |
| -These have to be compiled from the Gnuplot source tree using |
1744 |
| -`doc2texi.el'.") |
1745 |
| - |
1746 | 1741 |
|
1747 | 1742 | ;;;; The pattern matching machine
|
1748 | 1743 | (defun gnuplot-context--match-pattern (instructions tokens completing-p
|
@@ -1998,7 +1993,7 @@ there."
|
1998 | 1993 | (t info)))
|
1999 | 1994 | (when gnuplot-context--info-at-point
|
2000 | 1995 | (gnuplot-context--trace "\tset info to \"%s\"\n" gnuplot-context--info-at-point)
|
2001 |
| - (when (and (not gnuplot-context--eldoc) gnuplot-eldoc-hash) |
| 1996 | + (unless gnuplot-context--eldoc |
2002 | 1997 | (let ((eldoc
|
2003 | 1998 | (car (gethash gnuplot-context--info-at-point gnuplot-eldoc-hash))))
|
2004 | 1999 | (when eldoc
|
@@ -2053,7 +2048,7 @@ there."
|
2053 | 2048 | "Pop up the extended documentation for the construction at point."
|
2054 | 2049 | (interactive nil gnuplot-mode gnuplot-comint-mode)
|
2055 | 2050 | (gnuplot-context--parse-at-point nil)
|
2056 |
| - (if (and gnuplot-context--info-at-point gnuplot-eldoc-hash) |
| 2051 | + (if gnuplot-context--info-at-point |
2057 | 2052 | (let ((eldoc
|
2058 | 2053 | (cadr (gethash gnuplot-context--info-at-point gnuplot-eldoc-hash))))
|
2059 | 2054 | (if eldoc (message eldoc)))))
|
@@ -2199,9 +2194,7 @@ customize the variable
|
2199 | 2194 | (progn
|
2200 | 2195 | (remove-hook 'completion-at-point-functions #'gnuplot-completion-at-point-info-look t)
|
2201 | 2196 | (add-hook 'completion-at-point-functions #'gnuplot-context-completion-at-point nil t)
|
2202 |
| - (add-hook 'eldoc-documentation-functions #'gnuplot-context-eldoc-function nil 'local) |
2203 |
| - (unless gnuplot-eldoc-hash |
2204 |
| - (load "gnuplot-eldoc" t t))) |
| 2197 | + (add-hook 'eldoc-documentation-functions #'gnuplot-context-eldoc-function nil 'local)) |
2205 | 2198 | (add-hook 'completion-at-point-functions #'gnuplot-completion-at-point-info-look nil t)
|
2206 | 2199 | (remove-hook 'completion-at-point-functions #'gnuplot-context-completion-at-point t)
|
2207 | 2200 | (remove-hook 'eldoc-documentation-functions #'gnuplot-context-eldoc-function t)))
|
|
0 commit comments