From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#30285: dired-do-chmod vs. top line of dired Date: Thu, 01 Feb 2018 22:07:10 +0200 Organization: LINKOV.NET Message-ID: <87k1vwcwy1.fsf@mail.linkov.net> References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1517516479 14124 195.159.176.226 (1 Feb 2018 20:21:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 1 Feb 2018 20:21:19 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 30285@debbugs.gnu.org, jidanni@jidanni.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 01 21:21:15 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehLM4-00033c-TL for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Feb 2018 21:21:09 +0100 Original-Received: from localhost ([::1]:60159 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehLO5-0003kJ-Vx for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Feb 2018 15:23:14 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:41544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehLKQ-0002N2-Hx for bug-gnu-emacs@gnu.org; Thu, 01 Feb 2018 15:23:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehLEF-0001Mz-BF for bug-gnu-emacs@gnu.org; Thu, 01 Feb 2018 15:14:09 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44858) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehLEF-0001Mo-4N for bug-gnu-emacs@gnu.org; Thu, 01 Feb 2018 15:13:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ehLED-0007Up-KC for bug-gnu-emacs@gnu.org; Thu, 01 Feb 2018 15:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Feb 2018 20:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30285 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30285-submit@debbugs.gnu.org id=B30285.151751594428766 (code B ref 30285); Thu, 01 Feb 2018 20:13:01 +0000 Original-Received: (at 30285) by debbugs.gnu.org; 1 Feb 2018 20:12:24 +0000 Original-Received: from localhost ([127.0.0.1]:52754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehLDb-0007Tu-VF for submit@debbugs.gnu.org; Thu, 01 Feb 2018 15:12:24 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:57237 helo=homiemail-a20.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehLDZ-0007Tm-PN for 30285@debbugs.gnu.org; Thu, 01 Feb 2018 15:12:22 -0500 Original-Received: from homiemail-a20.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTP id A93C27EC06F; Thu, 1 Feb 2018 12:12:20 -0800 (PST) Original-Received: from localhost.linkov.net (m91-129-107-8.cust.tele2.ee [91.129.107.8]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPSA id 14FF47EC060; Thu, 1 Feb 2018 12:12:18 -0800 (PST) In-Reply-To: (Tino Calancha's message of "Thu, 1 Feb 2018 17:16:26 +0900 (JST)") X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: 0.0 (/) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:142778 Archived-At: > IMO marking commands are at at different level than commands that opera= te > on marked files; we don't need to mimic such feature of the `dired-mark= '. > Indeed, if the user want to operate on all files, she can easily do > `dired-mark' followed by the command in question; I tend to think call= ing > `dired-do...' things without marked files from the top line as an user = mistake. Since `dired-mark' from the top line followed by the command in question is not obvious for users, we could provide a hint in the error message, i.e. mention the availability of =E2=80=98m=E2=80=99 on the top line with= such message: =E2=80=9CYou can type `m' here to mark all files for this operation=E2=80= =9D. >>> No, we don't need a function `dired-marked-files-or-file-at-point-p', >>> for that or anything else. The `dired-do-*' commands already DTRT >>> wrt the marked-files-or-file-at-point. >> >> I agree that it's better to check the =E2=80=98files=E2=80=99 returned= from >> =E2=80=98dired-get-marked-files=E2=80=99. > > Today I took a deeper look in the train and I saw there are several mor= e > commands that don't protect against X. Some even breaks > (e.g., dired-do-shell-command, dired-do-async-shell-command). > > Below patch introduce a macro to systematically handle the 'X condition= ', > what do you think? I agree with Drew that better to use existing functions, and not to duplicate them. Non sunt multiplicanda entia sine necessitate. Moreover, we should not change the old semantic of Dired commands: if users have a habit of operating on the first files by going to the top line and typing e.g. =E2=80=98M-< C-5 M=E2=80=99 to change modes of the f= irst 5 files, this is just fine, we should not prohobit this behaviour now. So what we need to do is just check if the list of files returned from =E2=80=98dired-get-marked-files=E2=80=99 is nil, and show some message in= this case in all places that you found where the prompt with [0 files] makes no sense.