GNU bug report logs - #4426
23.0.91; posn-at-point returns an incorrect value

Previous Next

Package: emacs;

Reported by: irieshinsuke <at> yahoo.co.jp

Date: Mon, 14 Sep 2009 09:25:04 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: irieshinsuke <at> yahoo.co.jp
Cc: 4426 <at> debbugs.gnu.org
Subject: bug#4426: [PATCH] posn-at-point returns an incorrect value
Date: Sun, 18 Sep 2011 10:21:43 +0200
IRIE Shinsuke <irieshinsuke <at> yahoo.co.jp> writes:

>    If header line is displayed, `posn-object-width-height' incorrectly
>    returns the size of object in position different from specified one.
>
>    For example, an expression
>
>      (posn-object-width-height (posn-at-point (window-start)))
>
>    must return the width and height of character on the top left corner
>    of text area, but actually returns the ones on the beginning of
>    header line.
>
> It turned out that this problem occurs as a result of confusion between
> it.vpos and MATRIX_ROW_VPOS in a function buffer_posn_from_coords
> (included in dispnew.c).
>
> So I wrote the small patch to fix this bug. Please check it.

[...]

> !   if (it.vpos < w->current_matrix->nrows
> !       && (row = MATRIX_ROW (w->current_matrix, it.vpos),
>   	  row->enabled_p))
>       {
>         if (it.hpos < row->used[TEXT_AREA])
> --- 5975,5984 ----
>       }
>   #endif
>   
> !   /* it.vpos isn't the same as MATRIX_ROW_VPOS if header line is displayed */
> !   matrix_vpos = (w->current_matrix->rows->mode_line_p ? 1 : 0) + it.vpos;
> !   if (matrix_vpos < w->current_matrix->nrows
> !       && (row = MATRIX_ROW (w->current_matrix, matrix_vpos),
>   	  row->enabled_p))
>       {
>         if (it.hpos < row->used[TEXT_AREA])

As far as I can tell, this patch hasn't been applied yet.  I'm not
familiar enough with this code to say whether this looks correct or
not.  Could someone take a look?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




This bug report was last modified 13 years and 291 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.