From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Display problems with `before-string' in overlay Date: Sun, 15 Apr 2007 09:59:22 -0400 Message-ID: References: <461C10A0.1010309@gmail.com> <87y7kyvm6a.fsf@stupidchicken.com> <461D49A2.5070803@gmail.com> <461DCB05.7090204@gmail.com> <87r6qof8ln.fsf@stupidchicken.com> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1176645822 10725 80.91.229.12 (15 Apr 2007 14:03:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 15 Apr 2007 14:03:42 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 15 16:03:36 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hd5KJ-0008W5-HF for ged-emacs-devel@m.gmane.org; Sun, 15 Apr 2007 16:03:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hd5Oo-0002hq-9V for ged-emacs-devel@m.gmane.org; Sun, 15 Apr 2007 10:08:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hd5NT-0001Th-Bp for emacs-devel@gnu.org; Sun, 15 Apr 2007 10:06:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hd5NS-0001T1-80 for emacs-devel@gnu.org; Sun, 15 Apr 2007 10:06:50 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hd5NS-0001Ss-1v for emacs-devel@gnu.org; Sun, 15 Apr 2007 10:06:50 -0400 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hd5Iv-0004VI-JT for emacs-devel@gnu.org; Sun, 15 Apr 2007 10:02:09 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1Hd5GE-00008Y-SF; Sun, 15 Apr 2007 09:59:22 -0400 In-reply-to: <87r6qof8ln.fsf@stupidchicken.com> (message from Chong Yidong on Fri, 13 Apr 2007 14:11:00 -0400) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:69455 Archived-At: Most of your proposed change in xdisp.c is the addition of the OVERLAY argument to `string_buffer_position'. That is harmless. It includes two substantial changes which could really alter Emacs's behavior. I've included them below. Could you explain them more clearly, in a way that demonstrates they are correct? *************** *** 11933,11952 **** Lisp_Object string; struct glyph *stop = glyph; int pos; limit = make_number (pt_old + 1); glyph = string_start; x = string_start_x; string = glyph->object; ! pos = string_buffer_position (w, string, string_before_pos); ! /* If STRING is from overlay, LAST_POS == 0. We skip such glyphs ! because we always put cursor after overlay strings. */ ! while (pos == 0 && glyph < stop) { string = glyph->object; SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string)); if (glyph < stop) ! pos = string_buffer_position (w, glyph->object, string_before_pos); } while (glyph < stop) --- 11934,11955 ---- Lisp_Object string; struct glyph *stop = glyph; int pos; + Lisp_Object overlay = Qnil; limit = make_number (pt_old + 1); glyph = string_start; x = string_start_x; string = glyph->object; ! pos = string_buffer_position (w, string, string_before_pos, &overlay); ! /* If STRING is from overlay, skip its glyphs because we always ! put cursor after overlay strings. */ ! while ((pos == 0 || !NILP (overlay)) && glyph < stop) { string = glyph->object; SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string)); if (glyph < stop) ! pos = string_buffer_position (w, glyph->object, ! string_before_pos, overlay); } while (glyph < stop) *************** *** 15854,15865 **** if (PT == MATRIX_ROW_END_CHARPOS (row)) { /* If the row ends with a newline from a string, we don't want ! the cursor there, but we still want it at the start of the ! string if the string starts in this row. If the row is continued it doesn't end in a newline. */ if (CHARPOS (row->end.string_pos) >= 0) ! cursor_row_p = (row->continued_p ! || PT >= MATRIX_ROW_START_CHARPOS (row)); else if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row)) { /* If the row ends in middle of a real character, --- 15857,15866 ---- if (PT == MATRIX_ROW_END_CHARPOS (row)) { /* If the row ends with a newline from a string, we don't want ! the cursor there. If the row is continued it doesn't end in a newline. */ if (CHARPOS (row->end.string_pos) >= 0) ! cursor_row_p = row->continued_p; else if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row)) { /* If the row ends in middle of a real character,