ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* buffers
@ 2006-07-31 20:52 Hans van der Meer
  2006-07-31 22:21 ` buffers Aditya Mahajan
  0 siblings, 1 reply; 5+ messages in thread
From: Hans van der Meer @ 2006-07-31 20:52 UTC (permalink / raw)



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

The ConTeXt manual tells me on page 237:

	You can define your own buffer with:
	\definebuffer[...]
	... name
	After this command /getbuffer and \typebuffer are available where  
buffer is the name of the buffer.

I do:
	\definebuffer[left]
	\startbuffer[left]
	left\crlf
	\stopbuffer
	\typeleft
and it gives me the error:
	! Undefined control sequence.
\typeleft ->\dodotypebuffer
                             [left][def-3]
l.92 \typeleft

then I try:
	\typebuffer[left]

this gives a typeset message [file examdoc-def-2.tmp does not exist]
(file examdoc.tex being the containing tex file)

when I try
	\getbuffer[left] or \getleft
nothing at all seems to happen?

Why doesn't it work according to the manual?
Or do I misunderstand the manual completely?

Hans van der Meer




[-- Attachment #1.2: Type: text/html, Size: 4618 bytes --]

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

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: buffers
  2006-07-31 20:52 buffers Hans van der Meer
@ 2006-07-31 22:21 ` Aditya Mahajan
  2006-08-01 10:50   ` buffers Hans van der Meer
  2006-08-07 15:47   ` buffers Aditya Mahajan
  0 siblings, 2 replies; 5+ messages in thread
From: Aditya Mahajan @ 2006-07-31 22:21 UTC (permalink / raw)


On Mon, 31 Jul 2006, Hans van der Meer wrote:

> The ConTeXt manual tells me on page 237:
>
> 	You can define your own buffer with:
> 	\definebuffer[...]
> 	... name
> 	After this command /getbuffer and \typebuffer are available where 
> buffer is the name of the buffer.
>
> I do:
> 	\definebuffer[left]
> 	\startbuffer[left]
> 	left\crlf
> 	\stopbuffer
> 	\typeleft
> and it gives me the error:
> 	! Undefined control sequence.
> \typeleft ->\dodotypebuffer
>                           [left][def-3]
> l.92 \typeleft
>
> then I try:
> 	\typebuffer[left]
>
> this gives a typeset message [file examdoc-def-2.tmp does not exist]
> (file examdoc.tex being the containing tex file)
>
> when I try
> 	\getbuffer[left] or \getleft
> nothing at all seems to happen?
>
> Why doesn't it work according to the manual?
> Or do I misunderstand the manual completely?

If you just want to "tag" buffers, you do not need to define new ones. 
You can simply do

\startbuffer[test]
Hello world
\stopbuffer

\typebuffer[test]

\getbuffer[test]


Defining new buffers is useful if you do not want to call buffers by 
some other name. This does not allow you to "tag" the buffers. There 
is also a bug in core-buf.tex due to which \type<buffer> did not work.

