From mboxrd@z Thu Jan 1 00:00:00 1970 From: D Bro Subject: :noweb-ref property inheritance failure? Date: Tue, 18 Apr 2017 18:44:41 -0500 Message-ID: <65201F98-7A44-4521-938F-DB19D718C170@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_9EA3E1FA-9DDB-4D01-B04E-422020A3C8A6" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0cng-00058e-Eb for emacs-orgmode@gnu.org; Tue, 18 Apr 2017 19:44:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0cnc-00046A-Nj for emacs-orgmode@gnu.org; Tue, 18 Apr 2017 19:44:48 -0400 Received: from mail-oi0-x243.google.com ([2607:f8b0:4003:c06::243]:33317) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0cnc-00045I-Ft for emacs-orgmode@gnu.org; Tue, 18 Apr 2017 19:44:44 -0400 Received: by mail-oi0-x243.google.com with SMTP id a189so1621177oib.0 for ; Tue, 18 Apr 2017 16:44:44 -0700 (PDT) Received: from [192.168.1.84] (99-64-96-11.lightspeed.austtx.sbcglobal.net. [99.64.96.11]) by smtp.gmail.com with ESMTPSA id o12sm350695otb.14.2017.04.18.16.44.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Apr 2017 16:44:42 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --Apple-Mail=_9EA3E1FA-9DDB-4D01-B04E-422020A3C8A6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Both 26.0 and 25.1 on OS X 10.12 via homebrew, using the Spacemacs = configuration. I recently tried the weaving technique from = http://orgmode.org/manual/noweb_002dref.html#noweb_002dref = : * Create=20 #+NAME: TestDemo2 #+BEGIN_SRC java :classname TestDemo2 :noweb yes :tangle yes <> #+END_SRC #+BEGIN_SRC elisp (format "%s" (org-babel-expand-src-block testdemo2)) #+END_SRC **Let's see what our code-weaving produces :PROPERTIES: :header-args: :noweb-ref testdemo2 :END: *** this is how we will assemble our code: #+BEGIN_SRC java public class Yo { public static void main (Args[]) { #+END_SRC *** body #+BEGIN_SRC java return "The test worked!"; #+END_SRC *** foot #+BEGIN_SRC java // <> }} #+END_SRC *** weave together - which will weave together the above blocks to produce this: #+BEGIN_SRC shell :results org :exports none cat TestDemo2.java #+END_SRC I have tried both (setq org-use-property-inheritance (quote = (noweb-ref))) and (setq org-use-property-inheritance t), both at = org-mode load and from within the org file in question. Also, note that = I am using the 9.0 syntax, which I believe Spacemacs loads as part of = its org-mode layer. The result is always an empty TestDemo2.java file. What=E2=80=99s = interesting is that if I run org-babel-expand-src-block I see this: public class Yo { public static void main (Args[]) { return "The test worked!"; //=20 }} cat TestDemo2.java If I add :noweb-ref to each block, it works. - OS: darwin - Emacs: 25.1.1 - Spacemacs: 0.200.9 - Spacemacs branch: develop (rev. 4b92183c) - Graphic display: t - Distribution: spacemacs - Editing style: vim - Completion: helm - Layers: - System configuration features: NOTIFY ACL GNUTLS LIBXML2 ZLIB = TOOLKIT_SCROLL_BARS NS MODULES My org-mode config (org-plus-contrib-20170210) ;; org-mode (with-eval-after-load 'org ;; Turning `org-use-property-inheritance' on can cause significant = overhead when doing a search, which is why it is not on by default. (setq org-use-property-inheritance t) (setq org-reveal-root "/usr/workspace/reveal.js") (setq org-src-fontify-natively t) (setq org-src-tab-acts-natively t) (setq org-confirm-babel-evaluate nil) (setq org-export-babel-evaluate nil) (setq org-startup-indented t) (setq org-imenu-depth 3) ;;; increase imenu depth to include third = level headings ;; https://www.mfoot.com/static/emacs-config/config.html (setq org-ditaa-jar-path "/usr/local/bin/ditaa") (setq org-html-checkbox-type 'html) (setq org-hide-emphasis-markers t) (setq org-src-window-setup 'other-window) ;; reuses another open = buffer window (add-hook 'org-mode-hook 'org-display-inline-images)=20 (add-hook 'org-babel-after-execute-hook 'org-display-inline-images) = ;;; Update images from babel code blocks automatically ;;; LaTex ;; = https://github.com/syl20bnr/spacemacs/tree/master/layers/+lang/latex ;; To perform full-document previews (that is, aside from the inline = previewing ;; under SPC m p), add the following to your .spacemacs under ;; dotspacemacs/user-config. Then when you open up a compiled PDF, = the preview ;; will update automatically when you recompile. (add-hook 'doc-view-mode-hook 'auto-revert-mode) ;; http://orgmode.org/manual/CDLaTeX-mode.html#CDLaTeX-mode ;; Don't use CDLaTeX mode itself under Org mode, but use the light = version ;; org-cdlatex-mode that comes as part of Org mode. Turn it on for = the current ;; buffer with M-x org-cdlatex-mode RET, or for all Org files with (add-hook 'org-mode-hook 'turn-on-org-cdlatex) ;; = http://stackoverflow.com/questions/11272236/how-to-make-formule-bigger-in-= org-mode-of-emacs (setq org-format-latex-options (plist-put org-format-latex-options = :scale 2.0)) ;; (setq org-format-latex-options (plist-put org-format-latex-options = :justify 'center)) ;; (setq org-pandoc-options-for-latex-pdf '((latex-engine . = "xelatex")));; "pdflatex")));; "lualatex")));; ;; http://bnbeckwith.com/blog/org-mode-tikz-previews-on-windows.html (add-to-list 'org-latex-packages-alist '("" "tikz" t)) (setq org-latex-create-formula-image-program 'imagemagick) (eval-after-load "preview" '(add-to-list 'preview-default-preamble = "\\PreviewEnvironment{tikzpicture}" t)) ;; = http://emacs.stackexchange.com/questions/23982/cleanup-org-mode-export-int= ermediary-file (setq org-latex-logfiles-extensions (quote ("lof" "lot" "tex~" "aux" = "idx" "log" "out" "toc" "nav" "snm" "vrb" "dvi" "fdb_latexmk" "blg" = "brf" "fls" "entoc" "ps" "spl" "bbl"))) (define-key evil-normal-state-map (kbd "zp") = 'org-toggle-latex-fragment) ;; (add-to-list 'org-src-lang-modes '("dot" . graphviz-dot))=20 (require 'ob-haskell) (require 'ob-scala) (require 'ob-dot) (require 'ob-ditaa) (require 'ob-shell) (require 'ob-C) (require 'ob-dot) (require 'ob-gnuplot) (require 'ob-java) (require 'ob-org) (add-to-list 'org-babel-load-languages '(haskell . t)) ;; (erlang . t) (add-to-list 'org-babel-load-languages '(elixir . t)) ;; (ipython . t) (add-to-list 'org-babel-load-languages '(python . t)) (add-to-list 'org-babel-load-languages '(java . t)) (add-to-list 'org-babel-load-languages '(js . t)) (add-to-list 'org-babel-load-languages '(ruby . t)) (add-to-list 'org-babel-load-languages '(emacs-lisp . t)) (add-to-list 'org-babel-load-languages '(C . t)) (add-to-list 'org-babel-load-languages '(latex . t)) (add-to-list 'org-babel-load-languages '(ditaa . t)) (add-to-list 'org-babel-load-languages '(gnuplot . t)) (add-to-list 'org-babel-load-languages '(dot . t)) (add-to-list 'org-babel-load-languages '(latex . t)) ;; (org . t) (add-to-list 'org-babel-load-languages '(calc . t)) (add-to-list 'org-babel-load-languages '(shell . t)) (add-to-list 'org-babel-load-languages '(org . t)) ;; = http://emacs.stackexchange.com/questions/12841/quickly-insert-source-block= s-in-org-mode ;; redefines source code block templae to provide a name (add-to-list 'org-structure-template-alist '("s" "#+NAME: ?\n#+BEGIN_SRC \n\n#+END_SRC")) ) ;; http://bnbeckwith.com/blog/org-mode-tikz-previews-on-windows.html (eval-after-load "preview" '(add-to-list 'preview-default-preamble = "\\PreviewEnvironment{tikzpicture}" t)) ) --Apple-Mail=_9EA3E1FA-9DDB-4D01-B04E-422020A3C8A6 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Both 26.0 and 25.1 on OS X 10.12 via = homebrew, using the Spacemacs configuration.

