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: Tue, 13 Feb 2024 23:26:42 +0200 Message-ID: <8876d606-c4af-4a27-a1b1-4c3dea6d720e@gutov.dev> References: <6aed5106-b78c-49f1-8caa-a7f9d34c161b@gutov.dev> <207528e2-6bec-436e-8868-8e7b707133f6@gutov.dev> <86sf1wpjui.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="35590"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: emacs-devel@gnu.org To: Eli Zaretskii , Arthur Miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Feb 13 22:28:00 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 1ra0Jq-0008ug-Ad for ged-emacs-devel@m.gmane-mx.org; Tue, 13 Feb 2024 22:27:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ra0Il-0003P2-JG; Tue, 13 Feb 2024 16:26:51 -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 1ra0Ij-0003OL-OW for emacs-devel@gnu.org; Tue, 13 Feb 2024 16:26:50 -0500 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ra0Ih-0000Dl-8O; Tue, 13 Feb 2024 16:26:48 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 147D75C00DB; Tue, 13 Feb 2024 16:26:45 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 13 Feb 2024 16:26:45 -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=1707859605; x=1707946005; bh=BXFspjPnVoieL8QlvpzUrWTjuLYAHOmr2ixmjT4Q/Nw=; b= rTObS2QX8raq49LGG32byDW3xJuwky0y/7cJSseZ5pXkVZ53Li7R7rWxP47gg/sI GwGTBhHPQp7oe5UTf88Z38zMRKeTha8BjFhT6lG3O1vETzQd3PTXTeapBuna3HUB LORSqNZvpnhyd8JYhMrjGWGCNRm21fGTW4vJUDYKEk0m4POCnQ7BSeD4lXV49vEh q5b7MrGWqvG65JvW39vBp573ON2Apqs21xdplJ18UUm8/tOdtR4d+H+f3jpJLADQ rKW3wSXnBvmgSEzIv36L7AF/41AeoOe8R6EKGhRDg2yuc+qlUfbtOG5W+BZl7mmQ SY6EZ87n/H8Teb9NUFqDRQ== 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=1707859605; x= 1707946005; bh=BXFspjPnVoieL8QlvpzUrWTjuLYAHOmr2ixmjT4Q/Nw=; b=X ZpADZUwJlkZqBuPPqmSxWxmeUociirBuJjPfja9sxFrl4peXF5oV2GGLp37r1V8R iAQ9nmareso4SLaqh3qesrylHfpMeN18Lpj4Y+BWOWYaA2qMjWtVHvWEavrCVFmz Oq4IsBaXAzvMftEBhvnxEd99xzazwOVhvaUFZrkcvcfZXdZz3Nj73cKuJfTqoU99 d3tMPr/iRyhIXTB0ddshYEsJvj9MQfMWEyFxeJXnGKJhCdt+tgRvHJCGbnnHz/E5 2vgqUHUOL+WE/kyAmqReSb48dWn3u9j8WaW0aS+T/c30dcC+Y3m1WnYgCmIR6C85 BEV5aHGG/gdUo4VEfIaOQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudehgddugeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Feb 2024 16:26:43 -0500 (EST) Content-Language: en-US In-Reply-To: <86sf1wpjui.fsf@gnu.org> Received-SPF: pass client-ip=66.111.4.29; envelope-from=dmitry@gutov.dev; helo=out5-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:316188 Archived-At: On 13/02/2024 15:36, Eli Zaretskii wrote: >> From: Arthur Miller >> Cc: emacs-devel@gnu.org >> Date: Tue, 13 Feb 2024 10:47:33 +0100 >> >> I wasn't even aware this was going on, untill yesterday. I understand that some >> users like to see diverse stuff in their modeline, statusbars, powerlines, >> command prompts and other widgets. That is fine; if users want it, give it to >> them. >> >> But I am not such a user, and this feels a bit too much to have it auto >> on. This can get triggered automatically in save places; for example I have save >> place on, so when I open a file, Emacs will display cursor at the same place >> where I left. I see that it gets triggred in some places with Helm >> completion. Basically everything I have nowdays is in Git, inclusive my entire >> emacs.d folder. That means I am constantly starting and killing git processes, >> and I don't even care about that info on my modeline. I look barely at modeline; >> sometimes I take a look at the clock or line/column number. > > 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. Apparent downsides: - As you noted in another thread, errors in the mode-line don't trigger the debugger. Any problems with fetching the VCS state will become somewhat more difficult to debug. Although someone would just have to evaluate (vc-state ...) to trigger that outside of mode-line context. - Prompting the user whether to follow "symbolic link to %s-controlled source file" would become a lot more difficult if the code that's supposed to do that, again, runs in the context of the mode-line. The latter seems like more of a problem, but we could fall back to the current functionality when the file is a symlink and vc-follow-symlinks is non-nil (fetch the backend eagerly). As a result, we could have Emacs that's a little bit faster for users with custom mode-lines. And also for any find-file-noselect calls done in the background (we do those, sometimes on a list of files) won't fetch the VCS status eagerly. That seems like a win. So I would welcome such an experiment, especially if one is careful to retain support for vc-follow-symlinks. vc-after-save could similarly avoid doing the full refresh until the file's backend/state are requested again.