comparison lisp/calc/calccomp.el @ 109682:bc0b9af387a7

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.
author Jay Belanger <jay.p.belanger@gmail.com>
date Sat, 07 Aug 2010 22:04:57 -0500
parents d150a25a0eb9
children 417b1e4d63cd
comparison
equal deleted inserted replaced
109681:232ba164887b 109682:bc0b9af387a7
1337 1337
1338 (t (math-comp-to-string-flat-term (nth 2 c))))) 1338 (t (math-comp-to-string-flat-term (nth 2 c)))))
1339 1339
1340 (defun math-comp-highlight-string (s) 1340 (defun math-comp-highlight-string (s)
1341 (setq s (copy-sequence s)) 1341 (setq s (copy-sequence s))
1342 (let ((i (length s))) 1342 (if calc-highlight-selections-with-faces
1343 (while (>= (setq i (1- i)) 0) 1343 (if (not calc-show-selections)
1344 (or (memq (aref s i) '(32 ?\n)) 1344 (propertize s 'face 'calc-selected-face)
1345 (aset s i (if calc-show-selections ?\. ?\#))))) 1345 (propertize s 'face 'calc-nonselected-face))
1346 s) 1346 (let ((i (length s)))
1347 1347 (while (>= (setq i (1- i)) 0)
1348 (or (memq (aref s i) '(32 ?\n))
1349 (aset s i (if calc-show-selections ?\. ?\#)))))
1350 s))
1348 1351
1349 ;; The variable math-comp-sel-tag is local to calc-find-selected-part 1352 ;; The variable math-comp-sel-tag is local to calc-find-selected-part
1350 ;; in calc-sel.el, but is used by math-comp-sel-flat-term and 1353 ;; in calc-sel.el, but is used by math-comp-sel-flat-term and
1351 ;; math-comp-add-string-sel, which are called (indirectly) by 1354 ;; math-comp-add-string-sel, which are called (indirectly) by
1352 ;; calc-find-selected-part. 1355 ;; calc-find-selected-part.