]> git.eshelyaron.com Git - emacs.git/commitdiff
Declare compat macro mh-do-in-xemacs obsolete
authorStefan Kangas <stefan@marxist.se>
Thu, 7 Oct 2021 13:33:52 +0000 (15:33 +0200)
committerStefan Kangas <stefan@marxist.se>
Thu, 7 Oct 2021 13:40:15 +0000 (15:40 +0200)
* lisp/mh-e/mh-identity.el (mh-identity-add-menu):
* lisp/mh-e/mh-acros.el (mh-do-in-xemacs): Declare obsolete.
* lisp/mh-e/mh-compat.el:
* lisp/mh-e/mh-e.el (mh-xemacs-use-tool-bar-flag):
* lisp/mh-e/mh-folder.el (mh-folder-mode):
* lisp/mh-e/mh-letter.el (mh-letter-mode):
* lisp/mh-e/mh-mime.el (mh-mime-button-map)
(mh-mime-security-button-map, mh-small-image-p)
(mh-signature-highlight):
* lisp/mh-e/mh-search.el (mh-search-mode):
* lisp/mh-e/mh-seq.el:
* lisp/mh-e/mh-show.el (mh-show-mode):
* lisp/mh-e/mh-tool-bar.el (mh-tool-bar-define):
* lisp/mh-e/mh-utils.el (mh-logo-display)
(mh-hidden-header-keymap):
* lisp/mh-e/mh-xface.el (mh-face-display-function)
(mh-picon-image-types, mh-x-image-display): Delete calls to
'mh-do-in-xemacs'.

13 files changed:
lisp/mh-e/mh-acros.el
lisp/mh-e/mh-compat.el
lisp/mh-e/mh-e.el
lisp/mh-e/mh-folder.el
lisp/mh-e/mh-identity.el
lisp/mh-e/mh-letter.el
lisp/mh-e/mh-mime.el
lisp/mh-e/mh-search.el
lisp/mh-e/mh-seq.el
lisp/mh-e/mh-show.el
lisp/mh-e/mh-tool-bar.el
lisp/mh-e/mh-utils.el
lisp/mh-e/mh-xface.el