I recently tried the weaving technique from http://orgmode.org/manual/noweb_002dref.html#noweb_002dref&= nbsp;:

* Create 
#+NAME: = TestDemo2
#+BEGIN_SRC java :classname TestDemo2 = :noweb yes :tangle yes
  = <<testdemo2>>
#+END_SRC

#+BEGIN_SRC = elisp
(format "%s" (org-babel-expand-src-block = testdemo2))
#+END_SRC

**Let's see what our code-weaving = produces
:PROPERTIES:
:header-args: :noweb-ref testdemo2
:END:

*** this is how we will assemble our code:
  #+BEGIN_SRC java
    = public class Yo {
      public = static void main (Args[]) {
  = #+END_SRC

*** = body
  #+BEGIN_SRC java
     return "The test worked!";
  #+END_SRC
*** foot
  #+BEGIN_SRC java
    // = <<test-foot>>
    = }}
  #+END_SRC
*** weave = together
- which will weave together the above = blocks to produce this:

  #+BEGIN_SRC shell :results org :exports none
  cat TestDemo2.java
  = #+END_SRC

I have tried both   (setq org-use-property-inheritance = (quote (noweb-ref))) and   (setq org-use-property-inheritance t), = both at org-mode load and from within the org file in question. =  Also, note that I am using the 9.0 syntax, which I believe = Spacemacs loads as part of its org-mode layer.

