ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Including command output
@ 2012-03-05  3:07 Kip Warner
  2012-03-05  4:20 ` Aditya Mahajan
  0 siblings, 1 reply; 13+ messages in thread
From: Kip Warner @ 2012-03-05  3:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 586 bytes --]

Hey list,

I'd like to include the output of a command. I am using the following to
define the command,

\def\BazaarRevision{\cldcontext{os.resultof"bzr revno | tr -d '\\n'"}}

and the following to use the output of the command,

\BazaarRevision

A concern I have is whether this command is executed multiple times
during the typesetting process when it need only be done once with the
result cached. If this is indeed the case, does anyone have any
suggestions?

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Including command output
  2012-03-05  3:07 Including command output Kip Warner
@ 2012-03-05  4:20 ` Aditya Mahajan
  2012-03-06  1:32   ` Kip Warner
  0 siblings, 1 reply; 13+ messages in thread
From: Aditya Mahajan @ 2012-03-05  4:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, 4 Mar 2012, Kip Warner wrote:

> Hey list,
>
> I'd like to include the output of a command. I am using the following to
> define the command,
>
> \def\BazaarRevision{\cldcontext{os.resultof"bzr revno | tr -d '\\n'"}}
>
> and the following to use the output of the command,
>
> \BazaarRevision
>
> A concern I have is whether this command is executed multiple times
> during the typesetting process when it need only be done once with the
> result cached. If this is indeed the case,

Yes.

> does anyone have any suggestions?

The cleaner way is to seperate the setup and use. For example:

\def\initilizebazaar
     {\ctxlua{context.setevalue(
               "usebazaarrevision",
                os.resultof"bzr revno | tr -d '\\n'")}}

\appendtoks \initilizebazaar \to \everystarttext

and then use can use \usebazaarrevision in the main text.

If you want to use the automagic way, you can define \BazaarRevision to 
redefined \BazaarRevision, for example:

\def\BazaarRevision
       {\ctxlua{context.setevalue(
                 "BazaarRevision",
                  os.resultof"bzr revno | tr -d '\\n'")}%
        \BazaarRevision}


Aditya

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Including command output
  2012-03-05  4:20 ` Aditya Mahajan
@ 2012-03-06  1:32   ` Kip Warner
  2012-03-06  3:05     ` Aditya Mahajan
  0 siblings, 1 reply; 13+ messages in thread
From: Kip Warner @ 2012-03-06  1:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1295 bytes --]

On Sun, 2012-03-04 at 23:20 -0500, Aditya Mahajan wrote:
> If you want to use the automagic way, you can define \BazaarRevision to 
> redefined \BazaarRevision, for example:
> 
> \def\BazaarRevision
>        {\ctxlua{context.setevalue(
>                  "BazaarRevision",
>                   os.resultof"bzr revno | tr -d '\\n'")}%
>         \BazaarRevision}

Hey Aditya. I tried the automagic method, but ConTeXt bails:

! TeX capacity exceeded, sorry [text input levels=127].
\BazaarRevision ...ltof"bzr revno | tr -d '\\n'")}
                                                  \BazaarRevision 
l.4 }
     
\BazaarRevision ...ltof"bzr revno | tr -d '\\n'")}
                                                  \BazaarRevision 
l.4 }
     
\BazaarRevision ...ltof"bzr revno | tr -d '\\n'")}
                                                  \BazaarRevision 
l.4 }
     
...
l.58 
     
!  ==> Fatal error occurred, no output PDF file produced!
mtx-context     | fatal error: return code: 1


