GNU bug report logs - #30938
27.0; `dired-do-create-files' etc.: do NOT always raise error if no files

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: Drew Adams <drew.adams@HIDDEN>; dated Sun, 25 Mar 2018 16:37:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 2 Apr 2018 19:55:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 02 15:55:39 2018
Received: from localhost ([127.0.0.1]:35419 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f35YJ-0003lW-BH
	for submit <at> debbugs.gnu.org; Mon, 02 Apr 2018 15:55:39 -0400
Received: from sub3.mail.dreamhost.com ([69.163.253.7]:36402
 helo=homiemail-a11.g.dreamhost.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1f35YI-0003lO-Ef
 for 30938 <at> debbugs.gnu.org; Mon, 02 Apr 2018 15:55:38 -0400
Received: from homiemail-a11.g.dreamhost.com (localhost [127.0.0.1])
 by homiemail-a11.g.dreamhost.com (Postfix) with ESMTP id 3F496314C069;
 Mon,  2 Apr 2018 12:55:37 -0700 (PDT)
Received: from localhost.linkov.net (m91-129-105-236.cust.tele2.ee
 [91.129.105.236])
 (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
 (No client certificate requested)
 (Authenticated sender: jurta@HIDDEN)
 by homiemail-a11.g.dreamhost.com (Postfix) with ESMTPSA id 629C6314C066;
 Mon,  2 Apr 2018 12:55:36 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#30938: 27.0;
 `dired-do-create-files' etc.: do NOT always raise error if no files
Organization: LINKOV.NET
References: <7ea429b5-b12e-4639-9d77-11db71504d9c@default>
 <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default>
 <87605g7xpj.fsf@HIDDEN>
 <70149736-0c90-4059-91d0-155144bf4abd@default>
 <87o9j6k5qx.fsf@HIDDEN>
 <8111e8b0-a7fb-4de4-9371-fd69c74c46e5@default>
Date: Mon, 02 Apr 2018 22:30:50 +0300
In-Reply-To: <8111e8b0-a7fb-4de4-9371-fd69c74c46e5@default> (Drew Adams's
 message of "Thu, 29 Mar 2018 21:01:44 -0700 (PDT)")
Message-ID: <87tvstwpl9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 30938
Cc: 30938 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

> I'm open to other ways to do what is needed, if they
> are better.  Feel free to propose something.

I still don't see why raising the error should depend on command's
interactivity, i.e. why these commands should not signal a user-error
in the non-interactive case.

We have thousands calls of such core functions as
(search-forward STRING &optional BOUND NOERROR COUNT)
and none of them binds the NOERROR arg to the command INTERACTIVE arg.
That's because it would make the control flow unmanageable in
a chain of commands, i.e. when a command that invokes a command
that invokes such core functions.

In very rare cases when you absolutely need to ignore errors,
just use (ignore-errors (dired-do-chmod))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 31 Mar 2018 16:50:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 31 12:50:26 2018
Received: from localhost ([127.0.0.1]:33170 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f2Jhy-0006I1-1k
	for submit <at> debbugs.gnu.org; Sat, 31 Mar 2018 12:50:26 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45424)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1f2Jhw-0006Hn-7p
 for 30938 <at> debbugs.gnu.org; Sat, 31 Mar 2018 12:50:24 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1f2Jhn-0004gI-0b
 for 30938 <at> debbugs.gnu.org; Sat, 31 Mar 2018 12:50:18 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54277)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1f2Jhm-0004g2-ST; Sat, 31 Mar 2018 12:50:14 -0400
Received: from [176.228.60.248] (port=2850 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1f2Jhm-0005J3-CI; Sat, 31 Mar 2018 12:50:14 -0400
Date: Sat, 31 Mar 2018 19:50:14 +0300
Message-Id: <83370g8a0p.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
In-reply-to: <cc9dcc3e-63c6-43ca-98ec-acdffd2c7ddd@default> (message from Drew
 Adams on Sat, 31 Mar 2018 09:10:41 -0700 (PDT))
Subject: Re: bug#30938: 27.0;	`dired-do-create-files' etc.: do NOT always
 raise error if no files
References: <<<<<7ea429b5-b12e-4639-9d77-11db71504d9c@default>
 <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default>
 <87605g7xpj.fsf@HIDDEN>
 <70149736-0c90-4059-91d0-155144bf4abd@default>
 <87o9j6k5qx.fsf@HIDDEN>>>>>
 <<<<<8111e8b0-a7fb-4de4-9371-fd69c74c46e5@default>>>>>
 <<<<<83lgeac7xs.fsf@HIDDEN>>>>>
 <<<<ea1c9d9f-2405-4377-bd42-de7f020cf9d4@default>>>>
 <<<<83k1tt8ttp.fsf@HIDDEN>>>>
 <<<ceb6e79f-5f03-45a5-a7a4-5fe954661d5d@default>>>
 <<<83in9d8s4b.fsf@HIDDEN>>> <<9b80ae9e-06e3-4217-89b1-eb8a3b0c93b8@default>>
 <<838ta88vfz.fsf@HIDDEN>> <cc9dcc3e-63c6-43ca-98ec-acdffd2c7ddd@default>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 30938
Cc: 30938 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Date: Sat, 31 Mar 2018 09:10:41 -0700 (PDT)
> From: Drew Adams <drew.adams@HIDDEN>
> Cc: juri@HIDDEN, 30938 <at> debbugs.gnu.org
> 
> > First, dired-get-marked-files _can_ be invoked when no files are
> > marked, without risking a user-error: it has the ARG argument for
> > that.  So if your hypothetical command needs for some reason to work
> > when no files are marked, it can, at least in principle.  Why your
> > dired[p]-insert-subdirs didn't go that way, or at least didn't pass nil
> > as ERROR, I don't understand (and I'm not sure it's related to the
> > issue at hand).
> 
> Don't confuse a command that invokes `dired-get-marked-files'
> with a command that invokes a command that invokes
> `dired-get-marked-files'.  Their behaviors can differ (and
> in the general case they do), including wrt interactive and
> non-interactive use.

Summary: I'm not convinced.  Some details below.

> `diredp-insert-subdirs' inserts the subdir of the current
> line, if no subdirs are marked.  If none are marked and it
> is called from a non-subdir line then it _should_ raise an
> error interactively (and it does).
> 
> Should it also do so non-interactively?  Why should it
> decide that?  Why not let its caller do that?  When
> called non-interactively it cannot (and need not) know
> what is the right way to handle that case.

AFAIU, you have all the tools to make it do that, by judicious use of
the ARG and ERROR arguments.

> Imaginary command `insert-marked-subdirs-and-do-stuff'
> should _not_ raise an error, and its invocation of
> `diredp-insert-subdirs' should be a _no-op_, in the
> same situation where invoking `diredp-insert-subdirs'
> interactively would raise an error.

If diredp-insert-subdirs is designed to support that, its interface
should allow that.  Commands that aren't designed to support that have
no obligations to allow calling them like that.  IOW freedom of
applications to invoke commands and functions outside their intended
domain is not unlimited, and asking for it to be unlimited, or
insisting that the limits be made wider, no matter the costs, is IMO
unreasonable.

> Being able to do that is for the benefit of reusing a
> command that calls `dired-get-marked-files' in different
> ways.

Such reuses have their limitations.  One of them is when no files are
marked and there's no "current file".  Those commands signal an error
because they cannot fulfill their contract; silently doing nothing in
this case is against that contract.

> While it is typically a user error if nothing is marked
> and point is not on any file line, it is not necessarily
> an error when neither of those is the case - even for an
> interactive case.

Signaling an error is a widely accepted way of telling the caller "you
asked me to do something; I didn't, and here's why".  If worse comes
to worst, the caller can always catch the error and recover from it.

> To me, the solution is simple: let a command that invokes
> `d-g-m-f' pass non-nil ERROR when the command is called
> interactively.

That solution causes unreasonable complication on a dozen of commands
for no good reason, so I don't see why we should do that.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 31 Mar 2018 16:17:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 31 12:17:28 2018
Received: from localhost ([127.0.0.1]:33165 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f2JC4-0005Xl-7o
	for submit <at> debbugs.gnu.org; Sat, 31 Mar 2018 12:17:28 -0400
Received: from aserp2130.oracle.com ([141.146.126.79]:41356)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1f2JC2-0005XZ-Nw
 for 30938 <at> debbugs.gnu.org; Sat, 31 Mar 2018 12:17:27 -0400
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 w2VGGwt5193611;
 Sat, 31 Mar 2018 16:17:19 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=bvlsEvcDzXfYV/0bdS2KuCq+NpnOO0lfW+05d2Se2+I=;
 b=P5JYYN8jJ+LSsrxxwG1LrtGleyQanWa9/JEp3tA7vy9rVSxJ8DdoFCMNIXax170yKp5K
 mzuMvwELr0I1ZgkjKISuh4YvPrRCYUEb1MoE/M59JnINZVDEcdPBmI6IKjuou8rlzjpo
 5ikfXTs2PdoECFl24bhKvMCxTxrMbbfEtym0exovU5Nm+s/rqVHUqbqUgYaGAnDQYYQ8
 ffNUXnCwkav5nlm7ee+mRDf0d5SNkFCFg9KMUle7smpDT4L8getiYavKmC55iOIlKHPF
 euKYtmG1LlBmB2y44CSJsuIlKuli/AtqD9eNJe6XGPcy6r1iwFXr+UiOkjl4Yf17nY5p NQ== 
Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74])
 by aserp2130.oracle.com with ESMTP id 2h2dqa80p8-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Sat, 31 Mar 2018 16:17:18 +0000
Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72])
 by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w2VGAhFV024120
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Sat, 31 Mar 2018 16:10:43 GMT
Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24])
 by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w2VGAgKd015349;
 Sat, 31 Mar 2018 16:10:43 GMT
MIME-Version: 1.0
Message-ID: <cc9dcc3e-63c6-43ca-98ec-acdffd2c7ddd@default>
Date: Sat, 31 Mar 2018 09:10:41 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: RE: bug#30938: 27.0;	`dired-do-create-files' etc.: do NOT always
 raise error if no files
