From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim Johnson Newsgroups: gmane.emacs.help Subject: Re: Find bindings for all modes Date: Tue, 28 Oct 2014 16:31:05 -0800 Organization: AkWebsoft Message-ID: <20141029003105.GF7374@mail.akwebsoft.com> References: <20141028175824.GD7374@mail.akwebsoft.com> <20141028220024.GE7374@mail.akwebsoft.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1414542702 22782 80.91.229.3 (29 Oct 2014 00:31:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Oct 2014 00:31:42 +0000 (UTC) To: Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 29 01:31:33 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XjHAi-00056P-VE for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Oct 2014 01:31:33 +0100 Original-Received: from localhost ([::1]:41971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjHAi-0003ml-J2 for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Oct 2014 20:31:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjHAS-0003mf-Oi for Help-gnu-emacs@gnu.org; Tue, 28 Oct 2014 20:31:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjHAJ-0004Mc-8n for Help-gnu-emacs@gnu.org; Tue, 28 Oct 2014 20:31:16 -0400 Original-Received: from 191-232-4-64.mtaonline.net ([64.4.232.191]:52320 helo=tj49.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjHAI-0004MN-WF for Help-gnu-emacs@gnu.org; Tue, 28 Oct 2014 20:31:07 -0400 Original-Received: by tj49.com (Postfix, from userid 501) id 8436751B9080; Tue, 28 Oct 2014 16:31:05 -0800 (AKDT) Mail-Followup-To: Emacs Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-detected-operating-system: by eggs.gnu.org: Mac OS X 10.x X-Received-From: 64.4.232.191 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:100641 Archived-At: * John Mastro [141028 14:30]: > Tim Johnson 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 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