aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1997-08-09 02:38:14 +0000
committerRichard M. Stallman1997-08-09 02:38:14 +0000
commit5f525595285afec5ad0bf402e84cafa8835e59fb (patch)
tree471e635eac75dd7b62a03b87e0b61a1d53a5345a /lisp
parent2d30d788ae65c10a4baeef2a3502d8f54448dbeb (diff)
downloademacs-5f525595285afec5ad0bf402e84cafa8835e59fb.tar.gz
emacs-5f525595285afec5ad0bf402e84cafa8835e59fb.zip
(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')
-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."
813 default) 813 default)
814 (if (not prop-alist) 814 (if (not prop-alist)
815 nil 815 nil
816 ;; If property is numeric, nil means 0
817 (cond ((and (numberp old) (null new))
818 (setq new 0))
819 ((and (numberp new) (null old))
820 (setq old 0)))
821 ;; If either old or new is a list, have to treat both that way. 816 ;; If either old or new is a list, have to treat both that way.
822 (if (or (consp old) (consp new)) 817 (if (or (consp old) (consp new))
823 (let* ((old (if (listp old) old (list old))) 818 (let* ((old (if (listp old) old (list old)))
@@ -846,13 +841,21 @@ OLD and NEW are the values."
846 (let (num-ann) 841 (let (num-ann)
847 ;; If old and new values are numbers, 842 ;; If old and new values are numbers,
848 ;; look for a number in PROP-ALIST. 843 ;; look for a number in PROP-ALIST.
849 (if (and (numberp old) (numberp new)) 844 (if (and (or (null old) (numberp old))
845 (or (null new) (numberp new)))
850 (progn 846 (progn
851 (setq num-ann prop-alist) 847 (setq num-ann prop-alist)
852 (while (and num-ann (not (numberp (car (car num-ann))))) 848 (while (and num-ann (not (numberp (car (car num-ann)))))
853 (setq num-ann (cdr num-ann))))) 849 (setq num-ann (cdr num-ann)))))
854 (if num-ann 850 (if num-ann
855 ;; Numerical annotation - use difference 851 ;; Numerical annotation - use difference
852
853 ;; If property is numeric, nil means 0
854 (cond ((and (numberp old) (null new))
855 (setq new 0))
856 ((and (numberp new) (null old))
857 (setq old 0)))
858
856 (let* ((entry (car num-ann)) 859 (let* ((entry (car num-ann))
857 (increment (car entry)) 860 (increment (car entry))
858 (n (ceiling (/ (float (- new old)) (float increment)))) 861 (n (ceiling (/ (float (- new old)) (float increment))))