emacs-devel
[Top][All Lists]
Advanced

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

How to obtain x/y/hpos/vpos at eol -- excluding overlay 'after-string.


From: Keith David Bershatsky
Subject: How to obtain x/y/hpos/vpos at eol -- excluding overlay 'after-string.
Date: Mon, 04 Apr 2016 12:39:18 -0700

I am looking for some assistance, please, to obtain in C (e.g., xdisp.c) the 
values for x/y/hpos/vpos at the end of a visual line when overlay 'after-string 
exists.

Whenever there is an overlay 'after-string at the end of the line, the `x` and 
`hpos` coordinates for eol are not what I want -- i.e., the values for `x` and 
`hpos` are both increased depending upon the visual length of the 'after-string.

I have tried adding `it->ignore_overlay_strings_at_pos_p = true;` to custom 
functions similar to `move_it_to` and `move_it_in_display_line_to`.  However, 
that doesn't seem to have the desired affect.

I have also tried deleting all overlays at the beginning of the command loop, 
but the overlays seem to still be present until redisplay finishes.

Here is what I have been using:

  struct it it;
  struct text_pos pt;
  /* peovl is shorthand for `point at end of visual line`.  */
  EMACS_INT peovl, peovl_x, peovl_y, peovl_hpos, peovl_vpos;
  peovl = [let us assume this is a point at the end of a visual line subsequent 
to w->start, either wrapped or just a plain end of line];
  SET_TEXT_POS_FROM_MARKER (pt, w->start);
  start_display (&it, w, pt);
  move_it_to (&it, peovl, -1, -1, -1, MOVE_TO_POS);
  peovl = CHARPOS (it.current.pos);
  peovl_x = it.current_x;
  peovl_y = it.current_y;
  peovl_hpos = it.hpos;
  peovl_vpos = it.vpos;


Thanks,

Keith



reply via email to

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