From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#30938: 27.0; `dired-do-create-files' etc.: do NOT always raise error if no files Date: Fri, 30 Mar 2018 10:12:13 -0700 (PDT) Message-ID: <9b80ae9e-06e3-4217-89b1-eb8a3b0c93b8@default> References: <<<<7ea429b5-b12e-4639-9d77-11db71504d9c@default> <87605g7xpj.fsf@mail.linkov.net> <70149736-0c90-4059-91d0-155144bf4abd@default> <87o9j6k5qx.fsf@mail.linkov.net>>>> <<<<8111e8b0-a7fb-4de4-9371-fd69c74c46e5@default>>>> <<<<83lgeac7xs.fsf@gnu.org>>>> <<>> <<<83k1tt8ttp.fsf@gnu.org>>> <> <<83in9d8s4b.fsf@gnu.org>> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1522430234 30227 195.159.176.226 (30 Mar 2018 17:17:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 30 Mar 2018 17:17:14 +0000 (UTC) Cc: 30938@debbugs.gnu.org, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 30 19:17:09 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 1f1xeH-0007i7-Eg for geb-bug-gnu-emacs@m.gmane.org; Fri, 30 Mar 2018 19:17:09 +0200 Original-Received: from localhost ([::1]:54811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1xgJ-0003hG-6l for geb-bug-gnu-emacs@m.gmane.org; Fri, 30 Mar 2018 13:19:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1xg7-0003f9-8n for bug-gnu-emacs@gnu.org; Fri, 30 Mar 2018 13:19:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f1xg6-0000l8-9R for bug-gnu-emacs@gnu.org; Fri, 30 Mar 2018 13:19:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52509) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f1xg6-0000kc-52 for bug-gnu-emacs@gnu.org; Fri, 30 Mar 2018 13:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f1xg5-0004Mr-QD for bug-gnu-emacs@gnu.org; Fri, 30 Mar 2018 13:19:01 -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, 30 Mar 2018 17:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30938 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30938-submit@debbugs.gnu.org id=B30938.152243033816780 (code B ref 30938); Fri, 30 Mar 2018 17:19:01 +0000 Original-Received: (at 30938) by debbugs.gnu.org; 30 Mar 2018 17:18:58 +0000 Original-Received: from localhost ([127.0.0.1]:60406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f1xg2-0004Ma-Lh for submit@debbugs.gnu.org; Fri, 30 Mar 2018 13:18:58 -0400 Original-Received: from aserp2130.oracle.com ([141.146.126.79]:54120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f1xfz-0004ML-V3 for 30938@debbugs.gnu.org; Fri, 30 Mar 2018 13:18:56 -0400 Original-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2UH6WQi004883; Fri, 30 Mar 2018 17:18:50 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 : content-transfer-encoding; s=corp-2017-10-26; bh=a0/yPav4yg73zROHOGc2YQpQMwHsa4nXaha+UUX2Peo=; b=F1HO8ViAnVX/qNPPkMy4sc74LtE6DUuKmWSOyLT7df/4YoKWEVa2mJMunBg2iZ3ZWGqa ePPgGetneDYE8W4/FflaEYPCIEefzRK6xn3FRWebLWgLOZwoTyJe+EAc1WiyyhEUqf8i ew8xdiG9GVyKcJrkxWiU1o6VOw/wHr8NJEDeh0AuklaDYztHFuKYoPWFmir+IBzN+EUL 7wna3bbqnTqJyXR3lgmgJ68ntb3XiEJtjeNl3nBQ6xb5vvZjHaHuEdvGSeSC8Rsh+4dK Swfr9tUhU8YkGEYbtwuirWvozu5igiREaBMoSBCY1kIfBAoI5GMD4ETaKAEfYmxcyOiW vA== Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2h1sabg3fw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Mar 2018 17:18:36 +0000 Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w2UHCFBa027431 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Mar 2018 17:12:15 GMT Original-Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w2UHCFJO006617; Fri, 30 Mar 2018 17:12:15 GMT In-Reply-To: <<83in9d8s4b.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4666.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8848 signatures=668697 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803300175 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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:144748 Archived-At: > I might agree that it's a bug if I understand it. But since you > refuse to explain it, I guess I never will. Maybe this will help (but I doubt it) - 1. Existing Dired+ command (updated to accommodate this bug by adding INTERACTIVEP and passing that to `dired-get-marked-files'): (defun diredp-insert-subdirs (&optional switches interactivep) "Insert the marked subdirectories. Like using \\`\\[dired-maybe-insert-subdir]' at \ each marked directory line." (interactive (list (and current-prefix-arg (read-string "Switches for listing: " (or dired-subdir-switches dired-actual-switches))) t)) (dolist (subdir (dired-get-marked-files nil nil (lambda (fl) (and (file-directory-p fl) (not (diredp-string-match-p "/[.][.]?\\'" fl)))) nil interactivep)) (dired-maybe-insert-subdir subdir switches))) Imaginary function that uses that command as a utility: (defun insert-marked-subdirs-and-do-stuff () (DO-STUFF) (diredp-insert-subdirs) (DO-OTHER-STUFF)) If you assume that the insertion of marked subdirs is not a requirement for the main behavior of this function, e.g., that it acts on any that get inserted but it doesn't _require_ any such insertions to do its job in general, then without some change as proposed this function can end in error without ever trying to DO-OTHER-STUFF. I'm arguing that similar considerations can apply to other existing commands. Whether each such case is actually problematic is not so important (IMO). The point is for individual such commands to, a priori, treat the non-interactive case separately. A non-interactive use case for an arbitrary command that calls ` dired-get-marked-files' does not necessarily have `user-error' as the right behavior for an empty set of marked files. That's all I'm saying.