The result is always an empty = TestDemo2.java file.  What=E2=80=99s interesting is that if I run = org-babel-expand-src-block I see this:

public class Yo = {
  public static void main (Args[]) = {
return "The test worked!";
// 
}}
cat = TestDemo2.java

If I add :noweb-ref to each block, it works.

- OS: = darwin
- Emacs: 25.1.1
- = Spacemacs: 0.200.9
- Spacemacs branch: develop = (rev. 4b92183c)
- Graphic display: t
- Distribution: spacemacs
- Editing = style: vim
- Completion: helm
- = Layers:
- System configuration features: NOTIFY ACL = GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES

My = org-mode config (org-plus-contrib-20170210)

;; org-mode
  = (with-eval-after-load 'org
    ;; Turning = `org-use-property-inheritance' on can cause significant overhead when = doing a search, which is why it is not on by default.
    (setq org-use-property-inheritance t)
    (setq org-reveal-root = "/usr/workspace/reveal.js")
    (setq = org-src-fontify-natively t)
    (setq = org-src-tab-acts-natively t)
    (setq = org-confirm-babel-evaluate nil)
    (setq = org-export-babel-evaluate nil)
    (setq = org-startup-indented t)
    (setq = org-imenu-depth 3) ;;; increase imenu depth to include third level = headings
=
    (setq org-ditaa-jar-path = "/usr/local/bin/ditaa")
    (setq = org-html-checkbox-type 'html)
    (setq = org-hide-emphasis-markers t)
    (setq = org-src-window-setup 'other-window) ;; reuses another open buffer = window
    (add-hook 'org-mode-hook = 'org-display-inline-images) 
    = (add-hook 'org-babel-after-execute-hook 'org-display-inline-images) ;;; = Update images from babel code blocks automatically


      ;;; LaTex
    ;; To perform full-document = previews (that is, aside from the inline previewing
    ;; under SPC m p), add the following to your = .spacemacs under
    ;; = dotspacemacs/user-config.  Then when you open up a compiled PDF, = the preview
    ;; will update = automatically when you recompile.
    = (add-hook 'doc-view-mode-hook 'auto-revert-mode)
    ;; http://orgmode.org/manual/CDLaTeX-mode.html#CDLaTeX-mode
    ;; Don't use CDLaTeX mode itself under = Org mode, but use the light version
    = ;; org-cdlatex-mode that comes as part of Org mode. Turn it on for the = current
    ;; buffer with M-x = org-cdlatex-mode RET, or for all Org files with
    (add-hook 'org-mode-hook = 'turn-on-org-cdlatex)
    = (setq org-format-latex-options (plist-put org-format-latex-options = :scale 2.0)) ;;
    (setq = org-format-latex-options (plist-put org-format-latex-options :justify = 'center)) ;;
    (setq = org-pandoc-options-for-latex-pdf '((latex-engine . "xelatex")));; =  "pdflatex")));; "lualatex")));;
    (add-to-list = 'org-latex-packages-alist '("" "tikz" t))
  =   (setq org-latex-create-formula-image-program = 'imagemagick)
    (eval-after-load = "preview" '(add-to-list 'preview-default-preamble = "\\PreviewEnvironment{tikzpicture}" t))
    (setq = org-latex-logfiles-extensions (quote ("lof" "lot" "tex~" "aux" "idx" = "log" "out" "toc" "nav" "snm" "vrb" "dvi" "fdb_latexmk" "blg" "brf" = "fls" "entoc" "ps" "spl" "bbl")))

    (define-key = evil-normal-state-map (kbd "zp") 'org-toggle-latex-fragment)

    ;; = (add-to-list 'org-src-lang-modes '("dot" . = graphviz-dot)) 
    (require = 'ob-haskell)
    (require = 'ob-scala)
    (require = 'ob-dot)
    (require = 'ob-ditaa)
    (require = 'ob-shell)
    (require 'ob-C)
    (require 'ob-dot)
  =   (require 'ob-gnuplot)
    (require = 'ob-java)
    (require 'ob-org)

    = (add-to-list 'org-babel-load-languages '(haskell    . = t))
    ;; (erlang . t)
    (add-to-list 'org-babel-load-languages '(elixir =     . t))
    ;; (ipython . = t)
    (add-to-list = 'org-babel-load-languages '(python     . t))
    (add-to-list 'org-babel-load-languages '(java =       . t))
    = (add-to-list 'org-babel-load-languages '(js         = . t))
    (add-to-list = 'org-babel-load-languages '(ruby       . t))
    (add-to-list 'org-babel-load-languages = '(emacs-lisp . t))
    (add-to-list = 'org-babel-load-languages '(C          . = t))
    (add-to-list = 'org-babel-load-languages '(latex      . t))
    (add-to-list 'org-babel-load-languages '(ditaa =      . t))
    = (add-to-list 'org-babel-load-languages '(gnuplot    . = t))
    (add-to-list = 'org-babel-load-languages '(dot        . = t))
    (add-to-list = 'org-babel-load-languages '(latex      . t))
    ;; (org     . t)
    (add-to-list 'org-babel-load-languages '(calc =       . t))
    = (add-to-list 'org-babel-load-languages '(shell      . = t))
    (add-to-list = 'org-babel-load-languages '(org        . = t))

    ;; = redefines source code block templae to provide a name
    (add-to-list = 'org-structure-template-alist
      =            '("s" "#+NAME: ?\n#+BEGIN_SRC = \n\n#+END_SRC"))


    = )

  (eval-after-load "preview"
    '(add-to-list 'preview-default-preamble = "\\PreviewEnvironment{tikzpicture}" t))


  )




= --Apple-Mail=_9EA3E1FA-9DDB-4D01-B04E-422020A3C8A6--