summaryrefslogtreecommitdiff
path: root/lisp/format.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-08-09 02:38:14 +0000
committerRichard M. Stallman <rms@gnu.org>1997-08-09 02:38:14 +0000
commit5f525595285afec5ad0bf402e84cafa8835e59fb (patch)
tree471e635eac75dd7b62a03b87e0b61a1d53a5345a /lisp/format.el
parent2d30d788ae65c10a4baeef2a3502d8f54448dbeb (diff)
downloademacs-5f525595285afec5ad0bf402e84cafa8835e59fb.tar.gz
(format-annotate-single-property-change,
format-annotate-atomic-property-change): move code that interprets nil as 0 inside test that property is numeric.
Diffstat (limited to 'lisp/format.el')
-rw-r--r--lisp/format.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/format.el b/lisp/format.el
index cfb6e4ca514..237c7b2964e 100644
--- a/lisp/format.el
+++ b/lisp/format.el
@@ -813,11 +813,6 @@ Annotations to open and to close are returned as a dotted pair."
default)
(if (not prop-alist)
nil
- ;; If property is numeric, nil means 0
- (cond ((and (numberp old) (null new))
- (setq new 0))
- ((and (numberp new) (null old))
- (setq old 0)))
;; If either old or new is a list, have to treat both that way.
(if (or (consp old) (consp new))
(let* ((old (if (listp old) old (list old)))
@@ -846,13 +841,21 @@ OLD and NEW are the values."
(let (num-ann)
;; If old and new values are numbers,
;; look for a number in PROP-ALIST.
- (if (and (numberp old) (numberp new))
+ (if (and (or (null old) (numberp old))
+ (or (null new) (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
+ ;; Numerical annotation - use difference
+
+ ;; If property is numeric, nil means 0
+ (cond ((and (numberp old) (null new))
+ (setq new 0))
+ ((and (numberp new) (null old))
+ (setq old 0)))
+
(let* ((entry (car num-ann))
(increment (car entry))
(n (ceiling (/ (float (- new old)) (float increment))))