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.devel Subject: Dired - ls-switches on Modeline Date: Wed, 13 May 2020 11:10:54 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="96870"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 13 11:11:33 2020 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 1jYnQK-000P6u-Lu for ged-emacs-devel@m.gmane-mx.org; Wed, 13 May 2020 11:11:32 +0200 Original-Received: from localhost ([::1]:34678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYnQJ-0000zD-LW for ged-emacs-devel@m.gmane-mx.org; Wed, 13 May 2020 05:11:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYnPp-0000JW-95 for emacs-devel@gnu.org; Wed, 13 May 2020 05:11:01 -0400 Original-Received: from mail-oln040092075011.outbound.protection.outlook.com ([40.92.75.11]:54918 helo=EUR04-VI1-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 1jYnPm-0002Xb-Lr for emacs-devel@gnu.org; Wed, 13 May 2020 05:11:00 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CueJ3T2Fu1ZJBGc7UikMdrwksn/cCblN+hapMJZ3Err0OhYsqKKZ/BJlSF5Hy9m8lcF98ZmbuZrxxJjVrRLqBXmH1UPurokNDARcw8D7AfqysvqdcGzNf/YSd+xgxxPVEvv6mdzIY2NgNWLRUrSUCnpTlZ/zmRh0jP8uuaxeVO7ZP1gaLwR9k49NZH5UPGJ/m7uA71tu1TuCuY9/EgRWXGtRTaVJgUrzUe2asGr/48HjRZ9qMWGNCnTe8vDz5dqqH3ZpzLk2txFuAetz4Y6LqodM6WY3km9PtBhm9/2Vie8eCztlY73m1ZNmfqdybSc1Y9gEjkV7sVR6VgjGJH66uA== 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=szCuOVAoI2ODtTFDsRXPzP8UCMOAN9UpqWTt8VRjoyw=; b=YeXZibR7LGa1H72OLVxMwLOtzWdQV4v75KFSsE6cyEkY8d8WJhXvZaqacGxSz86wjm2x6BO0v9tbh++9wgQ/9WJFJECeT2OpiQl0PwiOC05QTUxpL7f01KN8CC0hFuNYTURQSsLhUwW5TGLPb6L+gugdcjZL7s3wVsFMSSkt5UyOks5R+W3ahrTTbFmDaSWEyoSGnhq47Yf9ZPScbifEBzVeGV+nOzAir+hOoFyTG0+UV8I8QJZc1LJk1pCECzSuOoUyylojZWwoiNrY0bq6KuN/8Vnatt7qs1kD33KMFUA/xTLtGtRPS+a3plh1f+XyCLMH4uxxOXKs9hSk9YSF7w== 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=szCuOVAoI2ODtTFDsRXPzP8UCMOAN9UpqWTt8VRjoyw=; b=Ab1rftbWoxMYa1zylwh/kQhM4O0L7o2DGWHVv2pJ+BQWGR9EfCDhR+E+db971eCXvHgLPSMPKgkzx4eFjBZDBR6Ht7WOmKx6JuRjvGBfF+r11B+Hxj4rJ0mmITPpKs+wu9aNbxYREI0nWquXgm5DeooIPvuV/tPK32MD+i5Sbc7Bh1kt9i2mzbFL4leqPxMZqfcituT5D8LdP56IOVVsRWhaALQuGbFAbNh/ptRLM1qBr/rU/L1FlEP10ABX9EoIJY55k0ZVuqYBARVgprSW4HgRUn36ZwcJPhw+B9WEZl5IoNF6cb1dJyPD+xdHvu/t07hc7SdZby3p4nl6S6FiKA== Original-Received: from VI1EUR04FT055.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::50) by VI1EUR04HT156.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27; Wed, 13 May 2020 09:10:56 +0000 Original-Received: from VI1PR06MB4526.eurprd06.prod.outlook.com (2a01:111:e400:7e0e::53) by VI1EUR04FT055.mail.protection.outlook.com (2a01:111:e400:7e0e::173) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Wed, 13 May 2020 09:10:56 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:2059750F4EFC17E9BF9FDC241AA4C6FE903245537531212922C66DF957DCC1D0; UpperCasedChecksum:3E6E5AB397E4D5A233EA8F2E6F28549E7CEF0C8A452EDDDCAC346A44D8F5A1D0; SizeAsReceived:7255; Count:45 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; Wed, 13 May 2020 09:10:56 +0000 X-ClientProxiedBy: AM6P194CA0057.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::34) To VI1PR06MB4526.eurprd06.prod.outlook.com (2603:10a6:803:ac::17) X-Microsoft-Original-Message-ID: <873684dwtd.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AM6P194CA0057.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Wed, 13 May 2020 09:10:55 +0000 X-Microsoft-Original-Message-ID: <873684dwtd.fsf@live.com> X-TMN: [43FUJWr+3j/q4jcOtiGGj7Zlx+Az8zaY] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 45 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: c055cbdc-1a16-4df3-a114-08d7f71d8b29 X-MS-TrafficTypeDiagnostic: VI1EUR04HT156: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MWdvnvzpHPS3P67mLYFrL6k/T0c+1Y0/fTvI2cSsI5ksag2Pb8vtwMLQbKwWPX8hVEUSGDcTR0XVA9b8oqVk+UytuAR+5xLO8aLmPXVzhU4VtABTyVbBktuPLZTmntyw5Iz966JfcwUASW9PBXz9wpfbRtgtWjbllzHfNXwoayQ0Jx5DG+xe+0/swqo02mwJG126wX3HXYkjD//dyLOeKw== 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: bnux3QZH8lIvEficPwwVT3qQEQ/OCfxC0uNfP1F4iCPI07+q0/z023UkoYHquXnQUi4avZDDz40dvvH2oR0z9Jfy9ot0aKQhNXTlPURLSTPNIInIA/xSCjdzb7mQYl3NM0u/X8GHSobs6ThdwWyqfQ== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: c055cbdc-1a16-4df3-a114-08d7f71d8b29 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 May 2020 09:10:56.1085 (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: VI1EUR04HT156 Received-SPF: pass client-ip=40.92.75.11; envelope-from=arthur.miller@live.com; helo=EUR04-VI1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/13 05:10:56 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] 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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:250106 Archived-At: I use dired a lot, and I like to have two vertical windows to work with. I try keep all my files 80 character wide lines. What I found a little annoying is that dired automatically displays ls-switches on modeline. If one has long switches line, like this one: "-lA --si --time-style long-iso --group-directories-first" then everything on modeline gets pushed far to the right. I haven't found any way to turn this behavour off. The code responsible for this is in dired.el, a function named "dired-sort-set-mode-line". There is a condition always set to execute (t ...). Since it always call "force-mode-line-update" after it adds ls-switches to dired, I don't think it is even possible to advice it. The ony way for me was to hack said function, and re-define it in my init file (I just added a variable and change condition to check for it): ;; Prevent dired to write to modeline - it displays all the switches and pushes ;; everything far to the right. (defvar dired-display-ls-switches nil "Non-nil meands the Dired will display current ls-switches on modeline.") (defun dired-sort-set-mode-line () ;; 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. (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") ((eq dired-display-ls-switches t) (concat "Dired " dired-actual-switches))))) (force-mode-line-update))) I suggest as a usability improvement to add a user option to enable/disable display of ls-switches on modeline, but if there is such an option already, which I haven't discovered, then just ignore this :-).