References: <<<<<7ea429b5-b12e-4639-9d77-11db71504d9c@default>
 <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default>
 <87605g7xpj.fsf@HIDDEN>
 <70149736-0c90-4059-91d0-155144bf4abd@default>
 <87o9j6k5qx.fsf@HIDDEN>>>>>
 <<<<<8111e8b0-a7fb-4de4-9371-fd69c74c46e5@default>>>>>
 <<<<<83lgeac7xs.fsf@HIDDEN>>>>>
 <<<<ea1c9d9f-2405-4377-bd42-de7f020cf9d4@default>>>>
 <<<<83k1tt8ttp.fsf@HIDDEN>>>>
 <<<ceb6e79f-5f03-45a5-a7a4-5fe954661d5d@default>>>
 <<<83in9d8s4b.fsf@HIDDEN>>> <<9b80ae9e-06e3-4217-89b1-eb8a3b0c93b8@default>>
 <<838ta88vfz.fsf@HIDDEN>>
In-Reply-To: <<838ta88vfz.fsf@HIDDEN>>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4666.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8849
 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-1803310168
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 30938
Cc: 30938 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

> > 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.
>=20
> I'm sorry, but you lost me.  Let me try explaining this from my POV.
>=20
> First, dired-get-marked-files _can_ be invoked when no files are
> marked, without risking a user-error: it has the ARG argument for
> that.  So if your hypothetical command needs for some reason to work
> when no files are marked, it can, at least in principle.  Why your
> dired[p]-insert-subdirs didn't go that way, or at least didn't pass nil
> as ERROR, I don't understand (and I'm not sure it's related to the
> issue at hand).

Don't confuse a command that invokes `dired-get-marked-files'
with a command that invokes a command that invokes
`dired-get-marked-files'.  Their behaviors can differ (and
in the general case they do), including wrt interactive and
non-interactive use.

`diredp-insert-subdirs' inserts the subdir of the current
line, if no subdirs are marked.  If none are marked and it
is called from a non-subdir line then it _should_ raise an
error interactively (and it does).

Should it also do so non-interactively?  Why should it
decide that?  Why not let its caller do that?  When
called non-interactively it cannot (and need not) know
what is the right way to handle that case.

Imaginary command `insert-marked-subdirs-and-do-stuff'
should _not_ raise an error, and its invocation of
`diredp-insert-subdirs' should be a _no-op_, in the
same situation where invoking `diredp-insert-subdirs'
interactively would raise an error.

Code can tell `dired-get-marked-files' directly whether
it should raise an error if there are no files gathered.
What's missing is for callers of `dired-get-marked-files'
to tell it that conditionally, based on whether they are
called interactively.

Being able to do that is for the benefit of reusing a
command that calls `dired-get-marked-files' in different
ways.  It is not needed for the benefit of a command
that calls `dired-get-marked-files' directly, as that
choice is already under its control.

> It is true that dired-aux.el commands that call dired-get-marked-files
> all pass nil as ARG (and t as ERROR), but what would be the semantics
> of, say, dired-do-isearch-regexp when no files are marked?  That
> command, and all the others which call dired-get-marked-files in the
> same manner, is to do something on "all marked files", as their doc
> string clearly says.
>=20
> So why do we need to allow these commands to be invoked when no files
> are marked, and expect them not to signal a user-error?

For the benefit of a function that might call them and not
want to raise that error.

The interactive case for a command that calls
`dired-get-marked-files' is completely known by that
command.  The context of a non-interactive use of the same
command is not known to it.  Its code should not prejudice
the behavior intended by its caller.

In the example of `insert-marked-subdirs-and-do-stuff', its
call to `diredp-insert-subdirs' is _not_ its main purpose,
and it is fine if there are no marked subdirs and thus none
get inserted.  For `i-m-s-a-d-s' to do its overall job, the
call to `d-i-s' needs to tolerate no subdirs being marked
and inserted, by being benign - a no-op.

Although no marked subdirs (and point not on a subdir) _is_
a user error for interactively called `d-i-s', it is _not_
an error for interactively (or not) `i-m-s-a-d-s'.

> IOW, even if dired-do-isearch-regexp and its ilk are invoked
> non-interactively, they are invoked as result of some command up the
> call-stack, so the invocation does come from the user.=20

The invocation of `d-d-i-r' comes ultimately from the user,
as does the invocation of pretty much everything in Emacs.

But the intention and purpose of `d-d-i-r' can be different
- including wrt what no markings of particular files might
mean - from the intention and purpose of an upstream command
that directly or indirectly invokes `d-d-i-r'.

There is no reason to assume that interactive and
non-interactive use of a given command should have the same
behavior wrt the new `dired-get-marked-files' arg ERROR.
Such hardcoding provides no benefit and can get in the way.

> And since
> dired-do-isearch-regexp etc. are documented to act on marked files, it
> sounds appropriate to signal an error when no files are marked.

It is appropriate for _them_, i.e., when invoked interactively.
It is not necessarily appropriate for something that calls them.

> A feature which wants to allow users to get away silently in this case
> can always check whether any files are marked and avoid calling
> dired-do-isearch-regexp etc. if none are.

It shouldn't have to.  You are essentially suggesting that it
too should invoke `dired-get-marked-files'.  That shouldn't
be necessary (not to mention that it can be costly).

> That is why I asked for real-time use-cases where this gets in the
> way: your argument sounds like a general philosophical issue to me:

Call it what you like.

Your argument hasn't even been presented so far, AFAICT.
What are supporting reasons for a claim that we should
_not_ distinguish interactive from non-interactive use
for such commands and pass this along to `d-g-m-f'?

> you claim that it's "completely inappropriate" for a utility function
> to signal an error on theoretical grounds, while in reality I still
> don't see any practical problem that cannot be easily resolved.  If
> your diredp-insert-subdirs is an example of a problem, then as I said
> above, I don't understand why you couldn't just omit the last optional
> argument to dired-get-marked-files, and be done.  (And since ERROR was
> _added_ in Emacs 27, your original code should have been already
> future-proof against such changes anyway.)

See above.

The addition of optional arg ERROR was a _good_ thing.
No, no code could have taken care of this before, without
it.  Typically, point is on a file line, and when no files
are marked the command acts (purposefully) on the file of
the current line.  It is only rarely that point is in a
buffer position where the new error kicks in.

Another, more common, case where the error can kick in is
(as for the case of `diredp-insert-subdirs') when a FILTER
passed to `dired-get-marked-files' results in an empty
file list.

While it is typically a user error if nothing is marked
and point is not on any file line, it is not necessarily
an error when neither of those is the case - even for an
interactive case.  The individual command needs to decide
whether that is an error case.

Similarly, for a command B that _invokes_ such a command
A.  It is up to B to decide whether to raise an error.
If A systematically causes `d-g-m-f' to raise an error
in a context where an error makes sense for A, that can
conflict with what makes sense for B.

To me, the solution is simple: let a command that invokes
`d-g-m-f' pass non-nil ERROR when the command is called
interactively.

That just gives the command (and its author) more choice.
No reason to assume that its interactive use is the same
as its non-interactive use, including wrt its use of
`dired-get-marked-files'.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 31 Mar 2018 09:07:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 31 05:07:41 2018
Received: from localhost ([127.0.0.1]:60648 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f2CU8-00007a-SS
	for submit <at> debbugs.gnu.org; Sat, 31 Mar 2018 05:07:41 -0400
Received: from eggs.gnu.org ([208.118.235.92]:58755)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1f2CU7-00007O-8k
 for 30938 <at> debbugs.gnu.org; Sat, 31 Mar 2018 05:07:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1f2CTy-000250-4h
 for 30938 <at> debbugs.gnu.org; Sat, 31 Mar 2018 05:07:34 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46031)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1f2CTy-00024s-0T; Sat, 31 Mar 2018 05:07:30 -0400
