From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id cAzrKbgrz142YwAA0tVLHw (envelope-from ) for ; Thu, 28 May 2020 03:10:48 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id WLS+Jbgrz15rFgAA1q6Kng (envelope-from ) for ; Thu, 28 May 2020 03:10:48 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7CD8E9400B1 for ; Thu, 28 May 2020 03:10:47 +0000 (UTC) Received: from localhost ([::1]:56162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1je8wO-0005Wc-OZ for larch@yhetil.org; Wed, 27 May 2020 23:10:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1je8w3-0005WV-3M for emacs-orgmode@gnu.org; Wed, 27 May 2020 23:10:23 -0400 Received: from mail-ej1-x642.google.com ([2a00:1450:4864:20::642]:41518) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1je8w1-0006A7-Bf for emacs-orgmode@gnu.org; Wed, 27 May 2020 23:10:22 -0400 Received: by mail-ej1-x642.google.com with SMTP id x1so30412023ejd.8 for ; Wed, 27 May 2020 20:10:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=a6F+kjywGUCwN1GxkyB83M92mpwqsQzZKEhVmL0ppuQ=; b=P9JPpEMyBnEXTjD5+tJ6DNTdMDPUZeZhog2zczyonPqpvqq76GCT3uTBAx9wk8k4Tx FM3exLXpIceleaMAuyXm99+ZHSTObMDdlV1zalCXJfzxvQ59G90eHwchHA1FpIOloOQP WsZmWyGaoUWTC5oon4UGBegidHrc7E44WLtmuckjC8Q9r/fTLhZ+0WxdDRtMWHABBEvz kfkIDK+XxUi8Kwt5Q/W/LCuUUYKbm350fyHf0Wm4oz+j4UnsBBSskX+sDtzBiN95npje duEME7QwthtJlrYIuQ4dMVc0qBsk5/hxr/YCxy6KN/SuMs/2SNVVmmTZb3ULH6/h80sH FzeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=a6F+kjywGUCwN1GxkyB83M92mpwqsQzZKEhVmL0ppuQ=; b=UNTApblYf9V11dFq6qpNpMnNBEMx53q/wsxyxKdXPWNDWsBWmblgf679iFSoM3BKYb wFY9j8E+FTs1fRhoybLfv9Zrul9cWQa/uYYtIiAAxo5082i83YLn0FpM+6uXR5PsXuuh ndJayzNhi0Ms6MuZEkW+mamAkcRYUFLqHxV72y7ARdeiIbpo/gFXYRY/2XXb7eGo1uGZ eb5YJevINmdfq7pyhXmgOTkXHL6FKlSzQdtEbhYhbZ6lnFiyuANGmuE97QZU5fhcoGGj rgFM2Wi0st+3fizIAtXJWokljD4MSFKzcT4X43IS1vbqbAWWqJNh86Hz4tYha3+NfULF 9ovQ== X-Gm-Message-State: AOAM530ZV+iL+EtLvOwdFp74kzIfw6n8AuxkECnY2Yl7iZd6JdahxmWs em13oc+zwYT+z2Qu0x6vpoeQ5awrHEQ= X-Google-Smtp-Source: ABdhPJwoWj5a5trc7iXMT9KELFved2MHszwuO4qy2Og0P/VBzKFePl6S+42pbUZidfUUwv6Ko/C5Yw== X-Received: by 2002:a17:906:b57:: with SMTP id v23mr1102671ejg.481.1590635418953; Wed, 27 May 2020 20:10:18 -0700 (PDT) Received: from delllaptop.lockywolf.net ([95.85.18.95]) by smtp.gmail.com with ESMTPSA id f8sm2239623eds.28.2020.05.27.20.10.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 20:10:18 -0700 (PDT) From: Vladimir Nikishkin To: emacs-orgmode@gnu.org Subject: Bug: Subtle bug with calling "noweb" blocks with already computed :results output code and :cache yes [9.3.4 (9.3.4-5-ga0f3bb-elpa @ /home/lockywolf/.emacs.d/elpa/org-20200210/)] Date: Thu, 28 May 2020 11:09:53 +0800 Message-ID: <87o8q8iwla.fsf@delllaptop.lockywolf.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::642; envelope-from=lockywolf@gmail.com; helo=mail-ej1-x642.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, IP_LINK_PLUS=0.012, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=P9JPpEMy; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.21 X-TUID: DRGDsnab2eAq 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. ------------------------------------------------------------------------ This bug is a bit hard to formulate. Have a look at the following org-file. Even though it's big, it's almost an MWE: ``` # -*- mode: org; -*- * Test :PROPERTIES: :header-args: :cache yes :noweb yes :END: #+name: empty #+begin_quote #+end_quote #+name: runner #+header: :stdin empty :exports code #+begin_src shell :results output code :exports both printf "%s\n%s" "Test string" "Test string2" #+end_src #+RESULTS[16ba04c7554c3436156f295ef43c8a0d2f2d9270]: runner #+begin_src shell Test string Test string2 #+end_src #+name: c-test-preserving-standard #+header: :stdin empty :exports code #+begin_src shell :results output code <> #+end_src #+RESULTS[16ba04c7554c3436156f295ef43c8a0d2f2d9270]: c-test-preserving-standard #+begin_src shell Test string Test string2 #+end_src #+name: c-test-preserving-unoptimized #+header: :stdin empty :exports code #+begin_src shell :results output <> #+end_src #+RESULTS[f9468f703a0c54b8601296d5332d51743d70fd05]: c-test-preserving-unoptimized : Test string : Test string2 #+header: :stdin empty #+begin_src shell :results output code :wrap src patch :exports both output1=$( cat <<'EOF' <> EOF ) output2=$( cat <<'EOF' <> EOF ) diff -w -s -y <(echo "$output1") <(echo "$output2") | nl -w2 - #+end_src #+RESULTS[2b14ae1ffc337f1857d2a3a75e890c3c3cb03d87]: #+begin_src patch 1 nil | Test string 2 > Test string2 #+end_src ``` You can see that the patch gives two different results for an identical body. The difference really is in: ":results output code" This is a bit hard to reproduce, because it also seems to depend on whether the block was cached, but I find it hard to formulate how exactly. In any case, the desired behaviour for me seems to be: take both results from cache, if they are available, and run the comparison block. If the cache is outdated, run each outdated block, update the cache, and feed the cache results into the comparison block. At the moment org doesn't seem to be updating the cache. I can imagine thought that if the block output is considered "code", someone may feel inclined to run the code instead of feeding it verbatim. Emacs : GNU Emacs 26.3 (build 1, x86_64-slackware-linux-gnu, GTK+ Version 3.24.12) of 2019-11-26 Package: Org mode version 9.3.4 (9.3.4-5-ga0f3bb-elpa @ /home/lockywolf/.emacs.d/elpa/org-20200210/) current state: ============== (setq org-src-mode-hook '((lambda nil (modify-syntax-entry 60 ".") (modify-syntax-entry 62 ".") (setq geiser-autodoc--inhibit t)) org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-latex-listings t org-link-shell-confirm-function 'yes-or-no-p 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-export-with-sub-superscripts '{} 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-link-descriptive nil org-latex-pdf-process '("latexmk -lualatex -outdir=%o -f %f") org-agenda-files '("~/Personal_Planner/Planner.org" "~/Personal_Planner/lockywolf_net.org" "~/Personal_Planner/cyberpunk_smarthome.org" "~/Personal_Planner/notes.org" "~/Personal_Planner/2020-04-28-hotkeys-to-remember.txt.org" "~/DevLinux/chibi-sicp/index.org") org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default org-modules '(org-habit ol-w3m ol-bbdb ol-bibtex ol-docview ol-gnus ol-info ol-irc ol-mhe ol-rmail ol-eww) org-plantuml-jar-path "/usr/local/bin/plantuml.jar" org-mode-hook '(#[0 "\301\211\207" [imenu-create-index-function org-imenu-get-tree] 2] turn-on-org-cdlatex org-tempo-setup (lambda nil (add-to-list (quote org-structure-template-alist) (quote ("p" . "src plantuml :noweb no :exports both :file "))) (add-to-list (quote org-structure-template-alist) (quote ("SO" . "src scheme :exports both :results output"))) (add-to-list (quote org-structure-template-alist) (quote ("SV" . "src scheme :exports both :results value"))) (add-to-list (quote org-structure-template-alist) (quote ("SE" . "src scheme :exports code"))) (add-to-list (quote org-structure-template-alist) (quote ("EL" . "src elisp :exports both :results output"))) (add-to-list (quote org-structure-template-alist) (quote ("F" . "src f90 :exports both :results output"))) ) (lambda nil (modify-syntax-entry 60 ".") (modify-syntax-entry 62 ".")) (lambda nil (imenu-add-to-menubar "Imenu")) #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-show-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-eldoc-load) 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-preview-latex-default-process 'imagemagick 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) (shell . t) (fortran . t)) org-log-done 'time org-link-abbrev-alist '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=") ("url-to-ja" . "http://translate.google.fr/translate?sl=en&tl=ja&u=%h") ("google" . "http://www.google.com/search?q=") ("gmap" . "http://maps.google.com/maps?q=%s") ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1") ("ads" . "https://ui.adsabs.harvard.edu/search/q=%20author%3A\"%s\"") ("note" . "rtcite:~/GDrive_vladimir_nikishkin_AT_phystech_edu/BibTeX_Bibliography/bibliography-bib.org::#%s") ("bib" . "rtcite:~/GDrive_vladimir_nikishkin_AT_phystech_edu/BibTeX_Bibliography/bibliography-bib.bib::%s") ) org-startup-align-all-tables t org-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS WIDTH)"] 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-catch-invisible-edits 'show org-occur-hook '(org-first-headline-recenter) org-log-into-drawer t org-edit-src-auto-save-idle-delay 15 org-agenda-include-diary t org-structure-template-alist '(("F" . "src f90 :exports both :results output") ("EL" . "src elisp :exports both :results output") ("SE" . "src scheme :exports code") ("SV" . "src scheme :exports both :results value") ("SO" . "src scheme :exports both :results output") ("p" . "src plantuml :noweb no :exports both :file ") ("a" . "export ascii") ("c" . "center") ("C" . "comment") ("e" . "example") ("E" . "export") ("h" . "export html") ("l" . "export latex") ("q" . "quote") ("s" . "src") ("v" . "verse")) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-edit-src-turn-on-auto-save t org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate) org-hierarchical-todo-statistics nil org-preview-latex-process-alist '((dvipng :programs ("latex" "dvipng") :description "dvi > png" :message "you need to install the programs: latex and dvipng." :image-input-type "dvi" :image-output-type "png" :image-size-adjust (1.0 . 1.0) :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f") :image-converter ("dvipng -D %D -T tight -o %O %f")) (dvisvgm :programs ("latex" "dvisvgm") :description "dvi > svg" :message "you need to install the programs: latex and dvisvgm." :image-input-type "dvi" :image-output-type "svg" :image-size-adjust (1.7 . 1.5) :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f") :image-converter ("dvisvgm %f -n -b min -c %S -o %O")) (imagemagick :programs ("latex" "convert") :description "pdf > png" :message "you need to install the programs: latex and imagemagick." :image-input-type "pdf" :image-output-type "png" :image-size-adjust (1.0 . 1.0) :latex-compiler ("lualatex -interaction nonstopmode -output-directory %o %f") :image-converter ("convert -density %D -trim -antialias %f -quality 100 %O") ) ) org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function org-babel-tangle-lang-exts '(("fortran" . "F90") ("latex" . "tex") ("D" . "d") ("C++" . "cpp") ("emacs-lisp" . "el") ("elisp" . "el")) org-format-latex-options '(:foreground default :background default :scale 3.0 :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\[")) org-latex-listings-langs '((patch "bash") (shell "bash") (plantuml "MetaPost") (elisp "elisp") (scheme "Lisp") (emacs-lisp "Lisp") (lisp "Lisp") (clojure "Lisp") (c "C") (cc "C++") (fortran "fortran") (perl "Perl") (cperl "Perl") (python "Python") (ruby "Ruby") (html "HTML") (xml "XML") (tex "TeX") (latex "[LaTeX]TeX") (shell-script "bash") (gnuplot "Gnuplot") (ocaml "Caml") (caml "Caml") (sql "SQL") (sqlite "sql") (makefile "make") (R "r")) org-confirm-shell-link-function 'yes-or-no-p org-link-parameters '(("attachment" :follow org-attach-open-link :export org-attach-export-link :complete org-attach-complete-link) ("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) ("rtcite" :follow org-bibtex-open :export my-rtcite-export-handler) ("file+sys") ("file+emacs") ("shell" :follow org-link--open-shell) (#1="news" :follow #[257 #2="\301\300\302Q!\207" [#1# browse-url #4=":"] 5 #5= "\n\n(fn URL)"] ) (#3="mailto" :follow #[257 #2# [#3# browse-url #4#] 5 #5#]) (#6="https" :follow #[257 #2# [#6# browse-url #4#] 5 #5#]) (#7="http" :follow #[257 #2# [#7# browse-url #4#] 5 #5#]) (#8="ftp" :follow #[257 #2# [#8# browse-url #4#] 5 #5#]) ("help" :follow org-link--open-help) ("file" :complete org-link-complete-file) ("elisp" :follow org-link--open-elisp) ("doi" :follow org-link--open-doi)) org-latex-format-headline-function 'org-latex-format-headline-default-function org-agenda-start-with-follow-mode t org-link-elisp-confirm-function 'yes-or-no-p org-org-src-mode-hook '((lambda nil (modify-syntax-entry 60 ".") (modify-syntax-entry 62 ".")) ) org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function org-tab-before-tab-emulation-hook '(org-tempo-complete-tag) org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"] org-latex-packages-alist '((#1="" "color") (#1# "listings")) org-image-actual-width nil org-html-use-infojs t org-latex-classes '(("acmart" "\\documentclass[sigplan,anonymous,review,timestamp,natbib=false]{acmart}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}")) ("article" "\\documentclass[11pt]{article}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) ("report" "\\documentclass[11pt]{report}" ("\\part{%s}" . "\\part*{%s}") ("\\chapter{%s}" . "\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}")) ("book" "\\documentclass[11pt]{book}" ("\\part{%s}" . "\\part*{%s}") ("\\chapter{%s}" . "\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}")) ) org-html-format-headline-function 'org-html-format-headline-default-function org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate org-use-sub-superscripts '{} org-latex-listings-options '(("numbers" "left") ("frame" "single")) org-use-speed-commands t org-latex-bib-compiler "biber" org-default-notes-file "~/Personal_Planner/notes.org" ) -- -- Vladimir Nikishkin (MiEr, lockywolf)