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: Thu, 15 Feb 2024 00:37:28 +0200 Message-ID: <1331394b-6bbb-47d7-a250-064c41fcecaf@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> 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="26365"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Eli Zaretskii , emacs-devel@gnu.org To: Arthur Miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 14 23:38:07 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 1raNtG-0006Xw-9d for ged-emacs-devel@m.gmane-mx.org; Wed, 14 Feb 2024 23:38:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raNsp-0008KD-5c; Wed, 14 Feb 2024 17:37:39 -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 1raNsn-0008Jp-Pj for emacs-devel@gnu.org; Wed, 14 Feb 2024 17:37:37 -0500 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1raNsl-0008P6-Qv; Wed, 14 Feb 2024 17:37:37 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4C4C15C0069; Wed, 14 Feb 2024 17:37:31 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 14 Feb 2024 17:37:31 -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=1707950251; x=1708036651; bh=kFeQbBCDC1bbh+zgWih6IcX9HyhrWM4jvut9B4/wP58=; b= q6KzIu2S5qnTJan22aZzZBBGbhYPDoATRmVZhJWCwAjupSlsd9YzCSOve/d+cQ9p QAC4vPNXgDgv+eQ86sT3dcRNaOW1PcPh372N9kNz7tWCfr2539wPDnD46NgGyWOI aHzUVJ3HhdwgkiQUoq6E/AettAM83G7i4y1r/9u5wtMUKHFxwgodx0a+yaRLv1ch jJxxFG2f/jVL5hKts/PI0Lvquw5Mvo0PgCBOzGN9RT106/m+F7aUh2lCQTkHptIj 6jv59Wj23Gt93FlyBWCE4w+VvjS1QnEcQ8xy5Bn/OFU3MSNww/Zvl9NBg8p00HxL RMwQeOnR1MJLmaha+F8RAA== 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=1707950251; x= 1708036651; bh=kFeQbBCDC1bbh+zgWih6IcX9HyhrWM4jvut9B4/wP58=; b=Y guus9/BICPP+U95PSlcMUb1a/d5QdGZsSP21xNc1MB6xAjFeGFeEcVJPsfaeZPZ3 LicU0z8Qp35BwbSrzUj+YnAujAXFiJ/KoRxb9TqCys2KY1pwNWuiaU9QZzun4Kyk BVFczFUyjFVlYLa4Vzf7R3x6Hv/hki2YK4rBcBPeCnyOp6MlIbMLAIFtFPVagtlH WKQ8BCslNUCb76ABQoIiPIU/BPSsc6iYIsOdKhuvDa0IVMOBOAACiEp6WT5Nv979 T/sXI+IS8hnhmkFBAjuU6KUTF0EpoxejJ8JYpuTRJ9mx3klMiAtQEgQiM3McVa64 1uf9qNXg3Tq5wt049BUYw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudejgdduieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 14 Feb 2024 17:37:30 -0500 (EST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=66.111.4.28; envelope-from=dmitry@gutov.dev; helo=out4-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_H3=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:316213 Archived-At: On 14/02/2024 23:04, Arthur Miller wrote: >> The idea behind it was something else: to be able to unify mode-line elements >> (from vc and project). > > Ok, I see. A question: is it importnat to keep display on modeline or > elsewhere decoupled from the actual repo query? Probably, yes. If I understood your question right. >>> In case when list of files are checked, one can let-binding vc-display-status >>> to nil in vc-refresh (or the responsible one) so to not trigger git? >> >> vc-display-status only affects vc's mode-line element. > > Can I use to in the meaning "no status display" = "no git query"? That is why I > ask if it is important to keep display decoupled from the query. If we do it this way, it will just be an incremental increase in the complexity of the code, and it will support only a part of the applicable use cases. I think I've explained that in one of the previous emails. >>>> 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. >>> When they request for the backend state; they could do so asyncrhonously to, >>> by >>> starting a timer? The update will not be immideate; run first when Emas is idle, >>> if it is just the modeline; but third party apps, if there are such, can be more >>> picky. >> >> That's not simpler. > > After looking more at it; what I find problematic is that it is automatic. Also, > use of hooks find-file/after-save (eventually) means either all or nothing. > > I looked a bit in vc-hooks and vc-dir, and come up with this little ugly hack: > > (define-minor-mode vc-mode > "vc-mode test" > :global nil :lighter " vcm " > (setq-local vc-handled-backends > (if vc-mode > '(RCS CVS SVN SCCS SRC Bzr Git Hg) > nil))) > > Since vc-mode is just a dummy function; I per-used it. Now I can keep in my init > file (setq vc-handled-backends nil) and nothing screems after Git when it is not > in the path; and in projects where I wish to work with vc-mode and run vc-dir, I > can start vc-mode and than vc-dir works as expected. If you're just looking for a hack for personal use, this one's as good as any. > I also don't see how Emacs could know when to start vc-mode and when not, > without user taking an action. If complete automatic handling of version control > is desired than something like that is not acceptable. It would be whenever some actual feature requested the vc state to be computed because it's going to use it now. > Anyway, I think I can personally live with my hack, unless there is something > really nasty I am forseeing there. That achieves what I asked for, without you > needed to change anything. I don't think you're going to have any big problems with the above setup, as long as you remember to turn on vc-mode to use any features that require VC. Such as diff-hl-mode, for example.