[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org ac3148e 3/3: org-plot: Don't move point when plotti
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org ac3148e 3/3: org-plot: Don't move point when plotting |
Date: |
Mon, 26 Apr 2021 11:57:09 -0400 (EDT) |
branch: externals/org
commit ac3148ef8df10e73b42659ea20b5359370802763
Author: TEC <tec@tecosaur.com>
Commit: TEC <tec@tecosaur.com>
org-plot: Don't move point when plotting
* lisp/org-plot.el (org-plot/gnuplot): Expanding the `save-excursion'
block to include `org-plot/goto-nearest-table` prevents the current
point from being moved, and doesn't affect the rest of the function.
---
lisp/org-plot.el | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/lisp/org-plot.el b/lisp/org-plot.el
index a0687ab..2a5af67 100644
--- a/lisp/org-plot.el
+++ b/lisp/org-plot.el
@@ -637,15 +637,16 @@ line directly before or after the table."
(when (get-buffer "*gnuplot*") ; reset *gnuplot* if it already running
(with-current-buffer "*gnuplot*"
(goto-char (point-max))))
- (org-plot/goto-nearest-table)
- ;; Set default options.
- (dolist (pair org-plot/gnuplot-default-options)
- (unless (plist-member params (car pair))
- (setf params (plist-put params (car pair) (cdr pair)))))
- ;; Collect options.
- (save-excursion (while (and (equal 0 (forward-line -1))
- (looking-at "[[:space:]]*#\\+"))
- (setf params (org-plot/collect-options params))))
+ (save-excursion
+ (org-plot/goto-nearest-table)
+ ;; Set default options.
+ (dolist (pair org-plot/gnuplot-default-options)
+ (unless (plist-member params (car pair))
+ (setf params (plist-put params (car pair) (cdr pair)))))
+ ;; Collect options.
+ (while (and (equal 0 (forward-line -1))
+ (looking-at "[[:space:]]*#\\+"))
+ (setf params (org-plot/collect-options params))))
;; collect table and table information
(let* ((data-file (make-temp-file "org-plot"))
(table (let ((tbl (org-table-to-lisp)))