emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/gnuplot 3fc4020 147/184: solve package-lint/byte-compile/c


From: ELPA Syncer
Subject: [nongnu] elpa/gnuplot 3fc4020 147/184: solve package-lint/byte-compile/check-doc warnings
Date: Sun, 29 Aug 2021 11:03:33 -0400 (EDT)

branch: elpa/gnuplot
commit 3fc40202ffee49157e7d714b3ed65eee5ece60b9
Author: conao3 <conao3@gmail.com>
Commit: conao3 <conao3@gmail.com>

    solve package-lint/byte-compile/check-doc warnings
---
 gnuplot-context.el |  89 ++++++++++++-------------
 gnuplot-gui.el     |  23 ++-----
 gnuplot.el         | 191 ++++++++++++++++++++++++++++-------------------------
 3 files changed, 150 insertions(+), 153 deletions(-)

diff --git a/gnuplot-context.el b/gnuplot-context.el
index 382cf94..7a9f761 100644
--- a/gnuplot-context.el
+++ b/gnuplot-context.el
@@ -3,11 +3,7 @@
 ;; Copyright (C) 2012-2013 Jon Oddie <jonxfield@gmail.com>
 
 ;; Author:     Jon Oddie <jonxfield@gmail.com>
-;; Maintainer: Jon Oddie <jonxfield@gmail.com>
-;; Created:    Wednesday, 08 February 2012
-;; Updated:    Friday, 07 February 2013
-;; Version:    0.7.0
-;; Keywords:   gnuplot, plotting
+;; URL:        https://github.com/emacsorphanage/gnuplot
 
 ;; This file is not part of GNU Emacs.
 
@@ -45,10 +41,10 @@
 ;;
 ;; Gnuplot's context sensitive mode is best controlled using Customize
 ;; (M-x customize-group gnuplot): simply enable the
