emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 4c0dce4: Calc: use big brackets around function arguments


From: Mattias Engdegård
Subject: master 4c0dce4: Calc: use big brackets around function arguments
Date: Fri, 22 Jan 2021 09:50:02 -0500 (EST)

branch: master
commit 4c0dce4b66c41a12a4cf7439b036962e9525eeaa
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    Calc: use big brackets around function arguments
    
    * 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 | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el
index 5f38ee7..bd81d7f 100644
--- a/lisp/calc/calccomp.el
+++ b/lisp/calc/calccomp.el
@@ -822,9 +822,16 @@
                  (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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]