inchar, outchar and linechar



James Amundson <amundson@users.sourceforge.net> writes:
...
> P.S. Changes for above:
>

> 105c111,112
> <              (setq mexplabel (concat "(" (stripdollar mexplabel) ")"))
> ---
>>              (setq mexplabel (concat "(" (quote-% (stripdollar
> mexplabel))
>>                                      ")"))

> 127c134,135
> <               (eq (getchar $inchar 2) (getchar mexplabel 2)))
> ---
>>               (eq (getchars $inchar 2 (length (string $inchar)))
>>                   (getchars mexplabel 2 (length (string $inchar)))))

This is to distinguish the input prompt from others, but it seems to
reject the input prompt.  
I think the first line should be
    (eq (getchars $inchar 2 (1+ (length (string $inchar)))
Since any % in mexplabel gets replaced by \%, the second line should
be 
    (getchars mexplabel 3 (+ 2 length (string $inchar))))))
if the prompt begins with %,
    (getchars mexplabel 2 (+ 1 length (string $inchar))))))
otherwise.  Even with this, 
  tex(%i2);
(for example) will return something like
|(\%i2) ... |
Since this is supposed to be a verbatim environment, the % probably
shouldn't be quoted.  What about something like leaving
<              (setq mexplabel (concat "(" (stripdollar mexplabel) ")"))
as is, replacing
<               (eq (getchar $inchar 2) (getchar mexplabel 2)))
by
>               (eq (getchars $inchar 2 (1+ (length (string $inchar))))
>                   (getchars mexplabel 2 (1+ (length (string $inchar))))))

and then having the %'s quoted in the other clauses of the cond, as
needed: 
              (eq (getchars $inchar 2 (+ 1 (length (string $inchar))))
                  (getchars mexplabel 2 (+ 1 (length (string $inchar))))))
	       ;; aha, this is a C-line: do the grinding:
	       (format texport "~%|~a " mexplabel) ;delimit with |marks
	       (mgrind mexp texport) ;write expression as string
	       (format texport ";|~%"))
	      (t 
               (setq mexplabel (quote-% mexplabel))
                ;display the expression for TeX now:
                ...

Jay