-;; `gnuplot-context-sensitive-mode' setting. On recent Emacs (>= 23),
+;; `gnuplot-context-sensitive-mode' setting.  On recent Emacs (>= 23),
 ;; you may also want to turn on `gnuplot-tab-completion' so that the
 ;; TAB key does auto-completion on lines which are already
-;; indented. (This just sets the Emacs variable `tab-always-indent' to
+;; indented.  (This just sets the Emacs variable `tab-always-indent' to
 ;; `complete' in Gnuplot buffers).
 ;;
 ;; If you need to turn context sensitivity on or off from Lisp code
@@ -60,7 +56,7 @@
 ;; or not, you can always pop up a longer description of syntax using
 ;; `gnuplot-help-function' (C-c C-/ or C-c M-h).  ElDoc support also
 ;; requires an additional file of help strings, `gnuplot-eldoc.el',
-;; which should be included in recent Gnuplot releases. If it didn't
+;; which should be included in recent Gnuplot releases.  If it didn't
 ;; come with your Gnuplot installation, you'll need to grab a recent
 ;; source distribution of Gnuplot from http://gnuplot.info, and use
 ;; the `doc2texi.el' program in the docs/ directory to create it.  So
@@ -76,8 +72,8 @@
 ;;
 ;; Gnuplot's command language has a fair amount of syntactic
 ;; complexity, and the only way I could think of to support these
-;; features was to do a complete parse of the command line. So that's
-;; what this package does. Instead of building a parse tree, it
+;; features was to do a complete parse of the command line.  So that's
+;; what this package does.  Instead of building a parse tree, it
 ;; matches up until the token at point, and then either makes a list
 ;; of possible completions, or sets the variables `gnuplot-eldoc' and
 ;; `gnuplot-info-at-point' based on where it is in the grammar at that
@@ -95,7 +91,7 @@
 ;; work well enough, and it saves on the Emacs call stack.
 ;;
 ;; Compiling the grammar does require increasing `max-lisp-eval-depth'
-;; modestly. This shouldn't cause any problems on modern machines, and
+;; modestly.  This shouldn't cause any problems on modern machines, and
 ;; it only needs to be done once, at byte-compilation time.
 ;;
 ;; The parsing machine and compiler are partially based on the
@@ -113,26 +109,26 @@
 ;;     Match any token
 ;;
 ;;    name, number, string, separator
-;;     Match a token of the given type. "Separator" is semicolon, the
+;;     Match a token of the given type.  "Separator" is semicolon, the
 ;;     statement separator.
 ;;
 ;;    Any other symbol
-;;     Match another named rule in the grammar. May be recursive.
+;;     Match another named rule in the grammar.  May be recursive.
 ;;
 ;;    "STRING"
 ;;     Match literally: a token with exactly the text "STRING".
 ;;
 ;;   (kw KEYWORD ALIASES ...)
-;;     Match abbreviated Gnuplot keywords. KEYWORD can be a string or
-;;     a cons (PREFIX . SUFFIX). In the latter case, this pattern
+;;     Match abbreviated Gnuplot keywords.  KEYWORD can be a string or
+;;     a cons (PREFIX . SUFFIX).  In the latter case, this pattern
 ;;     will match PREFIX plus any number of characters from the
 ;;     beginning of SUFFIX.  Any literal string from ALIASES will
-;;     also match. The token-id of the matching token is mutated to
+;;     also match.  The token-id of the matching token is mutated to
 ;;     the canonical value of KEYWORD.
 ;;     Example:
 ;;      (kw ("linew" ."idth") "lw") matches "linew", "linewi",
-;;     ... "linewidth" as well as "lw". Any of these tokens will
-;;     appear as "linewidth" in subsequent processing. (This is
+;;     ... "linewidth" as well as "lw".  Any of these tokens will
+;;     appear as "linewidth" in subsequent processing.  (This is
 ;;     important for the "info-keyword" form, see below).
 ;;
 ;; The other pattern forms combine simpler patterns, much like regular
@@ -142,10 +138,10 @@
 ;;              { (:info "info page") }
 ;;              { (:no-info) }
 ;;          PATTERN PATTERN... )
-;;     Match all the PATTERNs in sequence or fail. Sequences can also
+;;     Match all the PATTERNs in sequence or fail.  Sequences can also
 ;;     have optional ElDoc strings and info pages associated with
 ;;     them; the innermost ElDoc or info page around point is the one
-;;     shown to the user. Alternatively, either property may be a
+;;     shown to the user.  Alternatively, either property may be a
 ;;     symbol, which should be a function to be called to get the
 ;;     real value.  Finally, if no ElDoc string is specified but the
 ;;     variable `gnuplot-eldoc-hash' contains a value for the name of
@@ -157,13 +153,13 @@
 ;;
 ;;    (either PATTERN PATTERN...)
 ;;     Match the first PATTERN to succeed, or fail if none
-;;     matches. Like regexp `|'.
+;;     matches.  Like regexp `|'.
 ;;
 ;;    (many PATTERN)
 ;;     Match PATTERN zero or more times, greedily; like regexp
-;;     `*'. Unlike a regular expression matcher, the parsing machine
+;;     `*'.  Unlike a regular expression matcher, the parsing machine
 ;;     will not backtrack and try to match fewer times if a later
-;;     part of the pattern fails. This applies equally to the other
+;;     part of the pattern fails.  This applies equally to the other
 ;;     non-deterministic forms "either" and "maybe".
 ;;
 ;;    (maybe PATTERN)
@@ -171,15 +167,15 @@
 ;;
 ;;    (capture NAME PATTERN)
 ;;     Match PATTERN, capturing the tokens in a capture group named
-;;     NAME. Capture groups are stored in `gnuplot-captures'
-;;     and can be retrieved using `gnuplot-capture-group'. This is
+;;     NAME.  Capture groups are stored in `gnuplot-captures'
+;;     and can be retrieved using `gnuplot-capture-group'.  This is
 ;;     used to store the plotting style, which we need in order to
 ;;     give the correct ElDoc string for "using" clauses, and for
 ;;     info keywords (see below)
 ;;
 ;;    (info-keyword PATTERN)
 ;;     Match PATTERN, and use whatever the value of the first token
-;;     it matches is to look up info pages for this pattern. Most
+;;     it matches is to look up info pages for this pattern.  Most
 ;;     Gnuplot info pages have the same name as the keyword they
 ;;     document, so by using this we only have to put :info
 ;;     properties on the few that don't, such as "set".
@@ -190,14 +186,14 @@
 ;;    (maybe (sequence "," expression))
 ;;
 ;;    (delimited-list PATTERN SEPARATOR)
-;;     Match a list of PATTERNs separated by SEPARATOR. Sugar for:
+;;     Match a list of PATTERNs separated by SEPARATOR.  Sugar for:
 ;;     (sequence PATTERN (many (sequence SEPARATOR PATTERN)))
 ;;
 ;;   (assert LISP-FORM)
-;;     Evaluate LISP-FORM and fail if it returns NIL. We need this in
+;;     Evaluate LISP-FORM and fail if it returns NIL.  We need this in
 ;;     the patterns for "plot" and "splot" to check whether the
 ;;     command at point should be parsed in parametric mode or
-;;     not. See `gnuplot-guess-parametric-p'.
+;;     not.  See `gnuplot-guess-parametric-p'.
 ;;
 ;;
 ;; Bugs, TODOs, etc.
@@ -214,22 +210,22 @@
 ;; many lines.
 ;;
 ;; In ElDoc mode, we parse the whole line every time the user stops
-;; typing. This is wasteful; should cache things in text properties
+;; typing.  This is wasteful; should cache things in text properties
 ;; instead.
 ;;
 ;; The pattern matching engine uses backtracking, which can take
-;; exponential time. So far it seems "fast enough" in actual use.
+;; exponential time.  So far it seems "fast enough" in actual use.
 ;;
 ;; The patterns don't really distinguish between "plot" and "splot"
 ;; for things like plot styles, binary arguments, etc.
 ;;
 ;; Some other the patterns are probably not quite right, especially for
 ;; things like abbreviated keywords, and features that I don't use
-;; myself like "fit". Hopefully anyone bothered by this will submit
+;; myself like "fit".  Hopefully anyone bothered by this will submit
 ;; patches ;-)
 ;;
 ;; It would be possible to provide more helpful ElDoc strings for
-;; sub-parts of complicated options like "cntrparam". This is a time
+;; sub-parts of complicated options like "cntrparam".  This is a time
 ;; and maintenance issue rather than a technical one.
 
 ;;; Code:
@@ -284,10 +280,11 @@
               rules))))
 
 (defun gnuplot-tokenize (&optional completing-p)
-  "Tokenize the Gnuplot command at point. Returns a list of `gnuplot-token' 
objects.
+  "Tokenize the Gnuplot command at point.
+Return a list of `gnuplot-token' objects.
 
 If COMPLETING-P is non-nil, omits the token at point if it is a
-name; otherwise continues tokenizing up to the token at point. FIXME"
+name; otherwise continues tokenizing up to the token at point.  FIXME."
   (let ((tokens '())
         (stop-point (min (point)
                          (gnuplot-point-at-end-of-command))))
@@ -326,7 +323,7 @@ name; otherwise continues tokenizing up to the token at 
point. FIXME"
                      :start from :end to)))
 
                  (t (error
-                     "gnuplot-tokenize: bad token beginning %s"
+                     "Gnuplot-tokenize: bad token beginning %s"
                      (buffer-substring-no-properties (point) stop-point))))))
 
           (push token tokens))))
@@ -572,7 +569,7 @@ name; otherwise continues tokenizing up to the token at 
point. FIXME"
              `((assert ,form))))
 
           (t
-           (error "gnuplot-compile-pattern: bad pattern form %s" pat)))))))
+           (error "Gnuplot-compile-pattern: bad pattern form %s" pat)))))))
 
   ;; Helper function for destructuring (sequence ...) forms in patterns
   ;; Takes the cdr of the sequence form, returns a list (PATTERNS ELDOC
@@ -679,7 +676,7 @@ name; otherwise continues tokenizing up to the token at 
point. FIXME"
                      (setcdr inst `(,location))))
 
                   (t
-                   (error "gnuplot-compile-grammar: bad instruction %s" 
inst))))))))
+                   (error "Gnuplot-compile-grammar: bad instruction %s" 
inst))))))))
         object-code))))
 
 ;;; The grammar.
@@ -1751,14 +1748,14 @@ token before point.")
   "Relevant page of the Gnuplot info manual for the construction at point.
 
 Set by `gnuplot-match-pattern' using information from
-`gnuplot-compiled-grammar'. `gnuplot-match-pattern' pushes ElDoc
+`gnuplot-compiled-grammar'.  `gnuplot-match-pattern' pushes ElDoc
 and info strings onto the stack as it runs, and scans the stack
 for the topmost entry when it reaches the token at point.")
 
 (defvar gnuplot-eldoc nil
   "ElDoc documentation string for the Gnuplot construction at point.
 
-Set by `gnuplot-match-pattern'. See also `gnuplot-info-at-point'.")
+Set by `gnuplot-match-pattern'.  See also `gnuplot-info-at-point'.")
 
 (defvar gnuplot-captures nil
   "Alist of named capture groups for gnuplot-mode completion code.
@@ -1776,9 +1773,9 @@ token list just after the end of the capture group.")
   "Parse TOKENS, setting completions, info and ElDoc information.
 
 This function parses TOKENS by simulating a stack machine with
-unlimited backtracking. If COMPLETING-P is non-nil, it stops
+unlimited backtracking.  If COMPLETING-P is non-nil, it stops
 before the token at point and collects a list of the next tokens
-that it would accept in `gnuplot-completions'. If COMPLETING-P is
+that it would accept in `gnuplot-completions'.  If COMPLETING-P is
 nil, it parses up to the token at point and sets `gnuplot-eldoc'
 and `gnuplot-info-at-point' based on the contents of the stack
 there."
@@ -1914,7 +1911,7 @@ there."
               ((commit)
                (let ((location (cadr inst)))
                  (if (not backtrack)
-                     (error "no more backtrack points in commit"))
+                     (error "No more backtrack points in commit"))
                  (pop backtrack)
                  (setq jump location)))
 
@@ -1955,7 +1952,7 @@ there."
                (let* ((name (cadr inst))
                       (record (assoc name gnuplot-captures)))
                  (if (not record)
-                     (error "gnuplot-match-tokens: no open capture group named 
%s" name)
+                     (error "Gnuplot-match-tokens: no open capture group named 
%s" name)
                    (setf (caddr record) tokens)
                    (gnuplot-debug (gnuplot-dump-captures)))))
 
@@ -1967,7 +1964,7 @@ there."
                    (push (cons pc tokens) progress))))
 
               (t
-               (error "bad instruction: %s" inst)))
+               (error "Bad instruction: %s" inst)))
 
             ;; Increment PC or jump
             (setq pc (or jump (1+ pc))
@@ -1996,7 +1993,7 @@ there."
                   (gnuplot-debug (gnuplot-dump-progress progress)))))))))))
 
 (defun gnuplot-scan-stack (stack tokens)
-  "Scan STACK for the most recently pushed eldoc and info strings"
+  "Scan STACK for the most recently pushed eldoc and info strings."
   (gnuplot-trace "\t* scanning stack *\n")
   (gnuplot-debug (gnuplot-backtrace))
   (gnuplot-debug (gnuplot-dump-captures))
diff --git a/gnuplot-gui.el b/gnuplot-gui.el
index a62996c..52e28d4 100644
--- a/gnuplot-gui.el
+++ b/gnuplot-gui.el
@@ -3,11 +3,7 @@
 ;; Copyright (C) 1998-2000 Bruce Ravel
 
 ;; Author:     Bruce Ravel <ravel@phys.washington.edu>
-;; Maintainer: Bruce Ravel <ravel@phys.washington.edu>
-;; Created:    19 December 1998
-;; Updated:    16 November 2000
-;; Version:    (same as gnuplot.el)
-;; Keywords:   gnuplot, plotting, interactive, GUI
+;; URL:        https://github.com/emacsorphanage/gnuplot
 
 ;; This file is not part of GNU Emacs.
 
@@ -112,7 +108,7 @@ If PATTERN is omitted, it defaults to \"[ 
\\f\\t\\n\\r\\v]+\"."
   :group 'gnuplot)
 
 (defcustom gnuplot-gui-popup-flag nil
-  "*Non-nil means to open arguments pop-ups automatically.
+  "Non-nil means to open arguments pop-ups automatically.
 This would be done after menu insertion of Gnuplot commands."
   :group 'gnuplot-gui
   :type 'boolean)
@@ -377,8 +373,7 @@ See the doc-string for `gnuplot-gui-all-types'.")
                      "dots" "points" "linespoints")
                     ("LINESTYLE"   'number " " "ls")
                     ("LINETYPE"    'number " " "lt")
-                    ("LINEWIDTH"   'number " " "lw")
-                    ))
+                    ("LINEWIDTH"   'number " " "lw")))
             (cons "boxwidth"
                   '(("WIDTH" 'number " ")))
             (cons "clabel"
@@ -621,8 +616,7 @@ See the doc-string for `gnuplot-gui-all-types'.")
             (cons "x2zeroaxis" gnuplot-gui-zeroaxis-list)
 
             (cons "zero"
-                  '(("THRESHOLD" 'number " ")))
-            ))
+                  '(("THRESHOLD" 'number " ")))))
 
 (defvar gnuplot-gui-command-types nil
   "Associated list of command descriptions.
@@ -702,8 +696,7 @@ parsing values already in the script buffer."
     ("LINE TYPE  " 'number " " "lt")
     ("LINE WIDTH " 'number " " "lw")
     ("POINT TYPE " 'number " " "pt")
-    ("POINT STYLE" 'number " " "ps")
-    ))
+    ("POINT STYLE" 'number " " "ps")))
 (defconst gnuplot-gui-splot-simple-list
   '(("DATA FILE"   'file   " ")
     ("TITLE"       'string " ")
@@ -856,8 +849,7 @@ This alist is formed at load time by appending together
                                     gnuplot-gui-set-types
                                     gnuplot-gui-command-types
                                     gnuplot-gui-plot-splot-fit
-                                    gnuplot-gui-test-type
-                                    ))
+                                    gnuplot-gui-test-type))
 
 
 (defun gnuplot-gui-swap-simple-complete ()
@@ -1203,8 +1195,7 @@ arguments."
               (setq temp-list (cdr temp-list)) ) )
            ;; ---------------------------- other or unknown
            (t
-            (setq temp-list nil))
-           ))
+            (setq temp-list nil))))
         (setq gnuplot-gui-alist
               (append gnuplot-gui-alist (list this-cons))))
       (setq alist (cdr alist))) ))
