[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gnuplot 3f28986 134/184: Fix compiler warnings, comments a
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gnuplot 3f28986 134/184: Fix compiler warnings, comments and docstrings |
Date: |
Sun, 29 Aug 2021 11:03:31 -0400 (EDT) |
branch: elpa/gnuplot
commit 3f289860e0fade4e7cf190e69a71d051fe74f9ae
Author: joddie <jonxfield@gmail.com>
Commit: joddie <jonxfield@gmail.com>
Fix compiler warnings, comments and docstrings
- Move definition of `gnuplot-eldoc-hash` into gnuplot.el
- Declare `eldoc-add-command` function
- Move definition of `gnuplot-comint-menu` above its first use
---
gnuplot-context.el | 7 ----
gnuplot.el | 111 +++++++++++++++++++++++++++--------------------------
2 files changed, 56 insertions(+), 62 deletions(-)
diff --git a/gnuplot-context.el b/gnuplot-context.el
index b685974..7b77784 100644
--- a/gnuplot-context.el
+++ b/gnuplot-context.el
@@ -255,13 +255,6 @@
;; We need ElDoc support
(require 'eldoc)
-;; Load external ElDoc strings if we can find them.
-(defvar gnuplot-eldoc-hash nil
- "ElDoc strings for gnuplot-mode.
-
-These have to be compiled from the Gnuplot source tree using
-`doc2texi.el'.")
-
;; Compatibility for Emacs version < 23
(eval-when-compile
(when (not (fboundp 'string-match-p))
diff --git a/gnuplot.el b/gnuplot.el
index 57a7275..97a8653 100644
--- a/gnuplot.el
+++ b/gnuplot.el
@@ -346,13 +346,7 @@
(require 'easymenu)
(eval-when-compile (require 'cl))
-;; Keep gnuplot-context separate from main gnuplot library, for people
-;; who don't want to load the whole thing. Load it automatically on
-;; choosing the menu item.
-(autoload 'gnuplot-context-sensitive-mode "gnuplot-context"
- "Toggle gnuplot context-sensitive completion and help mode."
- t)
-
+(declare-function 'eldoc-add-command "eldoc")
;;; --- variable definitions + eval-and-compile clauses
@@ -666,14 +660,14 @@ time that data is needed."
(with-current-buffer buffer
(when (derived-mode-p 'gnuplot-mode 'gnuplot-comint-mode)
(gnuplot-context-sensitive-mode
- (if gnuplot-use-context-sensitive-completion 1 0))))))
+ (if value 1 0))))))
(defcustom gnuplot-use-context-sensitive-completion t
- "Enable `gnuplot-context-sensitive-mode' by default in Gnuplot buffers.
+ "Non-nil if `gnuplot-context-sensitive-mode' should be enabled by default.
-In context-sensitive mode, gnuplot-mode's tab completion and info
-file lookup try to parse the current command line to find the
-most useful completions or info pages."
+In context-sensitive mode, gnuplot-mode parses the current
+command line to provide smarter completion and documentation
+suggestions."
:group 'gnuplot
:type 'boolean
:initialize 'custom-set-default
@@ -2173,8 +2167,44 @@ this function is attached to `gnuplot-after-plot-hook'"
;;; --- functions controlling the gnuplot process
-;; Define gnuplot-comint-mode, the mode for the gnuplot process
-;; buffer, by deriving from comint-mode
+;; Menu for the comint-mode buffer
+(defvar gnuplot-comint-menu
+ `("Gnuplot"
+ ["Plot most recent gnuplot buffer" gnuplot-plot-from-comint
+ (buffer-live-p gnuplot-comint-recent-buffer)]
+ ["Save and plot most recent gnuplot buffer"
gnuplot-save-and-plot-from-comint
+ (buffer-live-p gnuplot-comint-recent-buffer)]
+ "---"
+ ,gnuplot-display-options-menu
+ ["Contextual completion and help" gnuplot-context-sensitive-mode
+ :style toggle
+ :selected gnuplot-context-sensitive-mode]
+ ["Echo area help (eldoc-mode)" eldoc-mode
+ :active gnuplot-context-sensitive-mode
+ :style toggle
+ :selected eldoc-mode]
+ "---"
+ ["Insert filename at point" gnuplot-insert-filename
t]
+ ["Negate set option" gnuplot-negate-option t]
+ ["Keyword help" gnuplot-info-lookup-symbol
+ (or gnuplot-keywords gnuplot-keywords-pending)]
+ ["Quick help for thing at point" gnuplot-help-function
+ gnuplot-context-sensitive-mode]
+ ["Info documentation on thing at point"
+ gnuplot-info-at-point
+ gnuplot-context-sensitive-mode]
+ ["Switch to recent gnuplot script buffer" gnuplot-pop-to-recent-buffer
+ (buffer-live-p gnuplot-comint-recent-buffer)]
+ "---"
+ ["Customize gnuplot" gnuplot-customize t]
+ ["Submit bug report" gnuplot-bug-report t]
+ ["Show gnuplot-mode version" gnuplot-show-version t]
+ ["Show gnuplot version" gnuplot-show-gnuplot-version t]
+ "---"
+ ["Kill gnuplot" gnuplot-kill-gnuplot-buffer t]
+ ))
+
+;; Major mode `gnuplot-comint-mode' for the interaction buffer
(define-derived-mode gnuplot-comint-mode comint-mode "Gnuplot interaction"
"Major mode for interacting with a gnuplot process in a buffer.
@@ -2237,42 +2267,6 @@ buffer."
(defvar gnuplot-comint-mode-menu nil
"Menu for `gnuplot-comint-mode'.")
-(defvar gnuplot-comint-menu
- `("Gnuplot"
- ["Plot most recent gnuplot buffer" gnuplot-plot-from-comint
- (buffer-live-p gnuplot-comint-recent-buffer)]
- ["Save and plot most recent gnuplot buffer"
gnuplot-save-and-plot-from-comint
- (buffer-live-p gnuplot-comint-recent-buffer)]
- "---"
- ,gnuplot-display-options-menu
- ["Contextual completion and help" gnuplot-context-sensitive-mode
- :style toggle
- :selected gnuplot-context-sensitive-mode]
- ["Echo area help (eldoc-mode)" eldoc-mode
- :active gnuplot-context-sensitive-mode
- :style toggle
- :selected eldoc-mode]
- "---"
- ["Insert filename at point" gnuplot-insert-filename
t]
- ["Negate set option" gnuplot-negate-option t]
- ["Keyword help" gnuplot-info-lookup-symbol
- (or gnuplot-keywords gnuplot-keywords-pending)]
- ["Quick help for thing at point" gnuplot-help-function
- gnuplot-context-sensitive-mode]
- ["Info documentation on thing at point"
- gnuplot-info-at-point
- gnuplot-context-sensitive-mode]
- ["Switch to recent gnuplot script buffer" gnuplot-pop-to-recent-buffer
- (buffer-live-p gnuplot-comint-recent-buffer)]
- "---"
- ["Customize gnuplot" gnuplot-customize t]
- ["Submit bug report" gnuplot-bug-report t]
- ["Show gnuplot-mode version" gnuplot-show-version t]
- ["Show gnuplot version" gnuplot-show-gnuplot-version t]
- "---"
- ["Kill gnuplot" gnuplot-kill-gnuplot-buffer t]
- ))
-
;; Switch to the gnuplot program buffer
(defun gnuplot-make-gnuplot-buffer ()
"Switch to the gnuplot program buffer or create one if none exists."
@@ -2289,6 +2283,7 @@ buffer."
(gnuplot-setup-comint-for-image-mode)))
(message "Starting gnuplot plotting program...Done")))
+
(defun gnuplot-fetch-version-number ()
"Determine the installed version of the gnuplot program.
@@ -2877,7 +2872,7 @@ Return a list of keywords."
store ))
-;;;; Completion at point
+;;;; Completion at point and Eldoc.
;; There are two alternative completion-at-point mechanisms: the old
;; one using info-look and the new one (enabled by default) which
@@ -2892,6 +2887,12 @@ Return a list of keywords."
(defun gnuplot-completion-at-point ()
(funcall gnuplot-completion-at-point-function))
+(defvar gnuplot-eldoc-hash nil
+ "ElDoc strings for gnuplot-mode.
+
+These have to be compiled from the Gnuplot source tree using
+`doc2texi.el'.")
+
;; Enable and disable context-sensitive completion
(define-minor-mode gnuplot-context-sensitive-mode
"Use context-sensitive completion and help in gnuplot-mode.
@@ -2937,6 +2938,8 @@ distribution. See gnuplot-context.el for details."
(if gnuplot-context-sensitive-mode
;; Turn on
(progn
+ (load-library "gnuplot-context")
+ (load-library "eldoc")
(setq gnuplot-completion-at-point-function
#'gnuplot-context-completion-at-point)
(define-key gnuplot-comint-mode-map (kbd "TAB")
'comint-dynamic-complete)
@@ -2965,15 +2968,13 @@ distribution. See gnuplot-context.el for details."
(when gnuplot-tab-completion
(set (make-local-variable 'tab-always-indent) 'complete))
- (when called-interactively-p
- (message "Gnuplot context-sensitive help & completion enabled.")))
+ (message "Gnuplot context-sensitive help & completion enabled."))
;; Turn off
(setq gnuplot-completion-at-point-function
#'gnuplot-completion-at-point-info-look)
(setq eldoc-documentation-function nil)
(eldoc-mode 0)
- (when called-interactively-p
- (message "Gnuplot context-sensitive help & completion disabled."))))
+ (message "Gnuplot context-sensitive help & completion disabled.")))
;; Older completion method using info-look
(defun gnuplot-completion-at-point-info-look ()
- [nongnu] elpa/gnuplot 483a71f 103/184: Update documentation on installing, and tweak Makefile.dst, (continued)
- [nongnu] elpa/gnuplot 483a71f 103/184: Update documentation on installing, and tweak Makefile.dst, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 7350c9d 107/184: Use the syntax-propertize mechanism instead of after-change-functions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 4c5092a 115/184: Merge branch 'syntax-propertize', ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot edd779a 114/184: Fix context tests for syntax-propertize, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 156d6a9 120/184: Add option to send plot output to a dedicated buffer, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot ba3728a 113/184: Fix syntax-propertize rules for empty strings, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 08fe8e0 117/184: Try to make tests runnable on older Emacs, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 7f53432 132/184: Clarify `gnuplot-comint-complete` docstring, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 2442835 127/184: Use completion-at-point in comint buffers in recent Emacs, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot f3734b6 136/184: Add Jon as author, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 3f28986 134/184: Fix compiler warnings, comments and docstrings,
ELPA Syncer <=
- [nongnu] elpa/gnuplot 21f9046 135/184: Bind appropriate completion command in comint mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 3f569ef 137/184: Remove gnuplot-bug-report, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot a406143 140/184: Merge pull request #41 from conao3/re-pr-28, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 55e3f75 142/184: Merge pull request #42 from conao3/add-toolbar-make-button-check, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 3fc4020 147/184: solve package-lint/byte-compile/check-doc warnings, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 7830b22 156/184: Add configuration instructions in README.org. Remove dotemacs.el., ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 402d487 152/184: Support indent with tab in gnuplot script, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 5fdef54 151/184: Merge pull request #47 from conao3/remove-weird-char, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 9894505 153/184: Ignore backward-sexp error when get completion, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 2c6137c 159/184: Merge pull request #53 from conao3/add-github-actions, ELPA Syncer, 2021/08/29