@@ -246,20 +246,10 @@ beginning the continued command."
246
246
; ; with info-look, there is no need to carry this list around -- it
247
247
; ; can be generated on the fly appropriate to the currently installed
248
248
; ; version of gnuplot.info
249
- (defvar gnuplot-keywords nil
249
+ (defvar gnuplot--info- keywords 'pending
250
250
" A list of keywords used in GNUPLOT.
251
251
These are set by `gnuplot--set-keywords-list' from the values in
252
252
`info-lookup-cache' ." )
253
- (defvar gnuplot-keywords-pending t ; ; <HW>
254
- " A boolean which gets toggled when the info file is probed." )
255
- (defcustom gnuplot-keywords-when 'deferred ; ; 'immediately
256
- " This variable controls when the info file is parsed.
257
- The choices are immediately upon starting `gnuplot-mode' or the first
258
- time that data is needed."
259
- :group 'gnuplot
260
- :type
261
- '(radio (const :tag " Parse info file when gnuplot-mode starts" immediately)
262
- (const :tag " Parse info file the first time it is needed" deferred)))
263
253
264
254
(defcustom gnuplot-use-context-sensitive-completion t
265
255
" Non-nil if `gnuplot-context-sensitive-mode' should be enabled by default.
@@ -432,8 +422,7 @@ non-nil."
432
422
" ---"
433
423
[" Insert filename at point" gnuplot-insert-filename t]
434
424
[" Negate set option" gnuplot-negate-option t]
435
- [" Keyword help" gnuplot-info-lookup-symbol
436
- (or gnuplot-keywords gnuplot-keywords-pending)]
425
+ [" Keyword help" gnuplot-info-lookup-symbol]
437
426
[" Quick help for thing at point" gnuplot-help-function
438
427
gnuplot-context-sensitive-mode]
439
428
[" Info documentation on thing at point"
@@ -1305,8 +1294,7 @@ this function is attached to `gnuplot-after-plot-hook'"
1305
1294
" ---"
1306
1295
[" Insert filename at point" gnuplot-insert-filename t]
1307
1296
[" Negate set option" gnuplot-negate-option t]
1308
- [" Keyword help" gnuplot-info-lookup-symbol
1309
- (or gnuplot-keywords gnuplot-keywords-pending)]
1297
+ [" Keyword help" gnuplot-info-lookup-symbol]
1310
1298
[" Quick help for thing at point" gnuplot-help-function
1311
1299
gnuplot-context-sensitive-mode]
1312
1300
[" Info documentation on thing at point"
@@ -1788,13 +1776,9 @@ Negatable options are defined in `gnuplot-keywords-negatable-options'."
1788
1776
1789
1777
; ; set up stuff for info-look (as suggested by <SE>)
1790
1778
; ; modified with suggestion from <MS>
1791
- (defun gnuplot-setup-info-look ()
1779
+ (defun gnuplot-- setup-info-look ()
1792
1780
" Setup info-look in the gnuplot buffer.
1793
-
1794
- Also set the variable `gnuplot-keywords' and do something sensible if
1795
- info-look was not available."
1796
- (interactive )
1797
- (setq gnuplot-keywords-pending nil )
1781
+ Also set the variable `gnuplot--info-keywords' ."
1798
1782
; ; TODO Update info layout
1799
1783
(let ((doc-spec
1800
1784
'((" (gnuplot)Command_Index" nil " [_a-zA-Z0-9]+" )
@@ -1817,10 +1801,10 @@ info-look was not available."
1817
1801
; ; user will not want them lying around
1818
1802
(and (get-buffer " info dir" ) (kill-buffer " info dir" ))
1819
1803
(and (get-buffer " info dir<2>" ) (kill-buffer " info dir<2>" )))
1820
- (setq gnuplot-keywords (gnuplot--set-keywords-list)))
1804
+ (setq gnuplot--info- keywords (gnuplot--set-keywords-list)))
1821
1805
1822
1806
(defun gnuplot--set-keywords-list ()
1823
- " Set `gnuplot-keywords' from `info-lookup-cache' .
1807
+ " Set `gnuplot--info- keywords' from `info-lookup-cache' .
1824
1808
Return a list of keywords."
1825
1809
(let* ((list (cdr (assoc 'symbol info-lookup-cache)))
1826
1810
(list (cdr (cdr (assoc 'gnuplot-mode list ))))
@@ -1856,16 +1840,16 @@ Return a list of keywords."
1856
1840
" Return completions of keyword preceding point.
1857
1841
1858
1842
Uses the cache of keywords generated by `info-lookup' . See
1859
- `gnuplot-setup-info-look' . If non-nil, the return value is in the form
1843
+ `gnuplot-- setup-info-look' . If non-nil, the return value is in the form
1860
1844
\( BEGIN END COMPLETIONS) where BEGIN and END are buffer
1861
1845
positions and COMPLETIONS is a list."
1862
1846
1863
- (if gnuplot-keywords-pending ; <HW>
1864
- (gnuplot-setup-info-look))
1847
+ (when ( eq gnuplot--info-keywords 'pending )
1848
+ (gnuplot- -setup-info-look))
1865
1849
(list (condition-case _err
1866
1850
(save-excursion (backward-sexp 1 ) (point ))
1867
1851
(error (point )))
1868
- (point ) gnuplot-keywords))
1852
+ (point ) gnuplot--info- keywords))
1869
1853
1870
1854
1871
1855
(defun gnuplot-info-lookup-symbol (symbol &optional mode )
@@ -1875,20 +1859,16 @@ Takes SYMBOL and MODE as arguments exactly as
1875
1859
`gnuplot--adjust-info-display' to display the info buffer
1876
1860
according to the value of `gnuplot-info-display' ."
1877
1861
(interactive
1878
- (cond (gnuplot-keywords
1879
- (info-lookup-interactive-arguments 'symbol ))
1880
- (gnuplot-keywords-pending ; <HW>
1881
- (gnuplot-setup-info-look)
1882
- (info-lookup-interactive-arguments 'symbol ))
1883
- (t
1884
- (list nil (message
1885
- " Help is not available. The gnuplot info file could not be found." )))))
1886
-
1887
- (when gnuplot-keywords
1888
- (unless symbol (setq symbol " Commands" ))
1889
- (save-window-excursion
1890
- (info-lookup-symbol symbol mode))
1891
- (gnuplot--adjust-info-display)))
1862
+ (progn
1863
+ (when (eq gnuplot--info-keywords 'pending )
1864
+ (gnuplot--setup-info-look))
1865
+ (info-lookup-interactive-arguments 'symbol )))
1866
+ (when (eq gnuplot--info-keywords 'pending )
1867
+ (gnuplot--setup-info-look))
1868
+ (unless symbol (setq symbol " Commands" ))
1869
+ (save-window-excursion
1870
+ (info-lookup-symbol symbol mode))
1871
+ (gnuplot--adjust-info-display))
1892
1872
1893
1873
(defun gnuplot--adjust-info-display ()
1894
1874
" Displays the *info* buffer in a window or frame.
@@ -1943,8 +1923,8 @@ shown."
1943
1923
(fboundp 'gnuplot-gui-set-options-and-insert ))
1944
1924
(gnuplot-gui-set-options-and-insert))
1945
1925
(gnuplot-insertions-show-help-flag
1946
- (if gnuplot-keywords-pending ; <HW>
1947
- (gnuplot-setup-info-look))
1926
+ (when ( eq gnuplot--info-keywords 'pending )
1927
+ (gnuplot- -setup-info-look))
1948
1928
(gnuplot-info-lookup-symbol topic)))))
1949
1929
1950
1930
(defun gnuplot-toggle-info-display ()
@@ -2019,9 +1999,6 @@ a list:
2019
1999
2020
2000
(set-syntax-table gnuplot-mode-syntax-table)
2021
2001
2022
- (when (eq gnuplot-keywords-when 'immediately ) ; <HW>
2023
- (gnuplot-setup-info-look)) ; ; <SE>
2024
-
2025
2002
; ; Add syntax-propertizing functions to search for strings and comments
2026
2003
(setq-local syntax-propertize-function #'gnuplot--syntax-propertize )
2027
2004
(add-hook 'syntax-propertize-extend-region-functions
@@ -2085,6 +2062,7 @@ following in your .emacs file:
2085
2062
(define-obsolete-function-alias 'gnuplot-set-display-mode #'gnuplot--set-display-mode " 0.8.1" )
2086
2063
(define-obsolete-function-alias 'gnuplot-set-keywords-list #'gnuplot--set-keywords-list " 0.8.1" )
2087
2064
(define-obsolete-function-alias 'gnuplot-setup-comint-for-image-mode #'gnuplot--setup-comint-for-image-mode " 0.8.1" )
2065
+ (define-obsolete-function-alias 'gnuplot-setup-info-look #'gnuplot--setup-info-look " 0.8.1" )
2088
2066
(define-obsolete-function-alias 'gnuplot-split-string #'gnuplot--split-string " 0.8.1" )
2089
2067
(define-obsolete-function-alias 'gnuplot-syntax-propertize-extend-region #'gnuplot--syntax-propertize-extend-region " 0.8.1" )
2090
2068
0 commit comments