unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tim Johnson <tim@akwebsoft.com>
To: Emacs <Help-gnu-emacs@gnu.org>
Subject: Re: Find bindings for all modes
Date: Tue, 28 Oct 2014 16:31:05 -0800	[thread overview]
Message-ID: <20141029003105.GF7374@mail.akwebsoft.com> (raw)
In-Reply-To: <CAOj2CQT99J_wY2r9hvEiDr4WjYi-7vTvdvOUoRmno1JkC4x-Tw@mail.gmail.com>

* John Mastro <john.b.mastro@gmail.com> [141028 14:30]:
> Tim Johnson <tim@akwebsoft.com> wrote:
> >    I'd like to use C-j as a prefix key.
> >    Note: I have limited mobility in my hands and always have the
> >    control key to the left of my "A" key.
> 
> I wanted to do something similar in order to have a general-purpose
> prefix key on the right hand side of the keyboard. (I strongly prefer to
> use opposite hands for the modifier(s) and they keys themselves. So
> `C-c` or `C-x r` are fine, but I'm not a big fan of e.g. `C-x o`. This
> is primarily a "preference" thing, although I do think that using
> opposite hands is more ergonomic than not).
> 
> What I settled on for now is to steal C-h. I actually use the help
> commands quite a bit, but I find <f1> to be "good enough" for accessing
> them.

  I have done the same to use C-h for backward-delete

> If you don't mind, let us (the list) know what you settle on - I'm
> always interested to hear about Emacs users' key binding innovations.

  I've done considerable keybinding in the past, using emacs in gui
  mode on linux. So I've done considerable rewriting for OS X and
  terminal environment what follows is untested but should give an
  idea :

;; Could be a "template" for other rebindings
(defun tj-control-j ()
  "Function to call when control-j is rebound"
  (interactive)
  (cond
    ((string-equal mode-name "Lisp Interaction")
     (eval-print-last-sexp))
    (t
      (electric-newline-and-maybe-indent))))
;; set up the keymap
; Movement related bindings
(global-unset-key "\C-j")
(defvar tj-go-map (make-sparse-keymap) "Control-j")
(define-prefix-command 'tj-go-map)
(global-set-key "\C-j" 'tj-go-map)
;; rebind the original C-j
(define-key tj-go-map (kbd "j") 'tj-control-j)

No doubt there is going to be some glitches, but the next
few days will finish the story ...
cheers
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com



  reply	other threads:[~2014-10-29  0:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-28 17:58 Find bindings for all modes Tim Johnson
2014-10-28 21:53 ` John Mastro
2014-10-28 22:00   ` Tim Johnson
2014-10-28 22:18     ` John Mastro
2014-10-29  0:31       ` Tim Johnson [this message]
2014-10-29  3:09       ` Robert Thorpe
2014-10-29 18:19         ` Tim Johnson
2014-10-29 23:05         ` John Mastro
2014-10-30  1:46           ` Tim Johnson
2014-10-30  2:04           ` Robert Thorpe
2014-10-30 18:25             ` Tim Johnson
2014-11-01 21:00               ` Robert Thorpe
2014-11-04  0:04                 ` Tim Johnson

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=20141029003105.GF7374@mail.akwebsoft.com \
    --to=tim@akwebsoft.com \
    --cc=Help-gnu-emacs@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.
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).