In linear display we have no functions for formating mlable- and mtext-expressions. The formating is done in the function linear-displa. Therefore, the output of such expressions in linear-displa is not under the control of the function mprint which is responsible for the output of a formated expression. In 2d-display this problem does not exist.

The following two functions implement the formating of mlable- and mtext-expression for linear display:

;;; ----------------------------------------------------------------------------

;; Formating a mlable expression

(defprop mlable msize-mlabel grind)

(defun msize-mlabel (x l r)

(declare (special *display-labels-p*))

(cond (*display-labels-p*

(setq l (msize (cadr x) (list #\( ) (list #\) #\ ) nil nil)

r (msize (caddr x) nil r 'mparen 'mparen))

(cons (+ (car l) (car r)) (cons l (cons r nil))))

(t (msize (caddr x) l r 'mparen 'mparen))))

;;; ----------------------------------------------------------------------------

;; Formating a mtext expression

(defprop mtext msize-mtext grind)

(defun msize-mtext (x l r)

(setq x (cdr x))

(if (null x)

(msz nil l r)

(do ((nl) (w 0))

((null (cdr x))

(setq nl (cons (if (atom (car x))

(msz (makestring (car x)) l r)

(msize (car x) l r lop rop))

nl))

(cons (+ w (caar nl)) (nreverse nl)))

(setq nl (cons (if (atom (car x))

(msz (makestring (car x)) l r)

(msize (car x) l nil lop rop))

nl)

w (+ w (caar nl))

x (cdr x)

l nil))))

;;; ----------------------------------------------------------------------------

With this definitions the function linear-displa reduces to the following code:

(defun linear-displa (form)

(fresh-line *standard-output*)

(mgrind form *standard-output*)

(terpri))

Furthermore, the global variable fortranp is no longer necessary and can be cut out completely. It is set in linear-displa to signal the function msize-atom that a mtext-expression has to be formated.

Dieter Kaiser