Based on what I saw from htop, it looks like it running the command into
the ground over and over again which is the exact opposite of what we
are trying to do.

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Including command output
  2012-03-06  1:32   ` Kip Warner
@ 2012-03-06  3:05     ` Aditya Mahajan
  2012-03-06  3:11       ` Kip Warner
  0 siblings, 1 reply; 13+ messages in thread
From: Aditya Mahajan @ 2012-03-06  3:05 UTC (permalink / raw)
  To: Kip Warner; +Cc: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1273 bytes --]

On Mon, 5 Mar 2012, Kip Warner wrote:

> On Sun, 2012-03-04 at 23:20 -0500, Aditya Mahajan wrote:
>> If you want to use the automagic way, you can define \BazaarRevision to
>> redefined \BazaarRevision, for example:
>>
>> \def\BazaarRevision
>>        {\ctxlua{context.setevalue(
>>                  "BazaarRevision",
>>                   os.resultof"bzr revno | tr -d '\\n'")}%
>>         \BazaarRevision}
>
> Hey Aditya. I tried the automagic method, but ConTeXt bails:
>
> ! TeX capacity exceeded, sorry [text input levels=127].
> \BazaarRevision ...ltof"bzr revno | tr -d '\\n'")}
>                                                  \BazaarRevision
> l.4 }
>
> \BazaarRevision ...ltof"bzr revno | tr -d '\\n'")}
>                                                  \BazaarRevision
> l.4 }
>
> \BazaarRevision ...ltof"bzr revno | tr -d '\\n'")}
>                                                  \BazaarRevision
> l.4 }
>
> ...
> l.58

The attached file works at my end.

>
> Based on what I saw from htop, it looks like it running the command into
> the ground over and over again which is the exact opposite of what we
> are trying to do.

No. It is defining \BazaarVersion once and then reusing the result. Add 
\loggingall to your file to see what is happening.

Aditya

[-- Attachment #2: Type: APPLICATION/x-tex, Size: 223 bytes --]

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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Including command output
  2012-03-06  3:05     ` Aditya Mahajan
@ 2012-03-06  3:11       ` Kip Warner
  2012-03-06  3:15         ` Aditya Mahajan
  0 siblings, 1 reply; 13+ messages in thread
From: Kip Warner @ 2012-03-06  3:11 UTC (permalink / raw)
  To: Aditya Mahajan; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1448 bytes --]

On Mon, 2012-03-05 at 22:05 -0500, Aditya Mahajan wrote:
> The attached file works at my end.

It works at my end as well, but just not as part of my book.

> No. It is defining \BazaarVersion once and then reusing the result. Add 
> \loggingall to your file to see what is happening.

It still bails. This is what I see with \loggingall placed in the
environment file.

...
{vertical mode: \tracingstats}
{\tracingpages}
{\tracingoutput}
{\tracinglostchars}
{\tracingmacros}
{\tracingparagraphs}
{\tracingrestores}
{\showboxbreadth}
{\showboxdepth}
{\tracinggroups}
{\tracingifs}
{\tracingscantokens}
{\tracingnesting}
{\tracingassigns}
{into \tracingassigns=2}
{\errorstopmode}

{\tracingonline}
{changing \tracingonline=1}
! TeX capacity exceeded, sorry [text input levels=127].
\BazaarRevision ...ltof"bzr revno | tr -d '\\n'")}
                                                  \BazaarRevision 
l.4 }
     
\BazaarRevision ...ltof"bzr revno | tr -d '\\n'")}
                                                  \BazaarRevision 
l.4 }
     
\BazaarRevision ...ltof"bzr revno | tr -d '\\n'")}
                                                  \BazaarRevision 
l.4 }
     
...
l.60 
     
!  ==> Fatal error occurred, no output PDF file produced!
mtx-context     | fatal error: return code: 

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Including command output
  2012-03-06  3:11       ` Kip Warner
@ 2012-03-06  3:15         ` Aditya Mahajan
  2012-03-06  3:36           ` Kip Warner
  0 siblings, 1 reply; 13+ messages in thread
From: Aditya Mahajan @ 2012-03-06  3:15 UTC (permalink / raw)
  To: Kip Warner; +Cc: mailing list for ConTeXt users

On Mon, 5 Mar 2012, Kip Warner wrote:

> On Mon, 2012-03-05 at 22:05 -0500, Aditya Mahajan wrote:
>> The attached file works at my end.
>
> It works at my end as well, but just not as part of my book.

Hard to debug without the actual test file.

>> No. It is defining \BazaarVersion once and then reusing the result. Add
>> \loggingall to your file to see what is happening.
>
> It still bails. This is what I see with \loggingall placed in the
> environment file.


Use

{\loggingall \BazaarRevision }

in your file and attach the output of the log file.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Including command output
  2012-03-06  3:15         ` Aditya Mahajan
