From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#4426: [PATCH] posn-at-point returns an incorrect value Date: Sun, 18 Sep 2011 10:21:43 +0200 Message-ID: References: <4BA05437.8000303@yahoo.co.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1316335523 8931 80.91.229.12 (18 Sep 2011 08:45:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 18 Sep 2011 08:45:23 +0000 (UTC) Cc: 4426@debbugs.gnu.org To: irieshinsuke@yahoo.co.jp Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 18 10:45:16 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R5Czx-0002oy-Rj for geb-bug-gnu-emacs@m.gmane.org; Sun, 18 Sep 2011 10:45:14 +0200 Original-Received: from localhost ([::1]:34627 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5Czx-0002oj-EL for geb-bug-gnu-emacs@m.gmane.org; Sun, 18 Sep 2011 04:45:13 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:43697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5Czu-0002oO-AH for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2011 04:45:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5Czs-00055L-SA for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2011 04:45:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5Czs-00055H-PN for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2011 04:45:08 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1R5D4c-0003W9-GL for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2011 04:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Magne Ingebrigtsen Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Sep 2011 08:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 4426 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 4426-submit@debbugs.gnu.org id=B4426.131633574313410 (code B ref 4426); Sun, 18 Sep 2011 08:50:02 +0000 Original-Received: (at 4426) by debbugs.gnu.org; 18 Sep 2011 08:49:03 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R5D3c-0003To-SO for submit@debbugs.gnu.org; Sun, 18 Sep 2011 04:49:03 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R5D3X-0003TK-6J for 4426@debbugs.gnu.org; Sun, 18 Sep 2011 04:48:56 -0400 Original-Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=stories.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1R5Cyg-00061c-CN; Sun, 18 Sep 2011 10:43:54 +0200 In-Reply-To: <4BA05437.8000303@yahoo.co.jp> (IRIE Shinsuke's message of "Wed, 17 Mar 2010 13:01:59 +0900") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) X-Now-Playing: Eurythmics's _Touch_: "Cool Blue" X-MailScanner-ID: 1R5Cyg-00061c-CN MailScanner-NULL-Check: 1316940234.71639@IbuWjF0kR0v0qcrJy9609w X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 18 Sep 2011 04:50:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:51356 Archived-At: IRIE Shinsuke 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/