Fix last change
[gnus] / lisp / mm-view.el
index 99594a2..ecfa2ac 100644 (file)
@@ -22,9 +22,6 @@
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
 (eval-when-compile (require 'cl))
 (require 'mail-parse)
 (require 'mailcap)
                                 (- (nth 3 edges) (nth 1 edges)))))))
          image))
      b)
-    (insert "\n\n")
+    (insert "\n")
     (mm-handle-set-undisplayer
      handle
      `(lambda ()
        (let ((b ,b)
              (inhibit-read-only t))
          (remove-images b b)
-         (delete-region b (+ b 2)))))))
+         (delete-region b (1+ b)))))))
 
 (defun mm-inline-image-xemacs (handle)
   (when (featurep 'xemacs)
-    (insert "\n\n")
-    (forward-char -2)
+    (insert "\n")
+    (forward-char -1)
     (let ((annot (make-annotation (mm-get-image handle) nil 'text))
        (inhibit-read-only t))
       (mm-handle-set-undisplayer
          (let ((b ,(point-marker))
              (inhibit-read-only t))
            (delete-annotation ,annot)
-           (delete-region (- b 2) b))))
+           (delete-region (1- b) b))))
       (set-extent-property annot 'mm t)
       (set-extent-property annot 'duplicable t))))
 
         handle
         `(lambda ()
            (let ((inhibit-read-only t))
-             (delete-region ,(point-min-marker)
+             (delete-region ,(copy-marker (point-min) t)
                             ,(point-max-marker)))))))))
 
 (defvar mm-w3m-standalone-supports-m17n-p (if (featurep 'mule) 'undecided)
        handle
        `(lambda ()
           (let ((inhibit-read-only t))
-           (delete-region ,(point-min-marker)
+           (delete-region ,(copy-marker (point-min) t)
                           ,(point-max-marker))))))))
 
 (defun mm-insert-inline (handle text)
      handle
      `(lambda ()
        (let ((inhibit-read-only t))
-         (delete-region ,(copy-marker b)
-                        ,(copy-marker (point))))))))
+         (delete-region ,(copy-marker b t)
+                        ,(point-marker)))))))
 
 (defun mm-inline-audio (handle)
   (message "Not implemented"))
@@ -523,9 +520,11 @@ If MODE is not set, try to find mode automatically."
              (set-auto-mode)))
          ;; The mode function might have already turned on font-lock.
          ;; Do not fontify if the guess mode is fundamental.
-         (unless (or (symbol-value 'font-lock-mode)
+         (unless (or font-lock-mode
                      (eq major-mode 'fundamental-mode))
-           (font-lock-fontify-buffer))))
+            (if (fboundp 'font-lock-ensure)
+                (font-lock-ensure)
+              (font-lock-fontify-buffer)))))
       ;; By default, XEmacs font-lock uses non-duplicable text
       ;; properties.  This code forces all the text properties
       ;; to be copied along with the text.