emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Regression bug in tangle/weave


From: Eric Schulte
Subject: Re: [O] Regression bug in tangle/weave
Date: Thu, 30 Jun 2011 11:30:50 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Hi,

Indeed this example below no longer works, however I believe the new
behavior is both desired and permanent.  I'll explain and include an
option for how your example could be restructured to work with the new
code.

We ran into problems automatically removing trailing newlines from code
block bodies as in some languages (looking at you Python and Haskell)
things like trailing newlines are of syntactic importance.  In your
example this behavior results in the insertion of newlines after
file-name and file-version.  Babel is careful to preserve line prefixes
when expanding references in comments, so it then reproduces the

  # Generated from 

portion of that line for every line of the expanded noweb references.

I would suggest the following alternatives, either using a data
references in stead of a code block reference as in the file-version
example below, or using an evaluated code block as in the file-name
example below.  Hope this helps.

Best -- Eric

* Bugs
** SOMEDAY org-mode bug with tangle and newlines
   :PROPERTIES:
   :created: [2011-06-30 Thu 10:00]
   :ID: e4c992b5-4d35-443b-b34a-0fbda7c66aea
   :END:
   :LOGBOOK:
   - Added on [2011-06-30 Thu 10:00]
   :END:
   [2011-06-30 Thu]

   A regression bug has surfaced in org-mode with the tangle/weave
   process mangling the following setup:

   #+begin_src perl :noweb yes :tangle testoutput.pl :shebang #!perl
   # <<generated-from>>
   print "Hello world\n";
   #+end_src

   #+srcname: generated-from
   #+begin_src text :noweb yes
   Generated from <<file-name()>> version <<file-version()>>.
   #+end_src

   #+srcname: file-name
   #+begin_src emacs-lisp :var file=(buffer-file-name)
     (file-name-nondirectory file)
   #+end_src

   #+results: file-version
   : 1.2.3.4

   The last it worked* was sometime in the early 7.4 timeframe.  If I
   get some time, I may do a bisect on it, although others are welcome
   to do the work required.  Timeframe is based on memory, not actual
   checking, so first a bisect needs to be done to find where it last
   worked.
MidLifeXis at PerlMonks <address@hidden> writes:

> It appears that there may be a regression problem with the current
> tangle/weave process.  I used to be able to have a noweb section for
> the name of the file, another for the version of the file, and then
> have an autogenerated header section that included those two pieces of
> information on a single line.  Following is an org file snippet of my
> bug description.
>
>
> * Bugs
> ** SOMEDAY org-mode bug with tangle and newlines      :BUG:
>    :PROPERTIES:
>    :created: [2011-06-30 Thu 10:00]
>    :ID: e4c992b5-4d35-443b-b34a-0fbda7c66aea
>    :END:
>    :LOGBOOK:
>    - Added on [2011-06-30 Thu 10:00]
>    :END:
>    [2011-06-30 Thu]
>
>    A regression bug has surfaced in org-mode with the tangle/weave
>    process mangling the following setup:
>
>    #+begin_src perl :noweb yes :tangle testoutput.pl :shebang #!perl
>    # <<generated-from>>
>    print "Hello world\n";
>    #+end_src
>
>    #+srcname: generated-from
>    #+begin_src text :noweb yes
>    Generated from <<file-name>> version <<file-version>>.
>    #+end_src
>
>    #+srcname: file-name
>    #+begin_src text :noweb yes
>    ATestFile.org
>    #+end_src
>
>    #+srcname: file-version
>    #+begin_src text :noweb yes
>    1.2.3.4
>    #+end_src
>
>    The last it worked* was sometime in the early 7.4 timeframe.  If I
>    get some time, I may do a bisect on it, although others are welcome
>    to do the work required.  Timeframe is based on memory, not
>    actual checking, so first a bisect needs to be done to find where
>    it last worked.
>
>
> *** Actual output
>
> #+begin_src perl
> #!perl
>
> # Generated from ATestFile.org
> # Generated from version 1.2.3.4
> # Generated from <<file-name>> version .
> # 
> print "Hello world\n";
> #+end_src
>
> *** Expected output (or at least similar)
>
> #+begin_src perl
> #!perl
>
> # Generated from ATestFile.org version 1.2.3.4.
>
> print "Hello world\n";
> #+end_src
>
> * End of org file
>
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]