diff options
Diffstat (limited to 'lisp/calc')
-rw-r--r-- | lisp/calc/calc-aent.el | 18 | ||||
-rw-r--r-- | lisp/calc/calc-ext.el | 2 | ||||
-rw-r--r-- | lisp/calc/calc-lang.el | 3 | ||||
-rw-r--r-- | lisp/calc/calc-mode.el | 2 | ||||
-rw-r--r-- | lisp/calc/calc.el | 8 | ||||
-rw-r--r-- | lisp/calc/calcalg2.el | 4 | ||||
-rw-r--r-- | lisp/calc/calcalg3.el | 2 |
7 files changed, 29 insertions, 10 deletions
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index 697d510ac02..ee9c6e61e4c 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -1015,6 +1015,19 @@ in Calc algebraic input.") (concat (math-match-substring x 1) "-" (math-match-substring x 2))) x)) +(defun math-restore-underscores (x) + "Replace pound signs by underscores in the symbol x. +If the current Calc language does not allow underscores, return nil." + (if (memq calc-language calc-lang-allow-underscores) + (intern-soft (math-string-restore-underscores (symbol-name x))))) + +(defun math-string-restore-underscores (x) + "Replace pound signs by underscores in the string x." + (if (string-match "\\`\\(.*\\)#\\(.*\\)\\'" x) + (math-string-restore-underscores + (concat (math-match-substring x 1) "_" (math-match-substring x 2))) + x)) + (defun math-read-if (cond op) (let ((then (math-read-expr-level 0))) (or (equal math-expr-data ":") @@ -1116,7 +1129,10 @@ in Calc algebraic input.") sym (intern (concat "var-" (symbol-name sym))))))) - (let ((v (assq (nth 1 val) math-expr-variable-mapping))) + (let ((v (or + (assq (nth 1 val) math-expr-variable-mapping) + (assq (math-restore-underscores (nth 1 val)) + math-expr-variable-mapping)))) (and v (setq val (if (consp (cdr v)) (funcall (car (cdr v)) v val) (list 'var diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 140335a3d02..56b95ef218e 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -1434,7 +1434,7 @@ calc-kill calc-kill-region calc-yank)))) (calc-set-command-flag 'no-align) (setq prefix (set flag (not (symbol-value flag))) prefix-arg n) - (message (if prefix msg ""))) + (message "%s" (if prefix msg ""))) (and prefix (not calc-is-keypad-press) (if (boundp 'overriding-terminal-local-map) diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el index 2ae23cd5aa9..6773049c391 100644 --- a/lisp/calc/calc-lang.el +++ b/lisp/calc/calc-lang.el @@ -408,6 +408,9 @@ (message "LaTeX language mode with \\func(\\text{var}) and multiline matrices"))))) +(put 'tex 'math-lang-name "TeX") +(put 'latex 'math-lang-name "LaTeX") + (put 'tex 'math-oper-table '( ( "\\hat" calcFunc-hat -1 950 ) ( "\\check" calcFunc-check -1 950 ) diff --git a/lisp/calc/calc-mode.el b/lisp/calc/calc-mode.el index d7daf1bf997..85ae4d7b264 100644 --- a/lisp/calc/calc-mode.el +++ b/lisp/calc/calc-mode.el @@ -505,7 +505,7 @@ mode) (and (not (eq calc-simplify-mode mode)) mode))) - (message (if (eq calc-simplify-mode mode) + (message "%s" (if (eq calc-simplify-mode mode) msg "Default simplifications enabled"))) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 69cacec2220..fa98b161567 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -1228,7 +1228,7 @@ If nil, selections displayed but ignored.") (let ((prompt2 (format "%s " (key-description (this-command-keys)))) (glob (current-global-map)) (loc (current-local-map))) - (or (input-pending-p) (message prompt)) + (or (input-pending-p) (message "%s" prompt)) (let ((key (calc-read-key t))) (calc-unread-command (cdr key)) (unwind-protect @@ -1244,7 +1244,7 @@ If nil, selections displayed but ignored.") (defun calc-version () "Return version of this version of Calc." (interactive) - (message (concat "Calc version " calc-version))) + (message "Calc version %s" calc-version)) (defun calc-mode () "Calculator major mode. @@ -1675,8 +1675,8 @@ See calc-keypad for details." (t (format "Radix%d " calc-number-radix))) (if calc-leading-zeros "Zero " "") (cond ((null calc-language) "") - ((eq calc-language 'tex) "TeX ") - ((eq calc-language 'latex) "LaTeX ") + ((get calc-language 'math-lang-name) + (concat (get calc-language 'math-lang-name) " ")) (t (concat (capitalize (symbol-name calc-language)) " "))) diff --git a/lisp/calc/calcalg2.el b/lisp/calc/calcalg2.el index 4afed43d99c..1259642842a 100644 --- a/lisp/calc/calcalg2.el +++ b/lisp/calc/calcalg2.el @@ -746,7 +746,7 @@ (setq math-integ-msg (format "Working... Integrating %s" (math-format-flat-expr expr 0))) - (message math-integ-msg))) + (message "%s" math-integ-msg))) (if math-cur-record (setcar (cdr math-cur-record) (if same-as-above (vector simp) 'busy)) @@ -773,7 +773,7 @@ "simplification...\n") (setq val (math-integral simp 'no t)))))))) (if (eq calc-display-working-message 'lots) - (message math-integ-msg))) + (message "%s" math-integ-msg))) (setcar (cdr math-cur-record) (or val (if (or math-enable-subst (not math-any-substs)) diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el index 374b0487cfe..77e8b1537f4 100644 --- a/lisp/calc/calcalg3.el +++ b/lisp/calc/calcalg3.el @@ -416,7 +416,7 @@ (calc-record (calc-normalize calc-fit-to-trail) "parm")))) (when plot (if (stringp plot) - (message plot) + (message "%s" plot) (let ((calc-graph-no-auto-view t)) (calc-graph-delete t) (calc-graph-add-curve |