Received: from [176.228.60.248] (port=2805 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1f2CTx-0005hs-L3; Sat, 31 Mar 2018 05:07:29 -0400
Date: Sat, 31 Mar 2018 12:07:28 +0300
Message-Id: <838ta88vfz.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
In-reply-to: <9b80ae9e-06e3-4217-89b1-eb8a3b0c93b8@default> (message from Drew
 Adams on Fri, 30 Mar 2018 10:12:13 -0700 (PDT))
Subject: Re: bug#30938: 27.0;	`dired-do-create-files' etc.: do NOT always
 raise error if no files
References: <<<<7ea429b5-b12e-4639-9d77-11db71504d9c@default>
 <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default>
 <87605g7xpj.fsf@HIDDEN>
 <70149736-0c90-4059-91d0-155144bf4abd@default>
 <87o9j6k5qx.fsf@HIDDEN>>>>
 <<<<8111e8b0-a7fb-4de4-9371-fd69c74c46e5@default>>>>
 <<<<83lgeac7xs.fsf@HIDDEN>>>>
 <<<ea1c9d9f-2405-4377-bd42-de7f020cf9d4@default>>>
 <<<83k1tt8ttp.fsf@HIDDEN>>> <<ceb6e79f-5f03-45a5-a7a4-5fe954661d5d@default>>
 <<83in9d8s4b.fsf@HIDDEN>> <9b80ae9e-06e3-4217-89b1-eb8a3b0c93b8@default>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 30938
Cc: 30938 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Date: Fri, 30 Mar 2018 10:12:13 -0700 (PDT)
> From: Drew Adams <drew.adams@HIDDEN>
> Cc: juri@HIDDEN, 30938 <at> debbugs.gnu.org
> 
> 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.

I'm sorry, but you lost me.  Let me try explaining this from my POV.

First, dired-get-marked-files _can_ be invoked when no files are
marked, without risking a user-error: it has the ARG argument for
that.  So if your hypothetical command needs for some reason to work
when no files are marked, it can, at least in principle.  Why your
dired-insert-subdirs didn't go that way, or at least didn't pass nil
as ERROR, I don't understand (and I'm not sure it's related to the
issue at hand).

It is true that dired-aux.el commands that call dired-get-marked-files
all pass nil as ARG (and t as ERROR), but what would be the semantics
of, say, dired-do-isearch-regexp when no files are marked?  That
command, and all the others which call dired-get-marked-files in the
same manner, is to do something on "all marked files", as their doc
string clearly says.

So why do we need to allow these commands to be invoked when no files
are marked, and expect them not to signal a user-error?

IOW, even if dired-do-isearch-regexp and its ilk are invoked
non-interactively, they are invoked as result of some command up the
call-stack, so the invocation does come from the user.  And since
dired-do-isearch-regexp etc. are documented to act on marked files, it
sounds appropriate to signal an error when no files are marked.  A
feature which wants to allow users to get away silently in this case
can always check whether any files are marked and avoid calling
dired-do-isearch-regexp etc. if none are.

That is why I asked for real-time use-cases where this gets in the
way: your argument sounds like a general philosophical issue to me:
you claim that it's "completely inappropriate" for a utility function
to signal an error on theoretical grounds, while in reality I still
don't see any practical problem that cannot be easily resolved.  If
your diredp-insert-subdirs is an example of a problem, then as I said
above, I don't understand why you couldn't just omit the last optional
argument to dired-get-marked-files, and be done.  (And since ERROR was
_added_ in Emacs 27, your original code should have been already
future-proof against such changes anyway.)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 30 Mar 2018 17:18:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 30 13:18:58 2018
Received: from localhost ([127.0.0.1]:60406 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f1xg2-0004Ma-Lh
	for submit <at> debbugs.gnu.org; Fri, 30 Mar 2018 13:18:58 -0400
Received: from aserp2130.oracle.com ([141.146.126.79]:54120)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1f1xfz-0004ML-V3
 for 30938 <at> debbugs.gnu.org; Fri, 30 Mar 2018 13:18:56 -0400
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== 
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
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
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
MIME-Version: 1.0
Message-ID: <9b80ae9e-06e3-4217-89b1-eb8a3b0c93b8@default>
Date: Fri, 30 Mar 2018 10:12:13 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: RE: bug#30938: 27.0;	`dired-do-create-files' etc.: do NOT always
 raise error if no files
References: <<<<7ea429b5-b12e-4639-9d77-11db71504d9c@default>
 <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default>
 <87605g7xpj.fsf@HIDDEN>
 <70149736-0c90-4059-91d0-155144bf4abd@default>
 <87o9j6k5qx.fsf@HIDDEN>>>>
 <<<<8111e8b0-a7fb-4de4-9371-fd69c74c46e5@default>>>>
 <<<<83lgeac7xs.fsf@HIDDEN>>>>
 <<<ea1c9d9f-2405-4377-bd42-de7f020cf9d4@default>>>
 <<<83k1tt8ttp.fsf@HIDDEN>>> <<ceb6e79f-5f03-45a5-a7a4-5fe954661d5d@default>>
 <<83in9d8s4b.fsf@HIDDEN>>
In-Reply-To: <<83in9d8s4b.fsf@HIDDEN>>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4666.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
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-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 30938
Cc: 30938 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

> 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-mode-map>`\\[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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 30 Mar 2018 16:07:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 30 12:07:15 2018
Received: from localhost ([127.0.0.1]:60375 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f1wYd-0002lP-DM
	for submit <at> debbugs.gnu.org; Fri, 30 Mar 2018 12:07:15 -0400
Received: from eggs.gnu.org ([208.118.235.92]:36062)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1f1wYb-0002lC-79
 for 30938 <at> debbugs.gnu.org; Fri, 30 Mar 2018 12:07:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1f1wYS-0003yc-9t
 for 30938 <at> debbugs.gnu.org; Fri, 30 Mar 2018 12:07:07 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54455)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1f1wYS-0003yU-5E; Fri, 30 Mar 2018 12:07:04 -0400
Received: from [176.228.60.248] (port=2121 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1f1wYR-0004DF-Kc; Fri, 30 Mar 2018 12:07:04 -0400
Date: Fri, 30 Mar 2018 19:07:00 +0300
Message-Id: <83in9d8s4b.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
In-reply-to: <ceb6e79f-5f03-45a5-a7a4-5fe954661d5d@default> (message from Drew
 Adams on Fri, 30 Mar 2018 08:43:29 -0700 (PDT))
Subject: Re: bug#30938: 27.0;	`dired-do-create-files' etc.: do NOT always
 raise error if no files
References: <<<7ea429b5-b12e-4639-9d77-11db71504d9c@default>
 <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default>
 <87605g7xpj.fsf@HIDDEN>
 <70149736-0c90-4059-91d0-155144bf4abd@default>
 <87o9j6k5qx.fsf@HIDDEN>>>
 <<<8111e8b0-a7fb-4de4-9371-fd69c74c46e5@default>>>
 <<<83lgeac7xs.fsf@HIDDEN>>> <<ea1c9d9f-2405-4377-bd42-de7f020cf9d4@default>>
 <<83k1tt8ttp.fsf@HIDDEN>> <ceb6e79f-5f03-45a5-a7a4-5fe954661d5d@default>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 30938
Cc: 30938 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Date: Fri, 30 Mar 2018 08:43:29 -0700 (PDT)
> From: Drew Adams <drew.adams@HIDDEN>
> Cc: juri@HIDDEN, 30938 <at> debbugs.gnu.org
> 
> > > If you don't believe that a user or another library could
> > > or would define such a command (or in any other way would
> > > call an existing function that calls the workhorse function
> > > `dired-get-marked-files', then too bad.
> > 
> > Such uses can always call dired-get-marked-files with the last
> > argument nil or omitted.  Where's the problem?
> 
> I won't repeat myself this time.  If you don't want to see or
> fix the problem, so be it.

I might agree that it's a bug if I understand it.  But since you
refuse to explain it, I guess I never will.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 30 Mar 2018 15:43:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 30 11:43:39 2018
Received: from localhost ([127.0.0.1]:60370 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f1wBn-0002EU-Fw
	for submit <at> debbugs.gnu.org; Fri, 30 Mar 2018 11:43:39 -0400
Received: from aserp2130.oracle.com ([141.146.126.79]:56850)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1f1wBl-0002EH-Mb
 for 30938 <at> debbugs.gnu.org; Fri, 30 Mar 2018 11:43:38 -0400
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 w2UFTSt4125077;
 Fri, 30 Mar 2018 15:43:32 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=GAD1vvpy89nsso7hYrc8ZLoaBUZLnp/kW7o7ctnoVvE=;
 b=IY4vD/p0vfeO3tlq1mCd2GqQZ+YAXh3wK4SDijCY4SSujG+XYQkUFR4MI7XFYD/ZgPeu
 ad6XiPRrOHhwElWaeU7gv4IWYQJFfgpj+PVajAfLai2DtzTSyi9LSTxVJhGMrFm3XCvF
 ZN6JZ6mYHJ7PZHatKMAbIBRLczYKAa33nnSEjD6//LbYO9EltgNsOPAdrFW0KUD1Vs7S
 eA2CTozG94xeF3u7WBSwRAXdSc2nbRB7y9eBkTO/h7i+Nh9UzHnBAAS9tpJGM5ItTMkM
 5yzLNFgNwjIpt0df253WwmBPC3cgADN+vF+0gedvt5rYfi3eJw9BeHgSIk1NrmSoNKP0 1w== 
Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234])
 by aserp2130.oracle.com with ESMTP id 2h1qx50244-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 30 Mar 2018 15:43:32 +0000
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 w2UFhVwe032434
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 30 Mar 2018 15:43:31 GMT
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 w2UFhV4o016795;
 Fri, 30 Mar 2018 15:43:31 GMT
MIME-Version: 1.0
Message-ID: <ceb6e79f-5f03-45a5-a7a4-5fe954661d5d@default>
Date: Fri, 30 Mar 2018 08:43:29 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: RE: bug#30938: 27.0;	`dired-do-create-files' etc.: do NOT always
 raise error if no files
References: <<<7ea429b5-b12e-4639-9d77-11db71504d9c@default>
 <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default>
 <87605g7xpj.fsf@HIDDEN>
 <70149736-0c90-4059-91d0-155144bf4abd@default>
 <87o9j6k5qx.fsf@HIDDEN>>>
 <<<8111e8b0-a7fb-4de4-9371-fd69c74c46e5@default>>>
 <<<83lgeac7xs.fsf@HIDDEN>>> <<ea1c9d9f-2405-4377-bd42-de7f020cf9d4@default>>
 <<83k1tt8ttp.fsf@HIDDEN>>
In-Reply-To: <<83k1tt8ttp.fsf@HIDDEN>>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4666.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8847
 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=578
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.0.1-1711220000 definitions=main-1803300158
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 30938
Cc: 30938 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

> > If you don't believe that a user or another library could
> > or would define such a command (or in any other way would
> > call an existing function that calls the workhorse function
> > `dired-get-marked-files', then too bad.
>=20
> Such uses can always call dired-get-marked-files with the last
> argument nil or omitted.  Where's the problem?

I won't repeat myself this time.  If you don't want to see or
fix the problem, so be it.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 30 Mar 2018 15:30:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 30 11:30:24 2018
Received: from localhost ([127.0.0.1]:60364 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f1vyy-0001xE-6M
	for submit <at> debbugs.gnu.org; Fri, 30 Mar 2018 11:30:24 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54250)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1f1vyv-0001wx-Di
 for 30938 <at> debbugs.gnu.org; Fri, 30 Mar 2018 11:30:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1f1vyn-0001P5-Hv
 for 30938 <at> debbugs.gnu.org; Fri, 30 Mar 2018 11:30:16 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53340)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1f1vyn-0001P1-E0; Fri, 30 Mar 2018 11:30:13 -0400
Received: from [176.228.60.248] (port=2103 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1f1vym-00033i-Ow; Fri, 30 Mar 2018 11:30:13 -0400
Date: Fri, 30 Mar 2018 18:30:10 +0300
Message-Id: <83k1tt8ttp.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
In-reply-to: <ea1c9d9f-2405-4377-bd42-de7f020cf9d4@default> (message from Drew
 Adams on Fri, 30 Mar 2018 08:01:42 -0700 (PDT))
Subject: Re: bug#30938: 27.0;	`dired-do-create-files' etc.: do NOT always
 raise error if no files
References: <<7ea429b5-b12e-4639-9d77-11db71504d9c@default>
 <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default>
 <87605g7xpj.fsf@HIDDEN>
 <70149736-0c90-4059-91d0-155144bf4abd@default>
 <87o9j6k5qx.fsf@HIDDEN>>
 <<8111e8b0-a7fb-4de4-9371-fd69c74c46e5@default>> <<83lgeac7xs.fsf@HIDDEN>>
 <ea1c9d9f-2405-4377-bd42-de7f020cf9d4@default>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 30938
Cc: 30938 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Date: Fri, 30 Mar 2018 08:01:42 -0700 (PDT)
> From: Drew Adams <drew.adams@HIDDEN>
> Cc: juri@HIDDEN, 30938 <at> debbugs.gnu.org
> 
> >   Please provide at least one example (preferably more than one) of a
> >   real-life use case where these changes get in the way.
> > 
> > Without an answer to that, I cannot see why we have to do anything
> > about this issue, because up front I see no problem here at all, not
> > one that has been spelled out.
> 
> I answered your question, pointing to the example of calling
> `dired-do-isearch' (or any of the other such commands)
> non-interactively - e.g., by creating a command that uses it.

I don't see how I was supposed to understand that this as an answer to
my question: my question was not cited, and the text you posted had no
immediate relation to the issue at hand, it just says that
dired-get-marked-files could be called non-interactively, and intended
to do nothing when no files were marked, which is already possible.  I
don't want to guess what that has to do with the issue you raised, and
why.  Please spell that out.

> If you don't believe that a user or another library could
> or would define such a command (or in any other way would
> call an existing function that calls the workhorse function
> `dired-get-marked-files', then too bad.

Such uses can always call dired-get-marked-files with the last
argument nil or omitted.  Where's the problem?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 30 Mar 2018 15:01:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 30 11:01:55 2018
Received: from localhost ([127.0.0.1]:60351 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f1vXP-0001Gf-I2
	for submit <at> debbugs.gnu.org; Fri, 30 Mar 2018 11:01:55 -0400
Received: from userp2130.oracle.com ([156.151.31.86]:48180)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1f1vXN-0001GM-6P
 for 30938 <at> debbugs.gnu.org; Fri, 30 Mar 2018 11:01:53 -0400
Received: from pps.filterd (userp2130.oracle.com [127.0.0.1])
 by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2UEswri094097;
 Fri, 30 Mar 2018 15:01:47 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=B+4pEW/8X26+wp4Ckq2yIS6NtPtBLgOq1dPRCkiq91E=;
 b=j1nLuHr8JmhcDwq7rxaw36usJBS7OUoLZ4sJvu2BDINfZC2/o+WZySLve59meU5wJJ4c
 4TKk7NINyJtuyys/4Zt+rbltHWXFWDH0/7BooB1umN/QHFfxC2JYHpmQRJm2UJNhPzoa
 AueuOUMDgtxx/zXDcNCH31xocV9gxbf8vXbe/SkTxjBIWl6OyJQbrQPpDaGwQPDlYHGI
 ItvqX3NBqrjuOuww3+rZMp1YvS19Ozr1k8XvMDX1DYqfIGTDF6jJdje/F1wftcsXxs4X
 8UJPebpaAvHEYtnyLmiipTH0U1P/HaEoUuGEVfpL6B0Wt4BS6CuEjyiZp5QxA560JzfE tg== 
Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234])
 by userp2130.oracle.com with ESMTP id 2h1qdyr0xd-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 30 Mar 2018 15:01:46 +0000
Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236])
 by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w2UF1jSA022910
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 30 Mar 2018 15:01:45 GMT
Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9])
 by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w2UF1iAS018861;
 Fri, 30 Mar 2018 15:01:44 GMT
