* bug#20790: Add more S-SPC key bindings
@ 2015-06-11 23:36 Juri Linkov
2015-11-12 20:54 ` Juri Linkov
2015-11-12 23:51 ` Random832
0 siblings, 2 replies; 7+ messages in thread
From: Juri Linkov @ 2015-06-11 23:36 UTC (permalink / raw)
To: 20790
After adding S-SPC to some modes in bug#2145
it's natural to expect S-SPC to be the reverse of SPC
to move in opposite direction, but in modes where SPC
moves point by one line, S-SPC unexpectedly moves back
a full screen (because it uses the default binding
scroll-down-command in special-mode). This patch
binds S-SPC to line-oriented commands.
diff --git a/lisp/dired.el b/lisp/dired.el
index 02946e0..babdf35 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1541,7 +1541,8 @@ (defvar dired-mode-map
(define-key map "<" 'dired-prev-dirline)
(define-key map ">" 'dired-next-dirline)
(define-key map "^" 'dired-up-directory)
- (define-key map " " 'dired-next-line)
+ (define-key map " " 'dired-next-line)
+ (define-key map [?\S-\ ] 'dired-previous-line)
(define-key map [remap next-line] 'dired-next-line)
(define-key map [remap previous-line] 'dired-previous-line)
;; hiding
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index eb03a8b..87f1e05 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -271,6 +271,7 @@ (defvar vc-dir-mode-map
(define-key map " " 'vc-dir-next-line)
(define-key map "\t" 'vc-dir-next-directory)
(define-key map "p" 'vc-dir-previous-line)
+ (define-key map [?\S-\ ] 'vc-dir-previous-line)
(define-key map [backtab] 'vc-dir-previous-directory)
;;; Rebind paragraph-movement commands.
(define-key map "\M-}" 'vc-dir-next-directory)
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index 4df41b5..44d9a21 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -395,6 +395,7 @@ (defvar archive-mode-map
(define-key map "o" 'archive-extract-other-window)
(define-key map "p" 'archive-previous-line)
(define-key map "\C-p" 'archive-previous-line)
+ (define-key map [?\S-\ ] 'archive-previous-line)
(define-key map [up] 'archive-previous-line)
(define-key map "r" 'archive-rename-entry)
(define-key map "u" 'archive-unflag)
diff --git a/lisp/proced.el b/lisp/proced.el
index 69355ab..65bd243 100644
--- a/lisp/proced.el
+++ b/lisp/proced.el
@@ -463,6 +463,7 @@ (defvar proced-mode-map
(define-key km "\C-n" 'next-line)
(define-key km "\C-p" 'previous-line)
(define-key km "\C-?" 'previous-line)
+ (define-key km [?\S-\ ] 'previous-line)
(define-key km [down] 'next-line)
(define-key km [up] 'previous-line)
;; marking
^ permalink raw reply related [flat|nested] 7+ messages in thread
* bug#20790: Add more S-SPC key bindings
2015-06-11 23:36 bug#20790: Add more S-SPC key bindings Juri Linkov
@ 2015-11-12 20:54 ` Juri Linkov
2015-11-12 23:51 ` Random832
1 sibling, 0 replies; 7+ messages in thread
From: Juri Linkov @ 2015-11-12 20:54 UTC (permalink / raw)
To: 20790-done
> After adding S-SPC to some modes in bug#2145
> it's natural to expect S-SPC to be the reverse of SPC
> to move in opposite direction, but in modes where SPC
> moves point by one line, S-SPC unexpectedly moves back
> a full screen (because it uses the default binding
> scroll-down-command in special-mode). This patch
> binds S-SPC to line-oriented commands.
Pushed.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: bug#20790: Add more S-SPC key bindings
2015-06-11 23:36 bug#20790: Add more S-SPC key bindings Juri Linkov
2015-11-12 20:54 ` Juri Linkov
@ 2015-11-12 23:51 ` Random832
2015-11-13 0:53 ` Emanuel Berg
2015-11-13 2:19 ` Stefan Monnier
1 sibling, 2 replies; 7+ messages in thread
From: Random832 @ 2015-11-12 23:51 UTC (permalink / raw)
To: help-gnu-emacs
Juri Linkov <juri@linkov.net> writes:
> After adding S-SPC to some modes in bug#2145
> it's natural to expect S-SPC to be the reverse of SPC
> to move in opposite direction, but in modes where SPC
> moves point by one line, S-SPC unexpectedly moves back
> a full screen (because it uses the default binding
> scroll-down-command in special-mode). This patch
> binds S-SPC to line-oriented commands.
On the subject of S-SPC - I configured my terminal emulator to emit
"\e[27;2;32~" (the same escape sequence that xterm emits in some mode),
and added this to my init.el:
(define-key input-decode-map "^[[27;2;32~" (kbd "S-SPC"))
And it "works" (I don't get escape sequence junk when I type it), but
"doesn't work" in that all it ever seems to do is insert space, and
C-h k thinks I've typed SPC with no hint of it being translated from
anything else.
Anyone know what I'm doing wrong?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: bug#20790: Add more S-SPC key bindings
2015-11-12 23:51 ` Random832
@ 2015-11-13 0:53 ` Emanuel Berg
2015-11-13 2:52 ` Random832
2015-11-13 2:19 ` Stefan Monnier
1 sibling, 1 reply; 7+ messages in thread
From: Emanuel Berg @ 2015-11-13 0:53 UTC (permalink / raw)
To: help-gnu-emacs
Random832 <random832@fastmail.com> writes:
> On the subject of S-SPC - I configured my terminal
> emulator to emit "\e[27;2;32~" (the same escape
> sequence that xterm emits in some mode), and added
> this to my init.el:
>
> (define-key input-decode-map "^[[27;2;32~" (kbd
> "S-SPC"))
>
> And it "works" (I don't get escape sequence junk
> when I type it), but "doesn't work" in that all it
> ever seems to do is insert space, and C-h k thinks
> I've typed SPC with no hint of it being translated
> from anything else.
>
> Anyone know what I'm doing wrong?
Mine look like this:
(define-key input-decode-map [?\u0110] [C-0])
and yes, it should say it is translated:
<C-0> (translated from ...) is undefined
I once wrote a tutorial how to do this in the ttys:
http://user.it.uu.se/~embe8573/tty-emacs-keys.txt
but with xterm I don't know.
Either it is a notational issue - try something else
(something simpler), just to see if the translation
stuff works - either that, or it is something else.
:)
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: bug#20790: Add more S-SPC key bindings
2015-11-13 0:53 ` Emanuel Berg
@ 2015-11-13 2:52 ` Random832
2015-11-13 3:11 ` Emanuel Berg
0 siblings, 1 reply; 7+ messages in thread
From: Random832 @ 2015-11-13 2:52 UTC (permalink / raw)
To: help-gnu-emacs
Emanuel Berg <embe8573@student.uu.se> writes:
> Mine look like this:
>
> (define-key input-decode-map [?\u0110] [C-0])
Yes, but like you said in your tutorial, that's an arbitrary name. It's
not the real C-0, that'd be [?\C-0] == [#x4000030].
I found my issue, though. I'd been _assuming_ that Gnus sets a binding
for S-SPC to gnus-summary-prev-page/gnus-article-goto-prev-page, when in
reality it apparently doesn't. If I set a global binding on [?\S-\ ], it
works (fsvo. "works" - now I need to figure out how to add a binding to
Gnus for it.)
It is a bit annoying that I don't get the "translated from" notation in
C-h k, though. Led me down a bit of a false path in determining what the
problem was.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: bug#20790: Add more S-SPC key bindings
2015-11-13 2:52 ` Random832
@ 2015-11-13 3:11 ` Emanuel Berg
0 siblings, 0 replies; 7+ messages in thread
From: Emanuel Berg @ 2015-11-13 3:11 UTC (permalink / raw)
To: help-gnu-emacs
Random832 <random832@fastmail.com> writes:
> Yes, but like you said in your tutorial, that's an
> arbitrary name. It's not the real C-0, that'd be
> [?\C-0] == [#x4000030].
Yeah, no, that was just an example, so it is even more
arbitrary. I mean the unicode notation what the
virtual terminal is sending (in this case [?\u0110])
looks much simpler than what you had, so perhaps there
was an issue of notation where some char got out of
place compared to how it looked with xterm.
> I found my issue, though. I'd been _assuming_ that
> Gnus sets a binding for S-SPC to
> gnus-summary-prev-page/gnus-article-goto-prev-page,
> when in reality it apparently doesn't. If I set
> a global binding on [?\S-\ ], it works (fsvo.
> "works" - now I need to figure out how to add
> a binding to Gnus for it.)
Aha, cool.
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: bug#20790: Add more S-SPC key bindings
2015-11-12 23:51 ` Random832
2015-11-13 0:53 ` Emanuel Berg
@ 2015-11-13 2:19 ` Stefan Monnier
1 sibling, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2015-11-13 2:19 UTC (permalink / raw)
To: help-gnu-emacs
> And it "works" (I don't get escape sequence junk when I type it), but
> "doesn't work" in that all it ever seems to do is insert space, and
> C-h k thinks I've typed SPC with no hint of it being translated from
> anything else.
> Anyone know what I'm doing wrong?
Have you bound S-SPC to a command? If not, then Emacs will
automatically try to strip the shift modifier to find a valid command.
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-11-13 3:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-11 23:36 bug#20790: Add more S-SPC key bindings Juri Linkov
2015-11-12 20:54 ` Juri Linkov
2015-11-12 23:51 ` Random832
2015-11-13 0:53 ` Emanuel Berg
2015-11-13 2:52 ` Random832
2015-11-13 3:11 ` Emanuel Berg
2015-11-13 2:19 ` Stefan Monnier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.