diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el index a59ad82aa57..73a627f178c 100644 --- a/lisp/calc/calccomp.el +++ b/lisp/calc/calccomp.el @@ -1656,7 +1656,11 @@ Not all brackets have midpieces.") ((memq (car c) '(set break)) t))) (defun math-comp-width (c) - (cond ((not (consp c)) (length c)) + (cond ((not (consp c)) + (or (and (stringp c) + (ceiling (string-pixel-width c) + (string-pixel-width "-"))) + (length c))) ((memq (car c) '(horiz subscr supscr)) (let ((accum 0)) (while (setq c (cdr c))