all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Magne Ingebrigtsen <larsi@gnus.org>
To: irieshinsuke@yahoo.co.jp
Cc: 4426@debbugs.gnu.org
Subject: bug#4426: [PATCH] posn-at-point returns an incorrect value
Date: Sun, 18 Sep 2011 10:21:43 +0200	[thread overview]
Message-ID: <m362kqz2eg.fsf@stories.gnus.org> (raw)
In-Reply-To: <4BA05437.8000303@yahoo.co.jp> (IRIE Shinsuke's message of "Wed,  17 Mar 2010 13:01:59 +0900")

IRIE Shinsuke <irieshinsuke@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/





  reply	other threads:[~2011-09-18  8:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-14  9:18 bug#4426: 23.0.91; posn-at-point returns an incorrect value IRIE Shinsuke
2010-03-17  4:01 ` bug#4426: [PATCH] " IRIE Shinsuke
2011-09-18  8:21   ` Lars Magne Ingebrigtsen [this message]
2011-09-18  9:22     ` Eli Zaretskii
2011-10-08 11:01     ` Eli Zaretskii

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=m362kqz2eg.fsf@stories.gnus.org \
    --to=larsi@gnus.org \
    --cc=4426@debbugs.gnu.org \
    --cc=irieshinsuke@yahoo.co.jp \
    /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.
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.