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:08:43 +0200 Organization: LINKOV.NET Message-ID: <87eetzah2s.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="1842"; 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:10: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 1jBowv-0000Ng-TA for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Mar 2020 01:10:14 +0100 Original-Received: from localhost ([::1]:42034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBowu-0002rX-GM for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 10 Mar 2020 20:10:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53241) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBowl-0002rK-Jy for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2020 20:10:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jBowk-0001mG-Fi for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2020 20:10:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47500) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jBowk-0001m6-CT for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2020 20:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jBowk-0000Tg-6K for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2020 20:10:02 -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:10:02 +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.15838853631767 (code B ref 39902); Wed, 11 Mar 2020 00:10:02 +0000 Original-Received: (at 39902) by debbugs.gnu.org; 11 Mar 2020 00:09:23 +0000 Original-Received: from localhost ([127.0.0.1]:53470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jBow6-0000SR-Pb for submit@debbugs.gnu.org; Tue, 10 Mar 2020 20:09:22 -0400 Original-Received: from cheetah.birch.relay.mailchannels.net ([23.83.209.34]:29197) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jBow1-0000SF-Kn for 39902@debbugs.gnu.org; Tue, 10 Mar 2020 20:09:21 -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 852911A23EC; Wed, 11 Mar 2020 00:09:16 +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 0E2FB1A2328; Wed, 11 Mar 2020 00:09:16 +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:09:16 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Illustrious-Shade: 7c88a38071a73cce_1583885356308_3806740183 X-MC-Loop-Signature: 1583885356308:1624362732 X-MC-Ingress-Time: 1583885356308 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 9F9E684228; Tue, 10 Mar 2020 17:09:10 -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=47F7sN9w/GC90UVzfcUN74GWn1Q=; b= P53Oy2DL8+Ah6qamE86jsYJsa7nYRS3HmoozxERP1YufZ4VBvx2PGdSmu88YQdgF rE+LGnHMVgUZJVfp1AXase3OOLteVHAHyXSWdEmbIx8eO9K5rQaXTOcQPLXX5NNI /Fn6tQ5mCY99fOrI44ZEHa3GeS7iqS4OoRIRtPav1os= 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 F142084218; Tue, 10 Mar 2020 17:09:07 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a72 In-Reply-To: <87a74n4vet.fsf@web.de> (Michael Heerdegen's message of "Wed, 11 Mar 2020 00:55:38 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedugedruddvuddgudejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdejrdeiheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtjedrieehpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepmhhitghhrggvlhgphhgvvghruggvghgvnhesfigvsgdruggv 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:177160 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: diff --git a/lisp/dired.el b/lisp/dired.el index a4de51f609..486a8213c8 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 + (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)))