@ 2012-03-06  3:36           ` Kip Warner
  2012-03-06  3:38             ` Aditya Mahajan
  0 siblings, 1 reply; 13+ messages in thread
From: Kip Warner @ 2012-03-06  3:36 UTC (permalink / raw)
  To: Aditya Mahajan; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1342 bytes --]

On Mon, 2012-03-05 at 22:15 -0500, Aditya Mahajan wrote:
> Use
> 
> {\loggingall \BazaarRevision } 

I added the above to my environment, but this is all I see. I think this
is the same as last time:

<+ /usr/share/texmf/tex/context/third/simplefonts/t-simplefonts.lua>)
{vertical mode: \tracingstats}
{\tracingpages}
{\tracingoutput}
{\tracinglostchars}
{\tracingmacros}
{\tracingparagraphs}
{\tracingrestores}
{\showboxbreadth}
{\showboxdepth}
{\tracinggroups}
{\tracingifs}
{\tracingscantokens}
{\tracingnesting}
{\tracingassigns}
{into \tracingassigns=2}
{\errorstopmode}

{\tracingonline}
{changing \tracingonline=1}
! TeX capacity exceeded, sorry [text input levels=127].
\BazaarRevision ...ltof"bzr revno | tr -d '\\n'")}
                                                  \BazaarRevision 
l.4 }
     
\BazaarRevision ...ltof"bzr revno | tr -d '\\n'")}
                                                  \BazaarRevision 
l.4 }
     
\BazaarRevision ...ltof"bzr revno | tr -d '\\n'")}
                                                  \BazaarRevision 
l.4 }
     
...
l.61 
     
!  ==> Fatal error occurred, no output PDF file produced!
mtx-context     | fatal error: return code: 1

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Including command output
  2012-03-06  3:36           ` Kip Warner
@ 2012-03-06  3:38             ` Aditya Mahajan
  2012-03-06  3:41               ` Kip Warner
  0 siblings, 1 reply; 13+ messages in thread
From: Aditya Mahajan @ 2012-03-06  3:38 UTC (permalink / raw)
  To: Kip Warner; +Cc: mailing list for ConTeXt users


On Mon, 5 Mar 2012, Kip Warner wrote:

> On Mon, 2012-03-05 at 22:15 -0500, Aditya Mahajan wrote:
>> Use
>>
>> {\loggingall \BazaarRevision }
>
> I added the above to my environment, but this is all I see.

Can you attach your complete log file?

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Including command output
  2012-03-06  3:38             ` Aditya Mahajan
@ 2012-03-06  3:41               ` Kip Warner
  2012-03-06  3:50                 ` Aditya Mahajan
  0 siblings, 1 reply; 13+ messages in thread
From: Kip Warner @ 2012-03-06  3:41 UTC (permalink / raw)
  To: Aditya Mahajan; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1.1: Type: text/plain, Size: 221 bytes --]

On Mon, 2012-03-05 at 22:38 -0500, Aditya Mahajan wrote:
> Can you attach your complete log file?

Attached.

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.1.2: Handbook.log --]
[-- Type: text/x-log, Size: 6967 bytes --]

resolvers       > resolving > loading configuration file '/usr/share/texmf/web2c/contextcnf.lua'

