From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#39902: 28.0.50; Marking in dired with active region Date: Mon, 23 Mar 2020 08:09:47 -0700 (PDT) Message-ID: <71b84061-b6c4-4fec-b12b-084b2df3c6c3@default> References: <87d09suras.fsf@web.de> <8736aiqu3y.fsf@mail.linkov.net> <7a0a6f19-f958-4b38-beaf-3d60dc8a279f@default> <87d09lb1ts.fsf@mail.linkov.net> <87a74n4vet.fsf@web.de> <87eetzah2s.fsf@mail.linkov.net> <87zhcn9229.fsf@mail.linkov.net> <6d82d04a-db94-4df4-82cc-3ea13a78a4dd@default> <877dzqidzn.fsf@mail.linkov.net> <1e37a524-80d3-445f-8f81-a18539105ac3@default> <87pndhhyvk.fsf@mail.linkov.net> <1ce62594-cc2a-4e95-b2b3-d022fa65decd@default> <87bloybivx.fsf@mail.linkov.net> <0066d43a-5f97-4c9d-a4b7-84c6b0ecf356@default> <87bloxgp9g.fsf@mail.linkov.net> <8736a7ajn5.fsf@web.de> <87fte52pbf.fsf@mail.linkov.net> <87o8sruchv.fsf@mail.linkov.net> <875zexf6l3.fsf@web.de> <4dd30e49-9a6a-4962-a6f2-1a68a41ce5e2@default> <87a747zyru.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="24118"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Michael Heerdegen , 39902@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 23 16:11:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jGOjQ-00069p-BA for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Mar 2020 16:11:12 +0100 Original-Received: from localhost ([::1]:35194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGOjP-00059v-25 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Mar 2020 11:11:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48545) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGOjH-00058M-Fi for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2020 11:11:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGOjG-0004AB-FV for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2020 11:11:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47427) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jGOjG-0004A7-BU for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2020 11:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jGOjG-0004Kj-55 for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2020 11:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Mar 2020 15:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39902 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 39902-submit@debbugs.gnu.org id=B39902.158497620616580 (code B ref 39902); Mon, 23 Mar 2020 15:11:02 +0000 Original-Received: (at 39902) by debbugs.gnu.org; 23 Mar 2020 15:10:06 +0000 Original-Received: from localhost ([127.0.0.1]:53400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jGOiM-0004JL-FJ for submit@debbugs.gnu.org; Mon, 23 Mar 2020 11:10:06 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:56370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jGOiK-0004Ij-H7 for 39902@debbugs.gnu.org; Mon, 23 Mar 2020 11:10:04 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 02NF9GDi117911; Mon, 23 Mar 2020 15:09:56 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-2020-01-29; bh=ES1Odr+WkxMIoJ7NQh6EYtSn8gN3D8s1suw0Ra7fM3I=; b=DbZKGbXmuAuGrAe8sRwQHc90xAYVKZ2l5wa6aMKgaDv5e+oT0jjRzwhqL2GWAjk1vHyi kUTZ/+Uiu6qGNGW6rMsn/pwegfjNE1FIaf2ihjliIB55ytszUf2Hvcat9oxmPVsgoaXk r8SvpGTbD9l9L/r0A0nyWGqIcGSOclxVuzZpcmhfyy+7lIQBEtLVRimNmLKBCycXM02i nPeAb41fIIL7x/MEyHl4aWJ31JHzQ7W6+OGDiCHINvnutjyswCUnQIU7lX9HcextQ6Rs pyBY4t15nr1W2mQzuqJrZeMWuP1PjOnS7EjjwNVf9f/+cSRb6+VCbCO2QG4qA/k8Ype3 CQ== Original-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 2ywavky4rh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 23 Mar 2020 15:09:56 +0000 Original-Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 02NF84Y1167776; Mon, 23 Mar 2020 15:09:56 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3020.oracle.com with ESMTP id 2yxw7fmd7b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 23 Mar 2020 15:09:56 +0000 Original-Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 02NF9mdq011263; Mon, 23 Mar 2020 15:09:49 GMT In-Reply-To: <87a747zyru.fsf@mail.linkov.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4966.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9569 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 spamscore=0 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003230086 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9569 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 priorityscore=1501 mlxscore=0 bulkscore=0 clxscore=1015 impostorscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003230086 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177652 Archived-At: > Sorry, I received your message only after I pushed to master. > But nonetheless, your test cases should be handled carefully. > The simplest solution would be just to disallow the option > `use-empty-active-region' to use the empty region in Dired, > i.e. instead of >=20 > (if (use-region-p) > ... then mark files in the active region ... >=20 > to use >=20 > (if (let ((use-empty-active-region nil)) (use-region-p)) > ... then mark files in the active region ... Yes, that's what I was hinting at: an empty region should always be ignored, i.e., that case should be treated as if the region were not active. A better way to do it than binding that variable (even if it were _not_ a user option) is to just do what one would have done before `use-region-p' was defined: (if (and (region-active-p) (> (region-end) (region-beginning))) ... Really, `use-region-p', although convenient, is error prone. Few use cases really call for being able to use an empty region (non-nil `use-empty-active-region'), and code that deals with the region is much clearer if it says explicitly what it intends for an empty region.