From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/36405 Path: main.gmane.org!not-for-mail From: Lloyd Zusman Newsgroups: gmane.emacs.gnus.general Subject: Proposed patch to mm-view.el (was: Has `mm-inline-image-xemacs' changed recently?) Date: 25 May 2001 07:28:11 -0400 Organization: FreeBSD/Linux Hippopotamus Preserve Sender: Lloyd Zusman Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035171995 8403 80.91.224.250 (21 Oct 2002 03:46:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 03:46:35 +0000 (UTC) Return-Path: Original-Received: (qmail 10844 invoked by alias); 25 May 2001 11:28:16 -0000 Original-Received: (qmail 10839 invoked from network); 25 May 2001 11:28:16 -0000 Original-Received: from home.ljz.net (root@216.27.138.217) by gnus.org with SMTP; 25 May 2001 11:28:16 -0000 Original-Received: (from hippo@localhost) by home.ljz.net (8.9.3/8.9.3) id HAA05470; Fri, 25 May 2001 07:28:12 -0400 X-Authentication-Warning: home.ljz.net: hippo set sender to ljz@asfast.com using -f Original-To: ding@gnus.org X-Face: "!ga1s|?LNLE3MeeeEYs(%LIl9q[xV9!j4#xf4!**BFW_ihlOb;:Slb>)vy>CJM (Lloyd Zusman's message of "25 May 2001 00:53:17 -0400") User-Agent: Gnus/5.090004 (Oort Gnus v0.04) XEmacs/21.4 (Academic Rigor) Original-Lines: 61 Xref: main.gmane.org gmane.emacs.gnus.general:36405 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:36405 Enclosed is a proposed patch to the `mm-inline-image-xemacs' function in `mm-view.el'. I'd like to know what you folks think of this patch. The reason for this patch is as follows: If the point is at the end of the buffer at the moment that an inline image is being inserted, the `(insert "\n")' in the `mm-inline-image-xemacs' function cannot put the newline after the glyph that is added by `make-annotation', and the newline ends up being inserted before the glyph. The reason for this is that `make-annotation' causes the glyph to not take up any space within the logical buffer (in the XEmacs 21.4.3 documentation, see Info->Lispref->Annotation Basics). Therefore, there will be no way to insert any characters following the glyph if it's been placed at the end of the buffer. My change to `mm-inline-image-xemacs' inserts the "\n" and then moves the point to the left of it, *before* `make-annotation' is called. This ensures that the newline will always be positioned following the glyph. This, in turn, ensures that message parts that are to be inserted after the inline image will actually be able to appear after the glyph. Here's my patch. Comments? Thank you very much. *** mm-view.el.orig Fri May 25 07:08:43 2001 --- mm-view.el Fri May 25 07:09:37 2001 *************** *** 49,58 **** `(lambda () (remove-images ,b (1+ ,b)))))) (defun mm-inline-image-xemacs (handle) (let ((b (point)) (annot (make-annotation (mm-get-image handle) nil 'text)) buffer-read-only) - (insert "\n") (mm-handle-set-undisplayer handle `(lambda () --- 49,59 ---- `(lambda () (remove-images ,b (1+ ,b)))))) (defun mm-inline-image-xemacs (handle) + (insert "\n") + (forward-char -1) (let ((b (point)) (annot (make-annotation (mm-get-image handle) nil 'text)) buffer-read-only) (mm-handle-set-undisplayer handle `(lambda () -- Lloyd Zusman ljz@asfast.com