Skip to content

Commit 973acb1

Browse files
committed
Make gnuplot-eldoc a proper feature
1 parent 94b269c commit 973acb1

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

admin/doc2texi.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ Dumps the resulting data into gnuplot-eldoc.el"
700700
(insert d2t-gnuplot-license)
701701
(insert
702702
(format
703-
"\n\n%S\n%S"
703+
"\n\n%S\n%S\n(provide 'gnuplot-eldoc)\n;; gnuplot-eldoc.el ends here\n"
704704
'(eval-when-compile (defvar gnuplot-eldoc-hash nil))
705705
`(setq gnuplot-eldoc-hash
706706
(let ((tbl (make-hash-table :test 'equal))

gnuplot-context.el

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@
219219
;;; Code:
220220

221221
(require 'gnuplot)
222+
(require 'gnuplot-eldoc)
222223

223224

224225
;;;; The tokenizer.
@@ -1737,12 +1738,6 @@ token list just after the end of the capture group.")
17371738
Set by `gnuplot-context--match-pattern'. See also
17381739
`gnuplot-context-info-at-point'.")
17391740

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-
17461741

17471742
;;;; The pattern matching machine
17481743
(defun gnuplot-context--match-pattern (instructions tokens completing-p
@@ -1998,7 +1993,7 @@ there."
19981993
(t info)))
19991994
(when gnuplot-context--info-at-point
20001995
(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
20021997
(let ((eldoc
20031998
(car (gethash gnuplot-context--info-at-point gnuplot-eldoc-hash))))
20041999
(when eldoc
@@ -2053,7 +2048,7 @@ there."
20532048
"Pop up the extended documentation for the construction at point."
20542049
(interactive nil gnuplot-mode gnuplot-comint-mode)
20552050
(gnuplot-context--parse-at-point nil)
2056-
(if (and gnuplot-context--info-at-point gnuplot-eldoc-hash)
2051+
(if gnuplot-context--info-at-point
20572052
(let ((eldoc
20582053
(cadr (gethash gnuplot-context--info-at-point gnuplot-eldoc-hash))))
20592054
(if eldoc (message eldoc)))))
@@ -2199,9 +2194,7 @@ customize the variable
21992194
(progn
22002195
(remove-hook 'completion-at-point-functions #'gnuplot-completion-at-point-info-look t)
22012196
(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))
22052198
(add-hook 'completion-at-point-functions #'gnuplot-completion-at-point-info-look nil t)
22062199
(remove-hook 'completion-at-point-functions #'gnuplot-context-completion-at-point t)
22072200
(remove-hook 'eldoc-documentation-functions #'gnuplot-context-eldoc-function t)))

gnuplot-eldoc.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;;; Automatically generated by doc2texi.el on Fri, 30 May 2025 -*- lexical-binding: t -*-
1+
;;;; Automatically generated by doc2texi.el on Sun, 01 June 2025 -*- lexical-binding: t -*-
22

33
;;;; This file is generated automatically from the Gnuplot
44
;;;; documentation by `doc2texi.el', part of the Gnuplot distribution.
@@ -625,4 +625,6 @@ dashtype \"pattern\" # string containing a combination of the characters
625625
dashtype (s1,e1,s2,e2,s3,e3,s4,e4) # dash pattern specified by 1 to 4
626626
# numerical pairs <solid length>, <emptyspace length>") ("colorspec" "... {linecolor | lc} {\"colorname\" | <colorspec> | <n>} [more ...]" "... {linecolor | lc} {\"colorname\" | <colorspec> | <n>}
627627
... {textcolor | tc} {<colorspec> | {linetype | lt} <n>}
628-
... {fillcolor | fc} {<colorspec> | linetype <n> | linestyle <n>}") ("Time_functions" "time = weekdate_cdc( year, week [, day] )") ("Time_functions" "time = weekdate_iso( year, week [, day] )")))) (while alist (puthash (caar alist) (cdar alist) tbl) (setq alist (cdr alist))) tbl))
628+
... {fillcolor | fc} {<colorspec> | linetype <n> | linestyle <n>}") ("Time_functions" "time = weekdate_cdc( year, week [, day] )") ("Time_functions" "time = weekdate_iso( year, week [, day] )")))) (while alist (puthash (caar alist) (cdar alist) tbl) (setq alist (cdr alist))) tbl))
629+
(provide 'gnuplot-eldoc)
630+
;; gnuplot-eldoc.el ends here

0 commit comments

Comments
 (0)