From 22479987587a97f09edd9bae25d5c952e9868854 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sun, 18 Dec 2022 14:04:57 +0300 Subject: [PATCH 1/2] ob-core: Fix :results list when result is a table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/ob-core.el (org-babel-insert-result): Do not treat table lines in RESULT verbatim. * testing/lisp/test-ob-shell.el (ob-shell/results-list): Add new test. Reported-by: Rudolf Adamkovič Link: https://orgmode.org/list/m2tu1v8gj8.fsf@me.com --- lisp/ob-core.el | 6 +++++- testing/lisp/test-ob-shell.el | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index f69538f78..9d72cf870 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -2464,7 +2464,11 @@ INFO may provide the values of these header arguments (in the (cons 'unordered (mapcar (lambda (e) - (list (if (stringp e) e (format "%S" e)))) + (cond + ((stringp e) (list e)) + ((listp e) + (mapcar (lambda (x) (format "%S" x)) e)) + (t (list (format "%S" e))))) (if (listp result) result (split-string result "\n" t)))) '(:splicep nil :istart "- " :iend "\n"))) diff --git a/testing/lisp/test-ob-shell.el b/testing/lisp/test-ob-shell.el index 7aa45cc8a..b0d9beff4 100644 --- a/testing/lisp/test-ob-shell.el +++ b/testing/lisp/test-ob-shell.el @@ -170,6 +170,20 @@ ob-comint.el, which was not previously tested." "#+BEGIN_SRC sh :results table\necho 'I \"want\" it all'\n#+END_SRC" (org-babel-execute-src-block))))) +(ert-deftest ob-shell/results-list () + "Test :results list." + (org-test-with-temp-text + "#+BEGIN_SRC sh :results list\necho 1\necho 2\necho 3\n#+END_SRC" + (should + (equal '((1) (2) (3)) + (org-babel-execute-src-block))) + (search-forward "#+results") + (beginning-of-line 2) + (should + (equal + "- 1\n- 2\n- 3\n" + (buffer-substring-no-properties (point) (point-max)))))) + ;;; Standard output (ert-deftest ob-shell/standard-output-after-success () From 12e10eb0ddf5a38ae6aa9d5bfe68f2ec03cda858 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sun, 18 Dec 2022 17:41:52 +0300 Subject: [PATCH 2/2] * doc/org-guide.org: Fix typos (Visibility Cycling): Fix macro. (Multi-state Workflow): Fix emphasis. (Timestamps): (Clocking Work Time): (The Agenda Dispatcher): Fix heading link. Reported-by: Cauim de Souza Lima Link: https://orgmode.org/list/CAHFpVgHiZtBQ9U5CzJ1P1jGQVJhTGiP9uVdi9ttcP535urZkUg@mail.gmail.com --- doc/org-guide.org | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/org-guide.org b/doc/org-guide.org index e23b2efa7..f53555f65 100644 --- a/doc/org-guide.org +++ b/doc/org-guide.org @@ -141,7 +141,7 @@ See [[*Miscellaneous]] for a setup to realize this. Outlines make it possible to hide parts of the text in the buffer. Org uses just two commands, bound to {{{kbd(TAB)}}} and -{{{kbd{S-TAB)}}} to change the visibility in the buffer. +{{{kbd(S-TAB)}}} to change the visibility in the buffer. #+attr_texinfo: :sep , - {{{kbd(TAB)}}} :: @@ -667,7 +667,7 @@ of the option ~org-todo-state-tags-triggers~ for details. :DESCRIPTION: More than just on/off. :END: -You can use TODO keywords to indicate @emph{sequential} working progress +You can use TODO keywords to indicate /sequential/ working progress states: #+begin_src emacs-lisp @@ -1093,7 +1093,7 @@ a range of times---in a special format, either =<2003-09-16 Tue>= or =<2003-09-16 Tue 09:39>= or =<2003-09-16 Tue 12:00-12:30>=. A timestamp can appear anywhere in the headline or body of an Org tree entry. Its presence causes entries to be shown on specific dates in -the agenda (see [[*The Weekly/daily Agenda]]). We distinguish: +the agenda (see [[*The Weekly/Daily Agenda]]). We distinguish: - Plain timestamp; Event; Appointment :: @@ -1294,7 +1294,7 @@ a project. a {{{kbd(C-u)}}} prefix argument, select the target task from a list of recently clocked tasks. -The {{{kbd(l)}}} key may be used in the agenda (see [[*The Weekly/daily +The {{{kbd(l)}}} key may be used in the agenda (see [[*The Weekly/Daily Agenda]]) to show which tasks have been worked on or closed during a day. @@ -1527,7 +1527,7 @@ commands: #+attr_texinfo: :sep , - {{{kbd(a)}}} :: - Create the calendar-like agenda (see [[*The Weekly/daily Agenda]]). + Create the calendar-like agenda (see [[*The Weekly/Daily Agenda]]). - {{{kbd(t)}}}, {{{kbd(T)}}} ::