index 8fdcf3c62b40d1af557b764eacfcba6147155ecb..93523a111544636246db368af38f2dd73f5247ac 100644 (file)
@@ -53,7 +53,7 @@
 ;;;###mh-autoload
 (defmacro mh-do-in-xemacs (&rest body)
   "Execute BODY if in XEmacs."
-  (declare (debug t) (indent defun))
+  (declare (obsolete nil "29.1") (debug t) (indent defun))
   (when (featurep 'xemacs) `(progn ,@body)))
 
 ;;;###mh-autoload
index ade80e8b95e3133c92e43112e16842119f8da507..26e5576fe64369c81d3fbe27999e52ebe2b6dca0 100644 (file)
 (mh-do-in-gnu-emacs
   (defalias 'mh-require #'require))
 
-(mh-do-in-xemacs
-  (defun mh-require (feature &optional filename noerror)
-    "If feature FEATURE is not loaded, load it from FILENAME.
-If FEATURE is not a member of the list `features', then the feature
-is not loaded; so load the file FILENAME.
-If FILENAME is omitted, the printname of FEATURE is used as the file name.
-If the optional third argument NOERROR is non-nil,
-then return nil if the file is not found instead of signaling an error.
-
-Simulate NOERROR argument in XEmacs which lacks it."
-    (if (not (featurep feature))
-        (if filename
-            (load filename noerror t)
-          (load (format "%s" feature) noerror t)))))
-
 (defun-mh mh-assoc-string assoc-string (key list case-fold)
   "Like `assoc' but specifically for strings.
 Case is ignored if CASE-FOLD is non-nil.
index 9cbc8cfb73751ea27de4a24c57aa8b3d339c4531..d929a329c93b879609bd0f45927be15c7cf37216 100644 (file)
@@ -88,9 +88,6 @@
 (require 'mh-buffers)
 (require 'mh-compat)
 
-(mh-do-in-xemacs
-  (require 'mh-xemacs))
-
 (mh-font-lock-add-keywords
  'emacs-lisp-mode
  (eval-when-compile
@@ -619,10 +616,6 @@ Output is expected to be shown to user, not parsed by MH-E."
   ;; The bug wasn't seen in emacs21 but still occurred in XEmacs21.4.
   (mh-exchange-point-and-mark-preserving-active-mark))
 
-;; Shush compiler.
-(mh-do-in-xemacs
-  (defvar mark-active))
-
 (defun mh-exchange-point-and-mark-preserving-active-mark ()
   "Put the mark where point is now, and point where the mark is now.
 This command works even when the mark is not active, and
@@ -3117,42 +3110,6 @@ of your own choosing."
   :group 'mh-tool-bar
   :package-version '(MH-E . "7.0"))
 
-;; XEmacs has a couple of extra customizations...
-(mh-do-in-xemacs
-  (defcustom-mh mh-xemacs-use-tool-bar-flag mh-xemacs-has-tool-bar-flag
-    "If non-nil, use tool bar.
-
-This option controls whether to show the MH-E icons at all. By
-default, this option is turned on if the window system supports
-tool bars. If your system doesn't support tool bars, then you
-won't be able to turn on this option."
-    :type 'boolean
-    :group 'mh-tool-bar
-    :set (lambda (symbol value)
-           (if (and (eq value t)
-                    (not mh-xemacs-has-tool-bar-flag))
-               (error "Tool bar not supported"))
-           (set-default symbol value))
-    :package-version '(MH-E . "7.3"))
-
-  (defcustom-mh mh-xemacs-tool-bar-position nil
-    "Tool bar location.
-
-This option controls the placement of the tool bar along the four
-edges of the frame. You can choose from one of \"Same As Default
-Tool Bar\", \"Top\", \"Bottom\", \"Left\", or \"Right\". If this
-variable is set to anything other than \"Same As Default Tool
-Bar\" and the default tool bar is in a different location, then
-two tool bars will be displayed: the MH-E tool bar and the
-default tool bar."
-    :type '(radio (const :tag "Same As Default Tool Bar" :value nil)
-                  (const :tag "Top" :value top)
-                  (const :tag "Bottom" :value bottom)
-                  (const :tag "Left" :value left)
-                  (const :tag "Right" :value right))
-    :group 'mh-tool-bar
-    :package-version '(MH-E . "7.3")))
-
 \f
 
 ;;; Hooks (:group 'mh-hooks + group where hook described)
index 35277ae46a17d95bcd68133550751c23fac6a2b5..c22f95a79700d40b2ec7af4608bb3fd7eeea2ca9 100644 (file)
@@ -527,8 +527,6 @@ font-lock is done highlighting.")
 ;; Shush compiler.
 (defvar desktop-save-buffer)
 (defvar font-lock-auto-fontify)
-(mh-do-in-xemacs
-  (defvar font-lock-defaults))
 
 ;; Ensure new buffers won't get this mode if default major-mode is nil.
 (put 'mh-folder-mode 'mode-class 'special)
@@ -595,8 +593,6 @@ perform the operation on all messages in that region.
         (mh-tool-bar-folder-buttons-init))
     (if (boundp 'tool-bar-map)
         (set (make-local-variable 'tool-bar-map) mh-folder-tool-bar-map)))
-  (mh-do-in-xemacs
-    (mh-tool-bar-init :folder))
   (make-local-variable 'font-lock-defaults)
   (setq font-lock-defaults '(mh-folder-font-lock-keywords t))
   (make-local-variable 'desktop-save-buffer)
@@ -655,10 +651,6 @@ perform the operation on all messages in that region.
   (mh-funcall-if-exists hl-line-mode 1)
   (setq revert-buffer-function #'mh-undo-folder)
   (add-to-list 'minor-mode-alist '(mh-showing-mode " Show"))
-  (mh-do-in-xemacs
-    (easy-menu-add mh-folder-sequence-menu)
-    (easy-menu-add mh-folder-message-menu)
-    (easy-menu-add mh-folder-folder-menu))
   (mh-inc-spool-make)
   (mh-set-help mh-folder-mode-help-messages)
   (if (and (featurep 'xemacs)
index ceede0d07cbb3f043c69d36046db6b16515eaf07..656dc658cc30decd1b7c339bb29f7fd7628ebd2a 100644 (file)
@@ -88,8 +88,8 @@ See `mh-identity-add-menu'."
 (defun mh-identity-add-menu ()
   "Add the current Identity menu.
 See `mh-identity-make-menu'."
-  (if mh-identity-menu
-      (mh-do-in-xemacs (easy-menu-add mh-identity-menu))))
+  (declare (obsolete nil "29.1"))
+  nil)
 
 (defvar mh-identity-local nil
   "Buffer-local variable that holds the identity currently in use.")
index ae5b80d580721a4acc05e576dad47eeb84a40871..493749577b9390817bf2e186bd82fe5e86800e1e 100644 (file)
@@ -260,10 +260,6 @@ searching for `mh-mail-header-separator' in the buffer."
 
 ;;; MH-Letter Mode
 
-;; Shush compiler.
-(mh-do-in-xemacs
-  (defvar font-lock-defaults))
-
 ;; Ensure new buffers won't get this mode if default major-mode is nil.
 (put 'mh-letter-mode 'mode-class 'special)
 
@@ -300,8 +296,6 @@ order).
       (mh-tool-bar-letter-buttons-init))
     (if (boundp 'tool-bar-map)
         (set (make-local-variable 'tool-bar-map) mh-letter-tool-bar-map)))
-  (mh-do-in-xemacs
-    (mh-tool-bar-init :letter))
   ;; Set the local value of mh-mail-header-separator according to what is
   ;; present in the buffer...
   (set (make-local-variable 'mh-mail-header-separator)
@@ -328,12 +322,10 @@ order).
    (t
     ;; ...or the header only
     (setq font-lock-defaults '((mh-show-font-lock-keywords) t))))
-  (mh-do-in-xemacs (easy-menu-add mh-letter-menu))
   ;; Maybe we want to use the existing Mail menu from mail-mode in
   ;; 9.0; in the mean time, let's remove it since the redundancy will
   ;; only produce confusion.
   (define-key mh-letter-mode-map [menu-bar mail] #'undefined)
-  (mh-do-in-xemacs (easy-menu-remove mail-menubar-menu))
   (setq fill-column mh-letter-fill-column)
   (add-hook 'completion-at-point-functions
             #'mh-letter-completion-at-point nil 'local)
index ad594aef9063348bb9eb574376ed1162256ad3df..dfd984118b17e2e5cc361a0a1375206ab8418528 100644 (file)
@@ -189,8 +189,6 @@ Set from last use.")
       (set-keymap-parent map mh-show-mode-map))
     (mh-do-in-gnu-emacs
      (define-key map [mouse-2] #'mh-push-button))
-    (mh-do-in-xemacs
-     (define-key map '(button2) #'mh-push-button))
     (dolist (c mh-mime-button-commands)
       (define-key map (cadr c) (car c)))
     map))
@@ -215,8 +213,6 @@ Set from last use.")
     (define-key map "\r" #'mh-press-button)
     (mh-do-in-gnu-emacs
      (define-key map [mouse-2] #'mh-push-button))
-    (mh-do-in-xemacs
-     (define-key map '(button2) #'mh-push-button))
     map))
 
 \f
@@ -777,20 +773,13 @@ This is only useful if a Content-Disposition header is not present."
                                         ; this only tells us if the image is
                                         ; something that emacs can display
          (let ((image (mm-get-image handle)))
-           (or (mh-do-in-xemacs
-                 (and (mh-funcall-if-exists glyphp image)
-                      (< (glyph-width image)
-                         (or mh-max-inline-image-width (window-pixel-width)))
-                      (< (glyph-height image)
-                         (or mh-max-inline-image-height
-                             (window-pixel-height)))))
-               (mh-do-in-gnu-emacs
-                 (let ((size (and (fboundp 'image-size) (image-size image))))
-                   (and size
-                        (< (cdr size) (or mh-max-inline-image-height
-                                          (1- (window-height))))
-                        (< (car size) (or mh-max-inline-image-width
-                                          (window-width)))))))))))
+           (mh-do-in-gnu-emacs
+             (let ((size (and (fboundp 'image-size) (image-size image))))
+               (and size
+                    (< (cdr size) (or mh-max-inline-image-height
+                                      (1- (window-height))))
+                    (< (car size) (or mh-max-inline-image-width
+                                      (window-width))))))))))
 
 (defun mh-inline-vcard-p (handle)
   "Decide if HANDLE is a vcard that must be displayed inline."
@@ -821,19 +810,12 @@ being used to highlight the signature in a MIME part."
         (mh-do-in-gnu-emacs
           (let ((ov (make-overlay (point) (point-max))))
             (overlay-put ov 'face 'mh-show-signature)
-            (overlay-put ov 'evaporate t)))
-        (mh-do-in-xemacs
-          (set-extent-property (make-extent (point) (point-max))
-                               'face 'mh-show-signature))))))
+            (overlay-put ov 'evaporate t)))))))
 
 \f
 
 ;;; Button Display
 
-;; Shush compiler.
-(mh-do-in-xemacs
- (defvar ov))
-
 (defun mh-insert-mime-button (handle index displayed)
   "Insert MIME button for HANDLE.
 INDEX is the part number that will be DISPLAYED. It is also used
index e03c9dc83f737c12adb9ce63300a24920a294532..d84af791f9a308f186d61ff2a12b89decf06dc9a 100644 (file)
@@ -318,10 +318,6 @@ folder containing the index search results."
                  (cl-loop for msg-hash being the hash-values of mh-index-data
                           count (> (hash-table-count msg-hash) 0)))))))
 
-;; Shush compiler.
-(mh-do-in-xemacs
-  (defvar pick-folder))                    ;FIXME: Why?
-
 (defun mh-search-folder (folder window-config)
   "Search FOLDER for messages matching a pattern.
 
@@ -616,7 +612,6 @@ The hook `mh-search-mode-hook' is called upon entry to this mode.
 
 \\{mh-search-mode-map}"
 
-  (mh-do-in-xemacs (easy-menu-add mh-pick-menu))
   (mh-set-help mh-search-mode-help-messages))
 
 \f
index a50319a455de029a9fd36d1688babfab45010aba..69f9224ebee70773a4102a235e36e5d89dce0591 100644 (file)
@@ -194,8 +194,6 @@ MESSAGE appears."
                         " "))))
 
 ;; Shush compiler.
-(mh-do-in-xemacs
-  (defvar tool-bar-mode))
 (defvar tool-bar-map)
 
 ;;;###mh-autoload
index 803f07e02b2271ffebe89833c60c93bb0adff016..df7977c9cdfa0a4730feee7ad7f3be07c661ed08 100644 (file)
@@ -839,8 +839,6 @@ See also `mh-folder-mode'.
   (mh-do-in-gnu-emacs
    (if (boundp 'tool-bar-map)
        (set (make-local-variable 'tool-bar-map) mh-show-tool-bar-map)))
-  (mh-do-in-xemacs
-    (mh-tool-bar-init :show))
   (set (make-local-variable 'mail-header-separator) mh-mail-header-separator)
   (setq paragraph-start (default-value 'paragraph-start))
   (setq buffer-invisibility-spec '((vanish . t) t))
@@ -864,10 +862,6 @@ See also `mh-folder-mode'.
   (when mh-decode-mime-flag
     (mh-make-local-hook 'kill-buffer-hook)
     (add-hook 'kill-buffer-hook #'mh-mime-cleanup nil t))
-  (mh-do-in-xemacs
-    (easy-menu-add mh-show-sequence-menu)
-    (easy-menu-add mh-show-message-menu)
-    (easy-menu-add mh-show-folder-menu))
   (make-local-variable 'mh-show-folder-buffer)
   (buffer-disable-undo)
   (use-local-map mh-show-mode-map))
index 94aa8dd4a92a31efaf725cab3539dde22dfd65cd..4e795d960007bc0c9d84cb550f81d7a7617b85e5 100644 (file)
@@ -29,8 +29,6 @@
 (require 'mh-e)
 (mh-do-in-gnu-emacs
   (require 'tool-bar))
-(mh-do-in-xemacs
-  (require 'toolbar))
 
 ;;; Tool Bar Commands
 
@@ -145,8 +143,6 @@ where,
       (let* ((name (nth 0 button))
              (name-str (symbol-name name))
              (icon (nth 2 button))
-             (xemacs-icon (mh-do-in-xemacs
-                            `(cdr (assoc (quote ,(intern icon)) mh-xemacs-icon-map))))
              (full-doc (nth 3 button))
              (doc (if (string-match "\\(.*\\)\n" full-doc)
                       (match-string 1 full-doc)
@@ -186,7 +182,7 @@ where,
                                  (t 'folder-buttons)))
                  (docs (cond ((eq mbuttons 'letter-buttons) 'letter-docs)
                              ((eq mbuttons 'folder-buttons) 'folder-docs))))
-            (add-to-list vector-list `(vector ,xemacs-icon ',function t ,full-doc))
+            (add-to-list vector-list `(vector nil ',function t ,full-doc))
             (add-to-list
              setter `(when (member ',name ,list)
                        (mh-funcall-if-exists
@@ -282,72 +278,6 @@ Use SEQUENCE-MAP if display is limited; DEFAULT-MAP otherwise."
            (mh-tool-bar-letter-buttons-init)
            (mh-tool-bar-update 'mh-letter-mode mh-letter-tool-bar-map
                                mh-letter-tool-bar-map)))
-       ;; XEmacs specific code
-       (mh-do-in-xemacs
-         (defvar mh-tool-bar-folder-vector-map
-           (list ,@(cl-loop for button in folder-buttons
-                            for vector in folder-vectors
-                            collect `(cons ',button ,vector))))
-         (defvar mh-tool-bar-show-vector-map
-           (list ,@(cl-loop for button in show-buttons
-                            for vector in show-vectors
-                            collect `(cons ',button ,vector))))
-         (defvar mh-tool-bar-letter-vector-map
-           (list ,@(cl-loop for button in letter-buttons
-                            for vector in letter-vectors
-                            collect `(cons ',button ,vector))))
-         (defvar mh-tool-bar-folder-buttons)
-         (defvar mh-tool-bar-show-buttons)
-         (defvar mh-tool-bar-letter-buttons)
-         ;; Custom setter functions
-         (defun mh-tool-bar-letter-buttons-set (symbol value)
-           (set-default symbol value)
-           (when mh-xemacs-has-tool-bar-flag
-             (setq mh-tool-bar-letter-buttons
-                   (cl-loop
-                    for b in value
-                    collect (cdr (assoc b mh-tool-bar-letter-vector-map))))))
-         (defun mh-tool-bar-folder-buttons-set (symbol value)
-           (set-default symbol value)
-           (when mh-xemacs-has-tool-bar-flag
-             (setq mh-tool-bar-folder-buttons
-                   (cl-loop
-                    for b in value
-                    collect (cdr (assoc b mh-tool-bar-folder-vector-map))))
-             (setq mh-tool-bar-show-buttons
-                   (cl-loop
-                    for b in value
-                    collect (cdr (assoc b mh-tool-bar-show-vector-map))))))
-         (defun mh-tool-bar-init (mode)
-           "Install tool bar in MODE."
-           (when mh-xemacs-use-tool-bar-flag
-             (let ((tool-bar (cond ((eq mode :folder)
-                                    mh-tool-bar-folder-buttons)
-                                   ((eq mode :letter)
-                                    mh-tool-bar-letter-buttons)
-                                   ((eq mode :show)
-                                    mh-tool-bar-show-buttons)))
-                   (height 37)
-                   (width 40)
-                   (buffer (current-buffer)))
-               (cond
-                ((eq mh-xemacs-tool-bar-position 'top)
-                 (set-specifier top-toolbar tool-bar buffer)
-                 (set-specifier top-toolbar-visible-p t)
-                 (set-specifier top-toolbar-height height))
-                ((eq mh-xemacs-tool-bar-position 'bottom)
-                 (set-specifier bottom-toolbar tool-bar buffer)
-                 (set-specifier bottom-toolbar-visible-p t)
-                 (set-specifier bottom-toolbar-height height))
-                ((eq mh-xemacs-tool-bar-position 'left)
-                 (set-specifier left-toolbar tool-bar buffer)
-                 (set-specifier left-toolbar-visible-p t)
-                 (set-specifier left-toolbar-width width))
-                ((eq mh-xemacs-tool-bar-position 'right)
-                 (set-specifier right-toolbar tool-bar buffer)
-                 (set-specifier right-toolbar-visible-p t)
-                 (set-specifier right-toolbar-width width))
-                (t (set-specifier default-toolbar tool-bar buffer)))))))
        ;; Declare customizable tool bars
        (custom-declare-variable
         'mh-tool-bar-folder-buttons
@@ -372,7 +302,6 @@ Use SEQUENCE-MAP if display is limited; DEFAULT-MAP otherwise."
         ;;:package-version '(MH-E "7.1")
         ))))
 
-;; The icon names are duplicated in the Makefile and mh-xemacs.el.
 (mh-tool-bar-define
  ((:folder mh-inc-folder mh-mime-save-parts
            mh-previous-undeleted-msg mh-page-msg
index bbce17013b1c7c56c6bd191bc8466cd8cb1b3db2..1e244b542734b1af299af78522fe28f0d3d0c456 100644 (file)
@@ -139,14 +139,7 @@ Ignores case when searching for OLD."
                             (mh-funcall-if-exists
                              find-image '((:type xpm :ascent center
                                                  :file "mh-logo.xpm"))))))
-       (car mode-line-buffer-identification))))
-  (mh-do-in-xemacs
-    (setq modeline-buffer-identification
-          (list
-           (if mh-modeline-glyph
-               (cons modeline-buffer-id-left-extent mh-modeline-glyph)
-             (cons modeline-buffer-id-left-extent "XEmacs%N:"))
-           (cons modeline-buffer-id-right-extent " %17b")))))
+       (car mode-line-buffer-identification)))))
 
 \f
 
@@ -922,9 +915,6 @@ Handle RFC 822 (or later) continuation lines."
   (let ((map (make-sparse-keymap)))
     (mh-do-in-gnu-emacs
       (define-key map [mouse-2] #'mh-letter-toggle-header-field-display-button))
-    (mh-do-in-xemacs
-      (define-key map '(button2)
-        #'mh-letter-toggle-header-field-display-button))
     map))
 
 ;;;###mh-autoload
index 58177c1794eabdd614315021faccaacf22ab2a40..b27ab2bcabb6c0dcd753ae6ec5030c80b14f51e2 100644 (file)
@@ -88,36 +88,7 @@ in this order is used."
                              (mh-face-foreground 'mh-show-xface nil t)
                              :background
                              (mh-face-background 'mh-show-xface nil t))
-               " ")))
-          ;; XEmacs
-          (mh-do-in-xemacs
-            (cond
-             ((eq type 'url)
-              (mh-x-image-url-display url))
-             ((eq type 'png)
-              (when (featurep 'png)
-                (set-extent-begin-glyph
-                 (make-extent (point) (point))
-                 (make-glyph (vector 'png ':data (mh-face-to-png face))))))
-             ;; Try internal xface support if available...
-             ((and (eq type 'pbm) (featurep 'xface))
-              (set-glyph-face
-               (set-extent-begin-glyph
-                (make-extent (point) (point))
-                (make-glyph (vector 'xface ':data (concat "X-Face: " x-face))))
-               'mh-show-xface))
-             ;; Otherwise try external support with x-face...
-             ((and (eq type 'pbm)
-                   (fboundp 'x-face-xmas-wl-display-x-face)
-                   (fboundp 'executable-find) (executable-find "uncompface"))
-              (mh-funcall-if-exists x-face-xmas-wl-display-x-face))
-             ;; Picon display
-             ((and raw (member type '(xpm xbm gif)))
-              (when (featurep type)
-                (set-extent-begin-glyph
-                 (make-extent (point) (point))
-                 (make-glyph (vector type ':data raw))))))
-            (when raw (insert " "))))))))
+               " "))))))))
 
 (defun mh-face-to-png (data)
   "Convert base64 encoded DATA to png image."
@@ -178,8 +149,7 @@ The directories are searched for in the order they appear in the list.")
   (cl-loop for type in '(xpm xbm gif)
            when (or (mh-do-in-gnu-emacs
                      (ignore-errors
-                       (mh-funcall-if-exists image-type-available-p type)))
-                    (mh-do-in-xemacs (featurep type)))
+                       (mh-funcall-if-exists image-type-available-p type))))
            collect type))
 
 (autoload 'message-tokenize-header "sendmail")
@@ -405,15 +375,7 @@ filenames.  In addition, replaces * with %2a. See URL
                      (eq marker mh-x-image-marker))
             (goto-char marker)
             (mh-do-in-gnu-emacs
-              (mh-funcall-if-exists insert-image (create-image image 'png)))
-            (mh-do-in-xemacs
-              (when (featurep 'png)
-                (set-extent-begin-glyph
-                 (make-extent (point) (point))
-                 (make-glyph
-                  (vector 'png ':data (with-temp-buffer
-                                        (insert-file-contents-literally image)
-                                        (buffer-string))))))))
+              (mh-funcall-if-exists insert-image (create-image image 'png))))
         (set-buffer-modified-p buffer-modified-flag)))))
 
 (defun mh-x-image-url-fetch-image (url cache-file marker sentinel)