From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Aaron Culich Newsgroups: gmane.emacs.help Subject: Re: swapping C-x and C-j reliably for ergonomic reasons Date: Sun, 20 Feb 2011 08:25:39 -0800 Message-ID: <878vxak70c.wl%aaron@danzig> References: <4d611405.0673e50a.0a3b.3a48SMTPIN_ADDED@mx.google.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: dough.gmane.org 1298382047 19630 80.91.229.12 (22 Feb 2011 13:40:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 22 Feb 2011 13:40:47 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 22 14:40:42 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PrsT1-0005ij-IS for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Feb 2011 14:40:42 +0100 Original-Received: from localhost ([127.0.0.1]:44635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrsSx-0003yl-9i for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Feb 2011 08:39:47 -0500 Original-Received: from [140.186.70.92] (port=54776 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrC6Y-0000yk-2H for help-gnu-emacs@gnu.org; Sun, 20 Feb 2011 11:25:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrC6X-00046q-3S for help-gnu-emacs@gnu.org; Sun, 20 Feb 2011 11:25:49 -0500 Original-Received: from mail-pv0-f169.google.com ([74.125.83.169]:61092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrC6W-00046b-UU for help-gnu-emacs@gnu.org; Sun, 20 Feb 2011 11:25:49 -0500 Original-Received: by pvg4 with SMTP id 4so191526pvg.0 for ; Sun, 20 Feb 2011 08:25:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:message-id:from:to:subject:in-reply-to :references:user-agent:mime-version:content-type; bh=vbtFej81g6svBPz7O4LxL8YytnGxBhPT4sHOi+ZPS10=; b=ss6q3rfxzlHKOHTNjktmOr+gPFxIfsUe3aId76zjREg4uZe+Su8D+RNQBx8jFFGx6u 24WSeemmbNKMORmWEq1yR+Cm+OBZuXC8tnSJJKSrjEa5JNU7vuA23D7gtGvwGn+bizI8 00qy69c5v7KQdhGiHL/wd3Rh7J506LdvjGLxY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:message-id:from:to:subject:in-reply-to:references:user-agent :mime-version:content-type; b=d4MGSFUUVbeE5aCpMj2xnt5J+OvcVUyhYudQ345hveYY0lGolYURlPXnJQgmKHalCY /Y0VY9VRa6iGCHLJYH9uEWW4SNZU6BkskvFZBrp1mhyt1JZnX2eVXnUUpkaj4oiTkYhP Hu2Cdg8PSikON1tVZQyeEqBR1Xv+VmfJYUtek= Original-Received: by 10.142.109.20 with SMTP id h20mr367076wfc.420.1298219147812; Sun, 20 Feb 2011 08:25:47 -0800 (PST) Original-Received: from danzig.gmail.com (99-108-138-96.lightspeed.sntcca.sbcglobal.net [99.108.138.96]) by mx.google.com with ESMTPS id s41sm1645326wfc.15.2011.02.20.08.25.46 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 20 Feb 2011 08:25:46 -0800 (PST) In-Reply-To: <4d611405.0673e50a.0a3b.3a48SMTPIN_ADDED@mx.google.com> User-Agent: Emacs 23.2/Mule 6.0 (HANACHIRUSATO) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.83.169 X-Mailman-Approved-At: Tue, 22 Feb 2011 08:35:56 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:79308 Archived-At: Le Wang said the following on 19/02/11 04:57: > Hi, > > I do this from my .emacs.el: > > (keyboard-translate ?\C-x ?\C-j) > (keyboard-translate ?\C-j ?\C-x) The keyboard-translate command doesn't do quite what you expect of it. It merely sets the keyboard-translate-table variable that represents the ASCII table, so what happens is that the ASCII character 10 (LF) gets swapped with the ASCII character 24 (CAN). You can run 'C-h v keyboard-translate-table' to check that yourself. To accomplish what you want to do you can use: (global-set-key "\C-j" ctl-x-map) (global-set-key "\C-x" 'newline-and-indent) > This is part of my ongoing effort to use Emacs more ergonomically. It works > most of the time, however, ocassionally when I press C-j, > `newline-and-indent' still runs. I haven't put my finger on the exact > sequences of events that cause this. > > My Emace environment is heavily customized, so any number of things could be > causing this. It seems from the wiki and blogs that this swap is quite > common among power users