[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#39902: 28.0.50; Marking in dired with active region
From: |
Juri Linkov |
Subject: |
bug#39902: 28.0.50; Marking in dired with active region |
Date: |
Wed, 11 Mar 2020 02:08:43 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) |
> 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)))
- bug#39902: 28.0.50; Marking in dired with active region, (continued)
- bug#39902: 28.0.50; Marking in dired with active region, Juri Linkov, 2020/03/08
- bug#39902: 28.0.50; Marking in dired with active region, Drew Adams, 2020/03/08
- bug#39902: 28.0.50; Marking in dired with active region, Michael Heerdegen, 2020/03/09
- bug#39902: 28.0.50; Marking in dired with active region, Juri Linkov, 2020/03/09
- bug#39902: 28.0.50; Marking in dired with active region, Drew Adams, 2020/03/09
- bug#39902: 28.0.50; Marking in dired with active region, Juri Linkov, 2020/03/10
- bug#39902: 28.0.50; Marking in dired with active region, Stephen Berman, 2020/03/10
- bug#39902: 28.0.50; Marking in dired with active region, Juri Linkov, 2020/03/10
- bug#39902: 28.0.50; Marking in dired with active region, Drew Adams, 2020/03/10
- bug#39902: 28.0.50; Marking in dired with active region, Michael Heerdegen, 2020/03/10
- bug#39902: 28.0.50; Marking in dired with active region,
Juri Linkov <=
- bug#39902: 28.0.50; Marking in dired with active region, Juri Linkov, 2020/03/10
- bug#39902: 28.0.50; Marking in dired with active region, Drew Adams, 2020/03/10
- bug#39902: 28.0.50; Marking in dired with active region, Michael Heerdegen, 2020/03/10
- bug#39902: 28.0.50; Marking in dired with active region, Juri Linkov, 2020/03/11
- bug#39902: 28.0.50; Marking in dired with active region, Drew Adams, 2020/03/11
- bug#39902: 28.0.50; Marking in dired with active region, Juri Linkov, 2020/03/12
- bug#39902: 28.0.50; Marking in dired with active region, Pieter van Oostrum, 2020/03/13
- bug#39902: 28.0.50; Marking in dired with active region, Michael Heerdegen, 2020/03/13
- bug#39902: 28.0.50; Marking in dired with active region, Drew Adams, 2020/03/14
- bug#39902: 28.0.50; Marking in dired with active region, Drew Adams, 2020/03/14