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: Thu, 14 May 2020 03:42:32 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="11085"; mail-complaints-to="usenet@ciao.gmane.io" To: 41250@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 14 03:43:10 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 1jZ2tx-0002lh-Qo for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 May 2020 03:43:09 +0200 Original-Received: from localhost ([::1]:43892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZ2tw-0003B5-Mf for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 May 2020 21:43:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZ2tq-00039g-CA for bug-gnu-emacs@gnu.org; Wed, 13 May 2020 21:43:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48381) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jZ2tq-0001lP-2n for bug-gnu-emacs@gnu.org; Wed, 13 May 2020 21:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jZ2tq-0008Qf-18 for bug-gnu-emacs@gnu.org; Wed, 13 May 2020 21:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Arthur Miller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 May 2020 01:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41250 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.158942056232373 (code B ref -1); Thu, 14 May 2020 01:43:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 May 2020 01:42:42 +0000 Original-Received: from localhost ([127.0.0.1]:59927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZ2tW-0008Q5-0W for submit@debbugs.gnu.org; Wed, 13 May 2020 21:42:42 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:42960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZ2tU-0008Px-3D for submit@debbugs.gnu.org; Wed, 13 May 2020 21:42:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZ2tT-00039X-Rx for bug-gnu-emacs@gnu.org; Wed, 13 May 2020 21:42:39 -0400 Original-Received: from mail-oln040092070037.outbound.protection.outlook.com ([40.92.70.37]:1409 helo=EUR03-AM5-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 1jZ2tR-0001iU-Tj for bug-gnu-emacs@gnu.org; Wed, 13 May 2020 21:42:39 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lVfgJDF6cagofnOyB7zbLS0niKlFiH+A8u1lNFG99qOsvvLvYkskbHJV6Z6IcQ4kOcGVFsaTe0QPJXg78TtmiKVV3VyXd1cys/vpw9wIMof0PveK/xbZRsivlBYGSIUSRHDOHMnZzr7j7TPB+Wt+X9LqDqyxdrq6g6LXX4Ncf5qfcMst/R3RFYE4IT64WBkMxla5DV8FerHrOzW0wQRMcnIC03RjAva4J2FvVblqlbSec7HbnZHl0z+F+ULXoFwJSBd8g/ZjGwJY3DtWPTI1cLoLlrsckMkLPjtPJIdidhicVzOIzV9Gm4cYSjNKD2EOTjV9QtIjADHUhh8Q3vftRg== 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=QmsUuLUjCXExpNnSD14gGB+ICF6a8l9htsu8ad1DwIw=; b=gjj/b2qCFjP2zffr+0UJwHqH2klJZpeoNY7NaOIAv5+WyomrK+iVxVr9cp5ZjNt1hJZ/qArxyBhIKM3Z6KBUeRqevcg/Uytq2y0xrNZxvYN/FraEFByyJ4OhvFZV0ZcYVVVMhud5v+uG4V+ctfiii730EaRjmcdukHR2OIBNhOug0NKRM8KwnffSJA13iKK0NU/2MEnxQUZwxa2YVRK/Iu2qj8lOcbOkfam2exS4VhQqTq27eBmahfdxtpK8TJj94YEnXv4FWORpjRKUfM+RVK5mlUr/H0Rjk5A0zvPSVuUP+kGGRbKMwFuIq08bvaDHUkswcqPns1sbVefTtC7c0g== 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=QmsUuLUjCXExpNnSD14gGB+ICF6a8l9htsu8ad1DwIw=; b=m0H5fUPV4LpSQMEvnBkeV5re1V0hTckNQFNGenxnr31f9RpeVAAyaj8ivfzgGma6Eu9/91Fd+/TW42cy1dAZi86Td4Ov3ffC1RXO3E3kP5OefHkD1UDPaP2WbrL58SEpdykFIFfiXGMm7+e5d0uO1uH1PJQU0NjZgl2xwup9ZcjbpGGUm39HlKjzLYYy+lKQ5/TrDxrL8Fk4/rLgPE9C5dhzp7oH9e6bnSGDivS2KFJCELC7hdDlrBr+ozxoRW7LKnqskDNigLrrkd9Pdb61iuD3CxlBIOVsZJDextHkj3bruxTTY3kLxb58zZtjHsMoNG86sVnyDz3WJluzu5V1JA== Original-Received: from VE1EUR03FT014.eop-EUR03.prod.protection.outlook.com (2a01:111:e400:7e09::40) by VE1EUR03HT147.eop-EUR03.prod.protection.outlook.com (2a01:111:e400:7e09::234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.19; Thu, 14 May 2020 01:42:35 +0000 Original-Received: from VI1PR06MB4526.eurprd06.prod.outlook.com (2a01:111:e400:7e09::4f) by VE1EUR03FT014.mail.protection.outlook.com (2a01:111:e400:7e09::294) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.19 via Frontend Transport; Thu, 14 May 2020 01:42:35 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:806BA61611D56F311459A85C345EF0A51B6D17792DDB8BEBE08139927D2B699D; UpperCasedChecksum:203A4831F7C949E14F4F134687EB9F8BD565E6E8DDA2B78A323C84B1D9B514E9; SizeAsReceived:7272; Count:44 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.2979.033; Thu, 14 May 2020 01:42:35 +0000 X-ClientProxiedBy: AM6PR01CA0061.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::38) To VI1PR06MB4526.eurprd06.prod.outlook.com (2603:10a6:803:ac::17) X-Microsoft-Original-Message-ID: <87r1vnb8c7.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AM6PR01CA0061.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.24 via Frontend Transport; Thu, 14 May 2020 01:42:33 +0000 X-Microsoft-Original-Message-ID: <87r1vnb8c7.fsf@live.com> X-TMN: [6U5PpE854jVjkV4EcJ0NdsjudCdUQEBM] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 44 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 7e587401-24c2-441d-045c-08d7f7a812c5 X-MS-TrafficTypeDiagnostic: VE1EUR03HT147: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uZVXuQErP7/U7D1wjbOO7zpNc2NS7DqTDjl6ZZYZBOYBxLvfIVU8VCc8Flf/jHNv+10WP2S88yAj2nEYJQJf3yTYxv4dg4hT8ZUuC/FHvR0BNzKSC26TJqgDnC9PZ1lix/4hzi5XlQyLDM2XqBAQKEbgwyfck4vNBUb9VJFIzB7fIqsEQo8+PvrAkLK6xiaK3CVm8M+xPgX/G8uNDV9ixw== 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: 9rBZJlm/EKsqe40Qz5xn8PDx14qUNIYJd8U+pTIVKtkp06afQuAgQjRKuDhBz4Nl7/3fTToZ/2+TwfASuTXJS/UpB1Dd3TQ3TIYcKhkaXc4TuqJMtUHpwuhPtM5fOUuwQ62ML5Q/HMoXPmcFOHq6Rw== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e587401-24c2-441d-045c-08d7f7a812c5 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 May 2020 01:42:35.0215 (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: VE1EUR03HT147 Received-SPF: pass client-ip=40.92.70.37; envelope-from=arthur.miller@live.com; helo=EUR03-AM5-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/13 21:42:35 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:180189 Archived-At: --=-=-= Content-Type: text/plain There is no way to turn off displaying of ls-switches on modeline when in dired-mode. By default in certain configuration, dired display ls-switches on modeline. In case those switches are a long list, for example: "-lA --si --time-style long-iso --group-directories-first" then everything else on modeline gets pushed far to the right which is not very usable. In general I don't have much use of seing ls-switches on modeline and would like to be able to turn them off. As of current it does not seem possible since it is hard-coded in function `dired-sort-set-mode-line' in dired.el. I suggest, as small improvement, to introduce a user option to turn off or on displaying of ls-switches on modeline. As a suggestion I have attached small hack to dired.el as tested on my copy of Emacs, but you might wish to rewrite it. Drew had some other suggestions. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=dired.patch Content-Description: Patch to introduce user option to turn on/off for --- dired.el 2020-05-14 03:06:34.046112281 +0200 +++ lisp/dired.el 2020-05-14 03:12:03.423097577 +0200 @@ -70,12 +70,20 @@ :type 'string :group 'dired) +(defcustom dired-display-listing-switches nil + "Display switches passed to `ls' for Dired on modeline. +If value is `t', value of dired-listing-switches will be shown on +modeline, when dired is not showing files `by name' or `by date'. +Default value is nil." + :type 'boolean + :group 'dired) + (defcustom dired-subdir-switches nil "If non-nil, switches passed to `ls' for inserting subdirectories. If nil, `dired-listing-switches' is used." - :group 'dired - :type '(choice (const :tag "Use dired-listing-switches" nil) - (string :tag "Switches"))) + :group 'dired + :type '(choice (const :tag "Use dired-listing-switches" nil) + (string :tag "Switches"))) (defcustom dired-chown-program (purecopy (cond ((executable-find "chown") "chown") @@ -4118,22 +4126,25 @@ ;; Set mode line display according to dired-actual-switches. ;; Mode line display of "by name" or "by date" guarantees the user a ;; match with the corresponding regexps. Non-matching switches are - ;; shown literally. + ;; shown literally if user has not disabled displaying them by + ;; customizing dired-display-listing-switches variable. (when (eq major-mode 'dired-mode) - (setq mode-name - (let (case-fold-search) - (cond ((string-match-p - dired-sort-by-name-regexp dired-actual-switches) - "Dired by name") - ((string-match-p - dired-sort-by-date-regexp dired-actual-switches) - "Dired by date") - (t - (concat "Dired " dired-actual-switches))))) + (setq mode-name + (let (case-fold-search) + (cond ((string-match-p + dired-sort-by-name-regexp dired-actual-switches) + "Dired by name") + ((string-match-p + dired-sort-by-date-regexp dired-actual-switches) + "Dired by date") + ((eq dired-display-listing-switches t) + (concat "Dired " dired-actual-switches)) + (t + "Dired")))) (force-mode-line-update))) -(define-obsolete-function-alias 'dired-sort-set-modeline - #'dired-sort-set-mode-line "24.3") + (define-obsolete-function-alias 'dired-sort-set-modeline + #'dired-sort-set-mode-line "24.3") (defun dired-sort-toggle-or-edit (&optional arg) "Toggle sorting by date, and refresh the Dired buffer. --=-=-=--