From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: IRIE Shinsuke Newsgroups: gmane.emacs.bugs Subject: bug#4426: [PATCH] posn-at-point returns an incorrect value Date: Wed, 17 Mar 2010 13:01:59 +0900 Message-ID: <4BA05437.8000303@yahoo.co.jp> References: <4AAE0A77.3010807@yahoo.co.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010202010008050600060609" X-Trace: dough.gmane.org 1268799939 4894 80.91.229.12 (17 Mar 2010 04:25:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 17 Mar 2010 04:25:39 +0000 (UTC) To: 4426@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 17 05:25:34 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nrkp3-0004ok-9e for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Mar 2010 05:25:33 +0100 Original-Received: from localhost ([127.0.0.1]:56586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nrkp2-000395-NL for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Mar 2010 00:25:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NrkoQ-0002gx-D0 for bug-gnu-emacs@gnu.org; Wed, 17 Mar 2010 00:24:54 -0400 Original-Received: from [140.186.70.92] (port=42497 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NrkoO-0002et-NN for bug-gnu-emacs@gnu.org; Wed, 17 Mar 2010 00:24:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NrkoM-0003lp-Pc for bug-gnu-emacs@gnu.org; Wed, 17 Mar 2010 00:24:52 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51037) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NrkoM-0003li-Nr for bug-gnu-emacs@gnu.org; Wed, 17 Mar 2010 00:24:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NrkSI-0003n1-C7; Wed, 17 Mar 2010 00:02:02 -0400 X-Loop: bug-gnu-emacs@gnu.org In-Reply-To: <4AAE0A77.3010807@yahoo.co.jp> Resent-From: IRIE Shinsuke Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Mar 2010 04:02:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-GNU-PR-Message: followup 4426 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 4426-submit@debbugs.gnu.org id=B4426.126879850514561 (code B ref 4426); Wed, 17 Mar 2010 04:02:02 +0000 Original-Received: (at 4426) by debbugs.gnu.org; 17 Mar 2010 04:01:45 +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 1NrkS1-0003mo-Jt for submit@debbugs.gnu.org; Wed, 17 Mar 2010 00:01:45 -0400 Original-Received: from mail-gw0-f44.google.com ([74.125.83.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NrkS0-0003mj-AL for 4426@debbugs.gnu.org; Wed, 17 Mar 2010 00:01:45 -0400 Original-Received: by gwj18 with SMTP id 18so298761gwj.3 for <4426@debbugs.gnu.org>; Tue, 16 Mar 2010 21:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :reply-to:user-agent:mime-version:to:subject:x-enigmail-version :content-type; bh=Qwb/l8kM39OtgIYD2IwAe+eI4TaV9JroLCM1s3sCrpI=; b=kk9OzVjDcfzw0l5GEQGCMjmxxtzBVv3i/lHgoTZ3D1cAs/Oq1V5apSMaAFNzSFm5Gg JLBCMdLt6GDv8HEA3UEjRcHQc8iSvkce/W01gwGgtRUfT6OARo52YSLqIfwORbL+aDSo pK+WTo8Pc9FszQXybUaj2ysKRtCAXtFOQo20I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:reply-to:user-agent:mime-version:to :subject:x-enigmail-version:content-type; b=UEzV4YUtDphx2alN17d9nxXXYKT7NcZJmPdxzYKs8pewEdwf8zVVGoC21dURv5xPzv RjzbtpqzaRYT+Ysj/NwrmXMUZiFU1k3atOmG2RK+iEd4OQjOqbYvvjjkcamus7EoPYFz szTfYADzEtV1q5QTROnwOwfWehjIHMLQ3GjuI= Original-Received: by 10.100.81.2 with SMTP id e2mr482238anb.332.1268798500585; Tue, 16 Mar 2010 21:01:40 -0700 (PDT) Original-Received: from [114.51.157.58] (EM114-51-157-58.pool.e-mobile.ne.jp [114.51.157.58]) by mx.google.com with ESMTPS id 16sm4086764gxk.5.2010.03.16.21.01.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 16 Mar 2010 21:01:39 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; ja; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 X-Enigmail-Version: 1.0.1 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 17 Mar 2010 00:02:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:35602 Archived-At: This is a multi-part message in MIME format. --------------010202010008050600060609 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit 6 months ago I reported bug #4426, that is, `posn-at-point' returns incorrect value when header line is displayed. I've investigated this bug and found the solution. I describe again this bug: 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. IRIE Shinsuke --------------010202010008050600060609 Content-Type: text/x-diff; name="fix_bug4426.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fix_bug4426.patch" === modified file 'src/dispnew.c' *** old/src/dispnew.c 2010-03-16 14:48:29 +0000 --- new/src/dispnew.c 2010-03-16 16:06:28 +0000 *************** *** 5937,5942 **** --- 5937,5943 ---- Lisp_Object old_current_buffer = Fcurrent_buffer (); struct text_pos startp; Lisp_Object string; + int matrix_vpos; struct glyph_row *row; #ifdef HAVE_WINDOW_SYSTEM struct image *img = 0; *************** *** 5974,5981 **** } #endif ! 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]) --------------010202010008050600060609--