GNU bug report logs - #31115
26.1; python shell flicker

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: charles@HIDDEN (Charles A. Roelli); Keywords: confirmed; dated Mon, 9 Apr 2018 18:20:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) confirmed. Request was from Noam Postavsky <npostavs@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Severity set to 'minor' from 'normal' Request was from Noam Postavsky <npostavs@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 31115 <at> debbugs.gnu.org:


Received: (at 31115) by debbugs.gnu.org; 14 Apr 2018 14:42:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 14 10:42:23 2018
Received: from localhost ([127.0.0.1]:52476 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f7MNi-0004nZ-5Z
	for submit <at> debbugs.gnu.org; Sat, 14 Apr 2018 10:42:22 -0400
Received: from mail-io0-f172.google.com ([209.85.223.172]:43311)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>)
 id 1f7MNg-0004nH-Am; Sat, 14 Apr 2018 10:42:20 -0400
Received: by mail-io0-f172.google.com with SMTP id q84so13303052iod.10;
 Sat, 14 Apr 2018 07:42:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=O1uMghJj6px5B9hNyefhjTL2kAGWGLD90hibKdhff+8=;
 b=PRBU9Kc3VZIY+E+0WNWgUmO73uP1TlK85Hi4+0KEq0h5hFgGFfydpk7MhYiS8AFEM7
 CqXk/J3vHbsT69FP3GHs08wjO/ZfrQIKgY41i4qqJbinTpjJ/6U7cGTvOafxVqUhgRBb
 fEdpYb4MUF+omOP82AoZENhyWyCh+NsORTbDkSTGkgfqIdMxL4Ia6zTcWREIyrYF4m24
 R3TlTsqEGyA13D5WXppF72xSEtg61silU9Rp8H7aOsajnF1V+4JSze6kSA/ZJ3HXkY8c
 tZJqv3KCRUg7kVCk5knVhaxJ6kBVuINSdwZgJHICrAtRnFVTNzqj1OPUa3Qf+op/tELf
 g1Gw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=O1uMghJj6px5B9hNyefhjTL2kAGWGLD90hibKdhff+8=;
 b=TSPVMJ1MyTaPYG0LwTuNIsi9+fRuFvoVwjyNChHWA3/ryeVLD66fc7/d9J/IKBY8S7
 sjQEAYDKRqnvSfasIA6Xj4JwaNxUYneZFKBJaGWjab4tJ8qJzBL3da1ObYiOJedFgQvH
 Rfgg/wrinnNC4r9cvGXvL9pTU/vd/0ILS3l0LBy2egL2mQzlNb2JEf2LPQ6/E4DCVomy
 5vW8tTrMPZ2QJot4AHgX9T4V/YxSIbVVBy0LmfW9meNoG15wcj072j5UGvVTnctYyA7n
 UGuaN5sipysbRP6LvQlsAwODqHQGTD1SoueY8wIMdwruXha/yyudDXU9rBPc20ugkgTR
 E3qA==
X-Gm-Message-State: ALQs6tB/skwvWiBIXbnY/rKGlDtVtsLc+Y/zg3PFqZM9gZPZnT5TDFCo
 gAAPOh/88/bAFbeaOQMUrtQQVA==
X-Google-Smtp-Source: AIpwx4+dg0YS59HZe5Aj1h+UmLiPNXuMX7DscfxNfl6CTM/lSN0WNVBkZBsPa2ydTRZmRZB/+2jsTg==
X-Received: by 10.107.51.207 with SMTP id z198mr18059206ioz.112.1523716934633; 
 Sat, 14 Apr 2018 07:42:14 -0700 (PDT)
Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34])
 by smtp.googlemail.com with ESMTPSA id
 g16-v6sm760883ita.0.2018.04.14.07.42.12
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Sat, 14 Apr 2018 07:42:13 -0700 (PDT)
From: Noam Postavsky <npostavs@HIDDEN>
To: Andreas =?utf-8?Q?R=C3=B6hler?= <andreas.roehler@HIDDEN>
Subject: Re: bug#31115: 26.1; python shell flicker
References: <m2woxgz1h4.fsf@HIDDEN>
 <4b3cf81a-bff1-2894-52ee-203782c4554b@HIDDEN>
