unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Barzilay <eli@barzilay.org>
To: 21886@debbugs.gnu.org
Subject: bug#21886: 24.5; `dired-next/previous-line' should have a "^" in their interactive specs
Date: Thu, 12 Nov 2015 03:14:15 -0500	[thread overview]
Message-ID: <22084.19031.711354.826058@lambda.ccs.neu.edu> (raw)

[-- Attachment #1: message body text --]
[-- Type: text/plain, Size: 207 bytes --]

If I bind the up/down arrow keys to `dired-next/previous-line' in
dired mode, they misbehave wrt shift selection.  The following simple
patch fixes this by adding a "^" to their `interactive' declarations.


[-- Attachment #2: 0001-Add-to-the-interactive-specs-of-dired-next-previous-.patch --]
[-- Type: application/octet-stream, Size: 1297 bytes --]

From 195a4881482181443ffcec85e1863881c86edd35 Mon Sep 17 00:00:00 2001
From: Eli Barzilay <eli@barzilay.org>
Date: Thu, 12 Nov 2015 03:07:38 -0500
Subject: [PATCH] Add "^" to the interactive specs of
 `dired-next/previous-line'

It makes sense to bind these commands to the arrow keys, and that means
that they work better with a "^" in the `interactive' declaration so
selection works as expected.
---
 lisp/dired.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/dired.el b/lisp/dired.el
index 5f0a83a..049d45d 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2031,7 +2031,7 @@ Otherwise, toggle `read-only-mode'."
 (defun dired-next-line (arg)
   "Move down lines then position at filename.
 Optional prefix ARG says how many lines to move; default is one line."
-  (interactive "p")
+  (interactive "^p")
   (let ((line-move-visual)
 	(goal-column))
     (line-move arg t))
@@ -2044,7 +2044,7 @@ Optional prefix ARG says how many lines to move; default is one line."
 (defun dired-previous-line (arg)
   "Move up lines then position at filename.
 Optional prefix ARG says how many lines to move; default is one line."
-  (interactive "p")
+  (interactive "^p")
   (dired-next-line (- (or arg 1))))
 
 (defun dired-next-dirline (arg &optional opoint)
-- 
2.6.3


[-- Attachment #3: .signature --]
[-- Type: text/plain, Size: 151 bytes --]


-- 
                    ((x=>x(x))(x=>x(x)))                   Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

             reply	other threads:[~2015-11-12  8:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12  8:14 Eli Barzilay [this message]
2015-11-12  8:39 ` bug#21886: 24.5; `dired-next/previous-line' should have a "^" in their interactive specs Juanma Barranquero
2015-11-12  8:51   ` Eli Barzilay
2015-11-12 11:44     ` Juanma Barranquero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22084.19031.711354.826058@lambda.ccs.neu.edu \
    --to=eli@barzilay.org \
    --cc=21886@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).