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: Wed, 14 Feb 2024 00:10:08 +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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37695"; 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 Wed Feb 14 04:21:30 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 1ra5px-0009cr-Ri for ged-emacs-devel@m.gmane-mx.org; Wed, 14 Feb 2024 04:21:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ra5ox-00040Y-9e; Tue, 13 Feb 2024 22:20:27 -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 1ra1uu-0007Ih-QU for emacs-devel@gnu.org; Tue, 13 Feb 2024 18:10:20 -0500 Original-Received: from mail-db8eur05olkn2082.outbound.protection.outlook.com ([40.92.89.82] helo=EUR05-DB8-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 1ra1ur-0001eZ-Kb; Tue, 13 Feb 2024 18:10:20 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RbM7SZoh59s5WqjCFkg0MnsUZ4ojpNQCgNEZs7g+G3l0FCcgz1VWAI0e0vqoAL5MKhL8LjQCrZy6ZPfOYAMnEO06kODQgxl2R3LkZOcM9j4XtQbYy6Lmj0tnGvScOYSnT00UJgdSg3IvtRetNIgsXusIwwGQy9UxSk8Ny/zzqFwPH6MEmIXZyuHve4zTN0qFlCVh7puvol/ujhWmEqZy/rfVG4o6Xfw3YbJzYSemX1Av353HQHWGF3z4R21GgHFffcko/uwNJA44PcKpmXQQ3Z49a6vrpDYXn1T952vF0p+xVG/YzECf+/UdDNL5PKe3+nWJTRBePh3GcRLQ6GNrsA== 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=JfTyDxH7DggscWNBFSvUBxqkp1L+PMrwIdS/haaHwUU=; b=H4qxslGPnpNExjzvIiovsWWSze5sarGdxGfUfZ4dPUJnmHuWWq+ZuXifklzXamER7n8GoikN+ggG/8LM4nR0rzBJtLHLyL8ZLxOeJZlUnDvyItziK5f9H5TUcFyyLVv8DXiHFmtdoj39nHVn7QKCczLWpeISebTCT8hfRLum+P6J4GqwxaPKj23Y+WNWdLt0YSd+u6H/7MNfUWdvzv4896kkqe+9lDU45w2ZGliUwJNdg0uuTR8sNEu9SuqV0KbW6inzDlfAxQ4YJbN6xM4S541eJGe4OHKDOV6bfhaRLLlFtajBPlICL7CzKe0k/BfvixuMHgmi6z9BWzoF/rEjmQ== 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=JfTyDxH7DggscWNBFSvUBxqkp1L+PMrwIdS/haaHwUU=; b=UPTOr7Op0YQIm2zeixFHczy7z8nnwid19osyfGDwtTQc9yrdFdEPUWEUd0eS4On7NcMjWz9fJVoqvgaOI8hAjDSuMuR80UsLTvPujisiu56HsRFxDcCvKIxm/xDD368jdOA5Fpv0KqKBcOKavQ4zhkALHUAXe1/j+35AjCwibOIpyO5vYmjxydMehytgDO7BK4qOmNT0DVoyxzX9q+djfmJ8KvkzKTA5V/TfaIoDDkpPmTr0z0z7NbeLcgQWKEdXBZ5W5RTUw5k5mT8HWTWxNnOuYHXgtATBj7kEXY6qbx1XI0GzRXbnO4BGCq1h/CGzrIwfoubawa/qSMFL56a5DQ== Original-Received: from DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) by AM9PR02MB6834.eurprd02.prod.outlook.com (2603:10a6:20b:2ce::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.39; Tue, 13 Feb 2024 23:10:14 +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.036; Tue, 13 Feb 2024 23:10:13 +0000 In-Reply-To: <8876d606-c4af-4a27-a1b1-4c3dea6d720e@gutov.dev> (Dmitry Gutov's message of "Tue, 13 Feb 2024 23:26:42 +0200") X-TMN: [aFVpVUe17u6OUEcbX94KaOXgVUamElc0zdarBguFECo=] X-ClientProxiedBy: AS4P250CA0013.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5df::15) To DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) X-Microsoft-Original-Message-ID: <86jzn86jvz.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR02MB10109:EE_|AM9PR02MB6834:EE_ X-MS-Office365-Filtering-Correlation-Id: fda212de-22dc-463e-3c33-08dc2ce8ef17 X-MS-Exchange-SLBlob-MailProps: Cq7lScuPrnpus7uSNk3DzjFIFsNCynikT6MGY2lWsXTDirL/GfFD3dFnKThlU6groUS6ORXjJ607xN45CYR0YozqLGrW8hlVT/CcvbEGDfeoZr6a+pFuYXMkP6Qb8LO6pE3kT2mkI+cHjILz25KQKHi5a+AUOG07qTiPiVFX9s6qvf2TSje1Wnvd+GWNtjFAKpWsDvXAhyEblDwSs1IJYqUF3pqg2sw525ORzBgrXr11l68YUXWG52tWr+FGVl16oPY4v9tuqLLWucBASODd988LB6aTmVzYutEygr17xWybw42MUa23CU39ouJyuxFLD5KdvNzwF59AH+rjhv4K4oqjkLZUS9HL+vJe4gMVAsajF76Z1EAVdtkPDHNqWiWSvlLsQndnUcQp/Jwxh4U4GQpsC+2pMMlwDQZSbfSZbRHFjHIv4WlI6ZGYjtmtTivKO6ALGUB8nvocqg3Fg2/VRxEXDWBU91oGR0DRea73jnuHu9hqQY3/Yf7bcYTZbsnrtjUNR2gEcwGmK3/bKqpW8cZyp1mPj6imyhqk9ZGdbg1Izwb0TAKdaEvKI8b8wV33ouEJZGsCG0BZhIqqjqqrEJMlmt64lzU2H2+Fk5+9svgkFw9lpCWF+HyjR8txn9Jmz5vmWHXYgYAhVyZl39WIqOHRup54rVJD7UGKkl3fbLc3M8fBjA0JkU0fljHiQAuDlCcyY//w5pve03DvzYxePxz17WLdu8pQQ18sbLYZk2SVEnf+jrgEcBbcOXNb/0sB 92pwC4brBxY= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a6Rp/5uiNHm2KJc8RCdE7vjUda2mROaLAp65VM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V7j+QaEfmhjLyHxOUgVong03yvgbt7Gi4o?= =?us-ascii?Q?Im8nqCLFBznfZL1Wk6xIN2lspG3iwijY9b4D9OxKxqZjqbk9zKc0TPkyXQBy?= =?us-ascii?Q?buTMm7PPJe/IIUszymOFN+q8rqVZt/4kHIDaowmcveLOYtfoAXCN1Sj8Dw4L?= =?us-ascii?Q?x5N0kAJS+m4wLtRxSk0hPG/Yfe3htdyOIFRQJd5O6OFmpYmIFFVQigAJIv6b?= =?us-ascii?Q?s/ADZeEpRskhVK8Ssl66DBZxVyPTzObC9uug6Cq2S8sRZP44zqUbMlswPO4K?= =?us-ascii?Q?X0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-ab7de.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: fda212de-22dc-463e-3c33-08dc2ce8ef17 X-MS-Exchange-CrossTenant-AuthSource: DU2PR02MB10109.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2024 23:10:13.8791 (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: AM9PR02MB6834 Received-SPF: pass client-ip=40.92.89.82; envelope-from=arthur.miller@live.com; helo=EUR05-DB8-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: Tue, 13 Feb 2024 22:20:25 -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:316195 Archived-At: Dmitry Gutov writes: > 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). I didn't suggest to rebuild everything :). Just an option to remove the update for those who don't want the update (I guess I am the only one). > 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. It would be one's own responsibility to keep track if it is needed by other applicaitons or not. This why I asked, if there is something else than modeline that needs this. I see defcustom declaration fo vc-display-status is changed from what it was in 29.2 to what is now in the master. I guess you (or someone) is already planning something in this direction? Was it meant that vc-refresh (or something in the chain of call) decide to call git or not based on the value of that variable? Looks to me like that was the plan, but I don't know the intentions. > 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 I though yesterday of it, it is more like: do what you do now, the way you do now, when you do it, just let me turn it off. However, while I saw find-file-hook and was thinking in terms of just removing vc-refresh from the hook, perhaps there is a better way: As you (or whomever) seem to have prepared vc-display-status with choice of 'backend, 'status or nothing, so hook can be always called and it can decide if it will call git or not based the value of that variable? > 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. 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? > 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.