summaryrefslogtreecommitdiff
path: root/lisp/calc/calccomp.el
diff options
context:
space:
mode:
authorJay Belanger <jay.p.belanger@gmail.com>2010-08-07 22:04:57 -0500
committerJay Belanger <jay.p.belanger@gmail.com>2010-08-07 22:04:57 -0500
commit2c695727e092f051b17846c0897fd541cefbdf8a (patch)
tree6f72607d95778ef73ffaff06018fccfd6baca509 /lisp/calc/calccomp.el
parentb93d4f22cbb28c4efbb65fa4927e8b42b41ba00f (diff)
downloademacs-2c695727e092f051b17846c0897fd541cefbdf8a.tar.gz
calc.el (calc-trail-mode,calc-refresh): Use `face' property to italicize headers.
(calc-highlight-selections-with-faces): New variable. (calc-selected-face, calc-nonselected-face): New faces. calccomp.el (math-comp-highlight-string): Use `calc-highlight-selections-with-faces' to determine how to highlight subformulas. calc-sel.el (calc-show-selections): Change message to something appropriate. calc.texi (Making Selections, Selecting Subformulas) (Customizing Calc): Mention how to use faces to emphasize selected subformulas.
Diffstat (limited to 'lisp/calc/calccomp.el')
-rw-r--r--lisp/calc/calccomp.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el
index 7aeb31c7719..6923cd7693a 100644
--- a/lisp/calc/calccomp.el
+++ b/lisp/calc/calccomp.el
@@ -1339,12 +1339,15 @@
(defun math-comp-highlight-string (s)
(setq s (copy-sequence s))
- (let ((i (length s)))
- (while (>= (setq i (1- i)) 0)
- (or (memq (aref s i) '(32 ?\n))
- (aset s i (if calc-show-selections ?\. ?\#)))))
- s)
-
+ (if calc-highlight-selections-with-faces
+ (if (not calc-show-selections)
+ (propertize s 'face 'calc-selected-face)
+ (propertize s 'face 'calc-nonselected-face))
+ (let ((i (length s)))
+ (while (>= (setq i (1- i)) 0)
+ (or (memq (aref s i) '(32 ?\n))
+ (aset s i (if calc-show-selections ?\. ?\#)))))
+ s))
;; The variable math-comp-sel-tag is local to calc-find-selected-part
;; in calc-sel.el, but is used by math-comp-sel-flat-term and