From: Mattias Engdegård Date: Sun, 6 Dec 2020 10:07:33 +0000 (+0100) Subject: Unicode integrals in Calc X-Git-Tag: emacs-28.0.90~4902 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=75a91a0bb5236b049a5ea07488da5721ec5a3214;p=emacs.git Unicode integrals in Calc * lisp/calc/calccomp.el (math-compose-integ): Use Unicode integral signs when available instead of a crude ASCII approximation, with a shorter stem to save space. --- diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el index e4f6e989ecf..0631eb48f9f 100644 --- a/lisp/calc/calccomp.el +++ b/lisp/calc/calccomp.el @@ -1054,17 +1054,36 @@ (nth 1 a)) 185)) (calc-language 'flat) (low (and (nth 3 a) (math-compose-expr (nth 3 a) 0))) - (high (and (nth 4 a) (math-compose-expr (nth 4 a) 0)))) + (high (and (nth 4 a) (math-compose-expr (nth 4 a) 0))) + ;; Check if we have Unicode integral top/bottom parts. + (fancy (and (char-displayable-p ?⌠) + (char-displayable-p ?⌡))) + ;; If we do, find the most suitable middle part. + (fancy-stem (cond ((not fancy)) + ;; U+23AE INTEGRAL EXTENSION + ((char-displayable-p ?⎮) "⎮ ") + ;; U+2502 BOX DRAWINGS LIGHT VERTICAL + ((char-displayable-p ?│) "│ ") + ;; U+007C VERTICAL LINE + (t "| ")))) (list 'horiz (if parens "(" "") - (append (list 'vcent (if high 3 2)) - (and high (list (list 'horiz " " high))) - '(" /" - " | " - " | " - " | " - "/ ") - (and low (list (list 'horiz low " ")))) + (append (list 'vcent (if fancy + (if high 2 1) + (if high 3 2))) + (and high (list (if fancy + (list 'horiz high " ") + (list 'horiz " " high)))) + (if fancy + (list "⌠ " fancy-stem "⌡ ") + '(" /" + " | " + " | " + " | " + "/ ")) + (and low (list (if fancy + (list 'horiz low " ") + (list 'horiz low " "))))) expr (if over ""