aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1997-08-05 04:44:55 +0000
committerRichard M. Stallman <[email protected]>1997-08-05 04:44:55 +0000
commite5a60108a283047c142817d440667ef9eba6e295 (patch)
tree645b000d67d32a7ff6dd95727c1015f0f2f5bfc3 /lisp
parent688697012a754f85456841e968c68455f653d1eb (diff)
(format-annotate-atomic-property-change):
Look thru all elements of PROP-ALIST for a number, if OLD and NEW are numbers.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/format.el37
1 files changed, 20 insertions, 17 deletions
diff --git a/lisp/format.el b/lisp/format.el
index ad109a41c9..cfb6e4ca51 100644
--- a/lisp/format.el
+++ b/lisp/format.el
@@ -843,23 +843,26 @@ Annotations to open and to close are returned as a dotted pair."
"Internal function annotate a single property change.
PROP-ALIST is the relevant segment of a TRANSLATIONS list.
OLD and NEW are the values."
- (cond
- ;; Numerical annotation - use difference
- ((and (numberp old) (numberp new))
- (let* ((entry (progn
- (while (and (car (car prop-alist))
- (not (numberp (car (car prop-alist)))))
- (setq prop-alist (cdr prop-alist)))
- (car prop-alist)))
- (increment (car (car prop-alist)))
- (n (ceiling (/ (float (- new old)) (float increment))))
- (anno (car (cdr (car prop-alist)))))
- (if (> n 0)
- (cons nil (make-list n anno))
- (cons (make-list (- n) anno) nil))))
-
- ;; Standard annotation
- (t (let ((close (and old (cdr (assoc old prop-alist))))
+ (let (num-ann)
+ ;; If old and new values are numbers,
+ ;; look for a number in PROP-ALIST.
+ (if (and (numberp old) (numberp new))
+ (progn
+ (setq num-ann prop-alist)
+ (while (and num-ann (not (numberp (car (car num-ann)))))
+ (setq num-ann (cdr num-ann)))))
+ (if num-ann
+ ;; Numerical annotation - use difference
+ (let* ((entry (car num-ann))
+ (increment (car entry))
+ (n (ceiling (/ (float (- new old)) (float increment))))
+ (anno (car (cdr entry))))
+ (if (> n 0)
+ (cons nil (make-list n anno))
+ (cons (make-list (- n) anno) nil)))
+
+ ;; Standard annotation
+ (let ((close (and old (cdr (assoc old prop-alist))))
(open (and new (cdr (assoc new prop-alist)))))
(if (or close open)
(format-make-relatively-unique close open)