[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gnuplot db98e06 012/184: Changed set up of info-look docum
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gnuplot db98e06 012/184: Changed set up of info-look documentation and completion |
Date: |
Sun, 29 Aug 2021 11:03:05 -0400 (EDT) |
branch: elpa/gnuplot
commit db98e065783ddaa4baf1ad9c8687f7717c56a5ac
Author: Jonathan Oddie <j.j.oddie@gmail.com>
Commit: Jonathan Oddie <j.j.oddie@gmail.com>
Changed set up of info-look documentation and completion
- Added check for gnuplot-program-version to gnuplot-setup-info-look,
which should hopefully look at the right sections of the info file both
for current version (>= 4.0) and old ones
- Inform user if info-look.el isn't installed
- Changed gnuplot-info-lookup-symbol to use with-selected-window, and
count-screen-lines instead of count-lines
---
gnuplot.el | 94 ++++++++++++++++++++++++++++++++++----------------------------
1 file changed, 51 insertions(+), 43 deletions(-)
diff --git a/gnuplot.el b/gnuplot.el
index 9f6d7f8..2981d6b 100644
--- a/gnuplot.el
+++ b/gnuplot.el
@@ -2190,37 +2190,46 @@ See the comments in `gnuplot-info-hook'."
(setq gnuplot-keywords-pending nil)
(if (featurep 'info-look)
(progn
- (cond ((boundp 'info-lookup-symbol-alist) ; older version
- (setq info-lookup-symbol-alist
- (append
- info-lookup-symbol-alist
- '((gnuplot-mode
- "[a-zA-Z][_a-zA-Z0-9]*" nil
- (("(gnuplot)Top" nil "[_a-zA-Z0-9]+")
- ("(gnuplot)Commands" nil "[_a-zA-Z0-9]+")
- ("(gnuplot)Functions" nil "[_a-zA-Z0-9]+")
- ("(gnuplot)plot" nil "[_a-zA-Z0-9]+")
- ("(gnuplot)set-show" nil "[_a-zA-Z0-9]+")
- ("(gnuplot)data-file" nil "[_a-zA-Z0-9]+")
- ("(gnuplot)smooth" nil "[_a-zA-Z0-9]+")
- ("(gnuplot)style" nil "[_a-zA-Z0-9]+")
- ("(gnuplot)terminal" nil "[_a-zA-Z0-9]+")
- ;;("(gnuplot)General Index" nil "[_a-zA-Z0-9]+")
- ) "[_a-zA-Z0-9]+" ))) ))
- (t ; newer version
- (info-lookup-maybe-add-help
- :mode 'gnuplot-mode :topic 'symbol
- :regexp "[a-zA-Z][_a-zA-Z0-9]*"
- :doc-spec '(("(gnuplot)Top" nil "[_a-zA-Z0-9]+")
- ("(gnuplot)Commands" nil "[_a-zA-Z0-9]+")
- ("(gnuplot)Functions" nil "[_a-zA-Z0-9]+")
- ("(gnuplot)plot" nil "[_a-zA-Z0-9]+")
- ("(gnuplot)set-show" nil "[_a-zA-Z0-9]+")
- ("(gnuplot)data-file" nil "[_a-zA-Z0-9]+")
- ("(gnuplot)smooth" nil "[_a-zA-Z0-9]+")
- ("(gnuplot)style" nil "[_a-zA-Z0-9]+")
- ("(gnuplot)terminal" nil "[_a-zA-Z0-9]+")
- ) )))
+ ;; TODO: should make this a function
+ (or gnuplot-program-version
+ (progn
+ (message "Determining gnuplot version number (sitting for 2
seconds)")
+ (gnuplot-fetch-version-number)
+ (sit-for 2)))
+
+ ;; In the absence of evidence to the contrary, I'm guessing
+ ;; the info file layout changed with gnuplot version 4 <jjo>
+ (let ((temp-info-lookup-doc-spec
+ (if (>= (string-to-number gnuplot-program-version) 4.0)
+ ;; New info-file layout - works with gnuplot 4.4
+ '(("(gnuplot)Command_Index" nil "[_a-zA-Z0-9]+")
+ ("(gnuplot)Options_Index" nil "[_a-zA-Z0-9]+")
+ ("(gnuplot)Function_Index" nil "[_a-zA-Z0-9]+")
+ ("(gnuplot)Terminal_Index" nil "[_a-zA-Z0-9]+"))
+
+ ;; Old info-file layout
+ '(("(gnuplot)Top" nil "[_a-zA-Z0-9]+")
+ ("(gnuplot)Commands" nil "[_a-zA-Z0-9]+")
+ ("(gnuplot)Functions" nil "[_a-zA-Z0-9]+")
+ ("(gnuplot)plot" nil "[_a-zA-Z0-9]+")
+ ("(gnuplot)set-show" nil "[_a-zA-Z0-9]+")
+ ("(gnuplot)data-file" nil "[_a-zA-Z0-9]+")
+ ("(gnuplot)smooth" nil "[_a-zA-Z0-9]+")
+ ("(gnuplot)style" nil "[_a-zA-Z0-9]+")
+ ("(gnuplot)terminal" nil "[_a-zA-Z0-9]+")))))
+ (cond ((boundp 'info-lookup-symbol-alist) ; older info-lookup version
+ (setq info-lookup-symbol-alist
+ (append
+ info-lookup-symbol-alist
+ `((gnuplot-mode
+ "[a-zA-Z][_a-zA-Z0-9]*" nil
+ ,temp-info-lookup-doc-spec "[_a-zA-Z0-9]+" )))))
+ (t ; newer version
+ (info-lookup-maybe-add-help
+ :mode 'gnuplot-mode :topic 'symbol
+ :regexp "[a-zA-Z][_a-zA-Z0-9]*"
+ :doc-spec temp-info-lookup-doc-spec))))
+
;; this hook is my best way of working with info-look and
;; allowing multiple versions of the gnuplot-info file.
;; yes, this is a hassle.
@@ -2232,14 +2241,13 @@ See the comments in `gnuplot-info-hook'."
;; user will not want them lying around
(and (get-buffer "info dir") (kill-buffer "info dir"))
(and (get-buffer "info dir<2>") (kill-buffer "info dir<2>")))
- (setq gnuplot-keywords (gnuplot-set-keywords-list))
- )
+ (setq gnuplot-keywords (gnuplot-set-keywords-list)))
;; or do something sensible if info-look is not installed
(defun info-lookup-interactive-arguments (symbol)
(message
- "Help is not available. The gnuplot info file could not be found.")
- (list nil nil))) )
+ "Help is not available. info-look.el is not installed.")
+ (list nil nil))))
(defun gnuplot-set-keywords-list ()
@@ -2280,7 +2288,8 @@ adapted from `lisp-complete-symbol'."
(delete-region beg end)
(insert completion))
(let* ((list (all-completions pattern alist))
- (mess (format "%S could be one of %S" pattern list))
+ (mess (format "%S could be one of %S"
+ (substring-no-properties pattern) list))
(orig (current-buffer))
(buff (get-buffer-create " *gnuplot-completions*")))
(if (= (length list) 1) (insert " "))
@@ -2322,13 +2331,12 @@ the frame."
(if symbol () (setq symbol "Commands"))
(info-lookup-symbol symbol mode)
(cond ((equal gnuplot-info-display 'window)
- (let ((sw (selected-window))
- (window-min-height 2))
- (other-window 1)
- (enlarge-window
- (min (- (count-lines (point-min) (point-max)) (window-height))
- (- (/ (frame-height) 2) (window-height))))
- (select-window sw)))
+ (let ((window-min-height 2))
+ (with-selected-window (get-buffer-window "*info*")
+ (enlarge-window
+ (min (- (count-screen-lines (point-min) (point-max))
(window-height))
+ (- (/ (frame-height) 2) (window-height)))))))
+
((equal gnuplot-info-display 'frame)
(switch-to-buffer buff)
(delete-other-windows)
- [nongnu] elpa/gnuplot 07a8027 183/184: Do not add lines to kill-ring when trimming the gnuplot buffer (#72), (continued)
- [nongnu] elpa/gnuplot 07a8027 183/184: Do not add lines to kill-ring when trimming the gnuplot buffer (#72), ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 7138b13 184/184: Fixup parens in gnuplot-trim-gnuplot-buffer, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 10f0d54 004/184: updated README.org, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot b51d4a9 001/184: initial commit, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot b0beecd 008/184: Improved gnuplot-send-string-to-gnuplot, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 00dadc3 011/184: Restored the check for XEmacs before calling make-local-hook, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 0beb68b 009/184: Corrected a couple typos in contact info, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 316d7df 006/184: Again README.org, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 10cf107 021/184: Fixed some more XEmacs compatibility that I broke, ho hum!, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 958db84 018/184: Use `add-hook' instead of `make-local-variable' in `gnuplot-comint-mode', ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot db98e06 012/184: Changed set up of info-look documentation and completion,
ELPA Syncer <=
- [nongnu] elpa/gnuplot 51756c3 015/184: Changed fetch-version-number to work with older gnuplots, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 710854f 026/184: Fixed a bug in gnuplot-end-of-continuation at beginning of buffer, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot cc4c45c 042/184: Merge branch 'context' of github.com:bruceravel/gnuplot-mode into context, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 8169bb8 045/184: Minor updates to info pages for some "set" commands, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot a4d00db 014/184: Added gnuplot-comint-mode. Improved completion, version check (?), ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot ca6841b 041/184: Added experimental context-sensitive completion and help code., ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 7cb3975 047/184: Cleaned up the tokenizer and got rid of gnuplot-token-at-point., ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot a276f0d 033/184: Fix bug #8: remove `eval-when-compile' from definition of `gnuplot-make-regexp', ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot cd73487 064/184: Remove other cruft, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 76cfd01 043/184: Lots of fixes to grammar, and some bugfixes., ELPA Syncer, 2021/08/29