From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#39902: 28.0.50; Marking in dired with active region Date: Wed, 11 Mar 2020 02:18:22 +0200 Organization: LINKOV.NET Message-ID: <87zhcn9229.fsf@mail.linkov.net> References: <87d09suras.fsf@web.de> <87tv33r8e2.fsf@mail.linkov.net> <87eeu6hpjf.fsf@web.de> <875zfixuoy.fsf@mail.linkov.net> <87h7z1jadw.fsf@web.de> <87y2sbloaa.fsf@mail.linkov.net> <877dzvgd4l.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="51706"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 39902@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 11 01:20:14 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 1jBp6b-000DMq-Lq for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Mar 2020 01:20:13 +0100 Original-Received: from localhost ([::1]:42086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBp6a-0006G2-NP for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 10 Mar 2020 20:20:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57454) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBp6R-0006DD-0c for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2020 20:20:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jBp6P-0003rS-VM for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2020 20:20:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jBp6P-0003pw-OL for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2020 20:20:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jBp6P-0000i5-JR for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2020 20:20:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Mar 2020 00:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39902 X-GNU-PR-Package: emacs Original-Received: via spool by 39902-submit@debbugs.gnu.org id=B39902.15838859672686 (code B ref 39902); Wed, 11 Mar 2020 00:20:01 +0000 Original-Received: (at 39902) by debbugs.gnu.org; 11 Mar 2020 00:19:27 +0000 Original-Received: from localhost ([127.0.0.1]:53479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jBp5q-0000hE-13 for submit@debbugs.gnu.org; Tue, 10 Mar 2020 20:19:26 -0400 Original-Received: from bird.elm.relay.mailchannels.net ([23.83.212.17]:3699) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jBp5o-0000h6-3u for 39902@debbugs.gnu.org; Tue, 10 Mar 2020 20:19:24 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id C2C991A2444; Wed, 11 Mar 2020 00:19:22 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a72.g.dreamhost.com (100-96-219-35.trex.outbound.svc.cluster.local [100.96.219.35]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 3EBE41A23F6; Wed, 11 Mar 2020 00:19:22 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a72.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Wed, 11 Mar 2020 00:19:22 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Suffer-Whistle: 29fb568454152cc6_1583885962551_1629360096 X-MC-Loop-Signature: 1583885962551:4261997270 X-MC-Ingress-Time: 1583885962550 Original-Received: from pdx1-sub0-mail-a72.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a72.g.dreamhost.com (Postfix) with ESMTP id 8F6DD84231; Tue, 10 Mar 2020 17:19:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=yOh4FXbslutjMN3Js7nBXy7Pu6M=; b= NhxwzAP10yKfjvGlmHq3vdLwnGQUA9/yaGy0Zc7AaRJ+yF0qbKCyp0nkwX+d58dw A0IuYq61h4xIuTRaj0YUcD/rnLu+b6wFJR3LfgG+OueyIrObVmuN4Qyx5qGOYk3z +YldFxblMIfNKq++dbFXpei5NQNzi3hHtkUzksrJ/AY= Original-Received: from mail.jurta.org (m91-129-107-65.cust.tele2.ee [91.129.107.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a72.g.dreamhost.com (Postfix) with ESMTPSA id 9111C84223; Tue, 10 Mar 2020 17:19:14 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a72 In-Reply-To: <87eetzah2s.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 11 Mar 2020 02:08:43 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedugedruddvuddgudelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdejrdeiheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtjedrieehpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepmhhitghhrggvlhgphhgvvghruggvghgvnhesfigvsgdruggv 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:177161 Archived-At: >> OTOH, if point is at the end of the region (in contrast to your >> screenshot), one could be surprised that the file line where the cursor >> is displayed doesn't get marked. > > Right, here is a complete patch that should do the right thing > depending on the new defcustom: Sorry, this patch was a response to another your comment: >> This is a strange corner case. I never used a region like that, I guess >> because I felt that this case is dubious. This means that the patch doesn't handle this strange corner case, but it handles more usual case where point is on the file name: diff --git a/lisp/dired.el b/lisp/dired.el index a4de51f609..420938ef2e 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3578,6 +3578,12 @@ dired-mark-files-in-region (insert dired-marker-char))) (forward-line 1)))) +(defcustom dired-mark-inclusive nil + "Non-nil means `dired-mark' marks file on the region end." + :type 'boolean + :version "28.1" + :group 'dired) + (defun dired-mark (arg &optional interactive) "Mark the file at point in the Dired buffer. If the region is active, mark all files in the region. @@ -3597,7 +3603,11 @@ dired-mark (end (region-end))) (dired-mark-files-in-region (progn (goto-char beg) (line-beginning-position)) - (progn (goto-char end) (line-beginning-position)))))) + (progn (goto-char end) + (if (and dired-mark-inclusive + (or (eolp) (get-text-property (point) 'dired-filename))) + (line-end-position) + (line-beginning-position))))))) ;; Mark subdir files from the subdir headerline. ((dired-get-subdir) (save-excursion (dired-mark-subdir-files)))