Date: Sat, 14 Apr 2018 10:42:12 -0400
In-Reply-To: <4b3cf81a-bff1-2894-52ee-203782c4554b@HIDDEN> ("Andreas
 \=\?utf-8\?Q\?R\=C3\=B6hler\=22's\?\= message of "Thu,
 12 Apr 2018 08:20:39 +0200")
Message-ID: <87lgdpkfy3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 31115
Cc: 31115 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

severity 31115 minor
tags 31115 + confirmed
quit

Andreas R=C3=B6hler <andreas.roehler@HIDDEN> writes:

> On 09.04.2018 20:19, Charles A. Roelli wrote:
>> emacs -q
>> M-x run-python RET C-x o
>>
>> Now press and hold down RET: a lot of prompts fly by, and as soon as
>> point reaches the bottom of the window, there is some flicker where
>> the cursor momentarily appears centered (as if `recenter' was run) and
>> simultaneously all the text in the buffer blinks as if the whole
>> screen was cleared and redrawn.  In contrast, if you try this same
>> recipe in a normal shell buffer from M-x shell, there won't be any
>> flicker.

> Can't reproduce with GNU Emacs 26.1 (build 1, i686-pc-linux-gnu, GTK+
> Version 3.14.5) of 2018-04-10 at Debian

I can reproduce on Emacs 26, both lucid and GTK builds.  Seems pretty
straightforward: point reaches the end of buffer, so Emacs autoscrolls
by half a window, then python-comint-postoutput-scroll-to-bottom kicks
in and scrolls back to the bottom.

>> A naive fix is to comment out the meat of python-comint-postoutput-
>> scroll-to-bottom, and reevaluate it:
>>=20
>> (defun python-comint-postoutput-scroll-to-bottom (output)
>>   "Faster version of `comint-postoutput-scroll-to-bottom'.
>> Avoids `recenter' calls until OUTPUT is completely sent."
>>   ;; (when (and (not (string=3D "" output))
>>   ;;            (python-shell-comint-end-of-output-p
>>   ;;             (ansi-color-filter-apply output)))
>>   ;;   (comint-postoutput-scroll-to-bottom output))
>>   output)

Right, that help because Emacs no longer scrolls the window back to the
bottom.  Seems like (setq scroll-conservatively 1) works better to
preserve the original behaviour (I feel like that's too easy, so I must
be missing something though).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31115; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 12 Apr 2018 06:20:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 12 02:20:21 2018
Received: from localhost ([127.0.0.1]:46970 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f6Vam-0004Aq-TJ
	for submit <at> debbugs.gnu.org; Thu, 12 Apr 2018 02:20:21 -0400
Received: from eggs.gnu.org ([208.118.235.92]:40025)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <andreas.roehler@HIDDEN>) id 1f6Val-0004Ab-Ip
 for submit <at> debbugs.gnu.org; Thu, 12 Apr 2018 02:20:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <andreas.roehler@HIDDEN>) id 1f6Vaf-0004Wk-Au
 for submit <at> debbugs.gnu.org; Thu, 12 Apr 2018 02:20:14 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:60028)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <andreas.roehler@HIDDEN>)
 id 1f6Vaf-0004WZ-7q
 for submit <at> debbugs.gnu.org; Thu, 12 Apr 2018 02:20:13 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:59215)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <andreas.roehler@HIDDEN>) id 1f6Vad-0004aW-92
 for bug-gnu-emacs@HIDDEN; Thu, 12 Apr 2018 02:20:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <andreas.roehler@HIDDEN>) id 1f6Vaa-0004Uk-3i
 for bug-gnu-emacs@HIDDEN; Thu, 12 Apr 2018 02:20:11 -0400
Received: from mout.kundenserver.de ([212.227.126.131]:52101)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <andreas.roehler@HIDDEN>)
 id 1f6VaZ-0004TT-Pg
 for bug-gnu-emacs@HIDDEN; Thu, 12 Apr 2018 02:20:08 -0400
Received: from [192.168.178.35] ([94.223.89.85]) by mrelayeu.kundenserver.de
 (mreue001 [212.227.15.167]) with ESMTPSA (Nemesis) id
 0LhoIM-1ejlh91JUg-00n8ur for <bug-gnu-emacs@HIDDEN>; Thu, 12 Apr 2018
 08:20:05 +0200
Subject: Re: bug#31115: 26.1; python shell flicker
To: bug-gnu-emacs@HIDDEN
References: <m2woxgz1h4.fsf@HIDDEN>
From: =?UTF-8?Q?Andreas_R=c3=b6hler?= <andreas.roehler@HIDDEN>
Message-ID: <4b3cf81a-bff1-2894-52ee-203782c4554b@HIDDEN>
Date: Thu, 12 Apr 2018 08:20:39 +0200
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101
 Thunderbird/52.7.0
MIME-Version: 1.0
In-Reply-To: <m2woxgz1h4.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Provags-ID: V03:K1:3vwWe7vzCZuCIUasaJQ7CUXlPWKg3eppyBzPn2Ex5iSLOX6eN9g
 2z/efdgR+J4zi0vdT/0ss7nGLAqhMGzQbMI0rOpOIv041mjr7nFtNC8b80pJckGSuDlGZZs
 ZUfWvOQOKDYoIbkMO2nlSG+FdyICIgqqvp0o0MPuRF292McN7WFd5Wtx/zrSQ8ohggRByc8
 lrNzJFVTs4qDQtTmz3tHg==
X-UI-Out-Filterresults: notjunk:1;V01:K0:4kFoSLrBcUk=:BYupLINuL724xfr4i87Ljk
 u0/Lkqot+gAM4Dcp7xKWn28avAsoHeg2RLapXdiAgJqdzBEtTmHB+4GUzAB2wTFHpSO0PpG+e
 3+6NzKwIe+6QHqXrALxA2S27qEaqz2PeIlnNltzivZM7iaPvCTLWU6IfZwbrGyfZ1BgYRH2pi
 arOB/uB7SRlDYzYKGHtRgGxx2npwrs2NqPHaW44LmjWic3eFvVTTgJRO6d/SqLp+026Jszpao
 baPf9uZxDYOXBpNr4gSK5SryroU8KbEmZoGdSkwA4v3YiqTGqy11mg2AmAtBEiI6YUyIikaCL
 EkQoHyiJxmteAm3qXdyaPSUcxUdIHa+q3wuN+Asp3y5oSBo1iAXmTpKVgAhl7EcvFnhLvd+wy
 trjpacLBw0BtAdRHcckDnnMOFXXw/EVC3j7INIS0Jps1HDg23WbsNxFnXmQ7kA/lA2uaXs0fq
 XEhGo199uK/H/PdFNkXmF1GWH1EgVu4sTaPJX2CaVrp1RApEADhrlfCdiuKiWEJSPhCpAJdX2
 MywGChPmj7COx8JmhL5I+zhn7a4Ji2Kuxmzd8AqdMm25tmE5rV90pBQuvH7RLFY+7Fx+adbWA
 QTy/pf71WzeCYj9Tcos9bizz7orQXcistyAgYO3lKLDguk4z7iF/82Y57HWpt7UTH4nk2bNLm
 f2sHRFIxMFyfToFcZddFjXhOge5QNYVvyJorO/+NVcndnfcT3swelg75G8l2cS6aIdntzOpkb
 z82QXAxBClFvg1r27WPnsvX3huGJW4RNt6nCttODmpFB+afW7GvKsW2gERM=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

On 09.04.2018 20:19, Charles A. Roelli wrote:
> emacs -q
> M-x run-python RET C-x o
> 
> Now press and hold down RET: a lot of prompts fly by, and as soon as
> point reaches the bottom of the window, there is some flicker where
> the cursor momentarily appears centered (as if `recenter' was run) and
> simultaneously all the text in the buffer blinks as if the whole
> screen was cleared and redrawn.  In contrast, if you try this same
> recipe in a normal shell buffer from M-x shell, there won't be any
> flicker.
> 
> Obviously, the above recipe is not a standard use case for a shell
> buffer, but the same flicker is observed during normal use too.
> 
> A naive fix is to comment out the meat of python-comint-postoutput-
> scroll-to-bottom, and reevaluate it:
> 
> (defun python-comint-postoutput-scroll-to-bottom (output)
>    "Faster version of `comint-postoutput-scroll-to-bottom'.
> Avoids `recenter' calls until OUTPUT is completely sent."
>    ;; (when (and (not (string= "" output))
>    ;;            (python-shell-comint-end-of-output-p
>    ;;             (ansi-color-filter-apply output)))
>    ;;   (comint-postoutput-scroll-to-bottom output))
>    output)
> 
> I have no idea why that works, but it seems to help.  The function in
> question was added in the following commit:
> 
>    commit a6dc66a5441bc6832c12d362edd2d886edc1612a
>    Author: Fabián Ezequiel Gallina <fgallina@HIDDEN>
>    Date:   Sat Jul 26 23:02:38 2014 -0300
> 
>        Faster comint output.
> 
>        * lisp/progmodes/python.el:
>        (python-comint-output-filter-function): Make obsolete.
>        (python-comint-postoutput-scroll-to-bottom): New function.
>        (inferior-python-mode): Set comint-output-filter-functions to a
>        minimum.
> 
>        Fixes: debbugs:16875
> 
> 
> 

Can't reproduce with GNU Emacs 26.1 (build 1, i686-pc-linux-gnu, GTK+ 
Version 3.14.5) of 2018-04-10 at Debian




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31115; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 9 Apr 2018 18:19:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 09 14:19:10 2018
Received: from localhost ([127.0.0.1]:44233 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f5bNm-0003Ic-Ae
	for submit <at> debbugs.gnu.org; Mon, 09 Apr 2018 14:19:10 -0400
Received: from eggs.gnu.org ([208.118.235.92]:58631)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <charles@HIDDEN>) id 1f5bNj-0003IN-Qf
 for submit <at> debbugs.gnu.org; Mon, 09 Apr 2018 14:19:08 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <charles@HIDDEN>) id 1f5bNd-0004AC-Kx
 for submit <at> debbugs.gnu.org; Mon, 09 Apr 2018 14:19:02 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:38605)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <charles@HIDDEN>) id 1f5bNd-0004A6-Gd
 for submit <at> debbugs.gnu.org; Mon, 09 Apr 2018 14:19:01 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:49592)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <charles@HIDDEN>) id 1f5bNc-0007Cp-DO
 for bug-gnu-emacs@HIDDEN; Mon, 09 Apr 2018 14:19:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <charles@HIDDEN>) id 1f5bNX-00047N-LL
 for bug-gnu-emacs@HIDDEN; Mon, 09 Apr 2018 14:19:00 -0400
Received: from [2a03:2040:2:1b::1] (port=58912 helo=sinyavsky.aurox.ch)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <charles@HIDDEN>) id 1f5bNX-00043H-Cm
 for bug-gnu-emacs@HIDDEN; Mon, 09 Apr 2018 14:18:55 -0400
Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1])
 by sinyavsky.aurox.ch (Postfix) with ESMTP id 340A022702
 for <bug-gnu-emacs@HIDDEN>; Mon,  9 Apr 2018 18:19:58 +0000 (UTC)
Authentication-Results: sinyavsky.aurox.ch (amavisd-new);
 dkim=pass (1024-bit key) reason="pass (just generated, assumed good)"
 header.d=aurox.ch
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h=
 content-transfer-encoding:content-type:content-type:mime-version
 :subject:subject:to:from:from:message-id:date:date; s=dkim; t=
 1523297996; x=1524161997; bh=BbECo4PRs0uuhboZ37kZFF2qzNzCpuqJlk2
 paE4v2LQ=; b=mSxvCl72MZ1DH3+GUEFp0lWukSmTSPpmsclEd4ONZAhJzcfUJqj
 K/Lvynuf7xzPMP6ytlGUPLKKy4R+mBxrvU/Dn6bcHHahyDBj9A2/lbBDuWFNWicJ
 0z+fftjI6FVT9yAJrd+/7U+ZjzYrVuAyQ9/jBLbZKubhpvu3uH9hl6s4=
X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com
Received: from sinyavsky.aurox.ch ([127.0.0.1])
 by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new,
 port 10026) with ESMTP id h23K-WggLnhi for <bug-gnu-emacs@HIDDEN>;
 Mon,  9 Apr 2018 18:19:56 +0000 (UTC)
Received: from gray (202.100.1.85.dynamic.wline.res.cust.swisscom.ch
 [85.1.100.202])
 by sinyavsky.aurox.ch (Postfix) with ESMTPSA id A93A5226F2
 for <bug-gnu-emacs@HIDDEN>; Mon,  9 Apr 2018 18:19:56 +0000 (UTC)
Date: Mon, 09 Apr 2018 20:19:51 +0200
Message-Id: <m2woxgz1h4.fsf@HIDDEN>
From: charles@HIDDEN (Charles A. Roelli)
To: bug-gnu-emacs@HIDDEN
Subject: 26.1; python shell flicker
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.1 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.1 (-----)

emacs -q
M-x run-python RET C-x o

Now press and hold down RET: a lot of prompts fly by, and as soon as
point reaches the bottom of the window, there is some flicker where
the cursor momentarily appears centered (as if `recenter' was run) and
simultaneously all the text in the buffer blinks as if the whole
screen was cleared and redrawn.  In contrast, if you try this same
recipe in a normal shell buffer from M-x shell, there won't be any
flicker.

Obviously, the above recipe is not a standard use case for a shell
buffer, but the same flicker is observed during normal use too.

A naive fix is to comment out the meat of python-comint-postoutput-
scroll-to-bottom, and reevaluate it:

(defun python-comint-postoutput-scroll-to-bottom (output)
  "Faster version of `comint-postoutput-scroll-to-bottom'.
Avoids `recenter' calls until OUTPUT is completely sent."
  ;; (when (and (not (string=3D "" output))
  ;;            (python-shell-comint-end-of-output-p
  ;;             (ansi-color-filter-apply output)))
  ;;   (comint-postoutput-scroll-to-bottom output))
  output)

I have no idea why that works, but it seems to help.  The function in
question was added in the following commit:

  commit a6dc66a5441bc6832c12d362edd2d886edc1612a
  Author: Fabi=C3=A1n Ezequiel Gallina <fgallina@HIDDEN>
  Date:   Sat Jul 26 23:02:38 2014 -0300

      Faster comint output.

      * lisp/progmodes/python.el:
      (python-comint-output-filter-function): Make obsolete.
      (python-comint-postoutput-scroll-to-bottom): New function.
      (inferior-python-mode): Set comint-output-filter-functions to a
      minimum.

      Fixes: debbugs:16875




Acknowledgement sent to charles@HIDDEN (Charles A. Roelli):
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#31115; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 14 Apr 2018 14:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.