I use noweb references inside sh code blocks, for example:
#+begin_src sh
echo "test"
<<some-ref>>
echo "test"
#+end_src
But this causes syntax highlighting to be broken because <<
gets interpreted as here document by the sh syntax highlighter and rest of the document (line 3 for the example above) becomes non-highlighted.
How can I fix this?
(setq org-babel-default-header-args (cons '(:emph . "'((\"<<\" \">>\" 'hi-red-b))") (assq-delete-all :emph org-babel-default-header-args)))
file-locally in the org files where you need it or even in your init file if you really want that. Save the code in some file within yourload-path
, e.g.,org+-emph.el
and byte-compile it. Add(require 'org+-emph)
to your init file.C-c '
the colors gets mixed up. OK, right now I realized the problem is the 2-space indentation that org automatically applies after doingC-c '
, your package does not account for that I guess.org-src-emph
. See the installation guide and the usage examples there. The code has some fix that hopefully makes editing withC-c '
fully functional. It is clear that the Noweb references may interfere with the source code in the special edit buffer. I had to rename the package to comply with the guidelines of Melpa. If the package is stable enough we could propose it for Melpa. Please test.