From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: bug in vertical-motion? Date: Mon, 29 Aug 2005 20:27:36 -0400 Message-ID: References: <200508230222.j7N2MVh14683@raven.dms.auburn.edu> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1125364155 12579 80.91.229.2 (30 Aug 2005 01:09:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 30 Aug 2005 01:09:15 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 30 03:09:13 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E9uc2-0002dW-Qg for ged-emacs-devel@m.gmane.org; Tue, 30 Aug 2005 03:08:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E9ug5-00023f-PK for ged-emacs-devel@m.gmane.org; Mon, 29 Aug 2005 21:12:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E9ufW-0001vG-6y for emacs-devel@gnu.org; Mon, 29 Aug 2005 21:12:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E9ufT-0001ug-OD for emacs-devel@gnu.org; Mon, 29 Aug 2005 21:12:05 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E9uPw-0007lr-BD for emacs-devel@gnu.org; Mon, 29 Aug 2005 20:56:00 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1E9u1P-0007a1-3R for emacs-devel@gnu.org; Mon, 29 Aug 2005 20:30:39 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1E9tyS-0004ub-U1; Mon, 29 Aug 2005 20:27:36 -0400 Original-To: Luc Teirlinck In-reply-to: <200508230222.j7N2MVh14683@raven.dms.auburn.edu> (message from Luc Teirlinck on Mon, 22 Aug 2005 21:22:31 -0500 (CDT)) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:42492 Archived-At: Put cursor on the next to last `q' on the screen line that is continued. Then M-: (vertical-motion 0) carries you to the beginning of the current screen line, as one would expect. But then put cursor on the very last `q' of the continued screen line. Then M-: (vertical-motion 0) carries you to the beginning of the _next_ screen line. This appears to be a bug. Do people get good results from this patch? *** xdisp.c 27 Aug 2005 22:41:25 -0400 1.1045 --- xdisp.c 29 Aug 2005 20:14:40 -0400 *************** *** 6012,6017 **** --- 6012,6019 ---- glyphs have the same width. */ int single_glyph_width = it->pixel_width / it->nglyphs; int new_x; + int x_before_this_char = x; + int hpos_before_this_char = it->hpos; for (i = 0; i < it->nglyphs; ++i, x = new_x) { *************** *** 6043,6050 **** --- 6045,6066 ---- { ++it->hpos; it->current_x = new_x; + + /* The character's last glyph just barely fits + in this row. */ if (i == it->nglyphs - 1) { + /* If this is the destination position, + return a position *before* it in this row, + now that we know it fits in this row. */ + if (BUFFER_POS_REACHED_P ()) + { + it->hpos = hpos_before_this_char; + it->current_x = x_before_this_char; + result = MOVE_POS_MATCH_OR_ZV; + break; + } + set_iterator_to_next (it, 1); #ifdef HAVE_WINDOW_SYSTEM if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))