emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Mario Frasca <mario@anche.no>
To: emacs-orgmode@gnu.org
Subject: [PATCH] docstrings to match the code, and minor cosmetics.
Date: Tue, 2 Jun 2020 11:25:57 -0500	[thread overview]
Message-ID: <c7768c14-711e-a719-87d7-8f7ab2317618@anche.no> (raw)

 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."
    p)

  (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."
    (interactive)
@@ -143,7 +147,8 @@ and dependent variables."
       (counter 0)
       row-vals)
      (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)))
                   table)))
      (when (or deps (>= ind 0)) ;; remove non-plotting columns
@@ -156,7 +161,8 @@ and dependent variables."
                table)))
      ;; 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."
      row-vals))

  (defun org-plot/gnuplot-script (data-file num-cols params &optional 
preface)
-  "Write a gnuplot script to DATA-FILE respecting the options set in 
PARAMS.
+  "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 
script."
  (defun org-plot/gnuplot (&optional params)
    "Plot table using gnuplot.  Gnuplot options can be specified with 
PARAMS.
  If not given options will be taken from the +PLOT
-line directly before or after the table."
+line(s) directly before the table."
    (interactive)
    (require 'gnuplot)
    (save-window-excursion
-- 
2.20.1




                 reply	other threads:[~2020-06-02 16:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c7768c14-711e-a719-87d7-8f7ab2317618@anche.no \
    --to=mario@anche.no \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).