GNU bug report logs - #50218
28.0.50; org-babel-tangle-file tangles code blocks starting with #+begin_src :tangle no

Previous Next

Package: org-mode;

Reported by: Tassilo Neubauer <tassilo.neubauer <at> gmail.com>

Date: Thu, 26 Aug 2021 23:06:01 UTC

Severity: normal

Found in version 28.0.50

Done: Ihor Radchenko <yantar92 <at> posteo.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kyle Meyer <kyle <at> kyleam.com>
To: Tassilo Neubauer <tassilo.neubauer <at> gmail.com>
Cc: 50218 <at> debbugs.gnu.org
Subject: bug#50218: 28.0.50; org-babel-tangle-file tangles code blocks starting with #+begin_src :tangle no
Date: Sat, 18 Dec 2021 17:16:50 -0500
Tassilo Neubauer writes:

> Hello,
>
> Here are the steps that led to code blocks being tangled I did not 
> expect to:
>
> emacs -Q
> C-x C-h: ~/org-roam/example.org
> content of example.org (excluding "):
> "
> #+begin_src emacs-lisp
> (setq some-emacs-lisp-variable t)
> #+end_src
>
> #+begin_src :tangle no
> ;;This line should not be in the elisp code
> #+end_src
> "

(Sorry for the delayed reply.  This message, unlike the initial post,
will be redirected to the Org list, where you're more likely to get a
response.)

Org sees the last block above as a source block of language ":tangle".
Here's what org-element-at-point reports:

  (src-block (:language ":tangle" :switches nil :parameters "yes"...)

org-lint will complain about this block:

     2 nil   Missing colon in header argument "yes"

And, were you to use a bare source block (i.e. drop ":tangle no"), it
would complain about a missing language:

     2 nil   Missing language in source block

So, I think the source block is mis-specified, and I'm not sure there's
much that Org should do here, but perhaps others will chime in with
their thoughts.




This bug report was last modified 1 year and 113 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.