From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.bugs Subject: bug#41250: 28.0.50; Dired displays unconditionally ls-switches on modeline Date: Sun, 17 May 2020 18:34:53 +0200 Message-ID: References: <87v9ky9p6o.fsf@mail.linkov.net> <654acc31-015d-4552-bd9b-3b8c69661fcd@default> <0957af50-7f85-455a-9d2c-e96451727872@default> <83a729uiaq.fsf@gnu.org> <835zcwv15e.fsf@gnu.org> <83wo5abngu.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="102846"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 41250@debbugs.gnu.org, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 17 18:36:13 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1jaMGq-000Qf3-PW for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 May 2020 18:36:12 +0200 Original-Received: from localhost ([::1]:47732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaMGp-0000IO-ML for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 May 2020 12:36:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaMGf-0000I5-W9 for bug-gnu-emacs@gnu.org; Sun, 17 May 2020 12:36:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32918) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaMGf-0001vm-NQ for bug-gnu-emacs@gnu.org; Sun, 17 May 2020 12:36:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jaMGf-00082s-L7 for bug-gnu-emacs@gnu.org; Sun, 17 May 2020 12:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Arthur Miller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 May 2020 16:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41250 X-GNU-PR-Package: emacs Original-Received: via spool by 41250-submit@debbugs.gnu.org id=B41250.158973332427042 (code B ref 41250); Sun, 17 May 2020 16:36:01 +0000 Original-Received: (at 41250) by debbugs.gnu.org; 17 May 2020 16:35:24 +0000 Original-Received: from localhost ([127.0.0.1]:44464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaMG4-00071g-2T for submit@debbugs.gnu.org; Sun, 17 May 2020 12:35:24 -0400 Original-Received: from mail-vi1eur06olkn2039.outbound.protection.outlook.com ([40.92.17.39]:59253 helo=EUR06-VI1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaMFh-0006yH-Pj for 41250@debbugs.gnu.org; Sun, 17 May 2020 12:35:02 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DQx+8WYFvgM3+2mOp0VOJEx/Iwjsc7gZ1i5E+j/FOWjfk/nMhCqIcDKeqDHYdTAxgv4fVCgnKU888NjV4Xrz5ejOKbuG5LOHg7kzDPVLm4RRjhj7tgr7KSYq0DPOdiDvHGmO32xWMunjChafjb253boiRwFrKebx4K1WN3vFcoeeNROYF/tirjrIXurQfAyjX1Fbx3qjWceCtOrgdJZVn683IN16JAekh8BIOJPjZLYTJwiZbbZGHeMTfWByQCScEIhzCM+w/5coEQc4Fiy3Taf98qY0BFEXW4y0LwVc0BvQq1NwNZMm1+HW1AXM4pn9SmZ0+2km6pbxB1hQ8YT01w== 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-SenderADCheck; bh=lys2N//9TPeqIzPYq1l/2uvxlVP44aI0OusD706cE68=; b=ZiBjOI2HiCujPz268BZEXgUSlbLKrCmRQWNh0cytD5jvKMYBcobvH0872Dp/mg+1zTFVnuXa0Y4V45hxy6zJEPfG1c7ER2hj8ZBkWP0ji4nifA5XbMq+8EjrU9o5h+ZcapsHuIaD3V0ibPwzMzBKo+GrEqzVhPHCeCEqxvOvQVOq0d1ANDGUNlMQwX8bUH0TJ+CStBsMhdTDFoaJoWdN7kTYRNnNSwWi7nHz+PYlx59fwmUT7lnPotpJHsDLGmG9rDIYqKWWiF4fKgtIvMyyBdQyxAQKpvsoz97HUs2nZw4+MyVvY+7T5PO4c5i78ah8ICwcvFwP5WrotAC1KcC4MQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.com; dmarc=pass action=none header.from=live.com; dkim=pass header.d=live.com; 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=lys2N//9TPeqIzPYq1l/2uvxlVP44aI0OusD706cE68=; b=tvFTPwR7IFHY8rxw77r6FbTwwR3Z/6QA5fkOTSY2hXXjNgBWwzMssX0tircWRV718noD6ObqQm0jr+ZIIptFd/V13S+tR4BTrANXUJTROlaL/XStMCzRFyQY3K1ti0Aj7LNxeQMIGY0fS832H5gqWddbf76PGvnSiPSvl4fCZP7fjoZhM+1KAKVsgQmPAWgsoKqTelX0EaZYOaM4YVwud5oZKTwaSthseQ/t2iAXh7LDfvwKaLJy45ESL1zSJHmcpKvi85dXVf9++ltJ8jGcYoLfK82bfas+m2/Z3jR+CDi7VPeY/ou0uqrLP+11tgaPk01ZOWaKrVi0/xxdOcNG0w== Original-Received: from AM7EUR06FT054.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::4d) by AM7EUR06HT094.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::269) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.19; Sun, 17 May 2020 16:34:55 +0000 Original-Received: from VI1PR06MB4526.eurprd06.prod.outlook.com (2a01:111:e400:fc36::45) by AM7EUR06FT054.mail.protection.outlook.com (2a01:111:e400:fc36::407) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.19 via Frontend Transport; Sun, 17 May 2020 16:34:55 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:C0F50026A3D436B6AA663530F10EFEF88E71FF8D1745294A73E2C6775D3584BE; UpperCasedChecksum:B9127A1A4355A66CE110FB11EBE5132E11C637E2D5474B9C06821A5276C16758; SizeAsReceived:8083; Count:48 Original-Received: from VI1PR06MB4526.eurprd06.prod.outlook.com ([fe80::49f0:2314:a959:bec5]) by VI1PR06MB4526.eurprd06.prod.outlook.com ([fe80::49f0:2314:a959:bec5%7]) with mapi id 15.20.3000.022; Sun, 17 May 2020 16:34:55 +0000 In-Reply-To: <83wo5abngu.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 17 May 2020 18:17:05 +0300") X-ClientProxiedBy: AM6PR0202CA0067.eurprd02.prod.outlook.com (2603:10a6:20b:3a::44) To VI1PR06MB4526.eurprd06.prod.outlook.com (2603:10a6:803:ac::17) X-Microsoft-Original-Message-ID: <87d0724j0y.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AM6PR0202CA0067.eurprd02.prod.outlook.com (2603:10a6:20b:3a::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Sun, 17 May 2020 16:34:54 +0000 X-Microsoft-Original-Message-ID: <87d0724j0y.fsf@live.com> X-TMN: [ZsryjoJuVNGVkWy5+dGfVb8oWzi6x1Zi] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: ae7590ac-065a-4e0f-02fc-08d7fa803acd X-MS-TrafficTypeDiagnostic: AM7EUR06HT094: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iFLrx7drfXi/EkWAfUBGHQXipwS8xZjR0h5bReXTt6yXkOp2c7fNHfOG0t1NpD2s9w42tkJUi+dx8Vf1PoSSr8tti0R4fNujSGnjOx9aO58inVKBuueZHBswHekzAWfEEZlOr8wboYaguB9lFfDauDcd7fn+bBFMh3Y6GWtN85+9vNYuPt8UKgYIANJjQZiTNwXMosCjkyxcoq5l9/KmOQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:0; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR06MB4526.eurprd06.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:; DIR:OUT; SFP:1901; X-MS-Exchange-AntiSpam-MessageData: hcRLKshd5QE8j7spoS/L9ylueC1ijWuyov7csx7VFQH79mjJKFbxkkwOzduIBq/PAeWsHpLnOt25Jl+TFgUYsDnU9s5jGx1TVEIInA0mG7ctguKp5vmCu8AQ1Hb8qgSMKgOaQL+KXVF6f7O7SG4G/g== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae7590ac-065a-4e0f-02fc-08d7fa803acd X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2020 16:34:55.0253 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7EUR06HT094 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:180482 Archived-At: Eli Zaretskii writes: >> From: Arthur Miller >> Cc: drew.adams@oracle.com, 41250@debbugs.gnu.org, juri@linkov.net >> Date: Sun, 17 May 2020 05:01:53 +0200 >> >> I have introduced dired-mode-line-hook, which is a usual thing in Emacs, >> which is ment as a list of hooks that user can set. Each hook should >> return a string that will be concatenated to the lighter. So users can >> print whatever they want to that string (number of files, dirs etc). >> >> I have introduced also another function that will just iterate through >> hooks concat stuff and update the modeline and refactored some code to >> call this function instead of old dired-sort-set-modeline. Also >> dired-sort-set-modeline is changed to work as a mentioned hook and is >> used as default value for dired-mode-line-hook. >> >> If user does not prefer to see any aditional info on modeline then it is >> just to set dired-mode-line-hook to nil. Obs, that can probably be coded >> more elegantly, me & elisp are maybe not best friends (yet :-)). I have >> built and tested emacs with the patch, but I might have missed >> something. > > Once again, I think users should have simple means to request simple > variations in behavior. A hook is not a simple means, it requires > non-trivial knowledge of Lisp. So it should not be the only or main > solution to such problems. I agree with what you say about elisping requiring more knowledge on users end, of course. Allowing for hooks is quite standard and usual in Emacs, so in that regard, it fits into the "emacs way", if I can call it so (and also a cheap way to get away with this :-)), but yes I agree it is not a newbie friendly. Really newbie friendly would involve adding more regexps, say for type and size and maybe some other "important" criteria, and also adding means of controlling display of those on modeline, either via customize (bunch of variables) or by some kind of gui I guess. Another considerations is that this really is a minor change, since this behaviour of Dired has existed for so long and nobody but me seems to complain about it. I guess, not many people are using dired in way I do, and/or are bothered by ls switches pushing stuff away on modeline. While I was looking to see if there was a solution before I coded mine, I couldn't find anyone asking on forums or SX about this, so I guess it was more of "advanced" usage anyway? In conclusion, it might be a lot of work for quite little regard in terms of how much people would use it. A hook is not that as nice as a gui of course, but it is still better then nothing. I don't know, what do you guys think, is it worth? Is there a need for that, I mean, more than "it would be nice to have"? Another suggestion: Instead of displaying ls-switches per se, dired could display just "by custom". It is consistent with "by name" and "by date" as of currently. Then when user hoovers over that part "by ..." the tooltip showing actuall regexp could be shown. I have a technical question regarding this: is it possilbe to detect in elisp when pointer howers over part of a string, i.e. part of mode-name on a lighter, since a lighter is a button. Would this be quite involved or it can be implemented easily? >> While I was looking through the code to set myself into dired, I have >> also noticed lots of '^L' chars, I took the freedom to clean it up where >> I saw them, there are probably more. > > You shouldn't remove them, they divide large files into sections, and > make it easy to move by "pages". Aha, that is why all those were there; I didn't know. Sorry, I'll never ever touch them again :-). Thanks for the explanation.