MIME-Version: 1.0
Message-ID: <ea1c9d9f-2405-4377-bd42-de7f020cf9d4@default>
Date: Fri, 30 Mar 2018 08:01:42 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: RE: bug#30938: 27.0;	`dired-do-create-files' etc.: do NOT always
 raise error if no files
References: <<7ea429b5-b12e-4639-9d77-11db71504d9c@default>
 <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default>
 <87605g7xpj.fsf@HIDDEN>
 <70149736-0c90-4059-91d0-155144bf4abd@default>
 <87o9j6k5qx.fsf@HIDDEN>>
 <<8111e8b0-a7fb-4de4-9371-fd69c74c46e5@default>> <<83lgeac7xs.fsf@HIDDEN>>
In-Reply-To: <<83lgeac7xs.fsf@HIDDEN>>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4666.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8847
 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-1803300148
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 30938
Cc: 30938 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

> A lot of discussion gone under the bridge, but I asked a question in
> the very beginning that was apparently ignored:
>=20
>   Please provide at least one example (preferably more than one) of a
>   real-life use case where these changes get in the way.
>=20
> Without an answer to that, I cannot see why we have to do anything
> about this issue, because up front I see no problem here at all, not
> one that has been spelled out.

I answered your question, pointing to the example of calling
`dired-do-isearch' (or any of the other such commands)
non-interactively - e.g., by creating a command that uses it.

If you don't believe that a user or another library could
or would define such a command (or in any other way would
call an existing function that calls the workhorse function
`dired-get-marked-files', then too bad.

