From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#22466: 25.0.50; disable-theme apparently forces a redisplay and causes a screen flash Date: Tue, 26 Jan 2016 16:58:26 +0200 Message-ID: <83powo1j71.fsf@gnu.org> References: <87y4bcsogq.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1453820361 10155 80.91.229.3 (26 Jan 2016 14:59:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Jan 2016 14:59:21 +0000 (UTC) Cc: 22466@debbugs.gnu.org To: Artur Malabarba Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 26 15:59:11 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1aO55K-0008Gm-C8 for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Jan 2016 15:59:10 +0100 Original-Received: from localhost ([::1]:44539 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO55J-0001EC-Uj for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Jan 2016 09:59:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO55F-0001DC-9A for bug-gnu-emacs@gnu.org; Tue, 26 Jan 2016 09:59:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aO55C-0002Ig-1K for bug-gnu-emacs@gnu.org; Tue, 26 Jan 2016 09:59:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO55B-0002Ib-U7 for bug-gnu-emacs@gnu.org; Tue, 26 Jan 2016 09:59:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aO55B-0000Gu-N5 for bug-gnu-emacs@gnu.org; Tue, 26 Jan 2016 09:59:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Jan 2016 14:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22466 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22466-submit@debbugs.gnu.org id=B22466.1453820302995 (code B ref 22466); Tue, 26 Jan 2016 14:59:01 +0000 Original-Received: (at 22466) by debbugs.gnu.org; 26 Jan 2016 14:58:22 +0000 Original-Received: from localhost ([127.0.0.1]:37765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aO54Y-0000Fz-79 for submit@debbugs.gnu.org; Tue, 26 Jan 2016 09:58:22 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37430) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aO54X-0000Fn-4h for 22466@debbugs.gnu.org; Tue, 26 Jan 2016 09:58:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aO54B-0001uh-VK for 22466@debbugs.gnu.org; Tue, 26 Jan 2016 09:58:15 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37573) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO54B-0001ua-Ro; Tue, 26 Jan 2016 09:57:59 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1334 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aO54A-00018J-Fw; Tue, 26 Jan 2016 09:57:59 -0500 In-reply-to: <87y4bcsogq.fsf@gmail.com> (message from Artur Malabarba on Tue, 26 Jan 2016 09:02:29 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111989 Archived-At: > From: Artur Malabarba > Date: Tue, 26 Jan 2016 09:02:29 +0000 > > > 1. From “emacs -Q” evaluate `(load-theme 'tango-dark)'. Any other theme > with a dark background will also do. > > 2. Then, notice how every time you evaluate the following code, the > screen flashes white for a moment, and then resumes the exact same > appearance. > > (progn (disable-theme 'tango-dark) > (load-theme 'tango-dark)) > > Of course, “resuming the same appearance” is expected, the problem is > that the white flash is distracting, unnecessary, and eye-hurting. > > I understand _why_ it happens (after `disable-theme' the background is > actually white), but I don't see why it _has_ to happen. That is, why > does Emacs redisplay the frame in the middle of lisp evaluation, instead > of waiting until the end of the command loop? It's not redisplay that does this. It's the fact that disable-theme changes the frame's background color, and when that happens, we immediately clear the frame using the new background color, as part of the modify-frame-parameters call. Redisplay only handles the portions of display where there's text and other decorations that we manage. Clearing the frame with the new background color is not redisplay's job. > More importantly, is this redisplay (or “partial redisplay”, or whatever > it is) be avoided, so Emacs doesn't flash white on my pretty little eyes? > > ----- > > ps: In case it helps, investigation shows that this is caused by this > form inside `disable-theme': > > (set-frame-parameter frame 'background-color > (custom--frame-color-default > frame :background "background" "Background" > "unspecified-bg" "white")) > > I'm not saying this form is wrong. I'm just pointing to where it happens. What happens if you remove that from disable-theme? (I don't really understand why it has to specify "white".) Anyway, how come you get to doing this so often it hurts your eyes? Aren't people setting their beloved theme once when the session starts, and then never change it?