diff --git a/gnuplot.el b/gnuplot.el
index f94062e..881065e 100644
--- a/gnuplot.el
+++ b/gnuplot.el
@@ -1,4 +1,4 @@
-;;; gnuplot.el --- drive gnuplot from within emacs
+;;; gnuplot.el --- Major-mode and interactive frontend for gnuplot
 
 ;; Copyright (C) 1998, 2011 Phil Type and Bruce Ravel, 1999-2012 Bruce Ravel
 
@@ -7,9 +7,10 @@
 ;;         Phil Type
 ;; Maintainer: Bruce Ravel <bruceravel1@gmail.com>
 ;; Created:    June 28 1998
-;; Updated:    November 1 2012
 ;; Version:    0.7.0
-;; Keywords:   gnuplot, plotting
+;; Keywords:   data gnuplot plotting
+;; URL:        https://github.com/emacsorphanage/gnuplot
+;; Package-Requires: ((emacs "24.1"))
 
 ;; This file is not part of GNU Emacs.
 
@@ -28,7 +29,6 @@
 
 ;;; Commentary:
 
-;;
 ;; This is a major mode for composing gnuplot scripts and displaying
 ;; their results using gnuplot.  It supports features of recent
 ;; Gnuplot versions (4.4 and up), but should also work fine with older
