help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to bind isearch-repeat-forward to F3 in a certain mode only?


From: Hikaru Ichijyo
Subject: Re: How to bind isearch-repeat-forward to F3 in a certain mode only?
Date: Wed, 29 Jul 2015 20:48:55 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Ian Zimmerman <itz@buug.org> writes:

> On 2015-07-29 19:23 -0500, Hikaru Ichijyo wrote:
>
>> > That's why many of my private bindings start with C-z.
>> 
>> Most of my private key bindings are setup on the "super" key, which is
>> the Windows key in X11 on Linux (on an x86 keyboard).  I never use the
>> Windows key for anything else, and Emacs seems to have done nothing with
>> it but make it the "super" from the days of space cadet keyboards, so
>> it's been pretty safe.  I've never seen anything else use an "s-"
>> binding but me.
>
> But the Super key is a modifier.  Key combinations involving a modifier
> (sometimes called "chords") are appreciably harder to perform, and more
> likely to lead to RSI, than sequences of single keystrokes.  I would
> rate even a 1-2 sequence starting with the dreaded function key as
> easier to type than something like C-h (h is exactly midway between the
> 2 Control keys on my keyboard).
>
> This also applies to C-z, alas.  But at least the components of that
> chord are very close to each other on typical keyboards where I live.

Oh, you want to be able to do it in one keystroke!

Well, for things that I want to make that easy, I just carefully choose
function keys that aren't already being used by something else that I
care about.  (Sorry if you were hoping for some solution other than
f-keys).  For example, I use 'other-window' way too much to be typing
'C-x o' all the time, so I have that bound to 'f6'.  As far as making it
only get mapped in a certain mode, you may have to do something like
I've done below to Gnus:

(add-hook 'gnus-summary-mode-hook (lambda ()
    (local-set-key "D" 'delete-then-read-next)
    (local-set-key "d" 'gnus-summary-put-mark-as-expirable-next)
    (local-set-key "u" 'gnus-summary-clear-mark-forward)
    (local-set-key "x" 'expunge-and-reload)
    (local-set-key "v" 'gnus-article-view-part)
    (local-set-key (kbd "C-a") 'gnus-summary-save-parts)))

I just got into Emacs last year, so I don't know how wise any of the
above is, but it's been working for me so far.  It attaches to the Gnus
summary screen and attaches local key bindings that only work there and
nowhere else.  You may be able to do something similar in your situation.

> Or have you managed to remove the modifier status from the Super key?  I
> tried to do something like that a couple of times and I remember it was
> close to impossible.  That was in the days of xmodmap, though.  I don't
> really expect it to be easier with xkb, but maybe you know more about
> this stuff?

Oh no, I wouldn't think trying to make any modifier key into an ordinary
one sounds like a very good idea.

-- 
He that would make his own liberty secure must guard even his enemy from
oppression; for if he violates this duty, he establishes a precedent
that will reach to himself.
                                        --Thomas Paine


reply via email to

[Prev in Thread] Current Thread [Next in Thread]