From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Missing snprintf in ucrt mingw + vc-refresh in find-file hook? Date: Wed, 14 Feb 2024 18:36:47 +0200 Message-ID: <7ecaf383-081f-47ad-bd83-6f1fe300fddc@gutov.dev> References: <6aed5106-b78c-49f1-8caa-a7f9d34c161b@gutov.dev> <207528e2-6bec-436e-8868-8e7b707133f6@gutov.dev> <86sf1wpjui.fsf@gnu.org> <8876d606-c4af-4a27-a1b1-4c3dea6d720e@gutov.dev> <86r0hfxgm9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2645"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: arthur.miller@live.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 14 17:37:49 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1raIGa-0000RT-P2 for ged-emacs-devel@m.gmane-mx.org; Wed, 14 Feb 2024 17:37:48 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raIFt-00016e-9Z; Wed, 14 Feb 2024 11:37:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1raIFr-00016K-Cp for emacs-devel@gnu.org; Wed, 14 Feb 2024 11:37:03 -0500 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1raIFh-0002fj-C2; Wed, 14 Feb 2024 11:36:55 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 2EA4232001FF; Wed, 14 Feb 2024 11:36:51 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 14 Feb 2024 11:36:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1707928610; x=1708015010; bh=pb0uXlucWA7cPqpYqrUc7Jb04Uftg0uTbZaOBevGIeg=; b= iX77EyNSJqqfH7ez7RMWHpOFZn1sFKsY2x97qdGzzZzqAQ2qWg/flwFHyTuXCcjL e2wkKVQ4QjPYfCw9aqD8CCgEpEJuEa1MQZIB/pb8Bc65QEuKZ28zpXU1EalUKSci 3FZMBrI4gqTKmFjNwwEJOL2bJ4LQV5sSkW6Zxy+oGPrnnmKjwSACZvSoUtyGk1rs giPVMm7gaf4n5+tkX/ROMho2+nmU+PwzQmayj+MnUkwd1/id1988eq6tqHUOnu09 5zeu6UiGmQIp5KL4x9XMieiBnIbdwDSLCT5NEC24ucIh+1gqoo1LwT0xQWe9AcHC 6YogizeSVcBLyDZuOB8gvQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1707928610; x= 1708015010; bh=pb0uXlucWA7cPqpYqrUc7Jb04Uftg0uTbZaOBevGIeg=; b=x +IFKmvPbzWpcQ5EZZ1R/VV7rm7LfyVgaldK2WcgNyZ14ly0k9v8+9DtsIbiutia4 Et7ADxzll4ojT8u0Yr6TVd1nxdUyh3nWkKeI51ZWY/7pyHmGL2IdDej7vpC2Gth9 tSx3mav8VlYeQHJuBHSGhgsDY8p89mYXQIP3uxmw4p56R+gMMkjdm90KLfyn1kGj o9NAj+ULEI5zGhlaOXRVMchq2KjvgZtst56x3+5MbOau0anEGeixL68TTZXTbgHB fYJdsTH0nBvsVf9Qn5ymi/b6cAndo/BzdQrYAr9sJuj8dcZ1fAhJ09Mz7vHYJxJz tSMfvkK2oCbsqg+geTPNQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudejgdeludcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedtvddtveefhfdvveegudej heenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 14 Feb 2024 11:36:49 -0500 (EST) Content-Language: en-US In-Reply-To: <86r0hfxgm9.fsf@gnu.org> Received-SPF: pass client-ip=64.147.123.25; envelope-from=dmitry@gutov.dev; helo=wout2-smtp.messagingengine.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_SBL_A=0.1 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:316205 Archived-At: On 14/02/2024 16:30, Eli Zaretskii wrote: >> Date: Tue, 13 Feb 2024 23:26:42 +0200 >> Cc: emacs-devel@gnu.org >> From: Dmitry Gutov >> >> On 13/02/2024 15:36, Eli Zaretskii wrote: >>> >>> I understand your POV, but this is turned on by default in Emacs long >>> ago. So the default cannot be changed just because you personally >>> dislike it. Instead, I suggest that you change the default value of >>> mode-line format locally. Or remove vc-refresh-state from >>> find-file-hook. Or try playing with the value of vc-display-status. >>> Or some other change that could do what you want; look in vc-hooks.el >>> for ideas. >> >> We could try dropping the forced refresh from find-file-hook. Then we'd >> have a function there that should be called differently, which would >> just reset the saved backend/status for the file, and the cached value >> for vc-mode (the mode-line element). >> >> Then, if the user disabled showing the VC state in the mode-line, and >> doesn't have any other packages installed that use the status, Git won't >> be called, at least not right away. > > What is the purpose of such a change? Does it target users who don't > want vc-refresh-state in find-file-hook, but still want the VC info > shown on the mode line? Those in particular won't see an immediate benefit, but, to reiterate: As a result, we could have Emacs that's a little bit faster for users with custom mode-lines [that don't show VCS status or backend]. And also [for all users:] any find-file-noselect calls performed in the background (sometimes those are even done on a list of files) won't fetch the VCS status eagerly until the buffer is displayed. > That sounds like a strange preference, since > find-file-hook is called just once per file buffer, whereas showing > the info on the mode line can potentially cause vc-refresh-state (or > something similar) to be called much more frequently, right? The backend and the state are cached in vc-file-prop-obarray, so it shouldn't result in more process calls, no matter the scenario. It's mostly about how early we fetch this information. > So before we discuss such a move, even as an experiment, I'd like to > understand better what would be the intended effect in user-facing > terms, and make sure we indeed consider such a behavior change > reasonable. Because this kind of changes is likely to cause > unintended problems, so I'd like to be sure we really want it before > we start investing time and efforts in it. Likewise, I would like to > avoid the situation where Arthur (or someone else) spends time and > efforts in experimenting with such a setup, only to be told later > that we don't think the results makes sense to us. For me, it really depends on the execution: whether it will actually require a moderate amount of changes (as I imagined), and whether the perceived improvement in user experience is there. And the appearance of "unintended problems", of course.