(Source/Handbook.tex

ConTeXt  ver: 2012.03.05 19:49 MKIV  fmt: 2012.3.5  int: english/english

system          > cont-new.mkiv loaded
(/usr/share/texmf/tex/context/base/cont-new.mkiv
system          > beware: some patches loaded from cont-new.mkiv
)
system          > Handbook.top loaded

system          > options > start used options

used options    > % runtime options files (command line driven)
used options    > \unprotect
used options    > % feedback and basic job control
used options    > % handy for special styles
used options    > \startluacode
used options    > document = document or { }
used options    > document.arguments={
used options    >  ["purgeresult"]=true,
used options    >  ["result"]="Avaneya Project Crew Handbook.pdf",
used options    > }
used options    > document.files={
used options    >  "Source/Handbook.tex",
used options    > }
used options    > \stopluacode
used options    > % process info
used options    > \setupsystem[inputfile=Source/Handbook.tex]
used options    > \setupsystem[file=Avaneya Project Crew Handbook.pdf]
used options    > \setupsystem[\c!n=1,\c!m=1]
used options    > % modes
used options    > % options (not that important)
used options    > \startsetups *runtime:options
used options    > \stopsetups
used options    > % styles and modules
used options    > \startsetups *runtime:modules
used options    > \stopsetups
used options    > % done
used options    > \protect \endinput

system          > options > stop used options

(Handbook.top)
fonts           > latin modern fonts are not preloaded
languages       > language en is active
{/usr/share/texmf/fonts/map/pdftex/context/mkiv-base.map}
fonts           > preloading latin modern fonts (second stage)
fonts           > typescripts > unknown: library 'loc'
{/usr/share/texmf/fonts/map/dvips/lm/lm-math.map}{/usr/share/texmf/fonts/map/dvips/lm/lm-rm.map}
fonts           > defining > forced type afm of stmary10 not found
fonts           > defining > font with asked name 'stmary10' is not found using lookup 'file'
fonts           > virtual math > loading font LMMath7-Regular subfont 9 with name stmary10.afm at 458752 is skipped, not found
fonts           > defining > forced type afm of stmary10 not found
fonts           > defining > font with asked name 'stmary10' is not found using lookup 'file'
fonts           > virtual math > loading font LMMath9-Regular subfont 9 with name stmary10.afm at 589824 is skipped, not found
fonts           > defining > forced type afm of stmary10 not found
fonts           > defining > font with asked name 'stmary10' is not found using lookup 'file'
fonts           > virtual math > loading font LMMath12-Regular subfont 9 with name stmary10.afm at 786432 is skipped, not found
fonts           > fallback modern rm 12pt is loaded
(Source/Environment.tex
resolvers       > modules > loaded: 'units'
(/usr/share/texmf/tex/context/base/m-units.mkiv<+ /usr/share/texmf/tex/context/base/x-mathml.lua>)
resolvers       > modules > loaded: 'simplefonts'
(/usr/share/texmf/tex/context/third/simplefonts/t-simplefonts.tex
loading         > ConTeXt User Module / Simplefonts
<+ /usr/share/texmf/tex/context/third/simplefonts/t-simplefonts.lua>)
{vertical mode: \tracingstats}
{\tracingpages}
{\tracingoutput}
{\tracinglostchars}
{\tracingmacros}
{\tracingparagraphs}
{\tracingrestores}
{\showboxbreadth}
{\showboxdepth}
{\tracinggroups}
{\tracingifs}
{\tracingscantokens}
{\tracingnesting}
{\tracingassigns}
{into \tracingassigns=2}
{\errorstopmode}

{\tracingonline}
{changing \tracingonline=1}
{into \tracingonline=0}

\BazaarRevision ->\ctxlua {context.setevalue( "BazaarRevision", os.resultof"bzr revno | tr -d '\\n'")}\BazaarRevision 

\ctxlua ->\directlua \zerocount 
{\directlua}

\setevalue #1->\expandafter \edef \csname #1\endcsname 
#1<-BazaarRevision
{\expandafter}
{\csname}
{\edef}
{changing \BazaarRevision=macro:->\ctxlua {context.setevalue( "B\ETC.}
{into \BazaarRevision=macro:->178}

\BazaarRevision ->178
{the character 1}
\everypar->\page_otr_command_synchronize_side_floats \checkindentation \showparagraphnumber \restoreinterlinepenalty \flushnotes \synchronizenotes \OTRSETshowstatus \flushpostponedbookmark \registerparoptions \flushpostponednodedata \typo_delimited_repeat \insertparagraphintro \dotagsetparcounter 

\page_otr_command_synchronize_side_floats ->\page_sides_synchronize_floats 

\page_sides_synchronize_floats ->\ifinner \else \page_sides_check_floats \fi 
{horizontal mode: \ifinner: (level 1) entered on line 49}
{false}
{\else: \ifinner (level 1) entered on line 49}

\page_sides_check_floats ->\page_sides_analyse_progress \ifdim \d_page_sides_progress >\zeropoint \page_sides_check_floats_set \else \page_sides_check_floats_reset \fi \parskip \s_spac_whitespace_parskip 

\page_sides_analyse_progress ->\d_page_sides_progress \d_page_sides_vsize \ifconditional \c_page_sides_flag \advance \d_page_sides_progress -\d_page_sides_page_total \global \setfalse \c_page_sides_flag \else \advance \d_page_sides_progress -\pagetotal \fi 
{\dimen462}
{reassigning \dimen462=0.0pt}
{\ifcase: (level 2) entered on line 49}
{case 1}
{\else: \ifcase (level 2) entered on line 49}
{\advance}
{reassigning \dimen462=0.0pt}
{\fi: \ifcase (level 2) entered on line 49}
{\ifdim: (level 2) entered on line 49}
{false}
{\else: \ifdim (level 2) entered on line 49}

\page_sides_check_floats_reset ->\global \c_page_sides_checks_done \zerocount 
{\global}
{\count542}
{globally changing \count542=0}
{into \count542=0}
{\fi: \ifdim (level 2) entered on line 49}
{\parskip}
{reassigning \parskip=0.0pt}
{\fi: \ifinner (level 1) entered on line 49}
{\relax}
{\relax}
{\relax}
{\relax}
{\relax}
{\relax}
{\relax}
{\relax}
{\relax}
{\relax}
{\relax}
{\relax}
{the character 1}
{the character 7}
{the character 8}
{end-group character }}
{restoring \BazaarRevision=macro:->\ctxlua {context.setevalue( "B\ETC.}
{restoring \tracingassigns=0}
{restoring \tracingnesting=0}
{restoring \tracingscantokens=0}
{restoring \tracingifs=0}
{restoring \tracinggroups=0}
{restoring \showboxdepth=3}
{restoring \showboxbreadth=5}
! TeX capacity exceeded, sorry [text input levels=127].
\BazaarRevision ...ltof"bzr revno | tr -d '\\n'")}
                                                  \BazaarRevision 
l.4 }
     
\BazaarRevision ...ltof"bzr revno | tr -d '\\n'")}
                                                  \BazaarRevision 
l.4 }
     
\BazaarRevision ...ltof"bzr revno | tr -d '\\n'")}
                                                  \BazaarRevision 
