]> git.eshelyaron.com Git - emacs.git/commitdiff
Calc: use big brackets around function arguments
authorMattias Engdegård <mattiase@acm.org>
Fri, 22 Jan 2021 14:47:48 +0000 (15:47 +0100)
committerMattias Engdegård <mattiase@acm.org>
Fri, 22 Jan 2021 14:49:50 +0000 (15:49 +0100)
* lisp/calc/calccomp.el (math-compose-expr): Use big brackets around
arguments in Big mode, so that expressions like sin(a/b) look a bit
better.

lisp/calc/calccomp.el

index 5f38ee71c78c8738a67ff4a2a16be14cbfb06ee4..bd81d7fe4065632bca09f71f3c3cc4de3cc80455 100644 (file)
                  (if (setq spfn (get calc-language 'math-func-formatter))
                      (funcall spfn func a)
 
-                   (list 'horiz func calc-function-open
-                      (math-compose-vector (cdr a) ", " 0)
-                      calc-function-close))))))))))
+                   (let ((args (math-compose-vector (cdr a) ", " 0)))
+                     (if (and (member calc-function-open '("(" "[" "{"))
+                              (member calc-function-close '(")" "]" "}")))
+                         (list 'horiz func
+                               (math--comp-bracket
+                                (string-to-char calc-function-open)
+                                (string-to-char calc-function-close)
+                                args))
+                       (list 'horiz func calc-function-open
+                            args calc-function-close))))))))))))
 
 
 (defun math-prod-first-term (x)