[O] org-export-preprocess-apply-macros ?

2017-04-30 Thread D Bro
Is this still a thing?  I can’t seem to find it anywhere but a very few online 
references, no where in the org code, and it doesn’t seem work…
https://lists.gnu.org/archive/html/emacs-orgmode/2011-03/msg00857.html

   (add-hook 'org-babel-tangle-body-hook (lambda () 
(org-export-preprocess-apply-macros)))

I only found 'org-macro-replace-all’, which I’m not sure how to apply while in 
the tangle context.

Many thanks,
Ed B.


[O] Latex class files in async export?

2017-04-29 Thread D Bro
I have the following definition in my org-mode file:

(add-to-list 'org-latex-classes ;; 
https://emacs.stackexchange.com/questions/29694/spacemacs-and-org-mode-configuration-problem
 '("koma-article"
   "\\documentclass{scrartcl}"
   ("\\section{%s}" . "\\section*{%s}")
   ("\\subsection{%s}" . "\\subsection*{%s}")
   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
   ("\\paragraph{%s}" . "\\paragraph*{%s}")
   ("\\subparagraph{%s}" . "\\subparagraph*{%s}"


Yet it doesn’t seem to be visible when I do an async export to PDF.  When I try 
an async export to PDF, I get “Process ‘org-export-process’ exited abnormally”. 
 The PDF is not altered.

I’m no longer getting an export stack buffer, but when I was, it was 
complaining about the class ‘koma-article’, to me indicating it couldn’t be 
found.  I don’t know why that buffer is no longer being generated.

Many thanks,
Ed B.


[O] Viewing tangled source code as source code block result?

2017-04-24 Thread D Bro
I was wondering if there is any simple way of displaying the actual tangled 
code in the org-mode buffer and resulting exports.  One can #+INCLUDE the 
resulting file, seeing it in the export; one can M-x ffap the #+INCLUDE file to 
see it in a buffer; one can do a hack like shelling out and calling cat; I 
guess you could write an lisp function that hooked org-babel-tangle, grabbed 
the buffer, and formatted it as output (haven’t figured out how to do that one 
yet). One could also do a #+src_begin org block.

But what about a simple :results setting, say ‘tangle’ or ‘noweb’?  Whose 
#+RESULTS: was actually a #+src_…#end_src block with appropriate language 
tagging that could get syntax highlighted?

Am I missing something here.  Is there a non-hackish way of composing existing 
features to print the resulting source of a noweb block, in addition to 
actually executing it and displaying the value/output?

Re: [O] :noweb-ref property inheritance failure?

2017-04-18 Thread D Bro
PS  I verified that in addition to org-use-property-inheritance, I have 
org-babel-use-quick-and-dirty-noweb-expansion set to nil, since the 
documentation and mailing list indicate that’s not compatible with property 
inheritance.

It’s good (and bad :) to know it’s just my config, based on it working for you…

> On Apr 18, 2017, at 9:47 PM, D Bro <dabro...@gmail.com> wrote:
> 
> Many thanks—especially for the quick response.  Unfortunately, no go.
> 
> The headline was a copy and paste issue into the email — my org-lint only 
> complains about the :classname (I didn’t even know about org-lint, thank you!)
> Export to Ascii produces:
> 
> … 
> 1 Create
> 
> 
>   ,
>   | <>
>   `
> 
> 
> 1.1 Let's see what our code-weaving produces
> 
> 
> 1.1.1 this is how we will assemble our code:
> 
> 
>   ,
>   | public class Yo {
>   |   public static void main (Args[]) {
>   `
> 
> 
> 1.1.2 body
> --
> 
>   ,
>   | return "The test worked!";
>   `
> 
> 
> 1.1.3 foot
> --
> 
>   ,
>   | // <>
>   | }}
>   `
> 
> 
> 1.1.4 weave together
> 
> 
>   - which will weave together the above blocks to produce this:
> 
> ,----
> | cat TestDemo2.java
> `——
> 
> Ed
> 
>> On Apr 18, 2017, at 9:04 PM, Charles C. Berry <ccbe...@ucsd.edu 
>> <mailto:ccbe...@ucsd.edu>> wrote:
>> 
>> On Tue, 18 Apr 2017, D Bro wrote:
>> 
>>> 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 
>>> <http://orgmode.org/manual/noweb_002dref.html#noweb_002dref> 
>>> <http://orgmode.org/manual/noweb_002dref.html#noweb_002dref 
>>> <http://orgmode.org/manual/noweb_002dref.html#noweb_002dref>> :
>> 
>> [snip]
>> 
>> Using M-x org-lint on your example gives
>> 
>> 3 high  Unknown header argument ":classname"
>>12 high  Incorrect location for PROPERTIES drawer
>> 
>> The latter is because the drawer is not immediately after a headline and is 
>> disregarded:
>> 
>>> **Let's see what our code-weaving produces
>>> :PROPERTIES:
>>> :header-args: :noweb-ref testdemo2
>>> :END:
>> 
>> If you put a space between `**' and `L[...]' the line becomes a valid 
>> headline. Then the TestDemo2 src block produces
>> 
>> ,
>>  | public class Yo {
>>  | public static void main (Args[]) {
>>  | return "The test worked!";
>>  | //
>>  | }}
>>  | cat TestDemo2.java
>>  `
>> 
>> on ASCII export.
>> 
>> You can ignore the message about :classname, which comes from ob-java not 
>> defining it as a header-arg.
>> 
>> HTH,
>> 
>> Chuck
> 



Re: [O] :noweb-ref property inheritance failure?

2017-04-18 Thread D Bro
Many thanks—especially for the quick response.  Unfortunately, no go.

The headline was a copy and paste issue into the email — my org-lint only 
complains about the :classname (I didn’t even know about org-lint, thank you!)
Export to Ascii produces:

… 
1 Create


  ,
  | <>
  `


1.1 Let's see what our code-weaving produces


1.1.1 this is how we will assemble our code:


  ,
  | public class Yo {
  |   public static void main (Args[]) {
  `


1.1.2 body
--

  ,
  | return "The test worked!";
  `


1.1.3 foot
--

  ,
  | // <>
  | }}
  `


1.1.4 weave together


  - which will weave together the above blocks to produce this:

,
| cat TestDemo2.java
`——

Ed

> On Apr 18, 2017, at 9:04 PM, Charles C. Berry <ccbe...@ucsd.edu> wrote:
> 
> On Tue, 18 Apr 2017, D Bro wrote:
> 
>> 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 
>> <http://orgmode.org/manual/noweb_002dref.html#noweb_002dref> :
> 
> [snip]
> 
> Using M-x org-lint on your example gives
> 
> 3 high  Unknown header argument ":classname"
>12 high  Incorrect location for PROPERTIES drawer
> 
> The latter is because the drawer is not immediately after a headline and is 
> disregarded:
> 
>> **Let's see what our code-weaving produces
>> :PROPERTIES:
>> :header-args: :noweb-ref testdemo2
>> :END:
> 
> If you put a space between `**' and `L[...]' the line becomes a valid 
> headline. Then the TestDemo2 src block produces
> 
> ,
>  | public class Yo {
>  | public static void main (Args[]) {
>  | return "The test worked!";
>  | //
>  | }}
>  | cat TestDemo2.java
>  `
> 
> on ASCII export.
> 
> You can ignore the message about :classname, which comes from ob-java not 
> defining it as a header-arg.
> 
> HTH,
> 
> Chuck



[O] :noweb-ref property inheritance failure?

2017-04-18 Thread D Bro
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 
#+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’s 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
;; 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) 
(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-intermediary-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)) 
(require 'ob-haskell)
(require 'ob-scala)
(require 'ob-dot)
(require 'ob-ditaa)
(require 'ob-shell)
(require 'ob-C)
(require 'ob-dot)
(require