From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#9229: 24.0.50; Bidi problem with `cursor' property Date: Wed, 03 Aug 2011 23:41:49 +0300 Message-ID: <83zkjqns6q.fsf@gnu.org> References: <87sjpi600v.fsf@gnu.org> <83ei12a2n2.fsf@gnu.org> <837h6upaur.fsf@gnu.org> <87liva5kk8.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: dough.gmane.org 1312404284 32739 80.91.229.12 (3 Aug 2011 20:44:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 3 Aug 2011 20:44:44 +0000 (UTC) Cc: 9229@debbugs.gnu.org To: Johan =?UTF-8?Q?Bockg=D6=B3=C2=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 03 22:44:38 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 1QoiIq-0004bM-KN for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Aug 2011 22:44:32 +0200 Original-Received: from localhost ([::1]:55484 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoiIq-0000Im-0B for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Aug 2011 16:44:32 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:33727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoiIm-0000Hx-NZ for bug-gnu-emacs@gnu.org; Wed, 03 Aug 2011 16:44:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QoiIl-0004Yv-Os for bug-gnu-emacs@gnu.org; Wed, 03 Aug 2011 16:44:28 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoiIl-0004Yr-M3 for bug-gnu-emacs@gnu.org; Wed, 03 Aug 2011 16:44:27 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QoiJK-0006X6-NF; Wed, 03 Aug 2011 16:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Aug 2011 20:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9229 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9229-submit@debbugs.gnu.org id=B9229.131240427425069 (code B ref 9229); Wed, 03 Aug 2011 20:45:02 +0000 Original-Received: (at 9229) by debbugs.gnu.org; 3 Aug 2011 20:44:34 +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 1QoiIs-0006WI-8u for submit@debbugs.gnu.org; Wed, 03 Aug 2011 16:44:34 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QoiIp-0006W8-ET for 9229@debbugs.gnu.org; Wed, 03 Aug 2011 16:44:32 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LPD00H00CYU7F00@a-mtaout22.012.net.il> for 9229@debbugs.gnu.org; Wed, 03 Aug 2011 23:43:50 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.228.94.185]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LPD00G3KDL1U4G0@a-mtaout22.012.net.il>; Wed, 03 Aug 2011 23:43:50 +0300 (IDT) In-reply-to: <87liva5kk8.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 03 Aug 2011 16:45: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:49888 Archived-At: > From: Johan Bockg=C3=A5rd > Cc: 9229@debbugs.gnu.org > Date: Wed, 03 Aug 2011 22:03:51 +0200 >=20 > Apparently, the patch only tries to fix the case where "the entire = line > is from display string", which doesn't solve the icomplete problem: >=20 > emacs -Q >=20 > M-x icomplete-mode RET >=20 > M-x a What about this one? (Apply it after "bzr revert".) =3D=3D=3D modified file 'src/xdisp.c' --- src/xdisp.c=092011-08-03 05:24:30 +0000 +++ src/xdisp.c=092011-08-03 20:33:08 +0000 @@ -13706,14 +13706,12 @@ set_cursor_from_row (struct window *w, s w->cursor.vpos >=3D 0 /* that candidate is not the row we are processing */ && MATRIX_ROW (matrix, w->cursor.vpos) !=3D row - /* the row we are processing is part of a continued line */ - && (row->continued_p || MATRIX_ROW_CONTINUATION_LINE_P (row)) /* Make sure cursor.vpos specifies a row whose start and end =09 charpos occlude point. This is because some callers of this =09 function leave cursor.vpos at the row where the cursor was =09 displayed during the last redisplay cycle. */ && MATRIX_ROW_START_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpo= s)) <=3D pt_old - && pt_old < MATRIX_ROW_END_CHARPOS (MATRIX_ROW (matrix, w->cur= sor.vpos))) + && pt_old <=3D MATRIX_ROW_END_CHARPOS (MATRIX_ROW (matrix, w->= cursor.vpos))) { struct glyph *g1 =3D =09MATRIX_ROW_GLYPH_START (matrix, w->cursor.vpos) + w->cursor.hpos; @@ -13722,15 +13720,20 @@ set_cursor_from_row (struct window *w, s if (!(row->reversed_p ? glyph > glyphs_end : glyph < glyphs_en= d)) =09return 0; /* Keep the candidate whose buffer position is the closest to -=09 point. */ +=09 point or has the `cursor' property. */ if (/* previous candidate is a glyph in TEXT_AREA of that row = */ =09 w->cursor.hpos >=3D 0 =09 && w->cursor.hpos < MATRIX_ROW_USED (matrix, w->cursor.vpos) -=09 && BUFFERP (g1->object) -=09 && (g1->charpos =3D=3D pt_old /* an exact match always wins */ -=09 || (BUFFERP (glyph->object) -=09=09 && eabs (g1->charpos - pt_old) -=09=09 < eabs (glyph->charpos - pt_old)))) +=09 && ((BUFFERP (g1->object) +=09 && (g1->charpos =3D=3D pt_old /* an exact match always win= s */ +=09=09 || (BUFFERP (glyph->object) +=09=09 && eabs (g1->charpos - pt_old) +=09=09 < eabs (glyph->charpos - pt_old)))) +=09 /* previous candidate is a glyph from a string that has +=09=09 a non-nil `cursor' property */ +=09 || (STRINGP (g1->object) +=09=09 && !NILP (Fget_char_property (make_number (g1->charpos), +=09=09=09=09=09=09Qcursor, g1->object))))) =09return 0; /* If this candidate gives an exact match, use that. */ if (!(BUFFERP (glyph->object) && glyph->charpos =3D=3D pt_old)