\unprotect
\def\dodefinebuffer[#1][#2]%
   {\iffirstargument % else problems
      \doglobal\increment\nofdefinedbuffers
      \letvalue{\??bu#1\c!number}\nofdefinedbuffers
      \letvalue{\??bu#1\c!paragraph}\v!no
      \setevalue{\e!start#1}%

{\noexpand\dostartbuffer[#1][def-\nofdefinedbuffers][\e!start#1][\e!stop#1]}%
      \setevalue{\e!get#1}%
        {\noexpand\dodoprocessTEXbuffer[#1][def-\nofdefinedbuffers]}%
      \setevalue{\e!type#1}%
        {\noexpand\dotypebuffer[#1][def-\nofdefinedbuffers]}%
        % was {\noexpand\dodotypebuffer[#1][def-\nofdefinedbuffers]}%
      \getparameters[\??bu#1][#2]%
    \fi}
\protect


\definebuffer[Example]

\startExample
   Hello again
\stopExample

\typeExample %The above fix is needed for this.

\getExample


Aditya

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

* Re: buffers
  2006-07-31 22:21 ` buffers Aditya Mahajan
@ 2006-08-01 10:50   ` Hans van der Meer
  2006-08-07 15:47   ` buffers Aditya Mahajan
  1 sibling, 0 replies; 5+ messages in thread
From: Hans van der Meer @ 2006-08-01 10:50 UTC (permalink / raw)



On Aug 1, 2006, at 0:21, Aditya Mahajan wrote:

> On Mon, 31 Jul 2006, Hans van der Meer wrote:
>
>> The ConTeXt manual tells me on page 237:
>>
>> 	You can define your own buffer with:
>> 	\definebuffer[...]
>> 	... name
>> 	After this command /getbuffer and \typebuffer are available where
>> buffer is the name of the buffer.
>>
>
> If you just want to "tag" buffers, you do not need to define new ones.
> You can simply do
>
> \startbuffer[test]
> Hello world
> \stopbuffer
>
> \typebuffer[test]
>
> \getbuffer[test]
>

Thanks, that solved it.

Hans van der Meer

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

* Re: buffers
  2006-07-31 22:21 ` buffers Aditya Mahajan
  2006-08-01 10:50   ` buffers Hans van der Meer
@ 2006-08-07 15:47   ` Aditya Mahajan
  2006-08-08  9:44     ` buffers Hans Hagen
  1 sibling, 1 reply; 5+ messages in thread
From: Aditya Mahajan @ 2006-08-07 15:47 UTC (permalink / raw)


On Mon, 31 Jul 2006, Aditya Mahajan wrote:

> On Mon, 31 Jul 2006, Hans van der Meer wrote:
>
>> The ConTeXt manual tells me on page 237:
>>
>> 	You can define your own buffer with:
>> 	\definebuffer[...]
>> 	... name
>> 	After this command /getbuffer and \typebuffer are available where
>> buffer is the name of the buffer.
>>
>> I do:
>> 	\definebuffer[left]
>> 	\startbuffer[left]
>> 	left\crlf
>> 	\stopbuffer
>> 	\typeleft
>> and it gives me the error:
>> 	! Undefined control sequence.
>> \typeleft ->\dodotypebuffer
>>                           [left][def-3]
>> l.92 \typeleft
>>
>> then I try:
>> 	\typebuffer[left]
>>
>> this gives a typeset message [file examdoc-def-2.tmp does not exist]
>> (file examdoc.tex being the containing tex file)
>>
>> when I try
>> 	\getbuffer[left] or \getleft
>> nothing at all seems to happen?
>>
>> Why doesn't it work according to the manual?
>> Or do I misunderstand the manual completely?
>
> If you just want to "tag" buffers, you do not need to define new ones.
> You can simply do
>
> \startbuffer[test]
> Hello world
> \stopbuffer
>
> \typebuffer[test]
>
> \getbuffer[test]
>
>
> Defining new buffers is useful if you do not want to call buffers by
> some other name. This does not allow you to "tag" the buffers. There
> is also a bug in core-buf.tex due to which \type<buffer> did not work.
>
> \unprotect
> \def\dodefinebuffer[#1][#2]%
>   {\iffirstargument % else problems
>      \doglobal\increment\nofdefinedbuffers
>      \letvalue{\??bu#1\c!number}\nofdefinedbuffers
>      \letvalue{\??bu#1\c!paragraph}\v!no
>      \setevalue{\e!start#1}%
>
> {\noexpand\dostartbuffer[#1][def-\nofdefinedbuffers][\e!start#1][\e!stop#1]}%
>      \setevalue{\e!get#1}%
>        {\noexpand\dodoprocessTEXbuffer[#1][def-\nofdefinedbuffers]}%
>      \setevalue{\e!type#1}%
>        {\noexpand\dotypebuffer[#1][def-\nofdefinedbuffers]}%
>        % TYPO: was
>        % {\noexpand\dodotypebuffer[#1][def-\nofdefinedbuffers]}%
>      \getparameters[\??bu#1][#2]%
>    \fi}
> \protect

Hans, was this fixed. There is a typo in core-buf.tex and it is still 
present in latest "updateable" version (2006.08.02).

Aditya

>
> \definebuffer[Example]
>
> \startExample
>   Hello again
> \stopExample
>
> \typeExample %The above fix is needed for this.
>
> \getExample

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

* Re: buffers
  2006-08-07 15:47   ` buffers Aditya Mahajan
@ 2006-08-08  9:44     ` Hans Hagen
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2006-08-08  9:44 UTC (permalink / raw)


Aditya Mahajan wrote:
> Hans, was this fixed. There is a typo in core-buf.tex and it is still 
> present in latest "updateable" version (2006.08.02).
>   
ok done 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

end of thread, other threads:[~2006-08-08  9:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-31 20:52 buffers Hans van der Meer
2006-07-31 22:21 ` buffers Aditya Mahajan
2006-08-01 10:50   ` buffers Hans van der Meer
2006-08-07 15:47   ` buffers Aditya Mahajan
2006-08-08  9:44     ` buffers Hans Hagen

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