l.4 }
     
...
l.61 
     
If you really absolutely need more capacity,
you can ask a wizard to enlarge me.

!  ==> Fatal error occurred, no output PDF file produced!

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Including command output
  2012-03-06  3:41               ` Kip Warner
@ 2012-03-06  3:50                 ` Aditya Mahajan
  2012-03-06  3:56                   ` Kip Warner
  0 siblings, 1 reply; 13+ messages in thread
From: Aditya Mahajan @ 2012-03-06  3:50 UTC (permalink / raw)
  To: Kip Warner; +Cc: mailing list for ConTeXt users

On Mon, 5 Mar 2012, Kip Warner wrote:

> On Mon, 2012-03-05 at 22:38 -0500, Aditya Mahajan wrote:
>> Can you attach your complete log file?
>
> Attached.

The error is not due to the macro \BazaarRevision. The log file shows that 
the group (for {\loggingall \BazaarRevison}) is closed properly; the error 
is displayed after that. So, something else in your setup is causing the 
error.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Including command output
  2012-03-06  3:50                 ` Aditya Mahajan
@ 2012-03-06  3:56                   ` Kip Warner
  2012-03-06  5:04                     ` Aditya Mahajan
  0 siblings, 1 reply; 13+ messages in thread
From: Kip Warner @ 2012-03-06  3:56 UTC (permalink / raw)
  To: Aditya Mahajan; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 877 bytes --]

On Mon, 2012-03-05 at 22:50 -0500, Aditya Mahajan wrote:
> The error is not due to the macro \BazaarRevision. The log file shows that 
> the group (for {\loggingall \BazaarRevison}) is closed properly; the error 
> is displayed after that. So, something else in your setup is causing the 
> error.

