From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#36803: 27.0.50; Update mode-line of every window when compilation ends Date: Fri, 26 Jul 2019 17:10:40 -0400 Message-ID: References: <877e87i0vw.fsf@gmail.com> <87imrqcuws.fsf@mouse.gnus.org> <83ef2enosr.fsf@gnu.org> <83r26dmcx3.fsf@gnu.org> <83imron88m.fsf@gnu.org> <83h878mzjc.fsf@gnu.org> <83ef2cmwji.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="191257"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 36803@debbugs.gnu.org, larsi@gnus.org, kevin.legouguec@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 26 23:12:39 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hr7W1-000nbh-Oz for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Jul 2019 23:12:38 +0200 Original-Received: from localhost ([::1]:43314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hr7W0-0003sm-2f for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Jul 2019 17:12:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43037) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hr7Vv-0003sN-9N for bug-gnu-emacs@gnu.org; Fri, 26 Jul 2019 17:12:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hr7Uy-0006nt-5l for bug-gnu-emacs@gnu.org; Fri, 26 Jul 2019 17:11:39 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34596) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hr7UU-0006WB-9r for bug-gnu-emacs@gnu.org; Fri, 26 Jul 2019 17:11:10 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hr7UU-00068A-1A for bug-gnu-emacs@gnu.org; Fri, 26 Jul 2019 17:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Jul 2019 21:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36803 X-GNU-PR-Package: emacs Original-Received: via spool by 36803-submit@debbugs.gnu.org id=B36803.156417545923557 (code B ref 36803); Fri, 26 Jul 2019 21:11:01 +0000 Original-Received: (at 36803) by debbugs.gnu.org; 26 Jul 2019 21:10:59 +0000 Original-Received: from localhost ([127.0.0.1]:43417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hr7UP-00067s-Dj for submit@debbugs.gnu.org; Fri, 26 Jul 2019 17:10:59 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:42667) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hr7UN-00067d-DE for 36803@debbugs.gnu.org; Fri, 26 Jul 2019 17:10:56 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id CAAF944567C; Fri, 26 Jul 2019 17:10:49 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5598B445668; Fri, 26 Jul 2019 17:10:48 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1564175448; bh=XI7AD4Mcp6pG+QGKx81Jtze0tFibV19rpSjSlxXk3jM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Vdvl0QeKZi51Bd/ldP7vKauK2MqiIA7/jePAXDMGrSIwQ3L5RqbiCVJXrp3wvhFp4 lOWD0wABbWTfLoLHvhnwhNbLVKP1g3MUJ2x9Dd6o//5wZVI3OBT1JdXvRI7C7eO5Zv ORe3nfLYzqFdb3StWfwtsn+kwuQA/SNtsk2FPxcKAJXdBpnnE2FPI0ZftIPLQ48xQr ELKUJ4FgTpeTw8IDOlxM9dI7bBqMgK9/Oz0VPEWUFVFjyrpCEUYXM52noEZPCS1uHP OnQpoTus1UIHFInkhqv/kdcmOr5fm4gw+Ljm6VVaZr6rZ09O9V/nH4JEQlRJRRuYGr J5L3Gk8tYxrGQ== Original-Received: from pastel (unknown [216.154.19.233]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1018612081F; Fri, 26 Jul 2019 17:10:48 -0400 (EDT) In-Reply-To: <83ef2cmwji.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 26 Jul 2019 22:21:37 +0300") 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: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:163815 Archived-At: >> Right: there are 2 windows displaying the original buffer, plus a third >> one displaying the compilation buffer. The C code for process sentinels >> makes sure that the mode-line of the window showing the compilation >> buffer get updated (for the benefit of mode-line-process, presumably), >> but none of the others. >> As it so happens, one of the others also gets updated because it's the >> currently selected_window. > > That's not what happens. What happens is that one of the windows > still shows "Compiling" after the process exits. AFAIK this is indeed just what I describe in the previous paragraph (i.e. at the end of the compilation, when the sentinel is run, the C part of the sentinel processing causes the refresh of the mode-line of the window showing the compilation buffer, the redisplay itself will on its own accord decide to refresh the selected window's mode-line, but the third window's mode-line is not refreshed because noone tells the C code that all mode-lines indicated the status of this specific process). > If you are saying that that buffer's mode line wasn't supposed to show > the process status in the first place, then that's the bug we should > solve. No, I only indicated as a side-comment that this default of showing the status of the compilation process in all mode lines is a behavior I dislike. > But right now the mode line of *scratch* does show "Compiling" > in all of its windows, so there's a global setting that is updated > when the process starts and ends, Indeed. > and that change isn't triggering the update of mode lines in all the > windows showing *scratch*. I still don't understand how you explain > that inconsistency. Very simple: the change in the mode-line is caused by a change to the `compilation-in-progress` global variable. Yet, the mode-line infrastructure is not setup to track dependencies on variables; instead it's traditionally the responsability of the code which sets this variable to explicitly call force-mode-line-update (as is done, for example in all minor-modes (from within `define-minor-mode`)). > If the call to force-mode-line-update is the solution you suggest, > then I think it is not a good solution. We cannot rely in a call to > force-mode-line-update, because there's the default sentinel, and The default sentinel does not modify `compilation-in-progress` (nor any other global variable for that matter), so there's never any need to update all the mode-lines at the end of a process using the default sentinel. > because it's unreasonable to request each sentinel written in Lisp to > make that call. If every sentinel must do that, then the core should > do that for them. Not all sentinels must so that. Only those which set global variables whose content affects the mode-line of "all" windows (not necessarily all, tho, but at least more than just the mode lines of the current buffer). There might be a few beside compile.el's sentinel, but they are the exception rather than the rule. Stefan