unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23642: 24.5; Dired Line Movement, Region Handling
@ 2016-05-28 21:25 Michael Cain
  2016-05-28 23:22 ` Drew Adams
  2016-05-30 21:18 ` Juri Linkov
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Cain @ 2016-05-28 21:25 UTC (permalink / raw)
  To: 23642

(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! :)






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23642: 24.5; Dired Line Movement, Region Handling
  2016-05-28 21:25 bug#23642: 24.5; Dired Line Movement, Region Handling Michael Cain
@ 2016-05-28 23:22 ` Drew Adams
  2016-05-28 23:41   ` Michael Heerdegen
  2016-05-30 21:18 ` Juri Linkov
  1 sibling, 1 reply; 6+ messages in thread
From: Drew Adams @ 2016-05-28 23:22 UTC (permalink / raw)
  To: Michael Cain, 23642

> 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.

What do you mean that it does not work by default.  Is this what you
tried?

C-a    ; To move to bol
C-SPC  ; To activate the region
<down> <down>... ; To extend the region downward.

(Or `C-n' instead of `<down>'.)

What did you try, what did it do, and what did you expect it to do?

> I've temporarily solved this by making wrapper functions around
> `dired-next-line' and `dired-previous-line' that handle the shift
> selection

Were you describing WDired (editable Dired, after `C-x C-q') or
Dired?  In the former, <down> and `C-n' are bound to
`wdired-next-line', not `dired-next-line'.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23642: 24.5; Dired Line Movement, Region Handling
  2016-05-28 23:22 ` Drew Adams
@ 2016-05-28 23:41   ` Michael Heerdegen
  2016-05-29  0:17     ` Michael Cain
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Heerdegen @ 2016-05-28 23:41 UTC (permalink / raw)
  To: Drew Adams; +Cc: 23642, Michael Cain

Drew Adams <drew.adams@oracle.com> writes:

> What did you try, what did it do, and what did you expect it to do?

AFAIU: Setting a region in wdired-mode with shift + arrow keys does not
work as expected.  No region is selected.


Michael.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23642: 24.5; Dired Line Movement, Region Handling
  2016-05-28 23:41   ` Michael Heerdegen
@ 2016-05-29  0:17     ` Michael Cain
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Cain @ 2016-05-29  0:17 UTC (permalink / raw)
  Cc: 23642

I figure I should probably include my current workaround wrapper 
functions, so you can personally examine what I expect to happen.

;; Dired
(defun my-dired-next-line (arg)
   (interactive "^p")
   (dired-next-line arg))

(defun my-dired-previous-line (arg)
   (interactive "^p")
   (dired-previous-line arg))

;; WDired
(defun my-wdired-next-line (arg)
   (interactive "^p")
   (wdired-next-line arg))

(defun my-wdired-previous-line (arg)
   (interactive "^p")
   (wdired-previous-line arg))

;; Bindings
(define-key dired-mode-map (kbd "<down>") #'my-dired-next-line)
(define-key dired-mode-map (kbd "<up>") #'my-dired-previous-line)

(define-key wdired-mode-map (kbd "<down>") #'my-wdired-next-line)
(define-key wdired-mode-map (kbd "<up>") #'my-wdired-previous-line)

With these bindings, the Shift+Arrow selection with Transient Mark mode 
works as I expect with both Dired and WDired.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23642: 24.5; Dired Line Movement, Region Handling
  2016-05-28 21:25 bug#23642: 24.5; Dired Line Movement, Region Handling Michael Cain
  2016-05-28 23:22 ` Drew Adams
@ 2016-05-30 21:18 ` Juri Linkov
  2016-06-05 21:16   ` Juri Linkov
  1 sibling, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2016-05-30 21:18 UTC (permalink / raw)
  To: Michael Cain; +Cc: 23642

> (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





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#23642: 24.5; Dired Line Movement, Region Handling
  2016-05-30 21:18 ` Juri Linkov
@ 2016-06-05 21:16   ` Juri Linkov
  0 siblings, 0 replies; 6+ messages in thread
From: Juri Linkov @ 2016-06-05 21:16 UTC (permalink / raw)
  To: Michael Cain; +Cc: 23642-done

>> (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.

Thanks for the suggestion.  Pushed to master.

> 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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-06-05 21:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-28 21:25 bug#23642: 24.5; Dired Line Movement, Region Handling Michael Cain
2016-05-28 23:22 ` Drew Adams
2016-05-28 23:41   ` Michael Heerdegen
2016-05-29  0:17     ` Michael Cain
2016-05-30 21:18 ` Juri Linkov
2016-06-05 21:16   ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).