From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Missing snprintf in ucrt mingw + vc-refresh in find-file hook? Date: Thu, 15 Feb 2024 12:16:35 +0100 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> <1331394b-6bbb-47d7-a250-064c41fcecaf@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28851"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 15 14:36:06 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 1rabuG-0007Hf-M5 for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Feb 2024 14:36:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rabtX-0004kH-Uv; Thu, 15 Feb 2024 08:35:21 -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 1raZjR-0007cd-6T for emacs-devel@gnu.org; Thu, 15 Feb 2024 06:16:45 -0500 Original-Received: from mail-am6eur05olkn2070.outbound.protection.outlook.com ([40.92.91.70] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1raZjM-00072L-T2; Thu, 15 Feb 2024 06:16:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UxUCKWVNwSAY4tMW3xH2LFDBqxjPtDEItz0Q6+1w4HcsBzeqHLKDFW2WMbn5OukoDxBX7UoZeqi5nJmUDOPBH6W8H1du1lWOO7NAWwTuN6+wc9daQTYLsqVdwH02vW9b3An9N8UePZhiJLWjpf0hFh4/+wSfZ8S+havY5IF78xE3C9dBMmuErCF8XzuC7rXQ521DCpOhjpmojx3r7ic+QQE0bRWr/5lvAufnYlsDLxxXG72LzePfIES+k7vIq/43qqmcr2+THLuenofMyQS0h1uFH7lTzJ5MOZENHgSYtVIMktbdIPiSxY7N3leF/W9aaPoCcFyQcLFKHwyLhIdoHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eTq8HCcbc0pZSg8Iju0TxGeceemMOLbu9enjQoq63Vs=; b=lg4YfhK5U4TPbaZjJ4ORhwYGN8ZGAl0NZiwKY/h1exVSmdfgLZ/A+f6MKybipAq/UkA978RlCNpBsSJ9kkfoI76Ln2bINBC7Gvy0AKiW2YGZFBBdAzcW+HbGz5okFCN0YPCfeeKImszqyZQcZB53vcQYJLdgpBhv21LrLe0+QixJCYpmTwHJyoTV5+7bUtoppIoanc4fLB2/MZL7vw2L0eH8GiLw1p/l826KYQ9WJuAT7Jk4NmmHFASLhaXGW5OWmyHzsy9iNMwCKSS/WamAIKwDb2ZGob8MhBDlYTrUxwnmoOMRHN2UCJJpwB7M8ce3GCUAYu8gYZIn48hsd+LCYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eTq8HCcbc0pZSg8Iju0TxGeceemMOLbu9enjQoq63Vs=; b=DjEnY+acGRID36rkWnyzs8msbeLxPT5vSIfEBGYfftgYUxPRfHqr+7qa7eOewNylR6qmpXrh8eFYUK1binvf0mAL2z6dGRtud7vKrRCIx3+YHah8o0E1BFJUTsrLapQytrt1AP5m7VW9XGZRihSCAYXKyyP3RJc12eXMXJY/P8WOU2agSOaFhoUu4Lg3fPOOn8PPW950PUnr1atIM37olZN/MFsyvreuQdaelplGd9dVaxaM5BD0KRaOKt3yWB3ZsSy236Mbw23MwwL7hFgFnuXoyJc965JQrYE25LeS/OoDvpMIEjzelnN1jGPwH00PYuH57iOyieANyxZ1JkzuEA== Original-Received: from DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) by DBBPR02MB10481.eurprd02.prod.outlook.com (2603:10a6:10:538::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.29; Thu, 15 Feb 2024 11:16:37 +0000 Original-Received: from DU2PR02MB10109.eurprd02.prod.outlook.com ([fe80::1752:9b0:4c48:15f8]) by DU2PR02MB10109.eurprd02.prod.outlook.com ([fe80::1752:9b0:4c48:15f8%7]) with mapi id 15.20.7270.043; Thu, 15 Feb 2024 11:16:37 +0000 In-Reply-To: <1331394b-6bbb-47d7-a250-064c41fcecaf@gutov.dev> (Dmitry Gutov's message of "Thu, 15 Feb 2024 00:37:28 +0200") X-TMN: [dd3CeZ94COlIlXucumX0my5Ct4LzZY7h+8ksHqjtRYk=] X-ClientProxiedBy: MM0P280CA0070.SWEP280.PROD.OUTLOOK.COM (2603:10a6:190:8::29) To DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) X-Microsoft-Original-Message-ID: <8734tu565o.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR02MB10109:EE_|DBBPR02MB10481:EE_ X-MS-Office365-Filtering-Correlation-Id: 4e1dbbe9-e693-476b-c8ca-08dc2e179384 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EIHzKxmJ71UrywKz1uyYsNQkijVQTdbwOCjcpa06uYkN7SupN6ejrMMx7nTYQEvipVUyk2vR2504IyHpnv+z8/Q3DPJ+09NF2Y2dJvRBFxe4OJz93nF4CGF8K+NLWYvSlTTepxcemXsQnxOtWak8x6jx5tYahSzEAQjkl/Q8NTnG//I8gQfqbD1zRQIaNkTyI4SoRzLXnspotNaZvMLBqzDkcpBbMedh15cNF7+7jta8u+ncxCxMivHaTdT9a6GIyR6+CBbhiWaf49rTaq8vTGfEsYwpZODlFvUc+AkBBMYRBmQNdj/Tc//WkQDsmuefCaiBp+9AyhVDQMUEvmUU44gn2iqF45fiq4RZvfs4TyfBB8oXYJ57McFe+I/Jn4+C5F5mvGw4pwDm6lmBmbdRSzI7Xn60dIlxUTXqIE/3oNpfnyfaLGtWXbDh2EpbpM7K2Y1eL5eD50a70qR3Z8Gr52mnpOfanMSV1PsbeeElo8Ta4wmfiV/HMnR57fCYjtIQYID4HX2xFf4FiZhRm3gOsEy4Q7NerD1GmAnVD5inYGpE23jvgWdOh17R13/eAtFA X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?WQJUCjMVthiyuAntuuc4YajUZ5nw0Y4/dJi3iaBwZ3ZMtqe3qKTMkrLKO3Eu?= =?us-ascii?Q?zzSlCv9HIRv+SiwtsnX29SmEXLOIvEOyqNCgUW9xsEAsOoMYn3q/gpic9nHS?= =?us-ascii?Q?G9/ljAeoJ1GHcZVvaldpITsQPAFbiJQ9gd8ZW6fobtrrxEHddQ1TybgW637X?= =?us-ascii?Q?BkcJyvxnI5JsUOvGZkYhpCXthBhlhtQ1+EfV34gB2SQcxf90THBBnEqteswo?= =?us-ascii?Q?tSsdIwhml95EhOpRW+1nCdVQ68uL3R/0Pry3h5WMsz5z+GrW6gw2xZ0wyGHw?= =?us-ascii?Q?9T4UEPaWBygbrf8i9sgvqw+70KBH3QWsB63v7n4+daS9DNwHmOYnKU3fZnxs?= =?us-ascii?Q?DV1qzDycXzS2NgchyjuAz4HrkmBmaygCFIab3QXohUhBGLPfS6zbu2Gy8KHb?= =?us-ascii?Q?L1Mxvz/v5IA4hmD+x9HUwtS34qFHWi6X7ZdAf7v6/RZ2uRd8bALCO9HRFoRV?= =?us-ascii?Q?h7efkmWkhU70JZB7BoFqzULlZoIVzIWRKCV4Mxuih0SdCSc+ALvipiOsed4s?= =?us-ascii?Q?n1wl+w9lj1g66G6RheGDq6J3+u1XPyTLESABU8JoxtGrVpBR9GmXgHXqCUoA?= =?us-ascii?Q?t23tsv9Lxpi7yJgnLb5j8ikf8bKaB2GClQeW22oB82mbpHtFBc3PUkIjYSJm?= =?us-ascii?Q?qX X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-ab7de.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 4e1dbbe9-e693-476b-c8ca-08dc2e179384 X-MS-Exchange-CrossTenant-AuthSource: DU2PR02MB10109.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 11:16:37.7566 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR02MB10481 Received-SPF: pass client-ip=40.92.91.70; envelope-from=arthur.miller@live.com; helo=EUR05-AM6-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 15 Feb 2024 08:35:15 -0500 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:316231 Archived-At: Dmitry Gutov writes: > 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 Allright, np I understand. > think I've explained that in one of the previous emails. You will have to forgive me; I am not familiar with vc-mode and project.el; perhaps you have explained, but I didn't got it how ti all hangs together and what are intentions with all this. Better to ask, than to assume wrong. >>>>> 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. So basically commands would have to auto-start it. >> 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. I can just advice or wrap those commands I use, so I guess it is not a problem for me. Thanks for the help. /a