From xemacs-m  Fri Feb  7 02:19:25 1997
Received: from altair.xemacs.org (steve@xemacs.miranova.com [206.190.83.19])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id CAA29653
	for <xemacs-beta@xemacs.org>; Fri, 7 Feb 1997 02:19:24 -0600 (CST)
Received: (from steve@localhost)
	by altair.xemacs.org (8.8.5/8.8.5) id AAA22344;
	Fri, 7 Feb 1997 00:30:29 -0800
To: xemacs-beta@xemacs.org
Subject: Loose ends -- tm in-line image patch/fun with glyphs
X-Url: http://www.miranova.com/%7Esteve/
Mail-Copies-To: never
X-Face: #!T9!#9s-3o8)*uHlX{Ug[xW7E7Wr!*L46-OxqMu\xz23v|R9q}lH?cRS{rCNe^'[`^sr5"
 f8*@r4ipO6Jl!:Ccq<xoV[Qz2u8<8-+Vwf2gzJ44lf_/y9OaQ`@#Q65{U4/TC)i2`~/M&QI$X>p:9I
 OSS'2{-)-4wBnVeg0S\O4Al@)uC[pD|+
X-Attribution: sb
From: Steven L Baur <steve@miranova.com>
Mime-Version: 1.0 (generated by tm-edit 7.101)
Content-Type: text/plain; charset=US-ASCII
Date: 07 Feb 1997 00:30:28 -0800
Message-ID: <m2afph2f2z.fsf@altair.xemacs.org>
Lines: 53
X-Mailer: Gnus v5.4.11/XEmacs 20.0

I haven't determined the exact cause of the widely reported problem of
tm not displaying inline images, but I have found a method that works
a little better.  The following patch is good against any recent tm.

Index: tm-image.el
===================================================================
RCS file: /usr/local/xemacs/xemacs-20.0/lisp/tm/tm-image.el,v
retrieving revision 1.2
diff -u -r1.2 tm-image.el
--- tm-image.el	1996/12/28 21:03:14	1.2
+++ tm-image.el	1997/02/07 07:54:30
@@ -224,14 +224,15 @@
     (mime-decode-region beg end encoding)
     (let ((data (buffer-string))
 	  (minor (assoc-value ctype mime-viewer/image-converter-alist))
-	  gl)
+	  gl e)
       (delete-region (point-min)(point-max))
       (while (progn
 	       (setq gl (make-glyph (vector minor :data data)))
 	       (eq (image-instance-type (glyph-image-instance gl))
 		   'text)
 	       ))
-      (make-annotation gl (point) 'text)
+      (setq e (make-extent (point) (point)))
+      (set-extent-end-glyph e gl)
       )
     (insert "\n")
     ))


There aren't any concise examples of glyph code in the documentation.
I created the following procedure for doing some testing.

(defun insert-glyph-at-point (file)
  "Insert a glyph at (point)."
  (interactive "*fGraphic Image: ")
  (save-excursion
    (save-restriction
      (let ((file-coding-system 'no-conversion)
	    gl e)
	(narrow-to-region (point) (point))
	(insert-file-contents file)
	(setq gl (make-glyph (buffer-substring (point-min) (point-max))))
	(delete-region (point-min) (point-max))
	(setq e (make-extent (point) (point)))
	(set-extent-end-glyph e gl)))))

The image type (jpeg, gif, xpm, etc.) is auto-detected.  Maybe someone
will get inspired and write xv-mode.el :-).
-- 
steve@miranova.com baur
Unsolicited commercial e-mail will be billed at $250/message.

