emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Regression bug in tangle/weave
@ 2011-06-30 15:24 MidLifeXis at PerlMonks
  2011-06-30 18:30 ` Eric Schulte
  0 siblings, 1 reply; 10+ messages in thread
From: MidLifeXis at PerlMonks @ 2011-06-30 15:24 UTC (permalink / raw)
  To: emacs-orgmode

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


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

* Re: Regression bug in tangle/weave
  2011-06-30 15:24 Regression bug in tangle/weave MidLifeXis at PerlMonks
@ 2011-06-30 18:30 ` Eric Schulte
  2011-07-01 12:51   ` MidLifeXis at PerlMonks
  2011-07-09 16:14   ` Neeum Zawan
  0 siblings, 2 replies; 10+ messages in thread
From: Eric Schulte @ 2011-06-30 18:30 UTC (permalink / raw)
  To: MidLifeXis at PerlMonks; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 975 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: ATestFile.org --]
[-- Type: text/x-org, Size: 1081 bytes --]

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

[-- Attachment #3: Type: text/plain, Size: 2202 bytes --]


MidLifeXis at PerlMonks <midlifexis@wightmanfam.org> 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/

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

* Re: Regression bug in tangle/weave
  2011-06-30 18:30 ` Eric Schulte
@ 2011-07-01 12:51   ` MidLifeXis at PerlMonks
  2011-07-01 19:14     ` Eric Schulte
  2011-07-09 16:14   ` Neeum Zawan
  1 sibling, 1 reply; 10+ messages in thread
From: MidLifeXis at PerlMonks @ 2011-07-01 12:51 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

Is there an example of this that does not use something like elisp, R, perl, python, shell, or some other process that requires either allowing all blocks to execute without prompting, or prompting for authority to run the block every time the file is tangled?

Brian



----- Original Message -----
From: Eric Schulte <schulte.eric@gmail.com>
To: MidLifeXis at PerlMonks <midlifexis@wightmanfam.org>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Sent: Thursday, June 30, 2011 1:30 PM
Subject: Re: [O] Regression bug in tangle/weave

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



MidLifeXis at PerlMonks <midlifexis@wightmanfam.org> 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/


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

* Re: Regression bug in tangle/weave
  2011-07-01 12:51   ` MidLifeXis at PerlMonks
@ 2011-07-01 19:14     ` Eric Schulte
  2011-07-01 20:40       ` MidLifeXis at PerlMonks
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Schulte @ 2011-07-01 19:14 UTC (permalink / raw)
  To: MidLifeXis at PerlMonks; +Cc: emacs-orgmode

Yes, the second example I gave (shown immediately below) requires no
execution of code.

    #+begin_src text :tangle yes
      <<file-version()>>.
    #+end_src

    #+results: file-version
    : 1.2.3.4

Best -- Eric

MidLifeXis at PerlMonks <midlifexis@wightmanfam.org> writes:

> Is there an example of this that does not use something like elisp, R, perl, python, shell, or some other process that requires either allowing all blocks to execute without prompting, or prompting for authority to run the block every time the file is tangled?
>
> Brian
>
>
>
> ----- Original Message -----
> From: Eric Schulte <schulte.eric@gmail.com>
> To: MidLifeXis at PerlMonks <midlifexis@wightmanfam.org>
> Cc: emacs-orgmode <emacs-orgmode@gnu.org>
> Sent: Thursday, June 30, 2011 1:30 PM
> Subject: Re: [O] Regression bug in tangle/weave
>
> 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
>
>
>
> MidLifeXis at PerlMonks <midlifexis@wightmanfam.org> 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/

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

* Re: Regression bug in tangle/weave
  2011-07-01 19:14     ` Eric Schulte
@ 2011-07-01 20:40       ` MidLifeXis at PerlMonks
  2011-07-01 21:36         ` Eric Schulte
  2011-07-05 12:56         ` MidLifeXis at PerlMonks
  0 siblings, 2 replies; 10+ messages in thread
From: MidLifeXis at PerlMonks @ 2011-07-01 20:40 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

I am still getting prompted with the 'Evaluate this text code block (file-version) on your system?' message.

What is your value of org-confirm-babel-evaluate set to?  Mine is set as the default, 't.  According to the docs, this is the more secure setting.


I updated no more than two weeks ago.  I will refresh my org-mode setup over the weekend and see if that takes care of it.

Brian



----- Original Message -----
From: Eric Schulte <schulte.eric@gmail.com>
To: MidLifeXis at PerlMonks <midlifexis@wightmanfam.org>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Sent: Friday, July 1, 2011 2:14 PM
Subject: Re: [O] Regression bug in tangle/weave

Yes, the second example I gave (shown immediately below) requires no
execution of code.

    #+begin_src text :tangle yes
      <<file-version()>>.
    #+end_src

    #+results: file-version
    : 1.2.3.4

Best -- Eric

MidLifeXis at PerlMonks <midlifexis@wightmanfam.org> writes:

> Is there an example of this that does not use something like elisp, R, perl, python, shell, or some other process that requires either allowing all blocks to execute without prompting, or prompting for authority to run the block every time the file is tangled?
>
> Brian
>
>
>
> ----- Original Message -----
> From: Eric Schulte <schulte.eric@gmail.com>
> To: MidLifeXis at PerlMonks <midlifexis@wightmanfam.org>
> Cc: emacs-orgmode <emacs-orgmode@gnu.org>
> Sent: Thursday, June 30, 2011 1:30 PM
> Subject: Re: [O] Regression bug in tangle/weave
>
> 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
>
>
>
> MidLifeXis at PerlMonks <midlifexis@wightmanfam.org> 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/

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

* Re: Regression bug in tangle/weave
  2011-07-01 20:40       ` MidLifeXis at PerlMonks
@ 2011-07-01 21:36         ` Eric Schulte
  2011-07-05 12:56         ` MidLifeXis at PerlMonks
  1 sibling, 0 replies; 10+ messages in thread
From: Eric Schulte @ 2011-07-01 21:36 UTC (permalink / raw)
  To: MidLifeXis at PerlMonks; +Cc: emacs-orgmode

I normally keep `org-confirm-babel-evaluate' set to nil but to test the
below I set it to t and was not prompted for evaluation.

Do you have a code block named "file-version" in this file?  If so then
either that code block, or the results line will need to be renamed.
When Org-mode finds both a code block _and_ a results line of the same
name it defaults to evaluating the code block in case the results are
stale.

Cheers -- Eric

MidLifeXis at PerlMonks <midlifexis@wightmanfam.org> writes:

> I am still getting prompted with the 'Evaluate this text code block (file-version) on your system?' message.
>
> What is your value of org-confirm-babel-evaluate set to?  Mine is set
> as the default, 't.  According to the docs, this is the more secure
> setting.
>
>
> I updated no more than two weeks ago.  I will refresh my org-mode setup over the weekend and see if that takes care of it.
>
> Brian
>
>
>
> ----- Original Message -----
> From: Eric Schulte <schulte.eric@gmail.com>
> To: MidLifeXis at PerlMonks <midlifexis@wightmanfam.org>
> Cc: emacs-orgmode <emacs-orgmode@gnu.org>
> Sent: Friday, July 1, 2011 2:14 PM
> Subject: Re: [O] Regression bug in tangle/weave
>
> Yes, the second example I gave (shown immediately below) requires no
> execution of code.
>
>     #+begin_src text :tangle yes
>       <<file-version()>>.
>     #+end_src
>
>     #+results: file-version
>     : 1.2.3.4
>
> Best -- Eric
>
> MidLifeXis at PerlMonks <midlifexis@wightmanfam.org> writes:
>
>> Is there an example of this that does not use something like elisp,
>> R, perl, python, shell, or some other process that requires either
>> allowing all blocks to execute without prompting, or prompting for
>> authority to run the block every time the file is tangled?
>>
>> Brian
>>
>>
>>
>> ----- Original Message -----
>> From: Eric Schulte <schulte.eric@gmail.com>
>> To: MidLifeXis at PerlMonks <midlifexis@wightmanfam.org>
>> Cc: emacs-orgmode <emacs-orgmode@gnu.org>
>> Sent: Thursday, June 30, 2011 1:30 PM
>> Subject: Re: [O] Regression bug in tangle/weave
>>
>> 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
>>
>>
>>
>> MidLifeXis at PerlMonks <midlifexis@wightmanfam.org> 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/

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

* Re: Regression bug in tangle/weave
  2011-07-01 20:40       ` MidLifeXis at PerlMonks
  2011-07-01 21:36         ` Eric Schulte
@ 2011-07-05 12:56         ` MidLifeXis at PerlMonks
  2011-07-05 15:17           ` Eric Schulte
  1 sibling, 1 reply; 10+ messages in thread
From: MidLifeXis at PerlMonks @ 2011-07-05 12:56 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

I tested this again over the weekend, and finally understood what you were saying.

I put a

#+resname: blah
: blahcontent

and then I can use <<blah()>> to get "blahcontent" replaced without keeping the newlines.

Is this "abusing" resname, or is it a proper use of the keyword?  Will this behavior be stable in the future?

Brian



----- Original Message -----
From: MidLifeXis at PerlMonks <midlifexis@wightmanfam.org>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Sent: Friday, July 1, 2011 3:40 PM
Subject: Re: [O] Regression bug in tangle/weave

I am still getting prompted with the 'Evaluate this text code block (file-version) on your system?' message.

What is your value of org-confirm-babel-evaluate set to?  Mine is set as the default, 't.  According to the docs, this is the more secure setting.


I updated no more than two weeks ago.  I will refresh my org-mode setup over the weekend and see if that takes care of it.

Brian



----- Original Message -----
From: Eric Schulte <schulte.eric@gmail.com>
To: MidLifeXis at PerlMonks <midlifexis@wightmanfam.org>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Sent: Friday, July 1, 2011 2:14 PM
Subject: Re: [O] Regression bug in tangle/weave

Yes, the second example I gave (shown immediately below) requires no
execution of code.

    #+begin_src text :tangle yes
      <<file-version()>>.
    #+end_src

    #+results: file-version
    : 1.2.3.4

Best -- Eric

MidLifeXis at PerlMonks <midlifexis@wightmanfam.org> writes:

> Is there an example of this that does not use something like elisp, R, perl, python, shell, or some other process that requires either allowing all blocks to execute without prompting, or prompting for authority to run the block every time the file is tangled?
>
> Brian
>
>
>
> ----- Original Message -----
> From: Eric Schulte <schulte.eric@gmail.com>
> To: MidLifeXis at PerlMonks <midlifexis@wightmanfam.org>
> Cc: emacs-orgmode <emacs-orgmode@gnu.org>
> Sent: Thursday, June 30, 2011 1:30 PM
> Subject: Re: [O] Regression bug in tangle/weave
>
> 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
>
>
>
> MidLifeXis at PerlMonks <midlifexis@wightmanfam.org> 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/


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

* Re: Regression bug in tangle/weave
  2011-07-05 12:56         ` MidLifeXis at PerlMonks
@ 2011-07-05 15:17           ` Eric Schulte
  0 siblings, 0 replies; 10+ messages in thread
From: Eric Schulte @ 2011-07-05 15:17 UTC (permalink / raw)
  To: MidLifeXis at PerlMonks; +Cc: emacs-orgmode

MidLifeXis at PerlMonks <midlifexis@wightmanfam.org> writes:

> I tested this again over the weekend, and finally understood what you were saying.
>
> I put a
>
> #+resname: blah
> : blahcontent
>
> and then I can use <<blah()>> to get "blahcontent" replaced without keeping the newlines.
>
> Is this "abusing" resname, or is it a proper use of the keyword?  Will this behavior be stable in the future?
>

This is not an abuse of inline results, and this behavior _will_ be
stable in the future.  Another optional alias for #+resname: which may
make more sense in this context is

#+data: blah
: blahcontent

Best -- Eric

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

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

* Re: Regression bug in tangle/weave
  2011-06-30 18:30 ` Eric Schulte
  2011-07-01 12:51   ` MidLifeXis at PerlMonks
@ 2011-07-09 16:14   ` Neeum Zawan
  2011-07-10 15:46     ` Eric Schulte
  1 sibling, 1 reply; 10+ messages in thread
From: Neeum Zawan @ 2011-07-09 16:14 UTC (permalink / raw)
  To: emacs-orgmode

Eric Schulte <schulte.eric@gmail.com> writes:

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

Oh dear. Am I to blame for this?

When I reported the newline issue, somewhere in the back of my mind I
knew it probably would have some ugly consequences. Now I see them. 

An evaluated code block seems inelegant/confusing if one intends to
export that code as part of the document. A data reference seems OK, but
I take it you can't have references within it?

Unfortunately, I see no easy solution...

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

* Re: Regression bug in tangle/weave
  2011-07-09 16:14   ` Neeum Zawan
@ 2011-07-10 15:46     ` Eric Schulte
  0 siblings, 0 replies; 10+ messages in thread
From: Eric Schulte @ 2011-07-10 15:46 UTC (permalink / raw)
  To: Neeum Zawan; +Cc: emacs-orgmode

Neeum Zawan <mailinglists@nawaz.org> writes:

> Eric Schulte <schulte.eric@gmail.com> writes:
>
>> 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.
>
> Oh dear. Am I to blame for this?
>
> When I reported the newline issue, somewhere in the back of my mind I
> knew it probably would have some ugly consequences. Now I see them. 
>
> An evaluated code block seems inelegant/confusing if one intends to
> export that code as part of the document. A data reference seems OK, but
> I take it you can't have references within it?
>
> Unfortunately, I see no easy solution...
>

In these cases, I feel that a data reference is the simplest, most
natural solution, and lightest-syntax solution in these cases, and I
don't see it as an ugly compromise.  Just my opinion.

As I mentioned above I feel that the current behavior is both desired
and permanent, and I'm happy that you raised the newline issue that help
lead to this behavior.

Best -- Eric

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

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

end of thread, other threads:[~2011-07-10 15:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-30 15:24 Regression bug in tangle/weave MidLifeXis at PerlMonks
2011-06-30 18:30 ` Eric Schulte
2011-07-01 12:51   ` MidLifeXis at PerlMonks
2011-07-01 19:14     ` Eric Schulte
2011-07-01 20:40       ` MidLifeXis at PerlMonks
2011-07-01 21:36         ` Eric Schulte
2011-07-05 12:56         ` MidLifeXis at PerlMonks
2011-07-05 15:17           ` Eric Schulte
2011-07-09 16:14   ` Neeum Zawan
2011-07-10 15:46     ` Eric Schulte

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