emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] docstrings to match the code, and minor cosmetics.
@ 2020-06-02 16:25 Mario Frasca
  0 siblings, 0 replies; only message in thread
From: Mario Frasca @ 2020-06-02 16:25 UTC (permalink / raw)
  To: emacs-orgmode

 From 43cc6264deb89fcc665d123b06c7c2aebb35ab3a Mon Sep 17 00:00:00 2001
From: Mario Frasca <mario@anche.no>
Date: Tue, 2 Jun 2020 16:22:07 +0000
Subject: [PATCH] docstrings to match the code, and minor cosmetics.

  lisp/org-plot.el | 21 ++++++++++++++-------
  1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/lisp/org-plot.el b/lisp/org-plot.el
index a23195d2a..3a95c72d6 100644
--- a/lisp/org-plot.el
+++ b/lisp/org-plot.el
@@ -85,14 +85,18 @@ Returns the resulting property list."

  (defun org-plot/goto-nearest-table ()
-  "Move the point forward to the beginning of nearest table.
-Return value is the point at the beginning of the table."
-  (interactive) (move-beginning-of-line 1)
+  "Move the point to the beginning of table.
+Moves back if the point is inside a table, otherwise looks for next table.
+If there is no table to be found, moves to end of buffer.
+Return value is the point."
+  (interactive)
+  (move-beginning-of-line 1)
    (while (not (or (org-at-table-p) (< 0 (forward-line 1)))))
    (goto-char (org-table-begin)))

  (defun org-plot/collect-options (&optional params)
    "Collect options from an org-plot `#+Plot:' line.
+Examines the line at point.
  Accepts an optional property list PARAMS, to which the options
  will be added.  Returns the resulting property list."
@@ -143,7 +147,8 @@ and dependent variables."
       (counter 0)
      (when (>= ind 0) ;; collect values of ind col
-      (setf row-vals (mapcar (lambda (row) (setf counter (+ 1 counter))
+      (setf row-vals (mapcar (lambda (row)
+                   (setf counter (+ 1 counter))
                     (cons counter (nth ind row)))
      (when (or deps (>= ind 0)) ;; remove non-plotting columns
@@ -156,7 +161,8 @@ and dependent variables."
      ;; write table to gnuplot grid datafile format
      (with-temp-file data-file
-      (let ((num-rows (length table)) (num-cols (length (nth 0 table)))
+      (let ((num-rows (length table))
+        (num-cols (length (nth 0 table)))
          (gnuplot-row (lambda (col row value)
                 (setf col (+ 1 col)) (setf row (+ 1 row))
                 (format "%f  %f  %f\n%f  %f  %f\n"
@@ -180,7 +186,8 @@ and dependent variables."

  (defun org-plot/gnuplot-script (data-file num-cols params &optional 
-  "Write a gnuplot script to DATA-FILE respecting the options set in 
+  "Return gnuplot script respecting the options set in PARAMS.
+DATA-FILE is the name of the data containing file.
  NUM-COLS controls the number of columns plotted in a 2-d plot.
  Optional argument PREFACE returns only option parameters in a
  manner suitable for prepending to a user-specified script."
@@ -274,7 +281,7 @@ manner suitable for prepending to a user-specified 
  (defun org-plot/gnuplot (&optional params)
    "Plot table using gnuplot.  Gnuplot options can be specified with 
  If not given options will be taken from the +PLOT
-line directly before or after the table."
+line(s) directly before the table."
    (require 'gnuplot)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-02 16:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-02 16:25 [PATCH] docstrings to match the code, and minor cosmetics Mario Frasca

Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).