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: Wed, 23 Feb 2011 07:14:00 -0800 Message-ID: References: <4d611405.0673e50a.0a3b.3a48SMTPIN_ADDED@mx.google.com> <878vxak70c.wl%aaron@danzig> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf3054a0ff18642d049cf48c33 X-Trace: dough.gmane.org 1298474076 11195 80.91.229.12 (23 Feb 2011 15:14:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 23 Feb 2011 15:14:36 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Le Wang Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 23 16:14:29 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 1PsGQ8-00032p-T4 for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Feb 2011 16:14:29 +0100 Original-Received: from localhost ([127.0.0.1]:51554 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PsGQ8-00057x-6m for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Feb 2011 10:14:28 -0500 Original-Received: from [140.186.70.92] (port=33444 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PsGPm-00057s-4z for help-gnu-emacs@gnu.org; Wed, 23 Feb 2011 10:14:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PsGPk-0005sP-VI for help-gnu-emacs@gnu.org; Wed, 23 Feb 2011 10:14:06 -0500 Original-Received: from mail-yi0-f41.google.com ([209.85.218.41]:57336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PsGPk-0005sB-S3 for help-gnu-emacs@gnu.org; Wed, 23 Feb 2011 10:14:04 -0500 Original-Received: by yib2 with SMTP id 2so1979803yib.0 for ; Wed, 23 Feb 2011 07:14:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=kW6nbrd89dAy7QaUs3VU0J4MGwBamPbK5X99L2KwB80=; b=tTTRpHHDM69l9fxM8gZWpnWjY6/YRdUIKKlhkyH3exO1rvxHJe4gSQYUqX4HPLQyTK WPI+my9GL899ib9U53RCR34TFWLnnJ9Vh51/+3oPaVtT/K0thata+Um8j6hjeCeVIKZe nWCvpc3Oc/Mx5TOmlj9DhNs3iCxOQsxjNZHCY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=s2Ggom+w/mSRrzu5kmjsFJaiFIjBZEheY+o0I71pvDNhQI0Q2+LMlDlOUBvoH8HGz8 XkW8KEDlKQOju0TnsRtn1/74SoLCkPZYrSf3UWXOOfMRz3fEf42GJ4bXJuazSUkjLlPT CFdEJmX/ydVZJ1Lx+iLea4VIVaykk5wr1xwvw= Original-Received: by 10.147.82.4 with SMTP id j4mr6306839yal.8.1298474043193; Wed, 23 Feb 2011 07:14:03 -0800 (PST) Original-Received: by 10.147.33.17 with HTTP; Wed, 23 Feb 2011 07:14:00 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.218.41 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:79387 Archived-At: --20cf3054a0ff18642d049cf48c33 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Feb 22, 2011 at 7:49 AM, Le Wang wrote: > On Mon, Feb 21, 2011 at 12:25 AM, Aaron Culich wrote: > >> > (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 > > > I'm not sure what you mean by this. It works like a champ most of the > time. My issue is that C-j registers as the original binding occasionally. > It gets fixed right away without me doing anything, i.e. C-j registers as > C-j, then C-_C-j registers as C-x. > It seems I messed something up the first time I tried evaling your keyboard-translate code. When I tried it again just now it worked, so I don't know what I did wrong before. I'm not sure why the C-j sometimes registers incorrectly and then fixes itself, but if you can consistently reproduce the problem, then I would suggest checking the value of keyboard-translate-table to see if it is getting changed in some way. Maybe in some situations it gets made into a buffer-local variable and set to nil? At least that could be one reasonable explanation. -Aaron > > -- > Le > --20cf3054a0ff18642d049cf48c33 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Tue, Feb 22, 2011 at 7:49 AM, Le Wang= <l26wang@gmail.c= om> wrote:
On Mon, Feb 21, 2011 at 12:25 = AM, Aaron Culich <aculich@gmail.com> wrote:
> (keyboard-translate ?\C-x ?\C-j)
> (keyboard-translate ?\C-j ?\C-x)

The keyboard-translate command doesn't do quite what you expect o= f it

I'm not sure what you mean b= y this. =A0It works like a champ most of the time. =A0My issue is that C-j = registers as the original binding occasionally. =A0It gets fixed right away= without me doing anything, i.e. C-j registers as C-j, then C-_C-j register= s as C-x.

It seems I messed something up the f= irst time I tried evaling your keyboard-translate code. When I tried it aga= in just now it worked, so I don't know what I did wrong before. I'm= not sure why the C-j sometimes registers incorrectly and then fixes itself= , but if you can consistently reproduce the problem, then I would suggest c= hecking the value of keyboard-translate-table to see if it is getting chang= ed in some way. Maybe in some situations it gets made into a buffer-local v= ariable and set to nil? At least that could be one reasonable explanation.<= /div>

-Aaron
=A0
=A0
--
Le

--20cf3054a0ff18642d049cf48c33--