emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Several suggestions for image support


From: Kim F. Storm
Subject: Re: Several suggestions for image support
Date: 18 Apr 2004 23:30:27 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

David Kastrup <address@hidden> writes:

> Richard Stallman <address@hidden> writes:
>
> > Emacs should have a way to scroll through an image,
> > so that C-v each time can advance one window-height
> > through the image.
> >
> > It would be inelegant to handle this by treating the tall
> > image as several lines--but perhaps that might actually
> > work more easily than some other methods.
>
> I don't think that splitting the image into lines by Emacs itself is
> feasible: the cursor positions on the image would need to correspond
> to actual cursor positions in the buffer, or things get inconsistent
> (Emacs moves out of cursor positions in the image automatically).
> While it would be a real boost of usability for my main application
> (preview-latex) if I could walk the cursor across lines or other areas
> of an image, the correlation between buffer positions and
> corresponding location of the cursor display would need to get
> explicitly established by the application: it would imply "stopping
> points" when Emacs is trying to move the cursor out of visually
> inaccessible areas.  And then Emacs would have to draw a cursor box or
> other indicator according to the location in there.  Substructuring an
> image like that would be a very nice feature.  But I don't see that
> it is possible to make the decision of where to split an image
> mechanically.

I have written some code (not too complex) which can split an image
into individual row, and each of those rows into individual "slices"
on each row, e.g.

   +--------+--------------+--------------+
   |        |              |              |
   |        |              |              |   POSSIBLE
   +--------+-----+-----------------------+   SLICING
   |              |                       |
   |              |                       |
   |              |                       |
   |              |                       |
   +--------------+-----------------------+

The major limitation of this is that all "slices" in one row
is (and must be) of equal height - the height of the row.

This is because emacs display engine is still row based, meaning that
all "glyphs" on a row are padded with empty space in top and bottom
to make all glyphs on the row of the same height  (this is not entirely
true, but you get the picture.)

In principle, my implementation can take any slice of an image and
combine it with any other slice of the same image, but the display
engine does not allow those slices to be placed arbitrarily in the
window, i.e. overlap rows like this:

   +----------------+---------------------+
   |                |                     |
   |                |                     |
   |                +---------------------+   IMPOSSIBLE
   |                |                     |   SLICING
   |                |                     |
   +----------------|                     |
   |                |                     |
   |                |                     |
   +----------------+---------------------+


David, what are the requirements for preview-latex ?

>
> Of course, scrolling through large images should be possible, anyway,
> and quite independent from that fanciful features.  Emacs already has
> set-window-vscroll in its display engine in order to deal perfectly
> well with that.

Yes, and it could probably be done entirely in lisp !?

--
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]