mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] mathematical input withing session (1.0.7.2)


Chronological Thread 
  • From: Joris van der Hoeven <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] mathematical input withing session (1.0.7.2)
  • Date: Thu, 24 Sep 2009 22:27:14 +0200

On Sat, Sep 19, 2009 at 10:10:42PM +0700, Maxim Nikulin wrote:
> It seems that the problem is in the progs/dynamic/session-edit.scm file.
> The field-update-math function sets node to <folded-io-math>
> (<folded-io>) even if it is <input> or <input-math> in the case of last
> session line:
>
> >(define (field-update-math t)
> > (if (session-math-input?)
> > (when (field-prog-context? t)
> > (tree-assign-node! t 'folded-io-math)
> > (tree-assign (tree-ref t 1) '(document "")))
> > (when (field-math-context? t)
> > (tree-assign-node! t 'folded-io)
> > (tree-assign (tree-ref t 1) '(document "")))))
>
> I try to fix that. This is my attempt to write scheme code, so it looks
> ugly. I'm sure there is a compact and clear variant of
>
> (define (field-update-math t)
> (if (session-math-input?)
> (when (tm-func? (tree-ref t :up) 'document)
> (when (tree-in? t '(input))
> (tree-assign-node! t 'input-math))
> (when (tree-in? t '(folded-io))
> (tree-assign-node! t 'folded-io-math))
> (when (tree-in? t '(unfolded-io))
> (tree-assign-node! t 'unfolded-io-math)))
> (when (tm-func? (tree-ref t :up) 'document)
> (when (tree-in? t '(input-math))
> (tree-assign-node! t 'input))
> (when (tree-in? t '(folded-io-math))
> (tree-assign-node! t 'folded-io))
> (when (tree-in? t '(unfolded-io-math))
> (tree-assign-node! t 'unfolded-io))
> ; There should be a better way than just clear the field.
> ; Copy from input-math to input field converts the expression
> ; and something similar can be used here
> (tree-assign (tree-ref t 1) '(document "")))))

Yes, this kind of fix should be fine.
You should consider the scheme 'cond' statement here.
If you create an account on Savannah, then you may apply this
to the SVN version.

Best wishes, --Joris



Archive powered by MHonArc 2.6.19.

Top of page