Convert consecutive FSF copyright years to ranges.
[bpt/emacs.git] / lisp / org / org-plot.el
index 81605f7..c5f4bff 100644 (file)
@@ -1,11 +1,11 @@
 ;;; org-plot.el --- Support for plotting from Org-mode
 
-;; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2011 Free Software Foundation, Inc.
 ;;
 ;; Author: Eric Schulte <schulte dot eric at gmail dot com>
 ;; Keywords: tables, plotting
 ;; Homepage: http://orgmode.org
-;; Version: 6.31a
+;; Version: 7.4
 ;;
 ;; This file is part of GNU Emacs.
 ;;
@@ -44,7 +44,7 @@
   '((:plot-type . 2d)
     (:with . lines)
     (:ind . 0))
-  "Default options to gnuplot used by `org-plot/gnuplot'")
+  "Default options to gnuplot used by `org-plot/gnuplot'.")
 
 (defvar org-plot-timestamp-fmt nil)
 
@@ -134,7 +134,7 @@ Pass PARAMS through to `orgtbl-to-generic' when exporting TABLE."
 
 (defun org-plot/gnuplot-to-grid-data (table data-file params)
   "Export the data in TABLE to DATA-FILE for gnuplot.
-This means, in a format appropriate for grid plotting by gnuplot.
+This means in a format appropriate for grid plotting by gnuplot.
 PARAMS specifies which columns of TABLE should be plotted as independent
 and dependant variables."
   (interactive)
@@ -250,8 +250,9 @@ manner suitable for prepending to a user-specified script."
                 (setf plot-lines
                       (cons
                        (format plot-str data-file
-                               (or (and (not text-ind) ind
-                                        (> ind 0) (format "%d:" ind)) "")
+                               (or (and ind (> ind 0)
+                                         (not text-ind)
+                                         (format "%d:" ind)) "")
                                (+ 1 col)
                                (if text-ind (format ":xticlabel(%d)" ind) "")
                                with
@@ -271,7 +272,7 @@ manner suitable for prepending to a user-specified script."
 ;; facade functions
 ;;;###autoload
 (defun org-plot/gnuplot (&optional params)
-  "Plot table using gnuplot. Gnuplot options can be specified with 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."
   (interactive)
@@ -280,7 +281,7 @@ line directly before or after the table."
     (delete-other-windows)
     (when (get-buffer "*gnuplot*") ;; reset *gnuplot* if it already running
       (with-current-buffer "*gnuplot*"
-        (goto-char (point-max))
+       (goto-char (point-max))
        (gnuplot-delchar-or-maybe-eof nil)))
     (org-plot/goto-nearest-table)
     ;; set default options
@@ -300,7 +301,7 @@ line directly before or after the table."
        (setf table (delq 'hline (cdr table)))) ;; clean non-data from table
       ;; collect options
       (save-excursion (while (and (equal 0 (forward-line -1))
-                                 (looking-at "#\\+"))
+                                 (looking-at "[[:space:]]*#\\+"))
                        (setf params (org-plot/collect-options params))))
       ;; dump table to datafile (very different for grid)
       (case (plist-get params :plot-type)
@@ -320,7 +321,6 @@ line directly before or after the table."
                           (mapcar (lambda (row) (nth ind row)) table)))) 0)
              (plist-put params :timeind t)
            ;; check for text ind column
-
            (if (or (string= (plist-get params :with) "hist")
                    (> (length
                        (delq 0 (mapcar
@@ -350,5 +350,4 @@ line directly before or after the table."
 
 (provide 'org-plot)
 
-;; arch-tag: 5763f7c6-0c75-416d-b070-398ee4ec0eca
 ;;; org-plot.el ends here