Subject: bug#23642: 24.5; Dired Line Movement, Region Handling

From: Juri Linkov <[email-masked]>
Date: Tue, 31 May 2016 00:18:20 +0300

> (I'm not sure if this is actually a bug or not, just because Dired is
> used so frequently and I assume someone probably would've mentioned it
> by now. Hopefully this feedback will be helpful anyway)
>
> I find myself using the writable feature of Dired rather frequently, but
> one default of Dired's up/down movement (specifically the shift
> selection in Transient Mark mode) is difficult to work around. That is,
> I very often try to hold down shift and proceed down lines to create a
> region, but this doesn't work by default.
>
> I've temporarily solved this by making wrapper functions around
> `dired-next-line' and `dired-previous-line' that handle the shift
> selection, but it also works to add an additional "^" argument to the
> existing "p" in those functions.
>
> Thanks! :)

You are right.  Shift-selection should be supported in WDired by this patch.

BTW, do you think that in WDired it would be more useful to select
rectangular regions because file names are organized in columns.
Then, for example, ‘downcase-region’ and ‘upcase-region’ will work
on the selected regions, not fail are they do now in WDired.

diff --git a/lisp/wdired.el b/lisp/wdired.el
index 2e68bec..600a813 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -590,7 +590,7 @@ (defun wdired-next-line (arg)
   "Move down lines then position at filename or the current column.
 See `wdired-use-dired-vertical-movement'.  Optional prefix ARG
 says how many lines to move; default is one line."
-  (interactive "p")
+  (interactive "^p")
   (with-no-warnings (next-line arg))
   (if (or (eq wdired-use-dired-vertical-movement t)
 	  (and wdired-use-dired-vertical-movement
@@ -603,7 +603,7 @@ (defun wdired-previous-line (arg)
   "Move up lines then position at filename or the current column.
 See `wdired-use-dired-vertical-movement'.  Optional prefix ARG
 says how many lines to move; default is one line."
-  (interactive "p")
+  (interactive "^p")
   (with-no-warnings (previous-line arg))
   (if (or (eq wdired-use-dired-vertical-movement t)
 	  (and wdired-use-dired-vertical-movement