diff options
| author | Gerd Moellmann | 2000-02-21 13:00:25 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-02-21 13:00:25 +0000 |
| commit | f0a6c717e27cda12ba60d5afcd01a09d2e8cba67 (patch) | |
| tree | 3b90105adaac81e5fa68fbc2a308bf6025228f43 /lisp/format.el | |
| parent | ed58ed834c342bb2dc4fc7f4e70d34d0e782173a (diff) | |
| download | emacs-f0a6c717e27cda12ba60d5afcd01a09d2e8cba67.tar.gz emacs-f0a6c717e27cda12ba60d5afcd01a09d2e8cba67.zip | |
(format-annotate-single-property-change): Handle
properties.with dotted-list values.
(format-proper-list-p): New function.
Diffstat (limited to 'lisp/format.el')
| -rw-r--r-- | lisp/format.el | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/lisp/format.el b/lisp/format.el index 77b46860c1f..4a0ee582809 100644 --- a/lisp/format.el +++ b/lisp/format.el | |||
| @@ -483,6 +483,14 @@ returns nil." | |||
| 483 | b (cdr b))) | 483 | b (cdr b))) |
| 484 | a) | 484 | a) |
| 485 | 485 | ||
| 486 | (defun format-proper-list-p (list) | ||
| 487 | "Return t if LIST is a proper list. | ||
| 488 | A proper list is a list ending with a nil cdr, not with an atom " | ||
| 489 | (when (listp list) | ||
| 490 | (while (consp list) | ||
| 491 | (setq list (cdr list))) | ||
| 492 | (null list))) | ||
| 493 | |||
| 486 | (defun format-reorder (items order) | 494 | (defun format-reorder (items order) |
| 487 | "Arrange ITEMS to following partial ORDER. | 495 | "Arrange ITEMS to following partial ORDER. |
| 488 | Elements of ITEMS equal to elements of ORDER will be rearranged to follow the | 496 | Elements of ITEMS equal to elements of ORDER will be rearranged to follow the |
| @@ -925,25 +933,28 @@ Annotations to open and to close are returned as a dotted pair." | |||
| 925 | (if (not prop-alist) | 933 | (if (not prop-alist) |
| 926 | nil | 934 | nil |
| 927 | ;; If either old or new is a list, have to treat both that way. | 935 | ;; If either old or new is a list, have to treat both that way. |
| 928 | (if (and (or (consp old) (consp new)) | 936 | (if (and (or (listp old) (listp new)) |
| 929 | (not (get prop 'format-list-atomic-p))) | 937 | (not (get prop 'format-list-atomic-p))) |
| 930 | (let* ((old (if (listp old) old (list old))) | 938 | (if (or (not (format-proper-list-p old)) |
| 931 | (new (if (listp new) new (list new))) | 939 | (not (format-proper-list-p new))) |
| 932 | (tail (format-common-tail old new)) | 940 | (format-annotate-atomic-property-change prop-alist old new) |
| 933 | close open) | 941 | (let* ((old (if (listp old) old (list old))) |
| 934 | (while old | 942 | (new (if (listp new) new (list new))) |
| 935 | (setq close | 943 | (tail (format-common-tail old new)) |
| 936 | (append (car (format-annotate-atomic-property-change | 944 | close open) |
| 937 | prop-alist (car old) nil)) | 945 | (while old |
| 938 | close) | 946 | (setq close |
| 939 | old (cdr old))) | 947 | (append (car (format-annotate-atomic-property-change |
| 940 | (while new | 948 | prop-alist (car old) nil)) |
| 941 | (setq open | 949 | close) |
| 942 | (append (cdr (format-annotate-atomic-property-change | 950 | old (cdr old))) |
| 943 | prop-alist nil (car new))) | 951 | (while new |
| 944 | open) | 952 | (setq open |
| 945 | new (cdr new))) | 953 | (append (cdr (format-annotate-atomic-property-change |
| 946 | (format-make-relatively-unique close open)) | 954 | prop-alist nil (car new))) |
| 955 | open) | ||
| 956 | new (cdr new))) | ||
| 957 | (format-make-relatively-unique close open))) | ||
| 947 | (format-annotate-atomic-property-change prop-alist old new))))) | 958 | (format-annotate-atomic-property-change prop-alist old new))))) |
| 948 | 959 | ||
| 949 | (defun format-annotate-atomic-property-change (prop-alist old new) | 960 | (defun format-annotate-atomic-property-change (prop-alist old new) |