From xemacs-m  Fri Feb  7 05:30:54 1997
Received: from mikan.jaist.ac.jp (mikan-e0.jaist.ac.jp [150.65.1.9])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id FAA03946
	for <xemacs-beta@xemacs.org>; Fri, 7 Feb 1997 05:30:51 -0600 (CST)
Received: from is18e0s01.jaist.ac.jp (MORIOKA Tomohiko <morioka@jaist.ac.jp>) by mikan.jaist.ac.jp (8.7.5); id TAA18076; Fri, 7 Feb 1997 19:27:33 +0900 (JST)
Message-Id: <199702071027.TAA18076@mikan.jaist.ac.jp>
X-MUA: mh-e 5.0.2 + tm-mh-e 7.73, tm-view 7.80
X-Face: %yc?f+O/cVKlH*K(H2X/6-d''suf|"1{S:Y0}_9$t@0G3:5M2:-Ck^[8+4^iSLeGc[Ey[WP
 PF]2M#Q9C'u~[=7TJP72J`PZdWvP=s-'-/LhFneC->=ILc~H#$lf2%hLL5U8?psIp`<[>d&@$Pm%~(
 A'"CJ.zuX@TXh\Ra4,b7M&`f"hexU-a4,#X\]Bfp'JI+MGUDRA%_$&UnWAem4}1R"4%uivgn;xFZ%"
 NS>)eCuFYNHc/:W^:{7H>bGQS],x5z[Cy~C;7j#:8y9q|"~9~UWjE<Vm_;)o<Q4S5NweLc(cl7-suY
 NF|_O*xodbmQavM
X-Emacs: Emacs 19.34.91, Mule 3.0 =?ISO-2022-JP?B?KBskQjlITVUybBsoQik=?=
From: =?ISO-2022-JP?B?GyRCPGkyLBsoQiAbJEJDTkknGyhC?= / MORIOKA Tomohiko <morioka@jaist.ac.jp>
To: Steven L Baur <steve@miranova.com>
cc: xemacs-beta@xemacs.org, tm-en@chamonix.jaist.ac.jp
Subject: Re: Loose ends -- tm in-line image patch/fun with glyphs 
In-reply-to: Your message of "07 Feb 1997 00:30:28 PST."
             <m2afph2f2z.fsf@altair.xemacs.org> 
Mime-Version: 1.0 (generated by tm-edit 7.103)
Content-Type: multipart/signed; protocol="application/pgp-signature";
 boundary="pgp-sign-Multipart_Fri_Feb__7_19:27:20_1997-1"; micalg=pgp-md5
Content-Transfer-Encoding: 7bit
Date: Fri, 07 Feb 1997 19:27:35 JST
Sender: morioka@jaist.ac.jp

--pgp-sign-Multipart_Fri_Feb__7_19:27:20_1997-1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

>>>>> In <m2afph2f2z.fsf@altair.xemacs.org> 
>>>>>=09"sb" =3D Steven L Baur <steve@miranova.com> wrote:

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

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

  Thanks for your patch.  I applied it.


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

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

sb> The image type (jpeg, gif, xpm, etc.) is auto-detected.  Maybe
sb> someone will get inspired and write xv-mode.el :-).


  Thanks for your example.  But it must use
`file-coding-system-for-read' instead of `file-coding-system'.
(maybe it will/should be changed to `coding-system-for-read' to sync
with Emacs 20.0.  So (as-binary-input-file ...) might be better)

  By the way, I want a library for suck kind of image functions.  Then
we can make image application easily.  Let's define high level image
API (for file, buffer, region or string?).

  Thanks,
-- 
----------------------------------------------------------------------
MORIOKA Tomohiko <morioka@jaist.ac.jp>
        Japan advanced Institute of Science and Technology, Hokuriku
                Asahi-dai, Tatsu-no-kuchi ch=F4, Nomi, Ishikawa, Japan
------------------------------------------ Frisch, Frei, Fr=F6hlich! ---

--pgp-sign-Multipart_Fri_Feb__7_19:27:20_1997-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP MESSAGE-----
Version: 2.6.3ia
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQCVAwUBMvsDkBnuUGV7wuH5AQEKNAP/fKNrTqTlWiQOvAX8Wk3vdJBmJzZDl53N
fe+OrVOZ67gb62T1ZF1kKJHl3Bi8gXRYGRsiUL8aMdl+PiEnYEkCr7KmcxuUHuc2
97ZfmcsWrBwiQh4SFlFzTR0TYaMcUngpSQRB1BVcf5et2AtC1Bo+jD1+8Zrzzhxk
gb8LWYdpFak=
=TP2B
-----END PGP MESSAGE-----

--pgp-sign-Multipart_Fri_Feb__7_19:27:20_1997-1--

