Re: [O] Several headers on a table
Op zo 20 okt. 2019 om 20:42 schreef briangpowell . : > * Many years ago I asked that such features be programmed into > OrgMode--for Multivariate Statistics output--they flatly refused and said > there would be no plans to do so > I did not except it to be the case, but it does not hurt to check. Thanks. -- Cecil Westerhof
[O] Bug: Problems with ob-scheme in geiser-eval--retort-output [9.2.6 (9.2.6-4-ge30905-elpa @ /home/lockywolf/.emacs.d/elpa/org-20191021/)]
Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See https://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org mailing list. Hello, everyone. Can we replace the (set) on line 177 of ob-scheme.el with the following form: (setq result (if output (let ((g-r-o (geiser-eval--retort-output ret))) (if g-r-o g-r-o "Geiser-eval--retort-output returned nil.\nThe interpreter produced no output\nor there is a bug in geiser (likely!)")) (geiser-eval--retort-result-str ret "") I am not super sure about what's going on there, but I think that output can never be an empty list, because in the worst case it is an empty string. (But I wouldn't vouch for this.) Sorry for not sending a diff. Cheers, Lockywolf Emacs : GNU Emacs 26.3 (build 1, x86_64-slackware-linux-gnu, GTK+ Version 3.24.10) of 2019-08-30 Package: Org mode version 9.2.6 (9.2.6-4-ge30905-elpa @ /home/lockywolf/.emacs.d/elpa/org-20191021/) current state: == (setq org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-after-todo-state-change-hook '(org-clock-out-if-current) org-babel-after-execute-hook '((lambda nil (if org-inline-image-overlays (progn (org-redisplay-inline-images))) ) ) org-metadown-hook '(org-babel-pop-to-session-maybe) org-clock-out-hook '(org-clock-remove-empty-clock-drawer) org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function org-pretty-entities t org-odt-format-headline-function 'org-odt-format-headline-default-function org-agenda-files '("~/DevLinux/chibi-sicp/index.org" "~/Personal_Planner/Planner.org") org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default org-modules '(org-habits org-w3m org-bbdb org-bibtex org-docview org-gnus org-info org-irc org-mhe org-rmail) org-plantuml-jar-path "/usr/local/bin/plantuml.jar" org-export-creator-string "Emacs 26.3 (Org mode 9.1.9)" org-mode-hook '(org-eldoc-load turn-on-org-cdlatex (lambda nil (imenu-add-to-menubar "Imenu")) #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-show-block-all append local] 5] #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes) org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"] org-archive-hook '(org-attach-archive-delete-maybe) org-confirm-elisp-link-function 'yes-or-no-p org-agenda-before-write-hook '(org-agenda-add-entry-text) org-metaup-hook '(org-babel-load-in-session-maybe) org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn ENTRY)"] org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"] org-babel-pre-tangle-hook '(save-buffer) org-latex-compiler "lualatex" org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-babel-load-languages '((plantuml . t) (C . t) (scheme . t) (latex . t)) org-log-done 'time org-startup-align-all-tables t org-html-creator-string "https://www.gnu.org/software/emacs/\;>Emacs 26.3 (https://orgmode.org\;>Org mode 9.1.9)" org-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS WIDTH)"] org-src-lang-modes '(("redis" . redis) ("php" . php) ("arduino" . arduino) ("ocaml" . tuareg) ("elisp" . emacs-lisp) ("ditaa" . artist) ("asymptote" . asy) ("dot" . fundamental) ("sqlite" . sql) ("calc" . fundamental) ("C" . c) ("cpp" . c++) ("C++" . c++) ("screen" . shell-script) ("shell" . sh) ("bash" . sh)) org-catch-invisible-edits t org-occur-hook '(org-first-headline-recenter) org-edit-src-auto-save-idle-delay 15 org-agenda-include-diary t org-structure-template-alist '(("E" "#+begin_src elisp :exports both :results output\n?\n#+end_src") ("SV" "#+begin_src scheme :exports both :results value\n?\n#+end_src") ("SO" "#+begin_src scheme :exports both :results output\n?\n#+end_src") ("p" "#+begin_src plantuml :exports both :file ? \n#+end_src ") ("s" "#+BEGIN_SRC ?\n\n#+END_SRC") ("e" "#+BEGIN_EXAMPLE\n?\n#+END_EXAMPLE")
[O] [PATCH] COMMENT and noweb-ref
Sorry. I messed up the previous mail. Please ignore it. I wrote: > org-babel-tangle on > > * A > > #+BEGIN_SRC elisp :tangle yes :noweb yes > ;; A > <> > #+END_SRC > > * COMMENT B > > #+BEGIN_SRC elisp :noweb-ref B > ;; B > #+END_SRC > > * COMMENT C > > #+BEGIN_SRC elisp :tangle yes > ;; C > #+END_SRC > > produces a file with A and B in it. Expected: Just A. Changing > > #+BEGIN_SRC elisp :noweb-ref B > ;; B > #+END_SRC > > to > > # #+BEGIN_SRC elisp :noweb-ref B > # ;; B > # #+END_SRC > > does yield the expected result. Attached is a patch that fixes the problem. A second patch is attached that contains tests about this and related stuff. It is an updated version of an unapplied patch that I sent to this list earlier this month (https://lists.gnu.org/archive/html/emacs-orgmode/2019-10/msg00013.html). Best wishes Sebastian >From ddf0b6d89d30766158311c047d6de10091cb0377 Mon Sep 17 00:00:00 2001 From: Sebastian Miele Date: Sun, 20 Oct 2019 21:34:02 + Subject: [PATCH 1/2] ob-core: Respect COMMENTed headlines when expanding noweb references * lisp/ob-core.el (org-babel-expand-noweb-references): Add calls to org-in-commented-heading-p where appropriate. --- lisp/ob-core.el | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 572f97919..b99545ab5 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -2780,7 +2780,8 @@ block but are passed literally to the \"example-block\"." (concat (funcall c-wrap (car cs)) "\n" b "\n" (funcall c-wrap (cadr cs) - (if (re-search-forward name-regexp nil t) + (if (and (re-search-forward name-regexp nil t) + (not (org-in-commented-heading-p))) ;; Found a source block named SOURCE-NAME. ;; Assume it is unique; do not look after ;; `:noweb-ref' header argument. @@ -2791,14 +2792,16 @@ block but are passed literally to the \"example-block\"." ;; those with a matching Noweb reference. (let ((expansion nil)) (org-babel-map-src-blocks nil - (let* ((info (org-babel-get-src-block-info 'light)) - (parameters (nth 2 info))) - (when (equal source-name - (cdr (assq :noweb-ref parameters))) - (push (funcall expand-body info) expansion) - (push (or (cdr (assq :noweb-sep parameters)) - "\n") - expansion + (unless (org-in-commented-heading-p) + (let* ((info + (org-babel-get-src-block-info 'light)) +(parameters (nth 2 info))) + (when (equal source-name +(cdr (assq :noweb-ref parameters))) + (push (funcall expand-body info) expansion) + (push (or (cdr (assq :noweb-sep parameters)) + "\n") + expansion) (when expansion (mapconcat #'identity (nreverse (cdr expansion)) -- 2.23.0 >From 66c7904298a33900e389acb184fbe7511960b34d Mon Sep 17 00:00:00 2001 From: Sebastian Miele Date: Sun, 20 Oct 2019 21:38:03 + Subject: [PATCH 2/2] Add tests about omission of commented src blocks when e.g. tangling * testing/lisp/test-ob.el (test-ob/noweb-expansion): Add clause to test. * testing/lisp/test-ob-tangle.el (ob-tangle/commented-src-blocks): Add test. --- testing/lisp/test-ob-tangle.el | 84 ++ testing/lisp/test-ob.el| 24 ++ 2 files changed, 108 insertions(+) diff --git a/testing/lisp/test-ob-tangle.el b/testing/lisp/test-ob-tangle.el index 47c31dff5..301f7aff7 100644 --- a/testing/lisp/test-ob-tangle.el +++ b/testing/lisp/test-ob-tangle.el @@ -296,6 +296,90 @@ another block (org-split-string (buffer-string (delete-file file)) +(ert-deftest ob-tangle/commented-src-blocks () + "Test omission of commented src blocks." + (should + (equal '("A") + (let ((file (make-temp-file "org-tangle-"))) + (unwind-protect + (progn + (org-test-with-temp-text-in-file + (format "#+property: header-args :tangle %S +* A + + #+begin_src emacs-lisp + A +
[O] [PATCH] COMMENT and noweb-ref
>From ddf0b6d89d30766158311c047d6de10091cb0377 Mon Sep 17 00:00:00 2001 From: Sebastian Miele Date: Sun, 20 Oct 2019 21:34:02 + Subject: [PATCH 1/2] ob-core: Respect COMMENTed headlines when expanding noweb references * lisp/ob-core.el (org-babel-expand-noweb-references): Add calls to org-in-commented-heading-p where appropriate. --- lisp/ob-core.el | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 572f97919..b99545ab5 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -2780,7 +2780,8 @@ block but are passed literally to the \"example-block\"." (concat (funcall c-wrap (car cs)) "\n" b "\n" (funcall c-wrap (cadr cs) - (if (re-search-forward name-regexp nil t) + (if (and (re-search-forward name-regexp nil t) + (not (org-in-commented-heading-p))) ;; Found a source block named SOURCE-NAME. ;; Assume it is unique; do not look after ;; `:noweb-ref' header argument. @@ -2791,14 +2792,16 @@ block but are passed literally to the \"example-block\"." ;; those with a matching Noweb reference. (let ((expansion nil)) (org-babel-map-src-blocks nil - (let* ((info (org-babel-get-src-block-info 'light)) - (parameters (nth 2 info))) - (when (equal source-name - (cdr (assq :noweb-ref parameters))) - (push (funcall expand-body info) expansion) - (push (or (cdr (assq :noweb-sep parameters)) - "\n") - expansion + (unless (org-in-commented-heading-p) + (let* ((info + (org-babel-get-src-block-info 'light)) +(parameters (nth 2 info))) + (when (equal source-name +(cdr (assq :noweb-ref parameters))) + (push (funcall expand-body info) expansion) + (push (or (cdr (assq :noweb-sep parameters)) + "\n") + expansion) (when expansion (mapconcat #'identity (nreverse (cdr expansion)) -- 2.23.0 >From 66c7904298a33900e389acb184fbe7511960b34d Mon Sep 17 00:00:00 2001 From: Sebastian Miele Date: Sun, 20 Oct 2019 21:38:03 + Subject: [PATCH 2/2] Add tests about omission of commented src blocks when e.g. tangling * testing/lisp/test-ob.el (test-ob/noweb-expansion): Add clause to test. * testing/lisp/test-ob-tangle.el (ob-tangle/commented-src-blocks): Add test. --- testing/lisp/test-ob-tangle.el | 84 ++ testing/lisp/test-ob.el| 24 ++ 2 files changed, 108 insertions(+) diff --git a/testing/lisp/test-ob-tangle.el b/testing/lisp/test-ob-tangle.el index 47c31dff5..301f7aff7 100644 --- a/testing/lisp/test-ob-tangle.el +++ b/testing/lisp/test-ob-tangle.el @@ -296,6 +296,90 @@ another block (org-split-string (buffer-string (delete-file file)) +(ert-deftest ob-tangle/commented-src-blocks () + "Test omission of commented src blocks." + (should + (equal '("A") + (let ((file (make-temp-file "org-tangle-"))) + (unwind-protect + (progn + (org-test-with-temp-text-in-file + (format "#+property: header-args :tangle %S +* A + + #+begin_src emacs-lisp + A + #+end_src + +* COMMENT B + + #+begin_src emacs-lisp + B + #+end_src + +* C + + # #+begin_src emacs-lisp + # C + # #+end_src + +* D + + #+begin_comment + #+begin_src emacs-lisp + D + #+end_src + #+end_comment" + file) + (org-babel-tangle)) + (with-temp-buffer + (insert-file-contents file) + (org-split-string (buffer-string + (delete-file file) + (should + (equal '("A") + (let ((file (make-temp-file "org-tangle-"))) + (unwind-protect + (progn + (org-test-with-temp-text-in-file + (format "#+property: header-args :tangle %S +* A + + #+begin_src elisp :noweb yes + A + <> + <> + <> + #+end_src + +* COMMENT B + + #+begin_src elisp :noweb-ref B + B + #+end_src + +* C + + # #+begin_src elisp :noweb-ref C +
[O] org-fast-todo-selection window behaviour?
I've recently noticed a slightly frustrating behavour on the part of org-todo that I think is new and maybe was introduced in mid-August with f1c030bed54737319aeb1d592e3340d6a48cea3a In a split frame,calling org-todo with org-use-fast-todo-selection enabled, ~C-c C-t~ now calls ~delete-other-windows~ before popping up the org-todo keywords window. Is this necessary? I find this behaviour visually confusing and distracting, and a slowdown to my workflow. Would it make sense to introduce some kind of defcustom for this? For now I'm just commenting out line 10614 of org.el, but if others want to be able to customize the behaviour I will submit a patch. Maybe there's a reason delete-other-window is necessary, but i don't see it in the commit message nor immediately in the other parts of this otherwise very well-documented commit Thanks!
Re: [O] Several headers on a table
* Many years ago I asked that such features be programmed into OrgMode--for Multivariate Statistics output--they flatly refused and said there would be no plans to do so ** In retrospect; and, in the future, after much thought about it: I very much agree with and respect the main of the OrgMode developers & there decisions in this case *** Because you can always simply type in such parts of the "exterior table" and represent the fact that your table is Multivariate Statistics output--output from statistical software like SAS {which I've made such tables from--believe it was with the SAS Tabulate subsystem software} Also, OrgMode leverages the abilities of Donald Knuth's Tex/LaTeX typesetting system--which can output beautiful Multivariate Statistics in the format you seek OrgMode leverages Emacs Calc for the guts of the engine that operates on living and changing tables--OrgMode tables OrgMode operates on tables AFTER their initially generated--and in that way your tables enable the use of ANY programming language { through OrgMode's BabelMode etc.} to become a Functional Programming Language that operates on whatever is inside the main tables--and you define the functions--which are Emacs Calc functions that make up the tables {and this opens up your abilities to calculate on-the-fly tables and functions operating within those functions to a staggering degree--Emacs Calc is a very powerful software subsystem in and of itself} ** But back to your main question; and, away from the philosophy behind OrgMode: Suggest you do this: |--+-+-| | | Recording Time | | |--+-+-| | Battery pack | Continuous5 | Typical 5 | | | | | |--+-+-| |+-+-+-+-+-+-+-| | Image quality | HD | MP4 | STD | HD | MP4 | STD | XYZ | |+-+-+-+-+-+-+-| | NP-FV30 (supplied) | 90 | 100 | 95 | 45 | 50 | 45 | 555 | | NP-FV50| 170 | 190 | 180 | 85 | 95 | 90 | 555 | | NP-FV70| 355 | 395 | 375 | 175 | 195 | 185 | 555 | | NP-FV100 | 710 | 785 | 745 | 355 | 390 | 370 | 555 | |+-+-+-+-+-+-+-| ** Then just hit "Tab" inside each of the sub-pieces (to make it pretty again) & delete the 5's and the 2 lines separating the table pieces, voila, you have Multivariate Output tables that look very pretty, like SAS or TeX output and still have all of the methods accrued to you through OrgMode and the EmacsCalc subsystem to operate on and update the main guts of the table and with OrgMode and BabelMode you can do it with any language and/or extend it to accommodate your own or a new language On Sun, Oct 20, 2019 at 8:18 AM Cecil Westerhof wrote: > I have the following table: > |+-+-+-+-+-+-| > | Image quality | HD | MP4 | STD | HD | MP4 | STD | > |+-+-+-+-+-+-| > | NP-FV30 (supplied) | 90 | 100 | 95 | 45 | 50 | 45 | > | NP-FV50| 170 | 190 | 180 | 85 | 95 | 90 | > | NP-FV70| 355 | 395 | 375 | 175 | 195 | 185 | > | NP-FV100 | 710 | 785 | 745 | 355 | 390 | 370 | > |+-+-+-+-+-+-| > > But I like to put the following headers above it: > |+---| > || Recording Time| > |+---| > |+-+-| > | Battery pack | Continuous | Typical | > |+-+-| > > So I would get: > |+---| > || Recording Time| > |+---| > |+-+-| > | Battery pack | Continuous | Typical | > |+-+-| > |+-+-+-+-+-+-| > | Image quality | HD | MP4 | STD | HD | MP4 | STD | > |+-+-+-+-+-+-| > | NP-FV30 (supplied) | 90 | 100 | 95 | 45 | 50 | 45 | > | NP-FV50| 170 | 190 | 180 | 85 | 95 | 90 | > | NP-FV70| 355 | 395 | 375 | 175 | 195 | 185 | > | NP-FV100 | 710 | 785 | 745 | 355 | 390 | 370 | > |+-+-+-+-+-+-| > > Would that be possible? > > -- > Cecil Westerhof >
[O] Can different types of graphic be created at the same moment
I would like to generate different types of graphics files at the same moment. I tried: #+BEGIN_SRC plantuml :file Graphics/rabbitMQ.eps :file Graphics/rabbitMQ.jpg :noexport But that does not work: it only generates the eps file. Is it possible at all? It would even better when I only have to define the extension. I would normally call all the same except the extension? -- Cecil Westerhof
[O] Can I get a horizontal line in a component with plantuml
Because of the way plantuml works (as far as I know), I have the following code: @startuml [Producer 1\nProducer 2\nProducer ...\nProducer n] as Producers cloud { [Internet] as Internet1 } node RabbitMQ #LightSteelBlue { [Exchange] [Queue 1\nQueue 2\nQueue ...\nQueue n] as Queues } cloud { [Internet] as Internet2 } [Consumer 1\nConsumer 2\nConsumer ...\nConsumer n] as Consumers [Producers] -> [Internet1] : Publish [Internet1] -> [Exchange] : Publish [Exchange] -> [Queues] : Route [Queues]-> [Internet2] : Consume [Internet2] -> [Consumers] : Consume @enduml Which gives the attached graphic. The problem is that there are four producers, queues and consumers. Is it possible to put three lines in the components to signify that? -- Cecil Westerhof
[O] Several headers on a table
I have the following table: |+-+-+-+-+-+-| | Image quality | HD | MP4 | STD | HD | MP4 | STD | |+-+-+-+-+-+-| | NP-FV30 (supplied) | 90 | 100 | 95 | 45 | 50 | 45 | | NP-FV50| 170 | 190 | 180 | 85 | 95 | 90 | | NP-FV70| 355 | 395 | 375 | 175 | 195 | 185 | | NP-FV100 | 710 | 785 | 745 | 355 | 390 | 370 | |+-+-+-+-+-+-| But I like to put the following headers above it: |+---| || Recording Time| |+---| |+-+-| | Battery pack | Continuous | Typical | |+-+-| So I would get: |+---| || Recording Time| |+---| |+-+-| | Battery pack | Continuous | Typical | |+-+-| |+-+-+-+-+-+-| | Image quality | HD | MP4 | STD | HD | MP4 | STD | |+-+-+-+-+-+-| | NP-FV30 (supplied) | 90 | 100 | 95 | 45 | 50 | 45 | | NP-FV50| 170 | 190 | 180 | 85 | 95 | 90 | | NP-FV70| 355 | 395 | 375 | 175 | 195 | 185 | | NP-FV100 | 710 | 785 | 745 | 355 | 390 | 370 | |+-+-+-+-+-+-| Would that be possible? -- Cecil Westerhof
[O] cycling entries is inconsistent?
i have an outdated version of org, so this might have been fixed, but it is an old bug. cycling a trivial entry with text in it seems to have 2 states. cycling the entry with a list in it seems to have 3 states. i expect both to have 2 states, unless a variable is set to cycle lists or it is a nontrivial subtree.