all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: Partial highlighting of wrapped overlay
@ 2005-01-09 14:56 Chong Yidong
  2005-01-18 12:44 ` Kim F. Storm
  0 siblings, 1 reply; 2+ messages in thread
From: Chong Yidong @ 2005-01-09 14:56 UTC (permalink / raw)
  Cc: rms

Hi,

I've looked into the item "Partial highlighting of wrapped overlay"
described in FOR-RELEASE (which, by the way, is erroneously listed twice.)

AFAICT, the problem is this: when a 'display string continues over more
than one glyph_row, the value of end.pos.charpos for that glyph_row will
be stuck at the starting charpos of the overlay. This is because the
redisplay engine never draws the characters underneath that overlay, to
which the intervening charpos values correspond.

Unfortunately, at xdisp.c:21475 note_mouse_highlight calls
fast_find_position, which calls row_containing_pos, which loses because it
relies on row->end.pos.charpos to find a row corresponding to a given
charpos. That's why only the last line of the overlay is highlighted.

There are several possible ways to handle this, but I don't know which is
best.

1. There is an old version of fast_find_position, #define'd out at
xdisp.c:20632, which does not call row_containing_position. Reverting it
causes to bug to go away. However, according to the comments, the newer
version is "more correct in the presence of hscrolling" (no details
given.)

2. Alter fast_find_position to detect when multiple rows have the same
end.pos.charpos. This will probably require changing its argument list (to
tell it whether use the first or last such row.) This may be safe since,
as it turns out, note_mouse_highlight is the ONLY function that calls
fast_find_position.

3. Rework redisplay to update end.pos.charpos by looking at the text
underneath the 'display overlay. No idea how to do this.

4. Don't do anything. The documentation could say to avoid using overlays
with 'display + 'mouse-highlight that wrap across lines (would anyone want
to?) Anyway, this "bug" appears in Emacs 21.3, so it's not a regression.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Partial highlighting of wrapped overlay
  2005-01-09 14:56 Partial highlighting of wrapped overlay Chong Yidong
@ 2005-01-18 12:44 ` Kim F. Storm
  0 siblings, 0 replies; 2+ messages in thread
From: Kim F. Storm @ 2005-01-18 12:44 UTC (permalink / raw)
  Cc: rms, emacs-devel

"Chong Yidong" <cyd@stupidchicken.com> writes:

> Hi,
>
> I've looked into the item "Partial highlighting of wrapped overlay"
> described in FOR-RELEASE (which, by the way, is erroneously listed twice.)

Thanks.  Your analysis was a big help creating the fix I just installed.

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-01-18 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-09 14:56 Partial highlighting of wrapped overlay Chong Yidong
2005-01-18 12:44 ` Kim F. Storm

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.