In that case your idea of real-life use of Emacs Lisp differs
from mine; you will close the bug; and we will move on.  I've
already fixed my code to work around this change (except for
`dired-do-chxxx' repercussions - see below).

---

`dired-get-marked-files' is no less a utility function than
is, say, `dired-get-filename'.  And functions, including
commands, that call it are themselves candidates for reuse
in defining other functions, including other commands.

In addition, users often look to the definitions of Emacs
commands when creating similar or derivative commands.

Imagine that a user wants a command similar to
`dired-do-search' but that does things a bit differently.
S?he might look at the def of `dired-do-isearch' for
inspiration, and thus copy its use of `dired-marked-files'.
Hard-coding a non-nil 5th arg for it is a bad model.

(Same thing for `dired-do-search' etc. and the other
commands that, for some reason (?), have not yet
undergone this change.)

---

Similarly, for `dired-do-chxxx', which is NOT a command,
and which currently hardcodes a non-nil 5th arg to
`dired-get-marked-files' just like the commands do.

To fix that aberration a bit more surgery is required,
no doubt.  We could add an optional ERROR-IF-NONE-P arg
to `dired-do-chxxx', and obtain that from an optional
INTERACTIVEP arg to `dired-do-chmod' etc.  IOW, same
kind of fix.  Or perhaps Juri has a better fix in mind.

And as for "real-life" examples, BTW, I do define
`-mouse-' versions of the `dired-do-ch*' commands.
E.g.:

(defun diredp-mouse-do-chmod (event)
  "Change the mode of this file.
This calls chmod, so symbolic modes like `g+w' are allowed."
  (interactive "e")
  (let ((mouse-pos  (event-start event)))
    (select-window (posn-window mouse-pos))
    (goto-char (posn-point mouse-pos)))
  (dired-do-chxxx "Mode" "chmod" 'chmod 1)
  (diredp-previous-line 1))

As I haven't yet bothered to fix the now-bugged
`dired-do-chxxx' locally, such "real-life" commands
of mine are still broken by this recent change (for
the moment).

You can do nothing to fix this bug, and wait to see
whether Drew is the only one who has or will ever
have code that gets bitten by it.  Or you can DTRT
and not hardcode raising an error systematically
whenever `dired-get-marked-files' would come up
with no files.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 30 Mar 2018 07:57:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 30 03:57:31 2018
Received: from localhost ([127.0.0.1]:59310 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f1ouh-0000Eo-NU
	for submit <at> debbugs.gnu.org; Fri, 30 Mar 2018 03:57:31 -0400
Received: from eggs.gnu.org ([208.118.235.92]:38298)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1f1oud-0000EX-LN
 for 30938 <at> debbugs.gnu.org; Fri, 30 Mar 2018 03:57:28 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1f1ouU-00021X-1I
 for 30938 <at> debbugs.gnu.org; Fri, 30 Mar 2018 03:57:22 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33533)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1f1ouT-00021T-TR; Fri, 30 Mar 2018 03:57:17 -0400
Received: from [176.228.60.248] (port=3860 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1f1ouT-0005OV-3M; Fri, 30 Mar 2018 03:57:17 -0400
Date: Fri, 30 Mar 2018 10:57:03 +0300
Message-Id: <83lgeac7xs.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
In-reply-to: <8111e8b0-a7fb-4de4-9371-fd69c74c46e5@default> (message from Drew
 Adams on Thu, 29 Mar 2018 21:01:44 -0700 (PDT))
Subject: Re: bug#30938: 27.0;
 `dired-do-create-files' etc.: do NOT always raise error if no files
References: <7ea429b5-b12e-4639-9d77-11db71504d9c@default>
 <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default>
 <87605g7xpj.fsf@HIDDEN>
 <70149736-0c90-4059-91d0-155144bf4abd@default>
 <87o9j6k5qx.fsf@HIDDEN>
 <8111e8b0-a7fb-4de4-9371-fd69c74c46e5@default>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 30938
Cc: 30938 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Date: Thu, 29 Mar 2018 21:01:44 -0700 (PDT)
> From: Drew Adams <drew.adams@HIDDEN>
> Cc: 30938 <at> debbugs.gnu.org
> 
> Instead of asking me if I don't see there is something
> wrong with that, why don't you tell us what you think
> is wrong with it?
> 
> I said from the beginning:
> 
>   Please revert this change as soon as possible,
>   while you look for a better way to do what you
>   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   intended to do for it.
> 
> I'm open to other ways to do what is needed, if they
> are better.  Feel free to propose something.
> 
> I'm fine with what I proposed - either proposal:
> 
> 1. What I proposed at the outset: revert the bad change
>    and do nothing until a better approach is decided on.
> 
> 2. What I proposed in my follow-up: provide an INTERACTIVEP
>    arg to distinguish interactive use, and (at most) raise
>    a `user-error' only in the interactive-call case.
> 
> You asked if there was a better approach than doing #2.
> I replied that #2 seems fine, to me.  But please feel free
> to propose another approach, explaining why you think it's
> better.
> 
> Someone apparently thought it was OK to change 13 commands
> to ALWAYS raise an error in the no-files case.  Why are
> you shocked to hear that I would be OK with changing those
> same commands to not raise the error in the non-interactive
> case - IOW, to return them to their longstanding behavior
> in that case?

A lot of discussion gone under the bridge, but I asked a question in
the very beginning that was apparently ignored:

  Please provide at least one example (preferably more than one) of a
  real-life use case where these changes get in the way.

Without an answer to that, I cannot see why we have to do anything
about this issue, because up front I see no problem here at all, not
one that has been spelled out.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 30 Mar 2018 04:02:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 30 00:02:02 2018
Received: from localhost ([127.0.0.1]:59246 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f1lEo-0001Gp-9Z
	for submit <at> debbugs.gnu.org; Fri, 30 Mar 2018 00:02:02 -0400
Received: from aserp2120.oracle.com ([141.146.126.78]:49544)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1f1lEl-0001GN-Tr
 for 30938 <at> debbugs.gnu.org; Fri, 30 Mar 2018 00:02:00 -0400
Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1])
 by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2U3xcCg149235;
 Fri, 30 Mar 2018 04:01:52 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=1nXG5ZsKpLzqaetjFCL7WhdLDK78kYXqdiG9kfuPCwQ=;
 b=ha81+fT9/qDpM2sd0Zb2O6QYIzid6xZ8vamoEqa/INFBt8IRY2UFFO7a/FApyBBOf96N
 z8znIx+DmN0ldY6GyPf4semsIL36dF/2O5s0E6m99Ovc1xBKE6Dp13njbdGdgEnsElt5
 xwu6WD2YJqqaYSexNOtYYSSf49Dhxj4zABB//Xw560mI07ZfzCm+wdewIDC3MASX+Mx8
 vrTz6CIDHB2wzVADyLqt0bq6AUWJSg3sDzolpT09Op1KVqqIIJAb6YtTzyJeXXdnsnvd
 4BEVEp/zyl6jsluVrxkMn6GehLdaJmKK3iNQZXogDAG+cF5C3EI8BzvxxB6ZotpQUjMU 7w== 
Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233])
 by aserp2120.oracle.com with ESMTP id 2h1dtq804j-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 30 Mar 2018 04:01:52 +0000
Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72])
 by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w2U41oVl001245
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 30 Mar 2018 04:01:51 GMT
Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20])
 by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w2U41oIl011287;
 Fri, 30 Mar 2018 04:01:50 GMT
MIME-Version: 1.0
Message-ID: <073d8109-fb1e-44c0-9565-fed5e8a59257@default>
Date: Thu, 29 Mar 2018 21:01:49 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Noam Postavsky <npostavs@HIDDEN>, Juri Linkov <juri@HIDDEN>
Subject: RE: bug#30938: 27.0; `dired-do-create-files' etc.: do NOT always
 raise error if no files
References: <7ea429b5-b12e-4639-9d77-11db71504d9c@default>
 <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default>
 <87605g7xpj.fsf@HIDDEN>
 <70149736-0c90-4059-91d0-155144bf4abd@default>
 <87o9j6k5qx.fsf@HIDDEN>
 <CAM-tV-8hs6T-7mY+K0vrybTGVvMabTvW2EpOA+-4JvAMJULCXw@HIDDEN>
In-Reply-To: <CAM-tV-8hs6T-7mY+K0vrybTGVvMabTvW2EpOA+-4JvAMJULCXw@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4666.0 (x86)]
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8847
 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=549
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.0.1-1711220000 definitions=main-1803300029
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 30938
Cc: 30938 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

> > Don't you see there is something wrong in adding the same INTERACTIVEP
> > arg to all these 13 commands and possibly to more 15 other commands?
>=20
> The parameter should be named THROW-ERROR-P, then it's clear that
> there is nothing wrong with it, all commands just happen to share this
> interface feature: they may throw error, or not.
> (and they can still work correctly if called non-interactively from
> some other interactive command)

Actually, as you can see from the change log I cited,
I call the optional arg for `dired-get-marked-files'
ERROR-IF-NONE-P (which is better than THROW-ERROR-P,
which doesn't say what the error is about).

That's precisely what that optional arg means for
`dired-get-marked-files'.  And it will only ever
mean that, no doubt.

However, for the individual commands that call that
function, the arg can be called either that or just
INTERACTIVEP.

Yes, it is the case _currently_ that in those commands
distinguishing the interactive case is used only in the
call to `dired-get-marked-files', i.e., only to make it
raise the corner-case error, so far.  So I'm OK with
calling the arg ERROR-IF-NONE-P there also.  I'm also
OK with calling it INTERACTIVEP there.

In neither place should it be called THROW-ERROR-P, IMO.
But as long as the problem gets fixed I don't really care
much about the parameter name.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 30 Mar 2018 04:01:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 30 00:01:56 2018
Received: from localhost ([127.0.0.1]:59242 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f1lEi-0001GQ-0j
	for submit <at> debbugs.gnu.org; Fri, 30 Mar 2018 00:01:56 -0400
Received: from userp2120.oracle.com ([156.151.31.85]:42288)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1f1lEf-0001GC-K6
 for 30938 <at> debbugs.gnu.org; Fri, 30 Mar 2018 00:01:54 -0400
Received: from pps.filterd (userp2120.oracle.com [127.0.0.1])
 by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2U3gwcI006630;
 Fri, 30 Mar 2018 04:01:47 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=0uXyWm0eRLAoLOajO8ZpDBq43x/JPfFQ3YpUA2FdKxU=;
 b=dEGOnQmRzVZG2XouP58zlcyLeZ1CEanKhDe5vmJNTSz3SVo+E5InfhAb4/dpG4t7uxY2
 AyyxH6ghdp4eQoDb1oXLe6bhgU2ea15ro1Bc1I2upLcL17kYpPKre4nBIadQLTiPXkDg
 msUqTNP6I3+yDEetpderPOR/mx8tUdFbvImRPHGZL1oMDJDZofwuHURVfqqAXprdH7vu
 cY2zA8HGbxYAxRqdo46LI35pdyudQgCTOP9lzHyO4Fe3QIguYwcXvmsbhetU1S8cph4i
 x9lT0hRPRcRDJA629hDKTN9AjVrTLbZ7z/RP9epGK8CMHgmIF0X3B8t3cEUD7i6Br4yT Rw== 
Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74])
 by userp2120.oracle.com with ESMTP id 2h1djrg0va-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 30 Mar 2018 04:01:47 +0000
Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75])
 by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w2U41klG032614
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 30 Mar 2018 04:01:46 GMT
Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20])
 by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w2U41jvv015133;
 Fri, 30 Mar 2018 04:01:46 GMT
MIME-Version: 1.0
Message-ID: <8111e8b0-a7fb-4de4-9371-fd69c74c46e5@default>
Date: Thu, 29 Mar 2018 21:01:44 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: RE: bug#30938: 27.0; `dired-do-create-files' etc.: do NOT always
 raise error if no files
References: <7ea429b5-b12e-4639-9d77-11db71504d9c@default>
 <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default>
 <87605g7xpj.fsf@HIDDEN>
 <70149736-0c90-4059-91d0-155144bf4abd@default>
 <87o9j6k5qx.fsf@HIDDEN>
In-Reply-To: <87o9j6k5qx.fsf@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4666.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8847
 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-1803300029
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 30938
Cc: 30938 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

> > Emacs has already updated those 13 commands (there's one
> > also in dired-x.el) to add the 5th arg to their calls to
> > `dired-get-marked-files'.  The only further change needed
> > is to pass that arg as non-nil only when the command is
> > called interactively.  It is only in the interactive case
> > that we can know (assume) that such an error should be
> > raised.
>=20
> Don't you see there is something wrong in adding the same INTERACTIVEP
> arg to all these 13 commands and possibly to more 15 other commands?
> What I'm asking for is an alternative, e.g. to detect if the command is
> called interactively and raise an error only in this case.

Instead of asking me if I don't see there is something
wrong with that, why don't you tell us what you think
is wrong with it?

I said from the beginning:

  Please revert this change as soon as possible,
  while you look for a better way to do what you
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  intended to do for it.

I'm open to other ways to do what is needed, if they
are better.  Feel free to propose something.

I'm fine with what I proposed - either proposal:

1. What I proposed at the outset: revert the bad change
   and do nothing until a better approach is decided on.

2. What I proposed in my follow-up: provide an INTERACTIVEP
   arg to distinguish interactive use, and (at most) raise
   a `user-error' only in the interactive-call case.

You asked if there was a better approach than doing #2.
I replied that #2 seems fine, to me.  But please feel free
to propose another approach, explaining why you think it's
better.

Someone apparently thought it was OK to change 13 commands
to ALWAYS raise an error in the no-files case.  Why are
you shocked to hear that I would be OK with changing those
same commands to not raise the error in the non-interactive
case - IOW, to return them to their longstanding behavior
in that case?

As for the other 15 commands: I don't know whether whoever
changed the 13 also considered the 15 and decided no error
was ever needed in their case.  But if not then the same
attention would be needed for them either to fix them as I
suggested (#2) or to break them as has been done for the
13.

I see no problem at all with having different behavior
when interactive and when not, especially when the only
difference is whether to raise an error in a corner case.

And the way to do that (explicitly recommended in the
manual) to make that distinction is to add an optional
INTERACTIVEP arg.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 29 Mar 2018 20:26:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 29 16:26:02 2018
Received: from localhost ([127.0.0.1]:59086 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f1e7U-0005c3-GU
	for submit <at> debbugs.gnu.org; Thu, 29 Mar 2018 16:26:01 -0400
Received: from mail-oi0-f43.google.com ([209.85.218.43]:36543)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>) id 1f1e7S-0005bp-6R
 for 30938 <at> debbugs.gnu.org; Thu, 29 Mar 2018 16:25:58 -0400
Received: by mail-oi0-f43.google.com with SMTP id t16-v6so6260534oih.3
 for <30938 <at> debbugs.gnu.org>; Thu, 29 Mar 2018 13:25:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc; bh=g0LXqXBe3RQ5Wwc+unYkU9An8yZrWNurzBVqxT9dJFk=;
 b=GjuI/g+W8L8x234ZyzkbFHdKP+n5ldg/EHKGE2yXrdsCRbOweStgnQ9RqTp6d5fHwC
 THpYGphHAA8sPwLOqajqNkLg/3ehOiGcMleBl9ZOnudpIyVyFWQNJcpQz7aF7vFeQ8O/
 lWUJmMRG4wWx5s2ww7HtT2ttCwCTxk7o6oJHO/fyz23/tpUBPeLe/Dk9Z0f9NHELKfES
 ppQbffGmBpgdAbnftzbohwQklKK2D7Mk+EElUohXOejKWymdEbJOITR/kG5w8MSkG/cb
 wrnMNYFRxvuLDkWdHBS0uwGsSsnP72KDk21NEZlnWUtERc1UuWpco8rNgOfd0XE1pUGw
 pGPw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=g0LXqXBe3RQ5Wwc+unYkU9An8yZrWNurzBVqxT9dJFk=;
 b=kMtxu4NbZBwS+z3OGVerkkg1j25VgKka+g5lRH3OpdQWa3Ux3kBwefgZBcgehx4vIk
 I3AoDwk8pGh+dJ2LfKQzwvCV8iErHXj9oqU1iJdOv52SCnBXCu/SRYZjUAXObT+oXLuB
 tDrdlvIzKOX/4H0STHJFbMAyl/fv2/RPPoLYWJXCrdcjSqbOU7FoA1xDoNhE6c0PQuq2
 3ZWgGLWn1B1Mgaa7860vga1fIYbomNNhOM9hlRE6D5GIID+Jt3inK3cK6geD8pkYm9Bu
 3mZK5FY/9FmuXUoJw+5BqJn28D747U984Z87TPVx0vHADh+Q3IMtCgqHM2w+zpyYy/8R
 zrcw==
X-Gm-Message-State: AElRT7HF4SS4dUAYZ6FISUbt/x6ozFPj7yJ+qUgKEPpK3UHHl/HebJzJ
 ijSOMkc1gvfEcDSzO6YfN/SKISfOXPTd4IwbuS4=
X-Google-Smtp-Source: AIpwx4/+Uw2eSQKP1c2Tmo9NMtL2wL7DJrhxDdI5NYBWCgVnIb1ciaL2NFAa9BCoI7VKrbyaPDzs3gyDHEMYdxW4W/8=
X-Received: by 10.202.208.84 with SMTP id h81mr5026603oig.330.1522355152566;
 Thu, 29 Mar 2018 13:25:52 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.74.139.213 with HTTP; Thu, 29 Mar 2018 13:25:52 -0700 (PDT)
In-Reply-To: <87o9j6k5qx.fsf@HIDDEN>
References: <7ea429b5-b12e-4639-9d77-11db71504d9c@default>
 <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default>
 <87605g7xpj.fsf@HIDDEN>
 <70149736-0c90-4059-91d0-155144bf4abd@default>
 <87o9j6k5qx.fsf@HIDDEN>
From: Noam Postavsky <npostavs@HIDDEN>
Date: Thu, 29 Mar 2018 16:25:52 -0400
Message-ID: <CAM-tV-8hs6T-7mY+K0vrybTGVvMabTvW2EpOA+-4JvAMJULCXw@HIDDEN>
Subject: Re: bug#30938: 27.0; `dired-do-create-files' etc.: do NOT always
 raise error if no files
To: Juri Linkov <juri@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 30938
Cc: 30938 <at> debbugs.gnu.org, Drew Adams <drew.adams@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

On 29 March 2018 at 16:04, Juri Linkov <juri@HIDDEN> wrote:

> Don't you see there is something wrong in adding the same INTERACTIVEP
> arg to all these 13 commands and possibly to more 15 other commands?

The parameter should be named THROW-ERROR-P, then it's clear that
there is nothing wrong with it, all commands just happen to share this
interface feature: they may throw error, or not.
(and they can still work correctly if called non-interactively from
some other interactive command)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 29 Mar 2018 20:05:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 29 16:05:30 2018
Received: from localhost ([127.0.0.1]:59065 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f1dne-000586-I3
	for submit <at> debbugs.gnu.org; Thu, 29 Mar 2018 16:05:30 -0400
Received: from sub3.mail.dreamhost.com ([69.163.253.7]:53963
 helo=homiemail-a19.g.dreamhost.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1f1dnb-00057v-2a
 for 30938 <at> debbugs.gnu.org; Thu, 29 Mar 2018 16:05:29 -0400
Received: from homiemail-a19.g.dreamhost.com (localhost [127.0.0.1])
 by homiemail-a19.g.dreamhost.com (Postfix) with ESMTP id 28231604076;
 Thu, 29 Mar 2018 13:05:26 -0700 (PDT)
Received: from localhost.linkov.net (m91-129-101-145.cust.tele2.ee
 [91.129.101.145])
 (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
 (No client certificate requested)
 (Authenticated sender: jurta@HIDDEN)
 by homiemail-a19.g.dreamhost.com (Postfix) with ESMTPSA id 4EDA560406B;
 Thu, 29 Mar 2018 13:05:25 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#30938: 27.0;
 `dired-do-create-files' etc.: do NOT always raise error if no files
Organization: LINKOV.NET
References: <7ea429b5-b12e-4639-9d77-11db71504d9c@default>
 <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default>
 <87605g7xpj.fsf@HIDDEN>
 <70149736-0c90-4059-91d0-155144bf4abd@default>
Date: Thu, 29 Mar 2018 23:04:54 +0300
In-Reply-To: <70149736-0c90-4059-91d0-155144bf4abd@default> (Drew Adams's
 message of "Wed, 28 Mar 2018 16:45:50 -0700 (PDT)")
Message-ID: <87o9j6k5qx.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 30938
Cc: 30938 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

> Emacs has already updated those 13 commands (there's one
> also in dired-x.el) to add the 5th arg to their calls to
> `dired-get-marked-files'.  The only further change needed
> is to pass that arg as non-nil only when the command is
> called interactively.  It is only in the interactive case
> that we can know (assume) that such an error should be
> raised.

Don't you see there is something wrong in adding the same INTERACTIVEP
arg to all these 13 commands and possibly to more 15 other commands?
What I'm asking for is an alternative, e.g. to detect if the command is
called interactively and raise an error only in this case.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 28 Mar 2018 23:46:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 28 19:46:00 2018
Received: from localhost ([127.0.0.1]:57761 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f1KlU-0005Bt-F1
	for submit <at> debbugs.gnu.org; Wed, 28 Mar 2018 19:46:00 -0400
Received: from aserp2130.oracle.com ([141.146.126.79]:47672)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1f1KlT-0005Be-Ip
 for 30938 <at> debbugs.gnu.org; Wed, 28 Mar 2018 19:45:59 -0400
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 w2SNTXct080518;
 Wed, 28 Mar 2018 23:45:53 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=kCcq8Xeqlmhpuik6jwc+M/slihwasqtZlnzQevTw1j4=;
 b=Z4uvn2dQVSjFcNvOlaWCUlMcinp/3HG0OXGq7o7TJrzyx52Qz3LhYBPQLf1d1DsabENX
 pQUkL4L0YsNaq0+ZIWdhsFsQ7fhBv/M34HxKBCGNKJuuAkOhOhwElCt3ZCPTAdVaNDKU
 Pabhmz2rNYMSVca+gldT7HoPCh8b9PyafKoc7vX5uuS4T9KSobVbM1w7HaSqs+RusZbc
 vu12Z3zxSiOjP2q2xEQCJrb+r1ySVy1Orqjzf59qOh7ee8nszfy8zy9ZSJ91z7qZMujC
 NLVHIZ2hgJdiJesWNeYOV/372yQM2otZC8zuDFjMrPtI3bLqdQOkqi8PGOF7ujB8eZc6 eg== 
Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71])
 by aserp2130.oracle.com with ESMTP id 2h0ms6818b-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Wed, 28 Mar 2018 23:45:53 +0000
Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235])
 by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w2SNjqOm011314
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Wed, 28 Mar 2018 23:45:52 GMT
Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16])
 by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w2SNjpss023177;
 Wed, 28 Mar 2018 23:45:51 GMT
MIME-Version: 1.0
Message-ID: <70149736-0c90-4059-91d0-155144bf4abd@default>
Date: Wed, 28 Mar 2018 16:45:50 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: RE: bug#30938: 27.0; `dired-do-create-files' etc.: do NOT always
 raise error if no files
References: <7ea429b5-b12e-4639-9d77-11db71504d9c@default>
 <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default>
 <87605g7xpj.fsf@HIDDEN>
In-Reply-To: <87605g7xpj.fsf@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4666.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8846
 signatures=668695
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-1803280233
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 30938
Cc: 30938 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

> > For example, `dired-do-isearch' could be called non-interactively
> > in a context where it should do nothing (or something else should
> > be done) if there are no marked files.  Something like this is
> > better:
> >
> > (defun dired-do-isearch (&optional interactivep)
> >   "Search for a string through all marked files using Isearch.
> > When invoked interactively, raise an error if no files are marked."
> >   (interactive "p")
> >   (multi-isearch-files
> >    (dired-get-marked-files
> >      nil nil 'dired-nondirectory-p nil interactivep)))
>=20
> Is there a better way than doing the same by adding such a formal arg
> to all 12 affected commands?

Are you asking whether adding an optional INTERACTIVEP arg to
commands that call `dired-get-marked-files', and passing that
as the 5th arg, is better than having them systematically raise
a `user-error' (i.e., even in the non-interactive case) when
`dired-get-marked-files' finds no marked files?

If so, yes; that was the point I was making in that mail.

There is not necessarily any user error - or any error at
all - when no files are marked (e.g., when the function
is called on a non-file-line part of the buffer).

That's what I've done in my code (dired+.el), for example:

;; Updated for Emacs 27-pretest-2 change in dired-get-marked-files signatur=
e.
;;  dired-get-marked-files: Added optional arg ERROR-IF-NONE-P.
;;  diredp-list-marked, diredp-insert-subdirs, dired-do-(i)search(-regexp),
;;  dired-do-query-replace-regexp, dired-do-find-marked-files,
;;  diredp-describe-marked-autofiles:
;;    Added optional arg INTERACTIVEP.
;;    Pass non-nil ERROR-IF-NONE-P to dired-get-marked-files when INTERACTI=
VEP.
;;    (See Emacs bug #30938.)

Emacs has already updated those 13 commands (there's one
also in dired-x.el) to add the 5th arg to their calls to
`dired-get-marked-files'.  The only further change needed
is to pass that arg as non-nil only when the command is
called interactively.  It is only in the interactive case
that we can know (assume) that such an error should be
raised.

[Dunno whether any of the 15 _other_ commands that call
`dired-get-marked-files' need similar treatment, i.e.,
those where NO 5th arg is passed yet (in dired.el,
image-dired.el, epa-dired.el, thumbs.el, and message.el).]





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 28 Mar 2018 20:29:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 28 16:29:07 2018
Received: from localhost ([127.0.0.1]:57697 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f1Hgx-0000j2-On
	for submit <at> debbugs.gnu.org; Wed, 28 Mar 2018 16:29:07 -0400
Received: from sub3.mail.dreamhost.com ([69.163.253.7]:49154
 helo=homiemail-a21.g.dreamhost.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1f1Hgv-0000it-Lu
 for 30938 <at> debbugs.gnu.org; Wed, 28 Mar 2018 16:29:06 -0400
Received: from homiemail-a21.g.dreamhost.com (localhost [127.0.0.1])
 by homiemail-a21.g.dreamhost.com (Postfix) with ESMTP id BE4561C0065;
 Wed, 28 Mar 2018 13:29:04 -0700 (PDT)
Received: from localhost.linkov.net (m91-129-101-145.cust.tele2.ee
 [91.129.101.145])
 (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
 (No client certificate requested)
 (Authenticated sender: jurta@HIDDEN)
 by homiemail-a21.g.dreamhost.com (Postfix) with ESMTPSA id CBE6D1C0058;
 Wed, 28 Mar 2018 13:29:03 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#30938: 27.0;
 `dired-do-create-files' etc.: do NOT always raise error if no files
Organization: LINKOV.NET
References: <7ea429b5-b12e-4639-9d77-11db71504d9c@default>
 <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default>
Date: Wed, 28 Mar 2018 23:27:04 +0300
In-Reply-To: <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default> (Drew Adams's
 message of "Sun, 25 Mar 2018 09:45:57 -0700 (PDT)")
Message-ID: <87605g7xpj.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 30938
Cc: 30938 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

> For example, `dired-do-isearch' could be called non-interactively
> in a context where it should do nothing (or something else should
> be done) if there are no marked files.  Something like this is
> better:
>
> (defun dired-do-isearch (&optional interactivep)
>   "Search for a string through all marked files using Isearch.
> When invoked interactively, raise an error if no files are marked."
>   (interactive "p")
>   (multi-isearch-files
>    (dired-get-marked-files
>      nil nil 'dired-nondirectory-p nil interactivep)))

Is there a better way than doing the same by adding such a formal arg
to all 12 affected commands?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 25 Mar 2018 16:50:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 25 12:50:43 2018
Received: from localhost ([127.0.0.1]:53143 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f08qx-0004FN-Iu
	for submit <at> debbugs.gnu.org; Sun, 25 Mar 2018 12:50:43 -0400
Received: from eggs.gnu.org ([208.118.235.92]:52986)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1f08qw-0004F9-7w
 for 30938 <at> debbugs.gnu.org; Sun, 25 Mar 2018 12:50:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1f08qn-0006Cw-Vl
 for 30938 <at> debbugs.gnu.org; Sun, 25 Mar 2018 12:50:37 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42235)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1f08qn-0006Cm-Rx; Sun, 25 Mar 2018 12:50:33 -0400
Received: from [176.228.60.248] (port=1960 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1f08qn-0001o9-Ac; Sun, 25 Mar 2018 12:50:33 -0400
Date: Sun, 25 Mar 2018 19:50:41 +0300
Message-Id: <83zi2wf6am.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
In-reply-to: <7ea429b5-b12e-4639-9d77-11db71504d9c@default> (message from Drew
 Adams on Sun, 25 Mar 2018 09:36:08 -0700 (PDT))
Subject: Re: bug#30938: 27.0;
 `dired-do-create-files' etc.: do NOT always raise error if no files
References: <7ea429b5-b12e-4639-9d77-11db71504d9c@default>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 30938
Cc: 30938 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Date: Sun, 25 Mar 2018 09:36:08 -0700 (PDT)
> From: Drew Adams <drew.adams@HIDDEN>
> 
> The bug is that calls to `dired-get-marked-files' have been changed all
> over the place to systematically pass a non-nil value for optional arg
> ERROR.  In general, this is completely inappropriate when the command
> invoking `dired-get-marked-files' is not called interactively.
> 
> There is NO reason to suppose that a `user-error' occurred when a given
> command is invoked non-interactively.
> 
> The logic behind this change is wrong - much too simplistic.  A non-nil
> ERROR arg should perhaps be passed when called from some commands, but
> typically only when such a command is called interactively.  Only then
> might Emacs legitimately assume (and even this is arguable, in general)
> that the user has committed an error.

Please provide at least one example (preferably more than one) of a
real-life use case where these changes get in the way.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at 30938 <at> debbugs.gnu.org:


Received: (at 30938) by debbugs.gnu.org; 25 Mar 2018 16:46:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 25 12:46:07 2018
Received: from localhost ([127.0.0.1]:53135 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f08mV-00048s-Is
	for submit <at> debbugs.gnu.org; Sun, 25 Mar 2018 12:46:07 -0400
Received: from aserp2130.oracle.com ([141.146.126.79]:53622)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1f08mT-000489-Iz
 for 30938 <at> debbugs.gnu.org; Sun, 25 Mar 2018 12:46:05 -0400
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 w2PGUjMQ047211
 for <30938 <at> debbugs.gnu.org>; Sun, 25 Mar 2018 16:45:59 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : subject : references :
 in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26;
 bh=oGbTxby5gSQUo86eZWo6RtaYeDABqVXelW1zk3P3Uhg=;
 b=QYR7AiVwMgmFqaSRZW2V21X+7b3rkcooOtAD1I4fX0wdgZGtZvPY5qFaJx1wR92cv38B
 qv1D3oC3mZfvZ61Rm32JYh75JKHlHox/zbnOoNpPn12iUMDej1na/8IPhD7rwUZ5Qlco
 GWbudqio3VTcV8C+SVVRZ1UdEHMFDYxdsKt1IkeLxfQ4aElAGJEoFS5LfEuliJzVkOKS
 9z16dvl5H5Nb8wlag5XrEfHs8M3FdoYPqY05+gLTPcfe8rOULalW3Q1yku3IHOCtCp3Y
 20uvlWeI8bTP7Qrs0splp0K8/TYZ9Ix8BLtWXD48XCpOYZ4WfydenpnVsGKBZB29BUDU oQ== 
Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71])
 by aserp2130.oracle.com with ESMTP id 2gxf5r01fv-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK)
 for <30938 <at> debbugs.gnu.org>; Sun, 25 Mar 2018 16:45:59 +0000
Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236])
 by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w2PGjwoU021192
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK)
 for <30938 <at> debbugs.gnu.org>; Sun, 25 Mar 2018 16:45:58 GMT
Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23])
 by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w2PGjvO2007019
 for <30938 <at> debbugs.gnu.org>; Sun, 25 Mar 2018 16:45:58 GMT
MIME-Version: 1.0
Message-ID: <d63f9dfd-b1b4-4b0f-937e-adade097bba8@default>
Date: Sun, 25 Mar 2018 09:45:57 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: 30938 <at> debbugs.gnu.org
Subject: RE: bug#30938: 27.0; `dired-do-create-files' etc.: do NOT always
 raise error if no files
References: <7ea429b5-b12e-4639-9d77-11db71504d9c@default>
In-Reply-To: <7ea429b5-b12e-4639-9d77-11db71504d9c@default>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4666.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8843
 signatures=668695
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=13
 malwarescore=0
 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=506
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.0.1-1711220000 definitions=main-1803250197
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 30938
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

For example, `dired-do-isearch' could be called non-interactively
in a context where it should do nothing (or something else should
be done) if there are no marked files.  Something like this is
better:

(defun dired-do-isearch (&optional interactivep)
  "Search for a string through all marked files using Isearch.
When invoked interactively, raise an error if no files are marked."
  (interactive "p")
  (multi-isearch-files
   (dired-get-marked-files
     nil nil 'dired-nondirectory-p nil interactivep)))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Mar 2018 16:36:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 25 12:36:26 2018
Received: from localhost ([127.0.0.1]:53130 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f08d8-0003ui-GF
	for submit <at> debbugs.gnu.org; Sun, 25 Mar 2018 12:36:26 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47365)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1f08d6-0003uT-Iu
 for submit <at> debbugs.gnu.org; Sun, 25 Mar 2018 12:36:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1f08d0-0007EY-Bg
 for submit <at> debbugs.gnu.org; Sun, 25 Mar 2018 12:36:19 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:46583)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <drew.adams@HIDDEN>)
 id 1f08d0-0007Du-95
 for submit <at> debbugs.gnu.org; Sun, 25 Mar 2018 12:36:18 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38335)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1f08cy-000172-W7
 for bug-gnu-emacs@HIDDEN; Sun, 25 Mar 2018 12:36:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1f08cu-000782-Vk
 for bug-gnu-emacs@HIDDEN; Sun, 25 Mar 2018 12:36:17 -0400
Received: from userp2130.oracle.com ([156.151.31.86]:49050)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <drew.adams@HIDDEN>)
 id 1f08cu-00075Q-Ku
 for bug-gnu-emacs@HIDDEN; Sun, 25 Mar 2018 12:36:12 -0400
Received: from pps.filterd (userp2130.oracle.com [127.0.0.1])
 by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2PGU9Vs191357
 for <bug-gnu-emacs@HIDDEN>; Sun, 25 Mar 2018 16:36:10 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : subject : content-type :
 content-transfer-encoding; s=corp-2017-10-26;
 bh=vwT1jUhTgHKtpq+7rBgDXgkKx5lGcJ2NdG/+TYyLtB4=;
 b=VFhRwUThb7rO8C+WRsEAJKsAds+Nu0G7dqkG+SoONNsi9fByiRX1sZGpSooIDjpo6nSo
 4vD2eFtxWPB5YKSVfdgCLdjuT0Y+prfJtb69xswAnrz26SkWKyyJoNvrAB/AP+6+9TiF
 nZWcsvv7q5WsMln6SU19gn1yijL6dEPzQ94dYHVbX1W5PT3UG0z7cxMAXbixuZWYchNs
 s/gb/jcC4W38sItpS/+ZgeQo6VDp6K5WGqST3f064SaO7rohDd41PAsey8FQhMPwm7BI
 Hov9+hHIMSL59bZoG7Zn6zaIj57Z3RQzJSNRPQe2A/m9r1KzVa75Ctp9Jd8z7tNwh4UG 6Q== 
Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233])
 by userp2130.oracle.com with ESMTP id 2gxf5r8123-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK)
 for <bug-gnu-emacs@HIDDEN>; Sun, 25 Mar 2018 16:36:09 +0000
Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235])
 by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w2PGa9sH009837
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK)
 for <bug-gnu-emacs@HIDDEN>; Sun, 25 Mar 2018 16:36:09 GMT
Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23])
 by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w2PGa8jq030048
 for <bug-gnu-emacs@HIDDEN>; Sun, 25 Mar 2018 16:36:09 GMT
MIME-Version: 1.0
Message-ID: <7ea429b5-b12e-4639-9d77-11db71504d9c@default>
Date: Sun, 25 Mar 2018 09:36:08 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 27.0; `dired-do-create-files' etc.: do NOT always raise error if no
 files
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4666.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8843
 signatures=668695
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1
 malwarescore=0
 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=869
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.0.1-1711220000 definitions=main-1803250197
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

Emacs 27 has introduced an unfortunate incompatible change.

It has added an extra optional arg, ERROR, to `dired-get-marked-files',
which is fine.

The bug is that calls to `dired-get-marked-files' have been changed all
over the place to systematically pass a non-nil value for optional arg
ERROR.  In general, this is completely inappropriate when the command
invoking `dired-get-marked-files' is not called interactively.

There is NO reason to suppose that a `user-error' occurred when a given
command is invoked non-interactively.

The logic behind this change is wrong - much too simplistic.  A non-nil
ERROR arg should perhaps be passed when called from some commands, but
typically only when such a command is called interactively.  Only then
might Emacs legitimately assume (and even this is arguable, in general)
that the user has committed an error.

Please revert this change as soon as possible, while you look for a
better way to do what you intended to do for it.  Please do not impose
raising such a user error on commands when they are not invoked
interactively.  It is perfectly reasonable for some such commands to be
invoked when there are no marked files, in which case the action should
typically be a no-op - it should not be to raise an error (much less a
"user" error).

In GNU Emacs 27.0.50 (build 3, x86_64-w64-mingw32)
 of 2018-03-21
Repository revision: e70d0c9e66d7a8609450b2889869d16aeb0363b5
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --without-dbus --host=3Dx86_64-w64-mingw32
 --without-compress-install -C 'CFLAGS=3D-O2 -static -g3''




Acknowledgement sent to Drew Adams <drew.adams@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#30938; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.