# HG changeset patch # User Richard M. Stallman # Date 871094294 0 # Node ID 759e45894579920f22bcacbcab1606cbfd8d71f9 # Parent 55924d8a5b9ee1b0c5cc789a84c083d14a093113 (format-annotate-single-property-change, format-annotate-atomic-property-change): move code that interprets nil as 0 inside test that property is numeric. diff -r 55924d8a5b9e -r 759e45894579 lisp/format.el --- a/lisp/format.el Sat Aug 09 02:23:32 1997 +0000 +++ b/lisp/format.el Sat Aug 09 02:38:14 1997 +0000 @@ -813,11 +813,6 @@ 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 @@ (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))))