From: SourceForge.net <noreply@so...>  20110902 22:06:29

Bugs item #3377114, was opened at 20110725 14:20 Message generated for change (Comment added) made by crategus You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3377114&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core Group: None >Status: Closed >Resolution: Fixed Priority: 2 Private: No Submitted By: Dieter Kaiser (crategus) Assigned to: Nobody/Anonymous (nobody) Summary: Linear display of long symbols and strings Initial Comment: In linear display expressions with long symbols or strings are not formated as expected. This is an example for 2ddisplay and for linear display. The option variable linel is set to 10: (%i1) display2d:true$ (%i2) a+b+c+ddddddd+eeeeeee+ffffffffffffff; (%o2) fff\ fffffffff\ ff + eeee\ eee + ddd\ dddd + c + b + a Again for linear display. The spaces in the output are replaced by points to show the format in this posting: (%i3) display2d:false$ (%i4) a+b+c+ddddddd+eeeeeee+ffffffffffffff; (%o4) ffffffffffffff .......+eeeeeee .......+ddddddd .......+c .......+b .......+a In linear display there are two problems. First, long symbols and strings are not broken up. This is a problem in the function mprint. Second, in linear display the available space is not used fully. This problem is caused in the function lineardisplay. This function prints out the output label directly. Therefore the format of the output label is not under control of the function mprint. The second problem is solved by providing a function msizelabel, which does the formating of the output label under control of the functions msize and mprint. This is an example with a new msizelabel function: (%i1) a+b+c+ddddddd+eeeeeee+ffffffffffffff; (%o1) ffffffffffffff +eeeeeee +ddddddd +c+b+a Still, the first problem is present. Long symbols are not broken up. Dieter Kaiser  >Comment By: Dieter Kaiser (crategus) Date: 20110903 00:06 Message: An implementation of a function msizemlable and msizetext has been committed to grind.lisp revision 03.09.2011. Closing this bug report as fixed. Dieter Kaiser  Comment By: Dieter Kaiser (crategus) Date: 20110814 21:48 Message: In linear display we have no functions for formating mlable and mtextexpressions. The formating is done in the function lineardispla. Therefore, the output of such expressions in lineardispla is not under the control of the function mprint which is responsible for the output of a formated expression. In 2ddisplay this problem does not exist. The following two functions implement the formating of mlable and mtextexpression for linear display: ;;;  ;; Formating a mlable expression (defprop mlable msizemlabel grind) (defun msizemlabel (x l r) (declare (special *displaylabelsp*)) (cond (*displaylabelsp* (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 msizemtext grind) (defun msizemtext (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 lineardispla reduces to the following code: (defun lineardispla (form) (freshline *standardoutput*) (mgrind form *standardoutput*) (terpri)) Furthermore, the global variable fortranp is no longer necessary and can be cut out completely. It is set in lineardispla to signal the function msizeatom that a mtextexpression has to be formated. Dieter Kaiser  You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=3377114&group_id=4933 