It doesn't bail unless I replace the previous definition with yours.
Here is an example of its usage from my source:

\setupinteraction
  [state=start,
   color=colour_link,
   contrastcolor=colour_link,
   focus=standard,
   title=Some Book (Bzr r\BazaarRevision),
   author=Some Book (Bzr r\BazaarRevision)]

The rest of the book just has some \BazaarRevision scattered here and
there, but I can't see anything unusual about their usage or context.

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Including command output
  2012-03-06  3:56                   ` Kip Warner
@ 2012-03-06  5:04                     ` Aditya Mahajan
  2012-03-06  5:37                       ` Kip Warner
  0 siblings, 1 reply; 13+ messages in thread
From: Aditya Mahajan @ 2012-03-06  5:04 UTC (permalink / raw)
  To: Kip Warner; +Cc: mailing list for ConTeXt users

On Mon, 5 Mar 2012, Kip Warner wrote:

> On Mon, 2012-03-05 at 22:50 -0500, Aditya Mahajan wrote:
>> The error is not due to the macro \BazaarRevision. The log file shows that
>> the group (for {\loggingall \BazaarRevison}) is closed properly; the error
>> is displayed after that. So, something else in your setup is causing the
>> error.
>
> It doesn't bail unless I replace the previous definition with yours.
> Here is an example of its usage from my source:
>
> \setupinteraction
>  [state=start,
>   color=colour_link,
>   contrastcolor=colour_link,
>   focus=standard,
>   title=Some Book (Bzr r\BazaarRevision),
>   author=Some Book (Bzr r\BazaarRevision)]

Why don't you use the first version (\initializebazaarversion and 
\usebazaarversion)?

\def\initializeBazaar
        {\ctxlua{context("\\global\\edef\\BazaarRevision{\%s}",
                 os.resultof"bzr revno | tr -d '\\n'")}}

\initializeBazaar

\setupinteraction
   [state=start,
    color=colour_link,
    contrastcolor=colour_link,
    focus=standard,
    title=Some Book (Bzr r\BazaarRevision),
    author=Some Book (Bzr r\BazaarRevision)]

\starttext

Hello \BazaarRevision Bye

\stoptext


> The rest of the book just has some \BazaarRevision scattered here and
> there, but I can't see anything unusual about their usage or context.

It helps if you try to create a minimal example.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Including command output
  2012-03-06  5:04                     ` Aditya Mahajan
@ 2012-03-06  5:37                       ` Kip Warner
  0 siblings, 0 replies; 13+ messages in thread
From: Kip Warner @ 2012-03-06  5:37 UTC (permalink / raw)
  To: Aditya Mahajan; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 581 bytes --]

On Tue, 2012-03-06 at 00:04 -0500, Aditya Mahajan wrote:
> Why don't you use the first version (\initializebazaarversion and 
> \usebazaarversion)?
> 
> \def\initializeBazaar
>         {\ctxlua{context("\\global\\edef\\BazaarRevision{\%s}",
>                  os.resultof"bzr revno | tr -d '\\n'")}}
> 
> \initializeBazaar

Very good question. I suppose trying to get the automagic method to work
doesn't matter since the above works fine. Thanks again Aditya.

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2012-03-06  5:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-05  3:07 Including command output Kip Warner
2012-03-05  4:20 ` Aditya Mahajan
2012-03-06  1:32   ` Kip Warner
2012-03-06  3:05     ` Aditya Mahajan
2012-03-06  3:11       ` Kip Warner
2012-03-06  3:15         ` Aditya Mahajan
2012-03-06  3:36           ` Kip Warner
2012-03-06  3:38             ` Aditya Mahajan
2012-03-06  3:41               ` Kip Warner
2012-03-06  3:50                 ` Aditya Mahajan
2012-03-06  3:56                   ` Kip Warner
2012-03-06  5:04                     ` Aditya Mahajan
2012-03-06  5:37                       ` Kip Warner

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 NNTP newsgroup(s).