Gnus development mailing list
 help / color / mirror / Atom feed
From: Lloyd Zusman <ljz@asfast.com>
Subject: Proposed patch to mm-view.el (was: Has `mm-inline-image-xemacs' changed recently?)
Date: 25 May 2001 07:28:11 -0400	[thread overview]
Message-ID: <yged78xis6s.fsf@asfast.com> (raw)
In-Reply-To: <ygeitiqhvwi.fsf@asfast.com> (Lloyd Zusman's message of "25 May 2001 00:53:17 -0400")

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


  reply	other threads:[~2001-05-25 11:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-25  4:53 Has `mm-inline-image-xemacs' changed recently? Lloyd Zusman
2001-05-25 11:28 ` Lloyd Zusman [this message]
2001-05-29 21:53   ` Proposed patch to mm-view.el (was: Has `mm-inline-image-xemacs' changed recently?) Kai Großjohann
2001-05-29 23:43     ` Daniel Pittman
2001-05-30  0:20       ` Lloyd Zusman
2001-05-30  9:24         ` Kai Großjohann
2001-05-30 10:58           ` Lloyd Zusman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yged78xis6s.fsf@asfast.com \
    --to=ljz@asfast.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).