]> code.delx.au - gnu-emacs/blobdiff - lisp/gnus/mm-view.el
Merge from origin/emacs-25
[gnu-emacs] / lisp / gnus / mm-view.el
index d8da137e0dc72d7684922a62ff6b7481dd135308..c62ea958da6ec66331a6279c532f0bd15c056fd0 100644 (file)
@@ -79,7 +79,7 @@
 
 (autoload 'gnus-rescale-image "gnus-util")
 
-(defun mm-inline-image-emacs (handle)
+(defun mm-inline-image (handle)
   (let ((b (point-marker))
        (inhibit-read-only t))
     (put-image
          (remove-images b b)
          (delete-region b (1+ b)))))))
 
-(defun mm-inline-image-xemacs (handle)
-  (when (featurep 'xemacs)
-    (insert "\n")
-    (forward-char -1)
-    (let ((annot (make-annotation (mm-get-image handle) nil 'text))
-       (inhibit-read-only t))
-      (mm-handle-set-undisplayer
-       handle
-       `(lambda ()
-         (let ((b ,(point-marker))
-             (inhibit-read-only t))
-           (delete-annotation ,annot)
-           (delete-region (1- b) b))))
-      (set-extent-property annot 'mm t)
-      (set-extent-property annot 'duplicable t))))
-
-(eval-and-compile
-  (if (featurep 'xemacs)
-      (defalias 'mm-inline-image 'mm-inline-image-xemacs)
-    (defalias 'mm-inline-image 'mm-inline-image-emacs)))
-
 (defvar mm-w3m-setup nil
   "Whether gnus-article-mode has been setup to use emacs-w3m.")
 
              (delete-region ,(point-min-marker)
                             ,(point-max-marker)))))))))
 
-(defvar mm-w3m-standalone-supports-m17n-p (if (featurep 'mule) 'undecided)
+(defvar mm-w3m-standalone-supports-m17n-p 'undecided
   "*T means the w3m command supports the m17n feature.")
 
 (defun mm-w3m-standalone-supports-m17n-p ()
   "Say whether the w3m command supports the m17n feature."
   (cond ((eq mm-w3m-standalone-supports-m17n-p t) t)
        ((eq mm-w3m-standalone-supports-m17n-p nil) nil)
-       ((not (featurep 'mule)) (setq mm-w3m-standalone-supports-m17n-p nil))
        ((condition-case nil
             (let ((coding-system-for-write 'iso-2022-jp)
                   (coding-system-for-read 'iso-2022-jp)
         handle
         `(lambda ()
            (let ((inhibit-read-only t))
-             (if (fboundp 'remove-specifier)
-                 ;; This is only valid on XEmacs.
-                 (dolist (prop '(background background-pixmap foreground))
-                   (remove-specifier
-                    (face-property 'default prop) (current-buffer))))
              (delete-region ,(point-min-marker) ,(point-max-marker)))))))))
 
 ;; Shut up byte-compiler.
@@ -485,11 +458,7 @@ If MODE is not set, try to find mode automatically."
        (unless charset
          (setq coding-system (mm-find-buffer-file-coding-system)))
        (setq text (buffer-string))))
-    ;; XEmacs @#$@ version of font-lock refuses to fully turn itself
-    ;; on for buffers whose name begins with " ".  That's why we use
-    ;; `with-current-buffer'/`generate-new-buffer' rather than
-    ;; `with-temp-buffer'.
-    (with-current-buffer (generate-new-buffer "*fontification*")
+    (with-temp-buffer
       (buffer-disable-undo)
       (mm-enable-multibyte)
       (insert (cond ((eq charset 'gnus-decoded)
@@ -523,28 +492,16 @@ If MODE is not set, try to find mode automatically."
          ;; Do not fontify if the guess mode is fundamental.
          (unless (or font-lock-mode
                      (eq major-mode 'fundamental-mode))
-            (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.
-      (when (featurep 'xemacs)
-       (map-extents (lambda (ext ignored)
-                      (set-extent-property ext 'duplicable t)
-                      nil)
-                    nil nil nil nil nil 'text-prop))
+           (font-lock-ensure))))
       (setq text (buffer-string))
       ;; Set buffer unmodified to avoid confirmation when killing the
       ;; buffer.
-      (set-buffer-modified-p nil)
-      (kill-buffer (current-buffer)))
+      (set-buffer-modified-p nil))
     (mm-insert-inline handle text)))
 
 ;; Shouldn't these functions check whether the user even wants to use
-;; font-lock?  At least under XEmacs, this fontification is pretty
-;; much unconditional.  Also, it would be nice to change for the size
-;; of the fontified region.
+;; font-lock?  Also, it would be nice to change for the size of the
+;; fontified region.
 
 (defun mm-display-patch-inline (handle)
   (mm-display-inline-fontify handle 'diff-mode))