emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* file-truename: Variable binding depth exceeds max-specpdl-size when tangling
@ 2014-08-20 21:19 Grant Rettke
  2014-08-20 21:25 ` Aaron Ecay
  0 siblings, 1 reply; 2+ messages in thread
From: Grant Rettke @ 2014-08-20 21:19 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

Good afternoon,

While debugging one of my babel documents, I re-read [this]
documentation on `:noweb-ref'.

What I had wanted to do was to define a bunch of source blocks and then
at the end of the heading to tangle them all into a file. This was just
a natural thing to do while /in the flow/ and *not* thinking about the
document structure.

Here is the simplest possible example.

,----
|
| * Demo
|   :PROPERTIES:
|   :noweb-ref: demo
|   :END:
|
| #+begin_src emacs-lisp
| (message "demo")
| #+end_src
|
| #+begin_src emacs-lisp
| (message "this")
| #+end_src
|
| #+begin_src sh :tangle ~/tmp/demo.el :noweb yes
| «demo»
| #+end_src
`----


  When you try and tangle this, you get the error:

        file-truename: Variable binding depth exceeds
        max-specpdl-size

  You can increase the size but it will run out:
  ╭────
  │ (setq max-specpdl-size 1500)
  ╰────

  Feel like I have caused an endless loop by asking babel to collect all
  references to `demo' and place them inside of a sourceblock, when that
  sourceblock itself will be collected. That said, I'm not sure where to
  go next and simply moved it up one heading.

  Questions:
  • What did I do wrong here?
  • Am I the only one to ever encounter this?
    • Web search did not reveal a lot quickly

  Here is the org and emacs version
  ╭────
  │ (org-version nil t)
  ╰────

  ╭────
  │ Org-mode version 8.2.7c (8.2.7c-25-g1faeb4-elpaplus @
/Users/gcr/.emacs.d/.cask/24.3.1/elpa/org-plus-contrib-20140811/)
  ╰────

  ╭────
  │ (emacs-version)
  ╰────

  ╭────
  │ GNU Emacs 24.3.1 (x86_64-apple-darwin13.2.0, Carbon Version 1.6.0
AppKit 1265.2)
  │  of 2014-07-03 on orion
  ╰────

  Kind regards,

  gcr

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: file-truename: Variable binding depth exceeds max-specpdl-size when tangling
  2014-08-20 21:19 file-truename: Variable binding depth exceeds max-specpdl-size when tangling Grant Rettke
@ 2014-08-20 21:25 ` Aaron Ecay
  0 siblings, 0 replies; 2+ messages in thread
From: Aaron Ecay @ 2014-08-20 21:25 UTC (permalink / raw)
  To: Grant Rettke, emacs-orgmode@gnu.org

Hi Grant,

2014ko abuztuak 20an, Grant Rettke-ek idatzi zuen:
> 
> Good afternoon,
> 
> While debugging one of my babel documents, I re-read [this]
> documentation on `:noweb-ref'.
> 
> What I had wanted to do was to define a bunch of source blocks and then
> at the end of the heading to tangle them all into a file. This was just
> a natural thing to do while /in the flow/ and *not* thinking about the
> document structure.
> 
> Here is the simplest possible example.
> 
> ,----
> |
> | * Demo
> |   :PROPERTIES:
> |   :noweb-ref: demo
> |   :END:
> |
> | #+begin_src emacs-lisp
> | (message "demo")
> | #+end_src
> |
> | #+begin_src emacs-lisp
> | (message "this")
> | #+end_src
> |
> | #+begin_src sh :tangle ~/tmp/demo.el :noweb yes
> | «demo»
> | #+end_src
> `----

Because the to-be-tangled code block is also under the headline with the
:noweb-ref property, it will try to include itself inside itself,
leading to an infinite regress.  Adding a headline before the third code
block fixes the issue.

-- 
Aaron Ecay

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-20 21:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-20 21:19 file-truename: Variable binding depth exceeds max-specpdl-size when tangling Grant Rettke
2014-08-20 21:25 ` Aaron Ecay

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).