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 19:01:10 +0200 Message-ID: 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> <7ecaf383-081f-47ad-bd83-6f1fe300fddc@gutov.dev> <865xyrxa3o.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="14187"; 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 18:02:29 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 1raIeS-0003U0-Fi for ged-emacs-devel@m.gmane-mx.org; Wed, 14 Feb 2024 18:02:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raIdl-0000eo-7o; Wed, 14 Feb 2024 12:01:45 -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 1raIdJ-0000Ii-O1 for emacs-devel@gnu.org; Wed, 14 Feb 2024 12:01:22 -0500 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1raIdH-0000fg-Em; Wed, 14 Feb 2024 12:01:17 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 3373C3200A14; Wed, 14 Feb 2024 12:01:13 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 14 Feb 2024 12:01:13 -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=1707930072; x=1708016472; bh=NRAdZVZCLcKu5Jczva9tLRRW3iFYN8u5QW5KI2VGMYY=; b= AP4KLiXbjGfSNg3jJEG1O3C3prDsYChm/WIN/+VG8+ynNLIsCk3VRmmJFMSoh1cn lrKJpqIRjn0ieSHtxMRtPos87GysvIbq9k0Wql4bd3TtJ2hWTcqk5rdcHV87ZeNi oQ6iQGhOV82iALLyuMfiMbboubVJzUq2zPgX+pl0pQrn+Eg00tibOMtC+MYeLCsa /lI+ABXE88X+NnTjzcuyLbF1neP9KGTY8Sj/06VX6b8O6mkooOQVsoDi9oAuvlEy M4GUrM50h1082e24VBqne1sXourkKB7UpSCtl4ebzTkEQjCtRpGNbU8n5Is0ZPdp 8qWf2/pdiO40i+f3zLOFuQ== 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=1707930072; x= 1708016472; bh=NRAdZVZCLcKu5Jczva9tLRRW3iFYN8u5QW5KI2VGMYY=; b=W rBUYLq/Gl7E8KrgXiaA58xbUWLqVjBKMmcPyzEjVmvfLX42/8r/PsLJJXPhJz1I0 18WF4YD0zbCeSABubjStemPDuneV8O7k4uYklRZftFmg2HCSVSv991m9Ut5UOixp NE6Y540c4wymIBp1IzF/U6GhLRjEODggrzpQqzNjHl8i/0rDH1qUV2PvTy+3H1Ns WnfoORpBFPTsL0Ow6ntem7ueEAWS49RYEf+P/bYZrNeG8fzRspnSDkFN4vQbEi2h ZnHlDJ02Dl5iFrKqObEPbp+rePV0zpoEJmG2glVdtC/TkJz+JpLVc0e/pJDLGVze 7qB8Yjz0uP9WGRZ8H0qXQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudejgdeljecutefuodetggdotefrodftvf 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 12:01:11 -0500 (EST) Content-Language: en-US In-Reply-To: <865xyrxa3o.fsf@gnu.org> Received-SPF: pass client-ip=64.147.123.20; envelope-from=dmitry@gutov.dev; helo=wout4-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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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:316207 Archived-At: On 14/02/2024 18:51, Eli Zaretskii wrote: >> Date: Wed, 14 Feb 2024 18:36:47 +0200 >> Cc: arthur.miller@live.com, emacs-devel@gnu.org >> From: Dmitry Gutov >> >>> 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. > > If that's the purpose, why not simply have a value of > vc-display-status which would cause vc-refresh-state do nothing? > AFAIU, the result will be the same, but with much less code churn and > definitely safer. vc-display-status only affects what the default mode-line does, and not the myriad of alternative configurations. It cleaner to let the work happen when it's really required to happen, rather than guess in advance based on an imprecise indicator like this. >> > 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. > > My point is that find-file-hook has an explicit and very specific > trigger for fetching the VC information, whereas doing that from the > mode line doesn't have that advantage, and will probably need to call > VC much more frequently in order not to miss changes. Again: the backend and state are cached. Why would VC be called more?