David MENTRE | 3 Mar 2006 22:10
Favicon

Re: [TeXmacs] Re: with-cursor macro

Hello,

[ Follow-up on texmacs-dev <at> , as this more a developer issue. ]

Henri Lesourd <texmacs <at> free.fr> writes:

> Yes, of course :-( it crashes when you use an invalid
> path, its exactly the same as with (go-to <path>), or
> with other function, like (path-assign), for example.
>
> Thus your code must *never* do any error with the paths...

Reading such sentences is pretty horrifying to me! TeXmacs should never
crash due to an error in a Scheme script. It should give an meaningful
error message.

Programmers *do* make errors.

I can understand that this might not be so easy to do because of the
tight integration of Guile with texmacs C++ primitives, but a protection
layer should be added to them.

Best wishes,
d.
--

-- 
pub  1024D/A3AD7A2A 2004-10-03 David MENTRE <dmentre <at> linux-france.org>
 5996 CC46 4612 9CA4 3562  D7AC 6C67 9E96 A3AD 7A2A
Henri Lesourd | 4 Mar 2006 00:32
Picon
Favicon

Re: [TeXmacs] Re: with-cursor macro

David MENTRE wrote:

>Hello,
>
>[ Follow-up on texmacs-dev <at> , as this more a developer issue. ]
>
>Henri Lesourd <texmacs <at> free.fr> writes:
>  
>
>>Yes, of course :-( it crashes when you use an invalid
>>path, its exactly the same as with (go-to <path>), or
>>with other function, like (path-assign), for example.
>>
>>Thus your code must *never* do any error with the paths...
>>    
>>
>
>Reading such sentences is pretty horrifying to me! TeXmacs should never
>crash due to an error in a Scheme script. It should give an meaningful
>error message.
>
>  
>
I know... :-(
David MENTRE | 4 Mar 2006 12:46
Favicon

Questions regarding conversion between strings and trees

Hello,

I'm pursuing the idea of a literate programming mode for texmacs. My
current running code is able to parse (and produce in the reverse
direction) a source file into a Scheme structure like the following one
(" and \ are backquoted in the Scheme way). TM and CODE a two Scheme
symbols representing respectively texmacs document and literate code.

  '((tm . "<TeXmacs|1.0.6>")
    (tm . "")
    (tm . "<style|generic>")
    (tm . "")
    (tm . "<\\body>")
    (tm . "  Sample texmacs document.")
    (tm . "")
    (code . "(define (hello-world) (display \"Hello world!\"))")
    (code . "")
    (tm . "  \;")
    (tm . "</body>")
    (tm . "")
    (tm . "<\\initial>")
    (tm . "  <\\collection>")
    (tm . "    <associate|language|french>")
    (tm . "  </collection>")
    (tm . "</initial>")

I need to transform this data structure into a texmacs document (and in
the reverse way for saving). I would like to keep the CODE blocks into a
specific node type of texmacs document tree.

(Continue reading)

Henri Lesourd | 4 Mar 2006 15:43
Picon
Favicon

Re: Questions regarding conversion between strings and trees

David MENTRE wrote:

>Hello,
>
>I'm pursuing the idea of a literate programming mode for texmacs. My
>current running code is able to parse (and produce in the reverse
>direction) a source file into a Scheme structure like the following one
>(" and \ are backquoted in the Scheme way). TM and CODE a two Scheme
>symbols representing respectively texmacs document and literate code.
>
>  '((tm . "<TeXmacs|1.0.6>")
>    (tm . "")
>    (tm . "<style|generic>")
>    (tm . "")
>    (tm . "<\\body>")
>    (tm . "  Sample texmacs document.")
>    (tm . "")
>    (code . "(define (hello-world) (display \"Hello world!\"))")
>    (code . "")
>    (tm . "  \;")
>    (tm . "</body>")
>    (tm . "")
>    (tm . "<\\initial>")
>    (tm . "  <\\collection>")
>    (tm . "    <associate|language|french>")
>    (tm . "  </collection>")
>    (tm . "</initial>")
>
>
>I need to transform this data structure into a texmacs document (and in
(Continue reading)

Stephan Mucha | 6 Mar 2006 16:44
Picon
Favicon

2nd try: (Semi)automatic recalculations of plugin session?

Same question, other mailing list, maybe I have more luck on the
dev-list:

Is there any way (or a workaround with guile or whatever) to achieve
automatic recalculation? A manual command that forces recalculation of
all output fields would be perfect too.

Maybe someone can tell me (Joris?) what had do be done to achieve
this? Is the mutator concept able to do this? Maybe with some extra
efforts, hopefully only in Scheme?

--

-- 
Thanks,
Stephan
Henri Lesourd | 7 Mar 2006 11:44
Picon
Favicon

Re: 2nd try: (Semi)automatic recalculations of plugin session?

Stephan Mucha wrote:

>Same question, other mailing list, maybe I have more luck on the
>dev-list:
>
>Is there any way (or a workaround with guile or whatever) to achieve
>automatic recalculation? A manual command that forces recalculation of
>all output fields would be perfect too.
>
>Maybe someone can tell me (Joris?) what had do be done to achieve
>this? Is the mutator concept able to do this? Maybe with some extra
>efforts, hopefully only in Scheme?
>
>  
>
The simplest way (i.e. a way that can be done and understood using
only usual concepts of programming) is to traverse the tree that
constitutes the session in the document. As far as markup is concerned,
your session looks something like that, in TeXmacs markup :
[[
<with|prog-language|LANG|prog-session|SESSION|
   <session|
      <input|PROMPT|INPUT1>
      <output|OUTPUT1>     
      <input|PROMPT|INPUT2>
      <output|OUTPUT2>
      ................
   >>
]]

(Continue reading)

David MENTRE | 9 Mar 2006 19:55
Favicon

Re: Questions regarding conversion between strings and trees

Hello Henri,

Many thanks for your detailed answers. I need to rethink my original
design as I need to use stree to build the document instead of
strings. But, on the other hand, I may have a way to have less cluttered
code.

I'll probably have further questions in the future. ;)

Best wishes,
d.
--

-- 
pub  1024D/A3AD7A2A 2004-10-03 David MENTRE <dmentre <at> linux-france.org>
 5996 CC46 4612 9CA4 3562  D7AC 6C67 9E96 A3AD 7A2A
Henri Lesourd | 10 Mar 2006 18:53
Picon
Favicon

Re: Questions regarding conversion between strings and trees

David MENTRE wrote:

>Hello Henri,
>
>Many thanks for your detailed answers. I need to rethink my original
>design
>
This is a good sign ;-), usually, looking at
a design from several points of view tends to
improve it.

>I'll probably have further questions in the future. ;)
>
>  
>
No problem.
hadar raz | 22 Mar 2006 16:23
Picon
Favicon

conversion to pdf

Hi all,

Searching this list, I found a few posts about pdf conversion, and even
one attempt at creating a new converter that dates back to 2002, but I
don't think anything came out of it.
Looking at the internal ps converter, I realized that it is a printer
device, and as such can convert directly to pdf as well, since the pdf
file structure contains the same drawing and text routines. Ofcoarse the
file header and some other pdf specific data will have to change as
well, but it is of no importance at the moment.
The two biggest problems as I see them are:

1. pdf file contains a 'catalog' which is located at the end of the
file, and points to all the different pieces of information in the file.
It will have to be implimented.

2. The pdf format is at it's best when it contains hyperlinks, just like
the TeXmacs files themselves. The internal ps printer device ignores
them at the moment.

There is a workaround for the first problem. The gs converter ps-->pdf
we currently use can handle a subset of commands called "pdfmark". These
commands can be embedded in the ps file TeXmacs outputs, and when
converted to pdf they will show as hyperlinks, bookmarks, etc'.

The second problem remains. How can we (I) embed these commands in the
ps device? There must be a way to let the device know when it proccesses
a certain block, that this block is a <label> or a <ref>, for example.
Does anyone know how can this be done?

(Continue reading)

Henri Lesourd | 22 Mar 2006 17:36
Picon
Favicon

Re: conversion to pdf

hadar raz wrote:

>Hi all,
>
>Searching this list, I found a few posts about pdf conversion, and even
>one attempt at creating a new converter that dates back to 2002, but I
>don't think anything came out of it.
>
As far as I can remember, there have been problems with fonts,
and also with inserting images connected to the PS/PDF exports,
but at least part of these problems have been solved. In
order to be able to give a more detailed answer about the
past attempts / current state of TeXmacs, I would need you
to provide more precise references about this attempt of
creating a new converter (or other things), because I can't
find it on the mailing list archives.

>Looking at the internal ps converter, I realized that it is a printer
>device, and as such can convert directly to pdf as well, since the pdf
>file structure contains the same drawing and text routines. Ofcoarse the
>file header and some other pdf specific data will have to change as
>well, but it is of no importance at the moment.
>The two biggest problems as I see them are:
>
>1. pdf file contains a 'catalog' which is located at the end of the
>file, and points to all the different pieces of information in the file.
>It will have to be implimented.
>
>2. The pdf format is at it's best when it contains hyperlinks, just like
>the TeXmacs files themselves. The internal ps printer device ignores
(Continue reading)


Gmane