all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bug: regression with :export both :noweb strip-export [9.2 (9.2-elpa @ /home/adl/.emacs.d/elpa/org-20181230/)]
@ 2019-01-15 22:50 Alexandre Duret-Lutz
  2019-01-16 20:28 ` Alexandre Duret-Lutz
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Duret-Lutz @ 2019-01-15 22:50 UTC (permalink / raw)
  To: emacs-orgmode


Hi!

I have some documentation where I use the noweb syntax to include some
common context in some code fragment I want to discuss.  On export
I'd like to display the code fragments without the common context,
followed by their output. 

Since I updated to org 9.2, the following idiom stopped working.

------------------
#+NAME: context
#+BEGIN_SRC C++ :exports none
#include <iostream>
int u = 0;
#+END_SRC

#+BEGIN_SRC C++ :exports both :noweb strip-export :results verbatim
<<context>>
int main()
{
  std::cout << "bar\n";
  return u;
}
#+END_SRC
------------------

Upon export to html I'm expecting to see the second block of code with
<<context>> stripped away, followed by a block of text containing the
result (bar).  With Org 9.2 I don't get the latter, because the
compilation of this small program fails during the export.  Inspection
of the temporary file passed to the compiler reveals that <<context>>
has been stripped away from the code passed as input to the compiler,
not just from the code displayed in html.

Changing ":exports both" to ":exports results" has the same issue.
Evaluating the code block with C-c C-c works correctly.  So it seems to
me that the meaning of "strip-export" was changed from "strip noweb
markers before exporting source blocks" to "strip noweb markers for
source blocks before exporting or even when evaluating them via
:export".  Was this meant?

One workaround I have found is to evaluate such code fragments via noweb
instead of via :exports.

------------------
#+NAME: context2
#+BEGIN_SRC C++ :exports none
#include <iostream>
int u = 0;
#+END_SRC

#+NAME: bar2
#+BEGIN_SRC C++ :exports code :noweb strip-export :results verbatim
<<context2>>
int main()
{
  std::cout << "bar\n";
  return u;
}
#+END_SRC

#+BEGIN_SRC text :noweb yes
<<bar2()>>
#+END_SRC
------------------

(This is not exactly equivalent from a CSS point of view, but at least
it exports the output.)


------------------------------------------------------------------------

Emacs  : GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.2)
 of 2018-12-18, modified by Debian
Package: Org mode version 9.2 (9.2-elpa @ /home/adl/.emacs.d/elpa/org-20181230/)

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-latex-listings 'minted
 org-babel-after-execute-hook '((lambda nil (org-redisplay-inline-images)))
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-protocol-default-template-key "w"
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function
 org-src-tab-acts-natively t
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-special-ctrl-a/e t
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 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-startup-with-inline-images t
 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-file-apps '(("\\.pdf::\\([[:digit:]]+\\)\\'" . org-pdfview-open) ("\\.pdf\\'" . org-pdfview-open)
                 (auto-mode . emacs) ("\\.mm\\'" . default) ("\\.x?html?\\'" . default)
                 ("\\.pdf\\'" . default))
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
 org-babel-load-languages '((shell . t) (python . t) (plantuml . t) (dot . t) (R . t) (C . t))
 org-babel-python-command "/usr/bin/python3"
 org-src-lang-modes '(("arduino" . arduino) ("redis" . redis) ("php" . php) ("C" . c) ("C++" . c++)
                      ("asymptote" . asy) ("bash" . sh) ("beamer" . latex) ("calc" . fundamental)
                      ("cpp" . c++) ("ditaa" . artist) ("dot" . fundamental) ("elisp" . emacs-lisp)
                      ("ocaml" . tuareg) ("screen" . shell-script) ("shell" . sh) ("sqlite" . sql))
 org-occur-hook '(org-first-headline-recenter)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines
                  org-optimize-window-after-visibility-change)
 org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate)
 org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
 org-babel-tangle-lang-exts '(("D" . "d") ("C++" . "cpp") ("python" . "py") ("emacs-lisp" . "el")
                              ("elisp" . "el"))
 org-return-follows-link t
 org-confirm-shell-link-function 'yes-or-no-p
 org-link-parameters '(("id" :follow org-id-open) ("eww" :follow eww :store org-eww-store-link)
                       ("rmail" :follow org-rmail-open :store org-rmail-store-link)
                       ("mhe" :follow org-mhe-open :store org-mhe-store-link)
                       ("irc" :follow org-irc-visit :store org-irc-store-link :export org-irc-export)
                       ("info" :follow org-info-open :export org-info-export :store
                        org-info-store-link)
                       ("gnus" :follow org-gnus-open :store org-gnus-store-link)
                       ("docview" :follow org-docview-open :export org-docview-export :store
                        org-docview-store-link)
                       ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link)
                       ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete
                        org-bbdb-complete-link :store org-bbdb-store-link)
                       ("w3m" :store org-w3m-store-link)
                       ("mu4e" :follow org-mu4e-open :store org-mu4e-store-link)
                       ("pdfview" :follow org-pdfview-open :complete org-pdfview-complete-link :store
                        org-pdfview-store-link)
                       ("file+sys") ("file+emacs")
                       ("elfeed" :follow elfeed-link-open :store elfeed-link-store-link)
                       ("doi" :follow org--open-doi-link) ("elisp" :follow org--open-elisp-link)
                       ("file" :complete org-file-complete-link)
                       ("ftp" :follow (lambda (path) (browse-url (concat "ftp:" path))))
                       ("help" :follow org--open-help-link)
                       ("http" :follow (lambda (path) (browse-url (concat "http:" path))))
                       ("https" :follow (lambda (path) (browse-url (concat "https:" path))))
                       ("mailto" :follow (lambda (path) (browse-url (concat "mailto:" path))))
                       ("news" :follow (lambda (path) (browse-url (concat "news:" path))))
                       ("shell" :follow org--open-shell-link))
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-capture-templates '(("t" "TODO" entry (file "~/org/inbox.org") "* TODO %?\n%U\n%a\n" :clock-in t
                          :clock-resume t)
                         ("r" "Respond" entry (file "~/org/inbox.org")
                          "* NEXT Respond to %:from on %:subject\nSCHEDULED: %t\n%U\n%a\n" :clock-in t
                          :clock-resume t :immediate-finish t)
                         ("n" "Note" entry (file "~/org/inbox.org") "* %? :NOTE:\n%U\n%a\n" :clock-in
                          t :clock-resume t)
                         ("j" "Journal" entry (file+olp+datetree "~/org/diary.org") "* %?\n%U\n"
                          :clock-in t :clock-resume t)
                         ("w" "org-protocol" entry (file "~/org/inbox.org")
                          "* TODO Review %a\n%U\n%:initial\n" :immediate-finish t)
                         ("m" "Meeting" entry (file "~/org/diary.org")
                          "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t)
                         ("p" "Phone call" entry (file "~/org/diary.org") "* PHONE %? :PHONE:\n%U"
                          :clock-in t :clock-resume t)
                         ("h" "Habit" entry (file "~/org/inbox.org")
                          "* NEXT %?\n%U\n%a\nSCHEDULED: %(format-time-string \"%<<%Y-%m-%d %a .+1d/3d>>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n")
                         )
 org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-html-format-headline-function 'org-html-format-headline-default-function
 org-confirm-babel-evaluate nil
 org-directory "~/org/"
 org-use-speed-commands t
 org-default-notes-file "~/org/inbox.org"
 )

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-19 16:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-15 22:50 Bug: regression with :export both :noweb strip-export [9.2 (9.2-elpa @ /home/adl/.emacs.d/elpa/org-20181230/)] Alexandre Duret-Lutz
2019-01-16 20:28 ` Alexandre Duret-Lutz
2019-01-19 16:29   ` Nicolas Goaziou

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.