From: Immanuel Litzroth <immanuel.litzroth@gmail.com>
To: immanuel <immanuel.litzroth@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: Bug: tangling with elisp as lang in a noweb reference doesn't work [9.1.9 (release_9.1.9-65-g5e4542 @ /usr/local/share/emacs/26.2/lisp/org/)]
Date: Sat, 31 Aug 2019 10:34:20 +0200 [thread overview]
Message-ID: <CAM1nAczGMj=qMQtsXzpmzorSLQrxyDo9=4ofL+spe7Nn+6-afw@mail.gmail.com> (raw)
In-Reply-To: <87sgpitjv6.fsf@nicolasgoaziou.fr>
No problem! I have some more coming up :-)
I've been looking at getting org-babel to add line directives for
languages that support it.
(c, c++, haskell...). It would make literate programming for these
kinds of languages much
better, and other people have been complaining e.g.
https://paulbatchelor.github.io/blog/posts/2018-09-21-org-babel-impressions.html
Unfortunately there is no easy way to hook this into org-babel now
without doing some rather
intrusive work.
1) The language specific expansions don't know the file or the line a
block comes from, and
noweb references have already been expanded.
2) The tangle-body-hook is useless since it runs in a temp buffer that
doesn't even have the major
mode set for the language you're tangling to.
3) The :comments mechanism is not strong enough to allow language
specific comments and it 's
different for noweb vs. normal block expansion.
Would there be interest in such a feature, if it doesn't change
current behaviour?
Immanuel
On Fri, Aug 30, 2019 at 11:37 PM Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
>
> Hello,
>
> immanuel <immanuel.litzroth@gmail.com> writes:
>
> > #+NAME: this is a test
> > #+BEGIN_SRC elisp :tangle no
> >
> > (message \"aha\") #+END_SRC
> >
> > #+BEGIN_SRC elisp :noweb yes :comments noweb :tangle out.el
> > first
> > <<this is a test>>
> > second
> > #+END_SRC
> >
> > #+BEGIN_SRC elisp :tangle no
> > (progn
> > (org-babel-tangle)
> > (with-temp-buffer
> > (insert-file-contents "out.el")
> > (buffer-string)))))
> > #+END_SRC
> >
> >
> > Doesn't work. The reason is that the function
> > org-babel-expand-noweb-references uses
> >
> > #+BEGIN_SRC emacs-lisp
> > (c-wrap (lambda (text)
> > (with-temp-buffer
> > (funcall (intern (concat lang "-mode")))
> > ...
> > #+END_SRC
>
> Fixed! Thank you for the report and the analysis.
>
> Regards,
>
> --
> Nicolas Goaziou
prev parent reply other threads:[~2019-08-31 8:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-25 12:00 Bug: tangling with elisp as lang in a noweb reference doesn't work [9.1.9 (release_9.1.9-65-g5e4542 @ /usr/local/share/emacs/26.2/lisp/org/)] immanuel
2019-08-30 21:37 ` Nicolas Goaziou
2019-08-31 8:34 ` Immanuel Litzroth [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAM1nAczGMj=qMQtsXzpmzorSLQrxyDo9=4ofL+spe7Nn+6-afw@mail.gmail.com' \
--to=immanuel.litzroth@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).