unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
Cc: 17281@debbugs.gnu.org
Subject: bug#17281: 24.4.50; emacs hangs in next-line
Date: Thu, 17 Apr 2014 12:03:03 +0300	[thread overview]
Message-ID: <83wqeoib08.fsf@gnu.org> (raw)
In-Reply-To: <20140417082931.GD23131@pille.home>

> Date: Thu, 17 Apr 2014 10:29:31 +0200
> From: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
> Cc: 17281@debbugs.gnu.org
> 
> Mail von Eli Zaretskii, Thu, 17 Apr 2014 at 11:00:05 +0300:
> > > Date: Thu, 17 Apr 2014 09:25:23 +0200
> > > From: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
> > > Cc: 17281@debbugs.gnu.org
> > > 
> > Then it's a different bug.  Are you sure it didn't happen before the
> > above commit?  I seem to be able to reproduce it as far back as Mar 15
> > (I have no easy way of trying older versions, due to changes in Lisp
> > files involved in this recipe).
> 
> I tried it back till 17. Dec 2013, but not all versions are compileable.
> All tried vesions have the same problem.
> 
> I even tried to debug it and I came to line-pixel-height (xdisp.c), which
> calls start-display(). I made a debug output in line-pixel-height before the
> call to start_display() and after. In the problematic case I never saw the
> debug output after start_display().

The infloop was indeed inside line-pixel-height.  Please try the patch
below, which I just committed to the emacs-24 branch.  It fixes your
recipe, so I hope the original use case with emacsclient will also be
fixed.

=== modified file 'src/xdisp.c'
--- src/xdisp.c	2014-04-12 11:21:47 +0000
+++ src/xdisp.c	2014-04-17 08:58:59 +0000
@@ -1262,12 +1262,23 @@ Value is the height in pixels of the lin
   struct it it;
   struct text_pos pt;
   struct window *w = XWINDOW (selected_window);
+  struct buffer *old_buffer = NULL;
+  Lisp_Object result;
 
+  if (XBUFFER (w->contents) != current_buffer)
+    {
+      old_buffer = current_buffer;
+      set_buffer_internal_1 (XBUFFER (w->contents));
+    }
   SET_TEXT_POS (pt, PT, PT_BYTE);
   start_display (&it, w, pt);
   it.vpos = it.current_y = 0;
   last_height = 0;
-  return make_number (line_bottom_y (&it));
+  result = make_number (line_bottom_y (&it));
+  if (old_buffer)
+    set_buffer_internal_1 (old_buffer);
+
+  return result;
 }
 
 /* Return the default pixel height of text lines in window W.  The






  reply	other threads:[~2014-04-17  9:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-17  6:10 bug#17281: 24.4.50; emacs hangs in next-line Stefan-W. Hahn
2014-04-17  7:13 ` Eli Zaretskii
2014-04-17  7:25   ` Stefan-W. Hahn
2014-04-17  8:00     ` Eli Zaretskii
2014-04-17  8:29       ` Stefan-W. Hahn
2014-04-17  9:03         ` Eli Zaretskii [this message]
2014-04-17 10:16           ` Eli Zaretskii
2014-04-17 11:00             ` Stefan-W. Hahn
2014-04-17 11:25               ` Eli Zaretskii
2014-04-17 12:39               ` Stefan Monnier
2014-04-17 12:37             ` Stefan Monnier
2014-04-17 12:47               ` Eli Zaretskii
2014-04-17 13:16                 ` Stefan Monnier
2014-04-17 12:56           ` Stefan-W. Hahn
2014-04-17 13:13             ` Eli Zaretskii

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=83wqeoib08.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=17281@debbugs.gnu.org \
    --cc=stefan.hahn@s-hahn.de \
    /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).