@@ -92,7 +92,7 @@
 ;;
 ;; ---------------------------------------------------------------------
 ;;
-;; Other lisp files used by gnuplot.el
+;; Other Lisp files used by gnuplot.el
 ;;
 ;; gnuplot-gui.el (written by Bruce):
 ;;   Defines the GUI interface for setting setting arguments to
@@ -100,7 +100,7 @@
 ;;
 ;; gnuplot-context.el (written by Jonathan, j.j.oddie@gmail.com)
 ;;   Context-sensitive completion, help lookup and eldoc
-;;   strings for gnuplot buffers. Should be byte-compiled before
+;;   strings for gnuplot buffers.  Should be byte-compiled before
 ;;   using.
 ;;
 ;; ---------------------------------------------------------------------
@@ -110,7 +110,7 @@
 ;; back to the early 90's.  Although this mode encompasses the
 ;; functionality of the original, the two share no code and the
 ;; current implementation takes advantage of many features of modern
-;; versions of emacs and adheres (or so I intend) to the major mode
+;; versions of Emacs and adheres (or so I intend) to the major mode
 ;; conventions described in the emacs-lisp reference for version 19
 ;; and later.
 ;;
@@ -366,7 +366,7 @@ real work."
       (interactive)
       (let ((comint-dynamic-complete-functions
              '(gnuplot-comint-complete)))
-        (comint-dynamic-complete))))
+        (completion-at-point))))
 
 ;; Work around missing `window-full-height-p'
 (if (fboundp 'window-full-height-p)
@@ -427,15 +427,15 @@ real work."
   :group 'gnuplot)
 
 (defcustom gnuplot-mode-hook nil
-  "*Hook run when `gnuplot-mode' is entered."
+  "Hook run when `gnuplot-mode' is entered."
   :group 'gnuplot-hooks
   :type 'hook)
 (defcustom gnuplot-load-hook nil
-  "*Hook run when gnuplot.el is first loaded."
+  "Hook run when gnuplot.el is first loaded."
   :group 'gnuplot-hooks
   :type 'hook)
 (defcustom gnuplot-after-plot-hook nil
-  "*Hook run after gnuplot plots something.
+  "Hook run after gnuplot plots something.
 This is the last thing done by the functions for plotting a line, a
 region, a buffer, or a file."
   :group 'gnuplot-hooks
@@ -443,7 +443,7 @@ region, a buffer, or a file."
 
 
 (defcustom gnuplot-info-hook nil
-  "*Hook run before setting up the info-look interface.
+  "Hook run before setting up the info-look interface.
 This hook is necessary to handle inconsistencies in versions of and
 sources of the gnuplot info file.  If Gnuplot-mode can find the info
 file generated from the 3.6beta patchlevel 347 (or later) release of
@@ -488,13 +488,13 @@ For the older version of info-look, do this:
 
 ;; comint hook suggested by <DB>
 (defcustom gnuplot-comint-setup-hook nil
-  "*Hook run after setting up the gnuplot buffer in comint mode.
+  "Hook run after setting up the gnuplot buffer in comint mode.
 So the configuration can be customised by the user."
   :group 'gnuplot-hooks
   :type 'hook)
 
 (defcustom gnuplot-comint-mode-hook nil
-  "*Hook run after setting up the gnuplot buffer in gnuplot-comint-mode.
+  "Hook run after setting up the gnuplot buffer in gnuplot-comint-mode.
 By default this runs the hook named `gnuplot-comint-setup-hook',
 for backward compatibility."
   :group 'gnuplot-hooks
@@ -507,7 +507,7 @@ useful for functions included in 
`gnuplot-after-plot-hook'.")
 (make-variable-buffer-local 'gnuplot-recently-sent)
 
 (defcustom gnuplot-program "gnuplot"
-  "*The name of the gnuplot executable."
+  "The name of the gnuplot executable."
   :group 'gnuplot
   :type 'string)
 (defvar gnuplot-program-version nil
@@ -525,7 +525,7 @@ This is found using `gnuplot-fetch-version-number'.")
   :group 'gnuplot
   :type 'string)
 (defvar gnuplot-buffer nil
-  "*The name of the buffer displaying the gnuplot process.")
+  "The name of the buffer displaying the gnuplot process.")
 (defvar gnuplot-process nil
   "Variable holding the process handle.")
 (defvar gnuplot-process-frame nil
@@ -537,7 +537,7 @@ This is used by the function that plot from the comint 
buffer.  It is
 reset every time something is plotted from a script buffer.")
 
 (defcustom gnuplot-gnuplot-buffer "plot.gp"
-  "*The name of the gnuplot scratch buffer opened by 'gnuplot-make-buffer'."
+  "The name of the gnuplot scratch buffer opened by 'gnuplot-make-buffer'."
   :group 'gnuplot
   :type 'string)
 
@@ -552,7 +552,7 @@ The values are
                 (const :tag "Separate window" window)
                 (const :tag "Not displayed"   nil)))
 (defcustom gnuplot-info-display 'window
-  "*Determines how `gnuplot-info-lookup-symbol' displays the info file.
+  "Determines how `gnuplot-info-lookup-symbol' displays the info file.
 The values are
    'frame    display info file in a separate frame
    'window   display info file in another window
@@ -563,7 +563,8 @@ The values are
                 (const :tag "This window"     nil)))
 
 (defcustom gnuplot-echo-command-line-flag (not gnuplot-ntemacs-p)
-  "*This sets the fall-back value of `comint-process-echos'.
+  "Non-nil means the gnuplot subprocess echoes any input.
+This sets the fall-back value of `comint-process-echoes'.
 If `gnuplot-mode' cannot figure out what version number of gnuplot
 this is, then the value of this variable will be used for
 `comint-process-echos'.  It seems that gnuplot 3.5 wants this to be
@@ -575,29 +576,28 @@ and start it again."
   :group 'gnuplot
   :type 'boolean)
 (defcustom gnuplot-insertions-show-help-flag nil
-  "*Non-nil means to display certain help messages automatically.
+  "Non-nil means to display certain help messages automatically.
 These messages are shown after menu insertion of gnuplot commands."
   :group 'gnuplot-insertions
   :type 'boolean)
 
 (defcustom gnuplot-delay 0.01
-  "*Amount of time to delay before sending a new line to gnuplot.
+  "Amount of time to delay before sending a new line to gnuplot.
 This is needed so that the the line is not written in the gnuplot
 buffer in advance of its prompt.  Increase this number if the
 prompts and lines are displayed out of order."
   :group 'gnuplot
   :type 'number)
 (defcustom gnuplot-buffer-max-size 1000
-  "*The maximum size in lines of the gnuplot process buffer.
+  "The maximum size in lines of the gnuplot process buffer.
 Each time text is written in the gnuplot process buffer, lines are
 trimmed from the beginning of the buffer so that the buffer is this
 many lines long.  The lines are deleted after the most recent lines
-were interpretted by gnuplot.  Setting to 0 turns off this feature
-\(i.e. no lines get trimmed)."
+were interpretted by gnuplot.  Setting to 0 turns off this feature."
   :group 'gnuplot
   :type 'integer)
 (defcustom gnuplot-quote-character "\'"
-  "*Quotation character used for inserting quoted strings.
+  "Quotation character used for inserting quoted strings.
 Gnuplot can use single or double quotes.  If you prefer to have the
 filename insertion function never insert quotes for you, set this
 to the empty string."
@@ -609,14 +609,14 @@ to the empty string."
   "Number of columns to indent lines inside a do- or if-else-block.
 
 This applies only to new-style do- and if-statements using
-braces. Commands continued over a linebreak using a backslash are
-always indented to line up with the second word on the line
+braces.  Commands continued over a linebreak using a backslash
+are always indented to line up with the second word on the line
 beginning the continued command."
   :group 'gnuplot
   :type 'integer)
 
 ;; (defcustom gnuplot-gnuplot-version nil
-;;   "*Force gnuplot-mode to behave for this version of gnuplot."
+;;   "Force gnuplot-mode to behave for this version of gnuplot."
 ;;   :group 'gnuplot
 ;;   :type '(radio (const :tag "unspecified"   nil)
 ;;             (const :tag "3.8 or newer" "3.8")
@@ -646,14 +646,6 @@ time that data is needed."
   '(radio (const :tag "Parse info file when gnuplot-mode starts"    
immediately)
           (const :tag "Parse info file the first time it is needed" deferred)))
 
-(defun gnuplot-set-context-sensitive-completion (_variable value)
-  "Customize :set function for `gnuplot-use-context-sensitive-completion'."
-  (dolist (buffer (buffer-list))
-    (with-current-buffer buffer
-      (when (derived-mode-p 'gnuplot-mode 'gnuplot-comint-mode)
-        (gnuplot-context-sensitive-mode
-         (if value 1 0))))))
-
 (defcustom gnuplot-use-context-sensitive-completion t
   "Non-nil if `gnuplot-context-sensitive-mode' should be enabled by default.
 
@@ -663,7 +655,12 @@ suggestions."
   :group 'gnuplot
   :type 'boolean
   :initialize 'custom-set-default
-  :set 'gnuplot-set-context-sensitive-completion
+  :set (lambda (sym value)
+         (dolist (buffer (buffer-list))
+           (with-current-buffer buffer
+             (when (derived-mode-p 'gnuplot-mode 'gnuplot-comint-mode)
+               (gnuplot-context-sensitive-mode
+                (if value 1 0))))))
   :link '(emacs-commentary-link "gnuplot-context"))
 
 (defcustom gnuplot-eldoc-mode nil
@@ -676,13 +673,14 @@ on."
 (defcustom gnuplot-tab-completion nil
   "Non-nil if TAB should perform completion in gnuplot-mode buffers.
 
-Setting this to `t' sets the `tab-always-indent' variable to the
+Setting this to non-nil sets the `tab-always-indent' variable to the
 symbol `complete' in gnuplot-mode buffers."
   :group 'gnuplot
   :type 'boolean)
 
 (defun gnuplot-set-display-mode (variable value &rest args)
-  "Customize :set function for `gnuplot-inline-image-mode'."
+  "Customize :set function for `gnuplot-inline-image-mode'.
+Set VARIABLE to VALUE.  ARGS is optional args."
   (if (and (eq variable 'gnuplot-inline-image-mode)
            value
            (not (gnuplot-display-images-p)))
@@ -697,7 +695,7 @@ symbol `complete' in gnuplot-mode buffers."
 
 Possible values are nil, `inline' and `dedicated'.
 
-When this is `nil', Gnuplot output is handled outside of Emacs in
+When this is nil, Gnuplot output is handled outside of Emacs in
 the normal way.  Otherwise, Emacs attempts to capture Gnuplot's
 output and display it in a buffer.  Output is inserted inline in
 the Gnuplot interaction buffer it this is `inline', in a
@@ -840,8 +838,7 @@ non-nil."
     ["Show gnuplot-mode version"        gnuplot-show-version t]
     ["Show gnuplot version"             gnuplot-show-gnuplot-version t]
     "---"
-    ["Kill gnuplot"                     gnuplot-kill-gnuplot-buffer t]
-    )
+    ["Kill gnuplot"                     gnuplot-kill-gnuplot-buffer t])
   "Menu for `gnuplot-mode'.")
 
 
@@ -898,7 +895,7 @@ the \"regis\" terminal type to the terminal sub-menu:
 See the document string for `gnuplot-insertions-menu'")
 
 (defcustom gnuplot-insertions-menu-flag t
-  "*Non-nil means to place the insertion menu in the menubar.
+  "Non-nil means to place the insertion menu in the menubar.
 Changing this will not effect a change in any currently existing
 `gnuplot-mode' buffer.  You will see the change the next time you
 create a `gnuplot-mode' buffer."
@@ -1192,7 +1189,7 @@ create a `gnuplot-mode' buffer."
                                (boolean  :tag "Enabled" t)))))
 
 
-
+(defvar gnuplot-gui-popup-flag)
 (defvar gnuplot-insertions-bottom ()
   "Bottom part of the insertions menu.
 This part contains the toggle buttons for displaying info or
@@ -1204,7 +1201,7 @@ opening an argument-setting popup.")
         ["Display GUI popup with insertion" gnuplot-gui-toggle-popup
          :active (fboundp 'gnuplot-gui-toggle-popup)
          :style toggle :selected (and (fboundp 'gnuplot-gui-toggle-popup)
-                                      gnuplot-gui-popup-flag)] ))
+                                      gnuplot-gui-popup-flag)]))
 
 
 ;; Regarding a comment by <DB>:
@@ -1280,19 +1277,19 @@ opening an argument-setting popup.")
   :group 'gnuplot)
 
 (defcustom gnuplot-toolbar-display-flag gnuplot-xemacs-p
-  "*Non-nil means to display display a toolbar in XEmacs."
+  "Non-nil means to display display a toolbar in XEmacs."
   :group 'gnuplot-toolbar
   :type 'boolean)
 
 (defcustom gnuplot-toolbar-use-toolbar (if (featurep 'toolbar) 'left-toolbar 
nil)
-  "*If nil, do not use a toolbar.
+  "If nil, do not use a toolbar.
 If it is non-nil, it must be a toolbar.  The five legal values are
 `default-toolbar', `top-toolbar', `bottom-toolbar', `right-toolbar',
 and `left-toolbar', although choosing `default-toolbar' or
 `top-toolbar' may be a bad idea since either will make the GNUPLOT
 toolbar replace the standard toolbar.  Changing this will not change
 the toolbar in a currently existing buffer, but it will take effect
-the next time you use `gnuplot-mode' and emacs.
+the next time you use `gnuplot-mode' and Emacs.
 
 This is only used if a toolbar can be displayed, thus this is used in
 XEmacs and ignored in FSF Emacs."
@@ -1638,6 +1635,7 @@ static char *help_btn[] = {
 
 
 (defun gnuplot-make-toolbar-function ()
+  "Make toolbar."
   (if (and gnuplot-xemacs-p gnuplot-all-buttons-defined)
       (progn
         ;;(remove-specifier gnuplot-toolbar-use-toolbar (current-buffer))
@@ -1703,6 +1701,7 @@ characters.")
 ;; words.  Although gnuplot will recognise unique abbreviations, these
 ;; regular expressions will not.
 (defmacro gnuplot-make-regexp (list)
+  "Macro to generate efficient regexps for keyword matching from LIST."
   `(regexp-opt ,list 'words))
 
 ;; Lists of gnuplot keywords for syntax coloring etc.
@@ -1760,7 +1759,7 @@ These are highlighted using `font-lock-constant-face'.")
     "y2zeroaxis" "ydtics" "ymtics" "ytics" "yzeroaxis" "zdtics" "zmtics" 
"ztics"
     "zzeroaxis")
 
-  "List of gnuplot options which can be negated using `gnuplot-negate-option'")
+  "List of gnuplot options which can be negated using 
`gnuplot-negate-option'.")
 
 (defvar gnuplot-negatable-options-regexp
   (gnuplot-make-regexp gnuplot-keywords-negatable-options))
@@ -1868,14 +1867,14 @@ These are highlighted using `font-lock-constant-face'.")
       (1 "!") (2 "!")))))
 
 (defun gnuplot-syntax-propertize-extend-region (start end)
-  "Expand the region to syntax-propertize for strings and comments.
+  "Expand the region to `syntax-propertize' for strings and comments.
 
+Region range is START to END.
 Ensures that the region being searched begins and ends outside of
 any lines continued with a backslash.
 
-This function is added to
-`syntax-propertize-extend-region-functions' in gnuplot-mode
-buffers."
+This function is added to `syntax-propertize-extend-region-functions'
+in gnuplot-mode buffers."
   (let ((continuation-start
          (min start
               (gnuplot-point-at-beginning-of-continuation start)))
@@ -1889,7 +1888,7 @@ buffers."
 
 ;; Parsing utilities to tell if we are inside a string or comment
 (defun gnuplot-in-string (&optional where)
-  "Returns non-nil if the text at WHERE is within a string.
+  "Return non-nil if the text at WHERE is within a string.
 
 If WHERE is omitted, defaults to text at point.
 This is a simple wrapper for `syntax-ppss'."
@@ -1898,7 +1897,7 @@ This is a simple wrapper for `syntax-ppss'."
       (nth 3 parse-state))))
 
 (defun gnuplot-in-comment (&optional where)
-  "Returns non-nil if the text at WHERE is within a comment.
+  "Return non-nil if the text at WHERE is within a comment.
 
 If WHERE is omitted, defaults to text at point.
 This is a simple wrapper for `syntax-ppss'."
@@ -1907,7 +1906,7 @@ This is a simple wrapper for `syntax-ppss'."
       (nth 4 parse-state))))
 
 (defun gnuplot-in-string-or-comment (&optional where)
-  "Returns non-nil if the text at WHERE is within a string or comment.
+  "Return non-nil if the text at WHERE is within a string or comment.
 
 If WHERE is omitted, defaults to text at point.
 This is a simple wrapper for `syntax-ppss'."
@@ -1988,8 +1987,8 @@ called by this function after all of STRING is sent to 
gnuplot."
     (run-hooks 'gnuplot-after-plot-hook)))
 
 (defun gnuplot-display-and-recenter-gnuplot-buffer ()
-  "Make sure the gnuplot comint buffer is displayed, and
-move point to the end if necessary"
+  "Make sure the gnuplot comint buffer is displayed.
+Move point to the end if necessary."
   (save-selected-window
     (select-window (display-buffer (get-buffer gnuplot-buffer)))
     (goto-char (point-max))
@@ -2046,7 +2045,8 @@ This sets `gnuplot-recently-sent' to 'line."
 (defun gnuplot-send-line-and-forward (&optional num)
   "Call `gnuplot-send-line-to-gnuplot' and move forward 1 line.
 You can use a numeric prefix to send more than one line.  Blank lines and
-lines with only comments are skipped when moving forward."
+lines with only comments are skipped when moving forward.
+NUM is optional arg."
   (interactive "p")
   (let (end)
     (while (> num 0)
@@ -2190,8 +2190,7 @@ this function is attached to `gnuplot-after-plot-hook'"
     ["Show gnuplot-mode version"               gnuplot-show-version t]
     ["Show gnuplot version"                    gnuplot-show-gnuplot-version t]
     "---"
-    ["Kill gnuplot"                            gnuplot-kill-gnuplot-buffer 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"
@@ -2280,9 +2279,9 @@ buffer."
 (defun gnuplot-fetch-version-number ()
   "Determine the installed version of the gnuplot program.
 
-If `gnuplot-program-version' is already set, does
-nothing. Otherwise, runs `gnuplot-program' and searches the text
-printed at startup for a string like \"Version N.N\".
+If `gnuplot-program-version' is already set, does nothing.
+Otherwise, runs `gnuplot-program' and searches the text printed
+at startup for a string like \"Version N.N\".
 
 Sets the variables `gnuplot-program-version',
 `gnuplot-program-major-version', `gnuplot-program-minor-version',
@@ -2320,6 +2319,7 @@ defaults to 3.7."
     (gnuplot-setup-menu-and-toolbar)))
 
 (defun gnuplot-setup-menu-and-toolbar ()
+  "Setup stuff that depends on version number."
   ;; set up the menubar (possibly dependent on version number)
   (gnuplot-setup-menubar)
   ;; set up the toolbar (possibly dependent on version number)
@@ -2335,7 +2335,7 @@ defaults to 3.7."
 
 (defvar gnuplot-prompt-regexp
   (regexp-opt '("gnuplot> " "multiplot> "))
-  "Regexp for recognizing the GNUPLOT prompt")
+  "Regexp for recognizing the GNUPLOT prompt.")
 
 (defun gnuplot-protect-prompt-fn (string)
   "Prevent the Gnuplot prompt from being deleted or overwritten.
@@ -2415,30 +2415,35 @@ gnuplot process buffer will be displayed in a window."
 (defvar gnuplot-image-buffer-name "*gnuplot output*")
 
 (defun gnuplot-display-images-p ()
-  ;; Inline images require GNU Emacs.
+  "Inline images require GNU Emacs."
   (and (not (featurep 'xemacs))
        (fboundp 'display-images-p)
        (display-images-p)))
 
 (defun gnuplot-external-display-mode ()
+  "Display image in external."
   (interactive)
   (gnuplot-set-display-mode 'gnuplot-inline-image-mode nil))
 
 (defun gnuplot-inline-display-mode ()
+  "Display image in inline."
   (interactive)
   (gnuplot-set-display-mode 'gnuplot-inline-image-mode 'inline))
 
 (defun gnuplot-dedicated-display-mode ()
+  "Display image in dedicated."
   (interactive)
   (gnuplot-set-display-mode 'gnuplot-inline-image-mode 'dedicated))
 
 (defun gnuplot-set-image-format (format)
+  "Display image in FORMAT."
   (interactive "sGnuplot image format: ")
   (gnuplot-set-display-mode 'gnuplot-image-format format)
   (unless gnuplot-inline-image-mode
     (message "Setting will take effect when plots are displayed in Emacs")))
 
 (defun gnuplot-setup-comint-for-image-mode ()
+  "Setup comint for image."
   (when (and gnuplot-buffer (buffer-live-p gnuplot-buffer)
              (get-buffer-process gnuplot-buffer))
     (with-current-buffer gnuplot-buffer
@@ -2462,10 +2467,10 @@ gnuplot process buffer will be displayed in a window."
 (defvar gnuplot-inhibit-filter nil)
 
 (defun gnuplot-insert-inline-image-output (string)
-  "Insert Gnuplot graphical output in the gnuplot-comint buffer.
+  "Insert Gnuplot graphical output STRING in the gnuplot-comint buffer.
 
 Called via `comint-preoutput-filter-functions' hook when
-`gnuplot-inline-image-mode' is enabled. Checks the status of the
+`gnuplot-inline-image-mode' is enabled.  Checks the status of the
 file `gnuplot-inline-image-filename'; if it exists and has
 nonzero size, inserts it as an inline image, stores a new
 temporary filename in `gnuplot-inline-image-filename', and
@@ -2513,13 +2518,13 @@ updates Gnuplot with the appropriate 'set output' 
command."
   (comint-send-string (get-buffer-process gnuplot-buffer) string))
 
 (defun gnuplot-discard-output (string)
-  ;; Temporary preoutput filter for hiding Gnuplot output & prompt.
-  ;; Accumulates output in a buffer until it finds the next prompt,
-  ;; then removes itself from comint-preoutput-filter-functions.
+  "Temporary preoutput filter for hiding Gnuplot output & prompt.
+Accumulates output STRING in a buffer until it finds the next prompt,
+then removes itself from `comint-preoutput-filter-functions'."
   (with-current-buffer
       (get-buffer-create gnuplot-hidden-output-buffer)
     (insert string)
-    (when (looking-back gnuplot-prompt-regexp)
+    (when (looking-back gnuplot-prompt-regexp (point-min))
       (with-current-buffer gnuplot-buffer
         (remove-hook 'comint-preoutput-filter-functions
                      'gnuplot-discard-output t))))
@@ -2584,13 +2589,13 @@ Add additional indentation for continuation lines."
     (let ((point-at-indent (+ (point-at-bol) indent)))
       (when (< (point) point-at-indent) (goto-char point-at-indent)))))
 
-;; Adjust indentation on inserting a close brace
-;; The blink-paren fix is stolen from cc-mode
-(defun gnuplot-electric-insert (arg)
+(defun gnuplot-electric-insert (BRACE)
+  "Adjust indentation on inserting a close BRACE.
+The blink-paren fix is stolen from cc-mode"
   (interactive "*p")
   (let ((old-blink-paren blink-paren-function)
         (blink-paren-function nil))
-    (self-insert-command arg)
+    (self-insert-command BRACE)
     (gnuplot-indent-line)
     (when old-blink-paren (funcall old-blink-paren))))
 
@@ -2622,7 +2627,7 @@ If not in a continuation line, move point to beginning of 
line."
 (defun gnuplot-end-of-continuation ()
   "Move point to the end of the continuation lines containing point.
 
-If there are no continuation lines, move point to end-of-line."
+If there are no continuation lines, move point to `end-of-line'."
   (end-of-line)
   (unless (bobp)
     (catch 'eob
@@ -2636,7 +2641,8 @@ If there are no continuation lines, move point to 
end-of-line."
 (defun gnuplot-point-at-beginning-of-continuation (&optional pos)
   "Return value of point at beginning of the continued block containing point.
 
-If there are no continuation lines, returns point-at-bol."
+If there are no continuation lines, returns `point-at-bol'.
+If specify POS, move POS befere execution."
   (save-excursion
     (when pos (goto-char pos))
     (gnuplot-beginning-of-continuation)
@@ -2645,15 +2651,16 @@ If there are no continuation lines, returns 
point-at-bol."
 (defun gnuplot-point-at-end-of-continuation (&optional pos)
   "Return value of point at the end of the continued block containing point.
 
-If there are no continuation lines, returns point-at-eol."
+If there are no continuation lines, returns `point-at-eol'.
+If specify POS, move POS before execution."
   (save-excursion
     (when pos (goto-char pos))
     (gnuplot-end-of-continuation)
     (point)))
 
-;; We also treat a block of continuation lines as a 'defun' for
-;; movement purposes
 (defun gnuplot-beginning-of-defun (&optional arg)
+  "We also treat a block of continuation lines as a `defun'.
+ARG is optional arg."
   (if (not arg) (setq arg 1))
   (if (> arg 0)
       (catch 'bob              ; go to beginning of ARGth prev. defun
@@ -2878,6 +2885,7 @@ Return a list of keywords."
   "Function to call to perform completion in Gnuplot buffers.")
 
 (defun gnuplot-completion-at-point ()
+  "Perform completion in Gnuplot buffers."
   (funcall gnuplot-completion-at-point-function))
 
 (defvar gnuplot-eldoc-hash nil
@@ -2972,8 +2980,8 @@ distribution. See gnuplot-context.el for details."
 (defun gnuplot-completion-at-point-info-look ()
   "Return completions of keyword preceding point.
 
-Uses the cache of keywords generated by info-lookup. See
-`gnuplot-setup-info-look'. If not nil, the return value is in the form
+Uses the cache of keywords generated by info-lookup.  See
+`gnuplot-setup-info-look'.  If non-nil, the return value is in the form
 \(BEGIN END COMPLETIONS) where BEGIN and END are buffer
 positions and COMPLETIONS is a list."
 
@@ -3029,11 +3037,11 @@ according to the value of `gnuplot-info-display'."
     (gnuplot--adjust-info-display)))
 
 (defun gnuplot--adjust-info-display ()
-  "Displays the *info* buffer in a window or frame as specified
-by the value of `gnuplot-info-display'.  If
-`gnuplot-info-display' is 'window, then the window will be shrunk
-to the size of the info entry if it is smaller than half the
-height of the frame.
+  "Displays the *info* buffer in a window or frame.
+Specified by the value of `gnuplot-info-display'.
+If `gnuplot-info-display' is 'window, then the window will be
+shrunk to the size of the info entry if it is smaller than half
+the height of the frame.
 
 The *info* buffer should already exist when this function is
 called."
@@ -3092,6 +3100,7 @@ shown."
                   (gnuplot-info-lookup-symbol topic)) ) )) ) )
 
 (defun gnuplot-toggle-info-display ()
+  "Toggle info display."
   (interactive)
   (setq gnuplot-insertions-show-help-flag (not 
gnuplot-insertions-show-help-flag))
   (message (if gnuplot-insertions-show-help-flag
@@ -3124,7 +3133,7 @@ distribution, or is available at the `gnuplot-mode' web 
page:
 https://github.com/emacsorphanage/gnuplot/
 
 With the new context-sensitive mode active, gnuplot-mode can also
-provide `eldoc-mode' syntax hints as you type.  This requires a
+provide function/`eldoc-mode' syntax hints as you type.  This requires a
 separate file of strings, `gnuplot-eldoc.el', which is also
 provided by recent Gnuplot distributions.
 
@@ -3228,12 +3237,12 @@ following in your .emacs file:
   (pop-to-buffer gnuplot-buffer))
 
 (defun gnuplot-show-version ()
-  "Show version number in echo area"
+  "Show version number in echo area."
   (interactive)
   (message "gnuplot-mode %s -- URL: %s" gnuplot-version 
gnuplot-maintainer-url))
 
 (defun gnuplot-show-gnuplot-version ()
-  "Show gnuplot program and version number in echo area"
+  "Show gnuplot program and version number in echo area."
   (interactive)
   (gnuplot-fetch-version-number)
   (message "You are calling gnuplot %s as %s" gnuplot-program-version 
gnuplot-program))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]