unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Giorgos Keramidas <keramida@ceid.upatras.gr>
Cc: tassilo@member.fsf.org, emacs-devel@gnu.org
Subject: Re: display bug for empty lines in recent git snapshot
Date: Wed, 17 Nov 2010 21:20:22 +0200	[thread overview]
Message-ID: <838w0rdafd.fsf@gnu.org> (raw)
In-Reply-To: <xeiapqu4ccs1.fsf@kobe.laptop>

> From: Giorgos Keramidas <keramida@ceid.upatras.gr>
> 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  <eliz@gnu.org>
+
+	* xdisp.c (set_cursor_from_row): Fix cursor positioning in empty
+	lines on text-mode terminals.  (bug#7417)
+
 2010-11-17  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* 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)))




  reply	other threads:[~2010-11-17 19:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-17  9:10 display bug for empty lines in recent git snapshot Giorgos Keramidas
2010-11-17  9:31 ` Tassilo Horn
2010-11-17  9:50   ` Giorgos Keramidas
2010-11-17 10:43   ` Giorgos Keramidas
2010-11-17 12:54     ` Eli Zaretskii
2010-11-17 13:14       ` Giorgos Keramidas
2010-11-17 19:20         ` Eli Zaretskii [this message]
2010-11-17 20:12           ` Giorgos Keramidas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=838w0rdafd.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=keramida@ceid.upatras.gr \
    --cc=tassilo@member.fsf.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).