Re: [PATCH] Have C-c C-c recognise #+plot lines
Eric S Fraga writes: > On Saturday, 1 May 2021 at 08:56, Bastien wrote: >> I have fixed this with commit ee507de47, can you confirm? > > Seems to work just fine now. Thank you. Thanks for confirming! -- Bastien
Re: [PATCH] Have C-c C-c recognise #+plot lines
Hi Bastien, On Saturday, 1 May 2021 at 08:56, Bastien wrote: > I have fixed this with commit ee507de47, can you confirm? Seems to work just fine now. Thank you. -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-405-g0a689b
Re: [PATCH] Have C-c C-c recognise #+plot lines
Hi Eric, Eric S Fraga writes: > On Thursday, 29 Apr 2021 at 02:04, Timothy wrote: >> Have you had a chance to test this out? > > Further on this, I don't have time to debug right now but the patch > seems to have broken org table recalculation, specifically C-u C-c C-c > on a table. I have fixed this with commit ee507de47, can you confirm? Thanks, -- Bastien
Re: [PATCH] Have C-c C-c recognise #+plot lines
Eric S Fraga writes: > I get this when I try: Thanks - I see what's wrong, I'll fix it. -- Bastien
Re: [PATCH] Have C-c C-c recognise #+plot lines
On Friday, 30 Apr 2021 at 20:16, Timothy wrote: > Thank you for taking the time to check this in what sounds like a busy > day, and the backtrace. It's much appreciated :) Thank you. All days are busy (for all/most of us, I'm sure) but org is a major part of my day's work so always happy to try to contribute in some way. > It seems like for you (org-element-property :post-affiliated context) > was unexpectedly nil. (or 0 ...) would be a quick-fix, but I find it odd > that this is a issue, and am yet to be able to reproduce this myself. It could very well be something I have done (inadvertently, but not surprisingly). I don't know what the above means so please suggest what I can do. It seems that C-c C-c on a table (no C-u) also fails sometimes. So it's probably (likely) me doing something wrong. > p.s. Good luck with the presentation! Thank you! :-) -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-394-g7fc090
Re: [PATCH] Have C-c C-c recognise #+plot lines
Eric S Fraga writes: > I have updated org. Problem persists. > > Attached is a full backtrace after hitting C-u C-c C-c on a table. The > document itself has 2 headings and a small table. > > I unfortunately cannot spend more time on this at the moment as I have a > presentation to make this afternoon and it's not quite ready... Thank you for taking the time to check this in what sounds like a busy day, and the backtrace. It's much appreciated :) It seems like for you (org-element-property :post-affiliated context) was unexpectedly nil. (or 0 ...) would be a quick-fix, but I find it odd that this is a issue, and am yet to be able to reproduce this myself. Is anybody else willing to try this and weigh in? -- Timothy p.s. Good luck with the presentation!
Re: [PATCH] Have C-c C-c recognise #+plot lines
I have updated org. Problem persists. Attached is a full backtrace after hitting C-u C-c C-c on a table. The document itself has 2 headings and a small table. I unfortunately cannot spend more time on this at the moment as I have a presentation to make this afternoon and it's not quite ready... -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-394-g7fc090 Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) <(240 nil) (and (< (point) (org-element-property :post-affiliated context)) (org-match-line "[ \11]*#\\+plot:")) (cond ((and (< (point) (org-element-property :post-affiliated context)) (org-match-line "[ \11]*#\\+plot:")) (org-plot/gnuplot)) ((eq (org-element-property :type context) 'table\.el) (message "%s" (substitute-command-keys "\\Use `\\[org-edit-special]' to edit t..."))) ((or (eq type 'table) (and (eq type 'table-row) (= (point) (org-element-property :end context (save-excursion (if (org-at-TBLFM-p) (progn (require 'org-table) (org-table-calc-current-TBLFM)) (goto-char (org-element-property :contents-begin context)) (org-call-with-arg 'org-table-recalculate (or arg t)) (orgtbl-send-table 'maybe (t (org-table-maybe-eval-formula) (cond (arg (call-interactively #'org-table-recalculate)) ((org-table-maybe-recalculate-line)) (t (org-table-align) (let nil (cond ((and (< (point) (org-element-property :post-affiliated context)) (org-match-line "[ \11]*#\\+plot:")) (org-plot/gnuplot)) ((eq (org-element-property :type context) 'table\.el) (message "%s" (substitute-command-keys "\\Use `\\[org-edit-special]' to edit t..."))) ((or (eq type 'table) (and (eq type 'table-row) (= (point) (org-element-property :end context (save-excursion (if (org-at-TBLFM-p) (progn (require 'org-table) (org-table-calc-current-TBLFM)) (goto-char (org-element-property :contents-begin context)) (org-call-with-arg 'org-table-recalculate (or arg t)) (orgtbl-send-table 'maybe (t (org-table-maybe-eval-formula) (cond (arg (call-interactively #'org-table-recalculate)) ((org-table-maybe-recalculate-line)) (t (org-table-align)) (cond ((memq type '(src-block inline-src-block)) (let nil (if org-babel-no-eval-on-ctrl-c-ctrl-c nil (org-babel-eval-wipe-error-buffer) (org-babel-execute-src-block current-prefix-arg (org-babel-get-src-block-info nil context) ((org-match-line "[ \11]*$") (let nil (or (run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-final-hook) (user-error (substitute-command-keys "`\\[org-ctrl-c-ctrl-c]' can do nothing useful here") ((memq type '(inline-babel-call babel-call)) (let nil (let ((info (org-babel-lob-get-info context))) (if info (progn (org-babel-execute-src-block nil info)) ((eq type 'clock) (let nil (org-clock-update-time-maybe))) ((eq type 'dynamic-block) (let nil (save-excursion (goto-char (org-element-property :post-affiliated context)) (org-update-dblock ((eq type 'footnote-definition) (let nil (goto-char (org-element-property :post-affiliated context)) (call-interactively 'org-footnote-action))) ((eq type 'footnote-reference) (let nil (call-interactively #'org-footnote-action))) ((memq type '(inlinetask headline)) (let nil (save-excursion (goto-char (org-element-property :begin context)) (call-interactively #'org-set-tags-command ((eq type 'item) (let nil (if (or radio-list-p (and (boundp org-list-checkbox-radio-mode) org-list-checkbox-radio-mode)) (org-toggle-radio-button arg) (let* ((box (org-element-property :checkbox context)) (struct (org-element-property :structure context)) (old-struct (copy-tree struct)) (parents (org-list-parents-alist struct)) (prevs (org-list-prevs-alist struct)) (orderedp (org-not-nil ...))) (org-list-set-checkbox (org-element-property :begin context) struct (cond (... "[-]") (... "[ ]") (... nil) (... "[ ]") (t "[X]"))) (org-list-struct-fix-ind struct parents 2) (org-list-struct-fix-item-end struct) (org-list-struct-fix-bul struct prevs) (org-list-struct-fix-ind struct parents) (let ((block-item ...)) (if (and box ...) (if ... ... ...) (org-list-struct-apply-struct struct old-struct) (org-update-checkbox-count-maybe)) (if block-item (progn ...))) ((eq type 'plain-list) (let nil (if (or radio-list-p (and (boundp org-list-checkbox-radio-mode) org-list-checkbox-radio-mode)) (org-toggle-radio-button arg) (let* ((begin (org-element-property :contents-begin context)) (struct (org-element-property :structure context)) (old-struct (copy-tree struct)) (first-box (save-excursion ... ... ...)) (new-box (cond ... ... ... ...))) (cond (arg (let ... ...)) ((and first-box ...) (org-list-set-checkbox begin struct new-box))) (if (equal (org-list-write-struct struct ... old-struct) old-struct) (progn (message "Cannot update this checkbox"))) (org-update-checkbox-count-maybe) ((eq type 'keyword) (let nil (let ((org-inhibit-startup-visibility-stuff t) (org-startup-align-all-tables nil)) (if (boundp 'org-table-coordinate-overlays) (progn (mapc #
Re: [PATCH] Have C-c C-c recognise #+plot lines
On Friday, 30 Apr 2021 at 16:52, Timothy wrote: > I checked the docs for `org-table-recalculate' and based on manually > calling it compared the behaviour to C-u C-c C-c on a table and noticed > no difference, but I'm not familiar with the intended functionality so > an example from Eric (or someone else) of what should happen would be > very helpful. I get this when I try: Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) org-ctrl-c-ctrl-c((4)) funcall-interactively(org-ctrl-c-ctrl-c (4)) command-execute(org-ctrl-c-ctrl-c) I will update org (noting that the patch has been incorporated) and will report back with a proper backtrace. -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-381-g17ef1b.dirty
Re: [PATCH] Have C-c C-c recognise #+plot lines
Bastien writes: > Eric S Fraga writes: > >> Further on this, I don't have time to debug right now but the patch >> seems to have broken org table recalculation, specifically C-u C-c C-c >> on a table. > > Thanks for reporting - Tim can you double-check this? I checked the docs for `org-table-recalculate' and based on manually calling it compared the behaviour to C-u C-c C-c on a table and noticed no difference, but I'm not familiar with the intended functionality so an example from Eric (or someone else) of what should happen would be very helpful. -- Timothy
Re: [PATCH] Have C-c C-c recognise #+plot lines
Eric S Fraga writes: > On Thursday, 29 Apr 2021 at 02:04, Timothy wrote: >> Have you had a chance to test this out? > > Further on this, I don't have time to debug right now but the patch > seems to have broken org table recalculation, specifically C-u C-c C-c > on a table. Thanks for reporting - Tim can you double-check this? -- Bastien
Re: [PATCH] Have C-c C-c recognise #+plot lines
On Thursday, 29 Apr 2021 at 02:04, Timothy wrote: > Have you had a chance to test this out? Further on this, I don't have time to debug right now but the patch seems to have broken org table recalculation, specifically C-u C-c C-c on a table. Have to run to a meeting but will try to check this out later today if I have time. -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-381-g17ef1b.dirty
Re: [PATCH] Have C-c C-c recognise #+plot lines
Hi Timothy, Timothy writes: > Now that Eric and I have both tested this, and Nicolas' comments have > been taken into account, it would be great if a core maintainer could > consider applying this patch :) Done with commit aea31b065 in master, thanks to everyone in this thread. I allowed myself to shortene the commit message a little bit, avoiding personal statements ("as I think"). Also note that this patch did not land on updates.orgmode.org because it was sent as a reply - I'll try to fix Woof! here. Thanks, -- Bastien
Re: [PATCH] Have C-c C-c recognise #+plot lines
Now that Eric and I have both tested this, and Nicolas' comments have been taken into account, it would be great if a core maintainer could consider applying this patch :) -- Timothy p.s. I'm specifically making a new reply to the version of the patch that should be looked at, in the hope that this might help with clarity when there are 4 different patches in this thread.
Re: [PATCH] Have C-c C-c recognise #+plot lines
Hi Timothy, On Thursday, 29 Apr 2021 at 02:04, Timothy wrote: > Have you had a chance to test this out? Yes, sorry for the delay; work pressures... C-c C-c seems to work fine on #+plot lines and the point does not move. thank you, eric -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-381-g17ef1b.dirty
Re: [PATCH] Have C-c C-c recognise #+plot lines
Hi Eric, Have you had a chance to test this out? -- Timothy
Re: [PATCH] Have C-c C-c recognise #+plot lines
Hi Eric, Eric S Fraga writes: > On Monday, 26 Apr 2021 at 17:11, Timothy wrote: >> Since you don't seem to have pushed yet, here's an updated patche that >> takes into account Nicolas' comments. > > Oh, and to clarify: I don't have push access; I can only do testing but > not installation! If you need push access for areas you want to maintain, just let us know. Thanks!
Re: [PATCH] Have C-c C-c recognise #+plot lines
On Monday, 26 Apr 2021 at 17:11, Timothy wrote: > Since you don't seem to have pushed yet, here's an updated patche that > takes into account Nicolas' comments. Oh, and to clarify: I don't have push access; I can only do testing but not installation! -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-337-g29d4cc.dirty
Re: [PATCH] Have C-c C-c recognise #+plot lines
On Monday, 26 Apr 2021 at 17:11, Timothy wrote: > Since you don't seem to have pushed yet, here's an updated patche that > takes into account Nicolas' comments. Thank you. I've incorporated that patch and will test out tomorrow. -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-337-g29d4cc.dirty
Re: [PATCH] Have C-c C-c recognise #+plot lines
On Monday, 26 Apr 2021 at 16:24, Timothy wrote: > A while ago Eric raised two nice suggestions. (2) has just been > implemented as Bastien reminded me that I can now just push straight to > Org for org-plot.el without going through a patch-review process. > > This patch resolves (1). Timothy, I've updated org and applied the patch. Both aspects seem to work just fine. I haven't done much testing, however, as it's beer time... I'll update tomorrow should I run into any strange behaviour. thank you, eric -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-335-gac3148.dirty
Re: [PATCH] Have C-c C-c recognise #+plot lines
... I didn't regenerate the patch after amending the commit. :big sigh: Take 4 >From 4e5fcb4726711ff356656cb6fccf6e341656443d Mon Sep 17 00:00:00 2001 From: TEC Date: Tue, 27 Apr 2021 00:05:37 +0800 Subject: [PATCH] org: Enable plotting with C-c C-c * lisp/org.el (org-ctrl-c-ctrl-c): When at a table, check if the current line starts with "#+plot", and if so call `org-plot/gnuplot'. As I think 4-deep nested if statements are bad for readability, I refactored the nested if statements to use `cond' while I was at it. --- lisp/org.el | 41 +++-- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 3f9c9a284..94ef9660d 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -17693,24 +17693,29 @@ (defun org-ctrl-c-ctrl-c (&optional arg) ;; send the table if necessary. If the table has ;; a `table.el' type, just give up. At a table row or cell, ;; maybe recalculate line but always align table. - (if (eq (org-element-property :type context) 'table.el) - (message "%s" (substitute-command-keys "\\\ -Use `\\[org-edit-special]' to edit table.el tables")) - (if (or (eq type 'table) - ;; Check if point is at a TBLFM line. - (and (eq type 'table-row) - (= (point) (org-element-property :end context - (save-excursion - (if (org-at-TBLFM-p) - (progn (require 'org-table) - (org-table-calc-current-TBLFM)) - (goto-char (org-element-property :contents-begin context)) - (org-call-with-arg 'org-table-recalculate (or arg t)) - (orgtbl-send-table 'maybe))) - (org-table-maybe-eval-formula) - (cond (arg (call-interactively #'org-table-recalculate)) - ((org-table-maybe-recalculate-line)) - (t (org-table-align)) + (cond + ((and (< (point) (org-element-property :post-affiliated context)) +(org-match-line "[ \t]*#\\+plot:")) + (org-plot/gnuplot)) + ((eq (org-element-property :type context) 'table.el) + (message "%s" (substitute-command-keys "\\\ +Use `\\[org-edit-special]' to edit table.el tables"))) + ((or (eq type 'table) + ;; Check if point is at a TBLFM line. + (and (eq type 'table-row) +(= (point) (org-element-property :end context + (save-excursion + (if (org-at-TBLFM-p) + (progn (require 'org-table) +(org-table-calc-current-TBLFM)) + (goto-char (org-element-property :contents-begin context)) + (org-call-with-arg 'org-table-recalculate (or arg t)) + (orgtbl-send-table 'maybe + (t + (org-table-maybe-eval-formula) + (cond (arg (call-interactively #'org-table-recalculate)) + ((org-table-maybe-recalculate-line)) + (t (org-table-align)) ((or `timestamp (and `planning (guard (org-at-timestamp-p 'lax (org-timestamp-change 0 'day)) ((and `nil (guard (org-at-heading-p))) -- 2.31.1 Sorry for the noise, Timothy
Re: [PATCH] Have C-c C-c recognise #+plot lines
Timothy writes: > Since you don't seem to have pushed yet, here's an updated patch that > takes into account Nicolas' comments. ... and that patch didn't take into account the need to escape "+" in the regex. Take 3. >From 4e5fcb4726711ff356656cb6fccf6e341656443d Mon Sep 17 00:00:00 2001 From: TEC Date: Tue, 27 Apr 2021 00:05:37 +0800 Subject: [PATCH] org: Enable plotting with C-c C-c * lisp/org.el (org-ctrl-c-ctrl-c): When at a table, check if the current line starts with "#+plot", and if so call `org-plot/gnuplot'. As I think 4-deep nested if statements are bad for readability, I refactored the nested if statements to use `cond' while I was at it. --- lisp/org.el | 41 +++-- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 3f9c9a284..94ef9660d 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -17693,24 +17693,29 @@ (defun org-ctrl-c-ctrl-c (&optional arg) ;; send the table if necessary. If the table has ;; a `table.el' type, just give up. At a table row or cell, ;; maybe recalculate line but always align table. - (if (eq (org-element-property :type context) 'table.el) - (message "%s" (substitute-command-keys "\\\ -Use `\\[org-edit-special]' to edit table.el tables")) - (if (or (eq type 'table) - ;; Check if point is at a TBLFM line. - (and (eq type 'table-row) - (= (point) (org-element-property :end context - (save-excursion - (if (org-at-TBLFM-p) - (progn (require 'org-table) - (org-table-calc-current-TBLFM)) - (goto-char (org-element-property :contents-begin context)) - (org-call-with-arg 'org-table-recalculate (or arg t)) - (orgtbl-send-table 'maybe))) - (org-table-maybe-eval-formula) - (cond (arg (call-interactively #'org-table-recalculate)) - ((org-table-maybe-recalculate-line)) - (t (org-table-align)) + (cond + ((and (< (point) (org-element-property :post-affiliated context)) +(org-match-line "[ \t]*#\\+plot:")) + (org-plot/gnuplot)) + ((eq (org-element-property :type context) 'table.el) + (message "%s" (substitute-command-keys "\\\ +Use `\\[org-edit-special]' to edit table.el tables"))) + ((or (eq type 'table) + ;; Check if point is at a TBLFM line. + (and (eq type 'table-row) +(= (point) (org-element-property :end context + (save-excursion + (if (org-at-TBLFM-p) + (progn (require 'org-table) +(org-table-calc-current-TBLFM)) + (goto-char (org-element-property :contents-begin context)) + (org-call-with-arg 'org-table-recalculate (or arg t)) + (orgtbl-send-table 'maybe + (t + (org-table-maybe-eval-formula) + (cond (arg (call-interactively #'org-table-recalculate)) + ((org-table-maybe-recalculate-line)) + (t (org-table-align)) ((or `timestamp (and `planning (guard (org-at-timestamp-p 'lax (org-timestamp-change 0 'day)) ((and `nil (guard (org-at-heading-p))) -- 2.31.1
Re: [PATCH] Have C-c C-c recognise #+plot lines
Since you don't seem to have pushed yet, here's an updated patche that takes into account Nicolas' comments. >From 04270b64315fed399748509f1c09428557b7742d Mon Sep 17 00:00:00 2001 From: TEC Date: Tue, 27 Apr 2021 00:05:37 +0800 Subject: [PATCH] org: Enable plotting with C-c C-c * lisp/org.el (org-ctrl-c-ctrl-c): When at a table, check if the current line starts with "#+plot", and if so call `org-plot/gnuplot'. As I think 4-deep nested if statements are bad for readability, I refactored the nested if statements to use `cond' while I was at it. --- lisp/org.el | 41 +++-- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 3f9c9a284..c4e2e132f 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -17693,24 +17693,29 @@ (defun org-ctrl-c-ctrl-c (&optional arg) ;; send the table if necessary. If the table has ;; a `table.el' type, just give up. At a table row or cell, ;; maybe recalculate line but always align table. - (if (eq (org-element-property :type context) 'table.el) - (message "%s" (substitute-command-keys "\\\ -Use `\\[org-edit-special]' to edit table.el tables")) - (if (or (eq type 'table) - ;; Check if point is at a TBLFM line. - (and (eq type 'table-row) - (= (point) (org-element-property :end context - (save-excursion - (if (org-at-TBLFM-p) - (progn (require 'org-table) - (org-table-calc-current-TBLFM)) - (goto-char (org-element-property :contents-begin context)) - (org-call-with-arg 'org-table-recalculate (or arg t)) - (orgtbl-send-table 'maybe))) - (org-table-maybe-eval-formula) - (cond (arg (call-interactively #'org-table-recalculate)) - ((org-table-maybe-recalculate-line)) - (t (org-table-align)) + (cond + ((and (< (point) (org-element-property :post-affiliated context)) +(org-match-line "[ \t]*#+plot:")) + (org-plot/gnuplot)) + ((eq (org-element-property :type context) 'table.el) + (message "%s" (substitute-command-keys "\\\ +Use `\\[org-edit-special]' to edit table.el tables"))) + ((or (eq type 'table) + ;; Check if point is at a TBLFM line. + (and (eq type 'table-row) +(= (point) (org-element-property :end context + (save-excursion + (if (org-at-TBLFM-p) + (progn (require 'org-table) +(org-table-calc-current-TBLFM)) + (goto-char (org-element-property :contents-begin context)) + (org-call-with-arg 'org-table-recalculate (or arg t)) + (orgtbl-send-table 'maybe + (t + (org-table-maybe-eval-formula) + (cond (arg (call-interactively #'org-table-recalculate)) + ((org-table-maybe-recalculate-line)) + (t (org-table-align)) ((or `timestamp (and `planning (guard (org-at-timestamp-p 'lax (org-timestamp-change 0 'day)) ((and `nil (guard (org-at-heading-p))) -- 2.31.1 Eric S Fraga writes: > On Monday, 26 Apr 2021 at 16:24, Timothy wrote: >> A while ago Eric raised two nice suggestions. (2) has just been >> implemented as Bastien reminded me that I can now just push straight to >> Org for org-plot.el without going through a patch-review process. >> >> This patch resolves (1). > > Timothy, > > I've updated org and applied the patch. Both aspects seem to work just > fine. I haven't done much testing, however, as it's beer time... I'll > update tomorrow should I run into any strange behaviour. > > thank you, > eric
Re: [PATCH] Have C-c C-c recognise #+plot lines
Hello, Timothy writes: > + (cond > + ((string-match-p "#\\+plot" (thing-at-point 'line t)) The whole `org-ctrl-c-ctrl-c' function relies on the parser. It would be nice to use it for this case too. Here a more accurate check would be: (and (< (point) (org-element-property :post-affiliated context)) (org-match-line (rx (zero-or-more (any " " "\t")) "#+plot:"))) Regards, -- Nicolas Goaziou
[PATCH] Have C-c C-c recognise #+plot lines
A while ago Eric raised two nice suggestions. (2) has just been implemented as Bastien reminded me that I can now just push straight to Org for org-plot.el without going through a patch-review process. This patch resolves (1). Eric S Fraga writes: > 1. it would be consistent and useful if "C-c C-c" executed >org-plot/gnuplot when on such a #+PLOT line. > > 2. why does point move to the next line when I do execute the command? >This is somewhat annoying when playing around with the settings. It >would be nice to have point remain where it is. > > Thank you all! -- Timothy >From fccd5f2c66fe8342da2a8eb405240f5247958597 Mon Sep 17 00:00:00 2001 From: TEC Date: Tue, 27 Apr 2021 00:05:37 +0800 Subject: [PATCH] org: Enable plotting with C-c C-c * lisp/org.el (org-ctrl-c-ctrl-c): When at a table, check if the current line starts with "#+plot", and if so call `org-plot/gnuplot'. As I think 4-deep nested if statements are bad for readability, I refactored the nested if statements to use `cond' while I was at it. --- lisp/org.el | 40 ++-- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 3f9c9a284..950509bfd 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -17693,24 +17693,28 @@ (defun org-ctrl-c-ctrl-c (&optional arg) ;; send the table if necessary. If the table has ;; a `table.el' type, just give up. At a table row or cell, ;; maybe recalculate line but always align table. - (if (eq (org-element-property :type context) 'table.el) - (message "%s" (substitute-command-keys "\\\ -Use `\\[org-edit-special]' to edit table.el tables")) - (if (or (eq type 'table) - ;; Check if point is at a TBLFM line. - (and (eq type 'table-row) - (= (point) (org-element-property :end context - (save-excursion - (if (org-at-TBLFM-p) - (progn (require 'org-table) - (org-table-calc-current-TBLFM)) - (goto-char (org-element-property :contents-begin context)) - (org-call-with-arg 'org-table-recalculate (or arg t)) - (orgtbl-send-table 'maybe))) - (org-table-maybe-eval-formula) - (cond (arg (call-interactively #'org-table-recalculate)) - ((org-table-maybe-recalculate-line)) - (t (org-table-align)) + (cond + ((string-match-p "#\\+plot" (thing-at-point 'line t)) + (org-plot/gnuplot)) + ((eq (org-element-property :type context) 'table.el) + (message "%s" (substitute-command-keys "\\\ +Use `\\[org-edit-special]' to edit table.el tables"))) + ((or (eq type 'table) + ;; Check if point is at a TBLFM line. + (and (eq type 'table-row) +(= (point) (org-element-property :end context + (save-excursion + (if (org-at-TBLFM-p) + (progn (require 'org-table) +(org-table-calc-current-TBLFM)) + (goto-char (org-element-property :contents-begin context)) + (org-call-with-arg 'org-table-recalculate (or arg t)) + (orgtbl-send-table 'maybe + (t + (org-table-maybe-eval-formula) + (cond (arg (call-interactively #'org-table-recalculate)) + ((org-table-maybe-recalculate-line)) + (t (org-table-align)) ((or `timestamp (and `planning (guard (org-at-timestamp-p 'lax (org-timestamp-change 0 'day)) ((and `nil (guard (org-at-heading-p))) -- 2.31.1