branch: elpa/gnuplot commit 973acb11aa348b3490628cedfa0d9807d51397bf Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Make gnuplot-eldoc a proper feature --- admin/doc2texi.el | 2 +- gnuplot-context.el | 15 ++++----------- gnuplot-eldoc.el | 6 ++++-- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/admin/doc2texi.el b/admin/doc2texi.el index 8d532521b1..d6e3800fff 100644 --- a/admin/doc2texi.el +++ b/admin/doc2texi.el @@ -700,7 +700,7 @@ Dumps the resulting data into gnuplot-eldoc.el" (insert d2t-gnuplot-license) (insert (format - "\n\n%S\n%S" + "\n\n%S\n%S\n(provide 'gnuplot-eldoc)\n;; gnuplot-eldoc.el ends here\n" '(eval-when-compile (defvar gnuplot-eldoc-hash nil)) `(setq gnuplot-eldoc-hash (let ((tbl (make-hash-table :test 'equal)) diff --git a/gnuplot-context.el b/gnuplot-context.el index c264daf1e1..1dd2945126 100644 --- a/gnuplot-context.el +++ b/gnuplot-context.el @@ -219,6 +219,7 @@ ;;; Code: (require 'gnuplot) +(require 'gnuplot-eldoc) ;;;; The tokenizer. @@ -1737,12 +1738,6 @@ token list just after the end of the capture group.") Set by `gnuplot-context--match-pattern'. See also `gnuplot-context-info-at-point'.") -(defvar gnuplot-eldoc-hash nil - "ElDoc strings for `gnuplot-mode'. - -These have to be compiled from the Gnuplot source tree using -`doc2texi.el'.") - ;;;; The pattern matching machine (defun gnuplot-context--match-pattern (instructions tokens completing-p @@ -1998,7 +1993,7 @@ there." (t info))) (when gnuplot-context--info-at-point (gnuplot-context--trace "\tset info to \"%s\"\n" gnuplot-context--info-at-point) - (when (and (not gnuplot-context--eldoc) gnuplot-eldoc-hash) + (unless gnuplot-context--eldoc (let ((eldoc (car (gethash gnuplot-context--info-at-point gnuplot-eldoc-hash)))) (when eldoc @@ -2053,7 +2048,7 @@ there." "Pop up the extended documentation for the construction at point." (interactive nil gnuplot-mode gnuplot-comint-mode) (gnuplot-context--parse-at-point nil) - (if (and gnuplot-context--info-at-point gnuplot-eldoc-hash) + (if gnuplot-context--info-at-point (let ((eldoc (cadr (gethash gnuplot-context--info-at-point gnuplot-eldoc-hash)))) (if eldoc (message eldoc))))) @@ -2199,9 +2194,7 @@ customize the variable (progn (remove-hook 'completion-at-point-functions #'gnuplot-completion-at-point-info-look t) (add-hook 'completion-at-point-functions #'gnuplot-context-completion-at-point nil t) - (add-hook 'eldoc-documentation-functions #'gnuplot-context-eldoc-function nil 'local) - (unless gnuplot-eldoc-hash - (load "gnuplot-eldoc" t t))) + (add-hook 'eldoc-documentation-functions #'gnuplot-context-eldoc-function nil 'local)) (add-hook 'completion-at-point-functions #'gnuplot-completion-at-point-info-look nil t) (remove-hook 'completion-at-point-functions #'gnuplot-context-completion-at-point t) (remove-hook 'eldoc-documentation-functions #'gnuplot-context-eldoc-function t))) diff --git a/gnuplot-eldoc.el b/gnuplot-eldoc.el index aefdeac00a..9f2036acf0 100644 --- a/gnuplot-eldoc.el +++ b/gnuplot-eldoc.el @@ -1,4 +1,4 @@ -;;;; Automatically generated by doc2texi.el on Fri, 30 May 2025 -*- lexical-binding: t -*- +;;;; Automatically generated by doc2texi.el on Sun, 01 June 2025 -*- lexical-binding: t -*- ;;;; This file is generated automatically from the Gnuplot ;;;; documentation by `doc2texi.el', part of the Gnuplot distribution. @@ -625,4 +625,6 @@ dashtype \"pattern\" # string containing a combination of the characters dashtype (s1,e1,s2,e2,s3,e3,s4,e4) # dash pattern specified by 1 to 4 # numerical pairs <solid length>, <emptyspace length>") ("colorspec" "... {linecolor | lc} {\"colorname\" | <colorspec> | <n>} [more ...]" "... {linecolor | lc} {\"colorname\" | <colorspec> | <n>} ... {textcolor | tc} {<colorspec> | {linetype | lt} <n>} -... {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)) \ No newline at end of file +... {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)) +(provide 'gnuplot-eldoc) +;; gnuplot-eldoc.el ends here