From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#41250: 28.0.50; Dired displays unconditionally ls-switches on modeline Date: Fri, 15 May 2020 15:19:03 -0700 (PDT) Message-ID: References: <87v9ky9p6o.fsf@mail.linkov.net> <654acc31-015d-4552-bd9b-3b8c69661fcd@default> <0957af50-7f85-455a-9d2c-e96451727872@default> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="__158958114405766808abhmp0001.oracle.com" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="88410"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41250@debbugs.gnu.org, Juri Linkov To: Arthur Miller Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 16 00:20: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 1jZigf-000Mtb-Ej for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 May 2020 00:20:13 +0200 Original-Received: from localhost ([::1]:53994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZige-0008EN-FX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 May 2020 18:20:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZigV-0008Du-3X for bug-gnu-emacs@gnu.org; Fri, 15 May 2020 18:20:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55731) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jZigU-0005nA-Pu for bug-gnu-emacs@gnu.org; Fri, 15 May 2020 18:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jZigU-0002vh-LJ for bug-gnu-emacs@gnu.org; Fri, 15 May 2020 18:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 May 2020 22:20:02 +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.158958115311187 (code B ref 41250); Fri, 15 May 2020 22:20:02 +0000 Original-Received: (at 41250) by debbugs.gnu.org; 15 May 2020 22:19:13 +0000 Original-Received: from localhost ([127.0.0.1]:39043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZifh-0002uM-Fn for submit@debbugs.gnu.org; Fri, 15 May 2020 18:19:13 -0400 Original-Received: from userp2120.oracle.com ([156.151.31.85]:47316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZiff-0002tw-OG for 41250@debbugs.gnu.org; Fri, 15 May 2020 18:19:12 -0400 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04FMHNNp101075; Fri, 15 May 2020 22:19:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type; s=corp-2020-01-29; bh=nxeSikcmKfujPnuSwFGPPglD1/SFwGzNoRLzTlKZY4s=; b=uENQ2IRUDpN9FShPTPXfP3hZ5digQJY1f4HB5j4mmZR0qZJ2MqK8rtYYrgsh8mQkIo0A TAz5n8U5Pc/AIeRiBItQMswrvfziaMAKDcXl4x1rltb3A3ydxvtH/nGrpR5QzlVYSG8o P13my7rYvAQObwxNuyp+XfMUB4kcJGWQSlBKcLNkw1Fc13vCqO6ny/k/vbqDuvZ90TiY Sv5sjhebc9YcjEnITqu6T4Qu87Tg6vh10ft0I/3hYGIzqtKedcKR2s/BlpU3tlQXENrP GzftrDY+sZKN3mFRbhFx8X8Hf+WMCUOBpfb3DE5JmEtZ4XuknJbi7pGzoaR/JYe0LrRG Rw== Original-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 311nu5p7x6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 15 May 2020 22:19:06 +0000 Original-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04FMICmg150758; Fri, 15 May 2020 22:19:05 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 3100yfjrdf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 May 2020 22:19:05 +0000 Original-Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 04FMJ4HH030610; Fri, 15 May 2020 22:19:04 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4993.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9622 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 phishscore=0 adultscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005150187 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9622 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 mlxscore=0 adultscore=0 priorityscore=1501 mlxlogscore=999 impostorscore=0 suspectscore=0 spamscore=0 lowpriorityscore=0 cotscore=-2147483648 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005150187 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:180367 Archived-At: --__158958114405766808abhmp0001.oracle.com Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable > I have just one question/suggestion: (Actually, it seems like several. ;-) > You first choice: indicate by name or date, else full. Does it really > need to be there?=20 Not sure I understand. Define "need". I kept the longstanding behavior, by default (option value nil). If you customize then you override that default behavior. If you don't customize then nothing changes for you (good). > ls-switches are displayed only when dired is not > sorted by name or date, i.e. custom My intention is to let a user impose showing switches even in the case where name or date regexp matches. And to let a user instead prefer "by name" and "by date" when they match, but default to showing all (as now). > Thus this customization only touches displaying of > switches when they are displayd. I.e. it should be > about "how", not "when". Sorry, I don't follow. Please say what behavior you want to be able to specify that the proposed code doesn't provide for. > To explain my thought: that is a hard-coded behaviour which user can't > customize anway.=20 What is "this"? Please give an example of the behavior you'd like that you don't think you can get, or that you think is too difficult to get. > By looking at your code, that bevahviour indeed > persists. If you mean that the longstanding behavior is still possible, and is even the default, yes. If you mean something else, please rephrase. > 2nd choice is the one that actually > consider how switches will be displayed. By "2nd choice" I guess you mean showing the full switches? Or do you mean truncating that? > I have same consideration about 3rd choice too. > Function choice (That's the 4th choice.) > gives option to run custom hook as format. I think it is cool to have cus= tom > format function to display when in dired mode, so I like it, but it is > a bit different purpose then regulating display of switches. What do you mean? The switches string is passed as an arg to the function, which can return anything. It can format and return any part of that string, or transform it in any way, or return something descriptive (a la "by name"), or return something completely unrelated (your birthday, "Hello world!"). > Maybe it should get it's own custom variable instead? Like > dired-mode-line-display-hook or something similar? Why? Then you're essentially back to the idea of having _only_ a function. > 2nd option, one with number=20 (That's the 3rd choice.) > does what the proposed variable name suggests. The name just suggests something in the mode-line that's based on switches. > Personally I ment to code just short (first switch) (That's name/date.) > and long (all switches), since probably the first > one is the most important one. Sorry, but I'm lost in your reference to first, second, etc. It sounds now like you're not interested in a truncation choice (?). I thought it was you who requested that. > I would also prefer nil to mean don't show switches at all, but it > works with N chars set to 0 as well I guess. A value of 0 shows nothing. And so does a value of (lambda (x) ""). > Observe also that if I turn off display by using 0 chars as suggested > there will be a small gap between word "Dired" and closing parenthesis. > It will look like: (Dired ) on modeline. Not a deal breaker, but kind > of small artefact. Easily fixed though. I can rework it if you wish, > but since it is yours, you might prefer to do it yourself. Attached patch takes care of that, and adds ellipsis. --__158958114405766808abhmp0001.oracle.com Content-Type: application/octet-stream; name="dired-2020-05-15b.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="dired-2020-05-15b.patch" ZGlmZiAtdSBkaXJlZC5lbCBkaXJlZC0yMDIwLTA1LTE1Yi1QQVRDSEVELmVsDQotLS0gZGlyZWQu ZWwJMjAyMC0wNS0xNSAxMToyMzozMi44MDQ4MjM4MDAgLTA3MDANCisrKyBkaXJlZC0yMDIwLTA1 LTE1Yi1QQVRDSEVELmVsCTIwMjAtMDUtMTUgMTU6MTM6NTMuOTY2MjA0NjAwIC0wNzAwDQpAQCAt NDExNCwyMiArNDExNCw0NSBAQA0KICAgIk5vbi1uaWwgbWVhbnMgdGhlIERpcmVkIHNvcnQgY29t bWFuZCBpcyBkaXNhYmxlZC4NCiBUaGUgaWRlYSBpcyB0byBzZXQgdGhpcyBidW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g ICAgICAgICAgICAgICAgICAgKGNvbmQgKChpbnRlZ2VycCBkaXJlZHAtc3dpdGNoZXMtaW4tbW9k ZS1saW5lKQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobGV0KiAoKGwxICAobGVu Z3RoIGRpcmVkLWFjdHVhbC1zd2l0Y2hlcykpDQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAoeHMgIChzdWJzdHJpbmcgZGlyZWQtYWN0dWFsLXN3aXRjaGVzDQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAobWluIGwx IGRpcmVkcC1zd2l0Y2hlcy1pbi1tb2RlLWxpbmUpKSkNCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIChsMiAgKGxlbmd0aCB4cykpKQ0KKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIChpZiAoemVyb3AgbDIpDQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHhzDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uY2F0 ICIgIiB4cyAoYW5kICg8IGwyICBsMSkgIuKApiIpKSkpKQ0KKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICgoZnVuY3Rpb25wIGRpcmVkcC1zd2l0Y2hlcy1pbi1tb2RlLWxpbmUpDQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmb3JtYXQgIiAlcyIgKGZ1bmNhbGwgZGlyZWRw LXN3aXRjaGVzLWluLW1vZGUtbGluZQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZGlyZWQtYWN0dWFsLXN3aXRjaGVzKSkpDQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKHQgKGNvbmNhdCAiICIgZGlyZWQtYWN0dWFsLXN3aXRjaGVz KSkpKQ0KKyAgICAgICAgICAgICAgKGNvbmQgKChzdHJpbmctbWF0Y2gtcCBkaXJlZC1zb3J0LWJ5 LW5hbWUtcmVnZXhwIGRpcmVkLWFjdHVhbC1zd2l0Y2hlcykNCisgICAgICAgICAgICAgICAgICAg ICAiRGlyZWQgYnkgbmFtZSIpDQorICAgICAgICAgICAgICAgICAgICAoKHN0cmluZy1tYXRjaC1w IGRpcmVkLXNvcnQtYnktZGF0ZS1yZWdleHAgZGlyZWQtYWN0dWFsLXN3aXRjaGVzKQ0KKyAgICAg ICAgICAgICAgICAgICAgICJEaXJlZCBieSBkYXRlIikNCisgICAgICAgICAgICAgICAgICAgICh0 IChjb25jYXQgIkRpcmVkICIgZGlyZWQtYWN0dWFsLXN3aXRjaGVzKSkpKSkpDQogICAgIChmb3Jj ZS1tb2RlLWxpbmUtdXBkYXRlKSkpDQogDQogKGRlZmluZS1vYnNvbGV0ZS1mdW5jdGlvbi1hbGlh cyAnZGlyZWQtc29ydC1zZXQtbW9kZWxpbmUNCg== --__158958114405766808abhmp0001.oracle.com--