]> code.delx.au - gnu-emacs/blobdiff - lisp/format.el
(log-view-goto-rev): New function for the new VC.
[gnu-emacs] / lisp / format.el
index 6fab2a3e725bcbe1b96a83da1cf83fc28ff8db4c..fccbdb22cb3265cf04aad9d41bda2412120a0d19 100644 (file)
@@ -86,9 +86,9 @@
     (gtex  "German TeX (encoding)"
           nil
           iso-gtex2iso iso-iso2gtex t nil)
-    (html  "HTML (encoding)"
+    (html  "HTML/SGML \"ISO 8879:1986//ENTITIES Added Latin 1//EN\" (encoding)"
           nil
-          "recode -f html:latin1" "recode -f latin1:html" t nil)
+          iso-sgml2iso iso-iso2sgml t nil)
     (rot13 "rot13"
           nil
           "tr a-mn-z n-za-m" "tr a-mn-z n-za-m" t nil)
@@ -483,6 +483,14 @@ returns nil."
          b (cdr b)))
   a)
 
+(defun format-proper-list-p (list)
+  "Return t if LIST is a proper list.
+A proper list is a list ending with a nil cdr, not with an atom "
+  (when (listp list)
+    (while (consp list)
+      (setq list (cdr list)))
+    (null list)))
+
 (defun format-reorder (items order)
   "Arrange ITEMS to following partial ORDER.
 Elements of ITEMS equal to elements of ORDER will be rearranged to follow the
@@ -502,6 +510,10 @@ ORDER.  Unmatched items will go last."
                                        ; See format-deannotate-region and
                                        ; format-annotate-region.
 
+;; This text property has list values, but they are treated atomically.
+
+(put 'display 'format-list-atomic-p t)
+
 ;;;
 ;;; Decoding
 ;;;
@@ -921,24 +933,28 @@ Annotations to open and to close are returned as a dotted pair."
     (if (not prop-alist)
        nil
       ;; 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)))
-                (new (if (listp new) new (list new)))
-                (tail (format-common-tail old new))
-                close open)
-           (while old
-             (setq close
-                   (append (car (format-annotate-atomic-property-change
-                                 prop-alist (car old) nil))
-                           close)
-                   old (cdr old)))
-           (while new
-             (setq open
-                   (append (cdr (format-annotate-atomic-property-change
-                                 prop-alist nil (car new)))
-                           open)
-                   new (cdr new)))
-           (format-make-relatively-unique close open))
+      (if (and (or (listp old) (listp new))
+              (not (get prop 'format-list-atomic-p)))
+         (if (or (not (format-proper-list-p old))
+                 (not (format-proper-list-p new)))
+             (format-annotate-atomic-property-change prop-alist old new)
+           (let* ((old (if (listp old) old (list old)))
+                  (new (if (listp new) new (list new)))
+                  (tail (format-common-tail old new))
+                  close open)
+             (while old
+               (setq close
+                     (append (car (format-annotate-atomic-property-change
+                                   prop-alist (car old) nil))
+                             close)
+                     old (cdr old)))
+             (while new
+               (setq open
+                     (append (cdr (format-annotate-atomic-property-change
+                                   prop-alist nil (car new)))
+                             open)
+                     new (cdr new)))
+             (format-make-relatively-unique close open)))
        (format-annotate-atomic-property-change prop-alist old new)))))
 
 (defun format-annotate-atomic-property-change (prop-alist old new)