From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mario Lang Newsgroups: gmane.emacs.devel Subject: Re: comint-preoutput-filter-functions and flickering redisplay in TTY Date: Tue, 03 Jun 2014 15:12:41 +0200 Message-ID: <87fvjm3zna.fsf@fx.delysid.org> References: <87r4366w66.fsf@fx.delysid.org> <87vbsigou7.fsf@geodiff-mac3.ulb.ac.be> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1401801789 22312 80.91.229.3 (3 Jun 2014 13:23:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Jun 2014 13:23:09 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 03 15:23:03 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wrog8-0000Dw-Pz for ged-emacs-devel@m.gmane.org; Tue, 03 Jun 2014 15:23:00 +0200 Original-Received: from localhost ([::1]:53161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wrog8-0001CF-AO for ged-emacs-devel@m.gmane.org; Tue, 03 Jun 2014 09:23:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WroWH-0007Mi-BW for emacs-devel@gnu.org; Tue, 03 Jun 2014 09:12:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WroWC-0003KD-KM for emacs-devel@gnu.org; Tue, 03 Jun 2014 09:12:49 -0400 Original-Received: from fep20.mx.upcmail.net ([62.179.121.40]:50879) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WroWC-0003Jv-AC for emacs-devel@gnu.org; Tue, 03 Jun 2014 09:12:44 -0400 Original-Received: from edge03.upcmail.net ([192.168.13.238]) by viefep20-int.chello.at (InterMail vM.8.01.05.13 201-2260-151-135-20130320) with ESMTP id <20140603131242.MLIH3265.viefep20-int.chello.at@edge03.upcmail.net> for ; Tue, 3 Jun 2014 15:12:42 +0200 Original-Received: from fx.delysid.org ([80.109.200.215]) by edge03.upcmail.net with edge id 9pCh1o01l4fLMH403pChHW; Tue, 03 Jun 2014 15:12:42 +0200 X-SourceIP: 80.109.200.215 Original-Received: from mlang by fx.delysid.org with local (Exim 4.82) (envelope-from ) id 1WroW9-0001g8-LI for emacs-devel@gnu.org; Tue, 03 Jun 2014 15:12:41 +0200 In-Reply-To: <87vbsigou7.fsf@geodiff-mac3.ulb.ac.be> (Nicolas Richard's message of "Tue, 03 Jun 2014 14:27:44 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 62.179.121.40 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:172288 Archived-At: Nicolas Richard writes: > Mario Lang writes: >> To reproduce: Install chess.el, call M-x chess-ics RET, login to >> freechess.org (as guest is OK), and wait a bit. Your screen (at least i= n -nw mode) >> should start to flicker noticeably every once in a while. >> >> Any ideas why? > > I tried it in my GUI emacs (just to try chess.el, in fact) and noticed > very frequent recentering of my window, even when not in the *chess-ics* > buffer. > > By tracing "recenter" I found that tabulated-list-print calls (recenter) > without checking what the selected window is.=20 > > here's the patch I applied, perhaps you can try it out and see if it > fixes the problem for you. Very good catch! Most of the flickering is now gone. I think this should be committed, if others are fine with it as well. > diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulate= d-list.el > index d0d71dd..dd1166f 100644 > --- a/lisp/emacs-lisp/tabulated-list.el > +++ b/lisp/emacs-lisp/tabulated-list.el > @@ -323,7 +323,9 @@ to the entry with the same ID element as the current = line." > (if saved-pt > (progn (goto-char saved-pt) > (move-to-column saved-col) > - (recenter)) > + (when (eq (window-buffer (selected-window)) > + (current-buffer)) > + (recenter))) > (goto-char (point-min))))) > > (defun tabulated-list-print-entry (id cols) --=20 CYa, =E2=A1=8D=E2=A0=81=E2=A0=97=E2=A0=8A=E2=A0=95