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#20445: excessive redisplay / echo area resizing during byte-compilation Date: Tue, 28 Apr 2015 18:13:25 +0300 Message-ID: <83sibkuvze.fsf@gnu.org> References: <7cfv7lxnpr.fsf@fencepost.gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1430235766 6804 80.91.229.3 (28 Apr 2015 15:42:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Apr 2015 15:42:46 +0000 (UTC) Cc: 20445@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 28 17:42:31 2015 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 1Yn7eV-0007en-Cz for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Apr 2015 17:42:27 +0200 Original-Received: from localhost ([::1]:34467 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yn7eU-0005K6-Ik for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Apr 2015 11:42:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yn7D7-00050h-8l for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2015 11:14:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yn7D1-0006id-4V for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2015 11:14:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yn7D1-0006iW-1E for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2015 11:14:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Yn7D0-0003PI-E2 for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2015 11:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Apr 2015 15:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20445 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20445-submit@debbugs.gnu.org id=B20445.143023402213060 (code B ref 20445); Tue, 28 Apr 2015 15:14:02 +0000 Original-Received: (at 20445) by debbugs.gnu.org; 28 Apr 2015 15:13:42 +0000 Original-Received: from localhost ([127.0.0.1]:42916 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yn7Cf-0003OX-8m for submit@debbugs.gnu.org; Tue, 28 Apr 2015 11:13:41 -0400 Original-Received: from mtaout26.012.net.il ([80.179.55.182]:59382) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yn7Cc-0003OG-1O for 20445@debbugs.gnu.org; Tue, 28 Apr 2015 11:13:39 -0400 Original-Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0NNI00600VP23M00@mtaout26.012.net.il> for 20445@debbugs.gnu.org; Tue, 28 Apr 2015 18:15:08 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NNI00J3HVP8ENB0@mtaout26.012.net.il>; Tue, 28 Apr 2015 18:15:08 +0300 (IDT) In-reply-to: <7cfv7lxnpr.fsf@fencepost.gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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:102173 Archived-At: > From: Glenn Morris > Date: Mon, 27 Apr 2015 17:31:28 -0400 > > Does not happen with M-x byte-recompile-file. If you invoke byte-compile-file like this: M-: (byte-compile-file "org.el") RET then it flickers exactly like with the menu-bar invocation. Which is expected, since the menu bar invokes emacs-lisp-byte-compile, which does this: (defun emacs-lisp-byte-compile () "Byte compile the file containing the current buffer." (interactive) (if buffer-file-name (byte-compile-file buffer-file-name) (error "The buffer must be saved in a file first"))) The difference between "M-x byte-compile-file" and the invocation via M-: seems to be due to this trick in bytecomp.el: (defun byte-compile--message (format &rest args) "Like `message', except sometimes don't print to minibuffer. If the variable `byte-compile--interactive' is nil, the message is not displayed on the minibuffer." (apply #'message format args) (unless byte-compile--interactive (message nil))) And indeed, if I invoke byte-compile-file like this: M-: (let ((byte-compile--interactive t)) (byte-compile-file "org.el")) RET the flickering goes away. Now to the source of the flickering: it's the resizing of the echo area that causes that. We have this code in echo_area_display: window_height_changed_p = display_echo_area (w); [...] if (window_height_changed_p <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< /* Don't do this if Emacs is shutting down. Redisplay needs to run hooks. */ && !NILP (Vrun_hooks)) { /* Must update other windows. Likewise as in other cases, don't let this update be interrupted by pending input. */ ptrdiff_t count = SPECPDL_INDEX (); specbind (Qredisplay_dont_pause, Qt); windows_or_buffers_changed = 44; <<<<<<<<<<<<<<<<<<<<<< redisplay_internal (); And a non-zero value of windows_or_buffers_changed causes a thorough redisplay, including, for example, the mode lines, the menu bar and the scroll bars. If I set resize-mini-windows to nil, the flickering disappears. I think what causes the frequent resizes of the echo area are those calls to (message nil) in byte-compile--message. Perhaps avoiding that would resolve the issue. Otherwise, I guess I'll have to say that this is the display engine "functioning as designed". > Does not happen with 24.5, even with the menu-bar. The trick with byte-compile--message and byte-compile--interactive is new on master, it didn't exist in Emacs 24.