From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: display bug for empty lines in recent git snapshot Date: Wed, 17 Nov 2010 21:20:22 +0200 Message-ID: <838w0rdafd.fsf@gnu.org> References: <87hbfgfg9v.fsf@member.fsf.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1290021859 17364 80.91.229.12 (17 Nov 2010 19:24:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 17 Nov 2010 19:24:19 +0000 (UTC) Cc: tassilo@member.fsf.org, emacs-devel@gnu.org To: Giorgos Keramidas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 17 20:24:14 2010 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.69) (envelope-from ) id 1PInc2-0007TQ-Q3 for ged-emacs-devel@m.gmane.org; Wed, 17 Nov 2010 20:24:14 +0100 Original-Received: from localhost ([127.0.0.1]:58673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PInbU-0000mg-Sz for ged-emacs-devel@m.gmane.org; Wed, 17 Nov 2010 14:23:36 -0500 Original-Received: from [140.186.70.92] (port=36769 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PInbF-0000ja-Cz for emacs-devel@gnu.org; Wed, 17 Nov 2010 14:23:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PInb7-0002tZ-TH for emacs-devel@gnu.org; Wed, 17 Nov 2010 14:23:15 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:56158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PInb7-0002tL-KQ for emacs-devel@gnu.org; Wed, 17 Nov 2010 14:23:13 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LC100E00MZQEZ00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Wed, 17 Nov 2010 21:22:25 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.126.249.126]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LC100DV5N5B1VE0@a-mtaout20.012.net.il>; Wed, 17 Nov 2010 21:22:25 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) 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:132789 Archived-At: > From: Giorgos Keramidas > Cc: tassilo@member.fsf.org, emacs-devel@gnu.org > Date: Wed, 17 Nov 2010 14:14:54 +0100 > > > The problem is that I installed a fix for displaying glyphless > > characters using the zero-width method (see the change in > > set_cursor_from_row in the changeset), and that fix inadvertently > > introduced this bug. > > > > I will try to fix this as soon as possible. > > That's ok. I daily build new snapshots, and this is a very minor detail > that doesn't have any serious consequences to the actual *data* of the > buffer. When you have a fix in the works, please feel free to forward > me the patch for testing. I think I fixed this now, patch below. === modified file 'src/ChangeLog' --- src/ChangeLog 2010-11-17 15:12:02 +0000 +++ src/ChangeLog 2010-11-17 19:15:24 +0000 @@ -1,3 +1,8 @@ +2010-11-17 Eli Zaretskii + + * xdisp.c (set_cursor_from_row): Fix cursor positioning in empty + lines on text-mode terminals. (bug#7417) + 2010-11-17 Stefan Monnier * xterm.c (get_current_wm_state): Rename from get_current_vm_state. === modified file 'src/xdisp.c' --- src/xdisp.c 2010-11-17 02:37:45 +0000 +++ src/xdisp.c 2010-11-17 19:15:24 +0000 @@ -12839,6 +12839,15 @@ set_cursor_from_row (struct window *w, s && BUFFERP (glyph->object) && glyph->charpos == pt_old) && bpos_covered < pt_old) { + /* An empty line has a single glyph whose OBJECT is zero and + whose CHARPOS is the position of a newline on that line. + Note that on a TTY, there are more glyphs after that, which + were produced by extend_face_to_end_of_line, but their + CHARPOS is zero or negative. */ + int empty_line_p = + (row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end) + && INTEGERP (glyph->object) && glyph->charpos > 0; + if (row->ends_in_ellipsis_p && pos_after == last_pos) { EMACS_INT ellipsis_pos; @@ -12875,6 +12884,7 @@ set_cursor_from_row (struct window *w, s || (row->truncated_on_right_p && pt_old > bpos_max) /* Zero-width characters produce no glyphs. */ || (!string_seen + && !empty_line_p && (row->reversed_p ? glyph_after > glyphs_end : glyph_after < glyphs_end)))