From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: BACKSPACE in GNU-EMACS editor Date: Thu, 10 Feb 2005 09:49:32 -0500 Organization: Bell Sympatico Message-ID: <871xbo4h1c.fsf-monnier+gnu.emacs.help@gnu.org> References: <1107907664.430179.177880@c13g2000cwb.googlegroups.com> <1107985825.153861.221600@c13g2000cwb.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1108047997 8217 80.91.229.2 (10 Feb 2005 15:06:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 10 Feb 2005 15:06:37 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 10 16:06:37 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1CzFsh-0004ZB-Tw for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Feb 2005 16:05:24 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CzG7S-0004p9-Fm for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Feb 2005 10:20:38 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wns13feed!worldnet.att.net!207.35.177.252!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:N4IBY6M0OSGmJGbINgprxgz2WUI= Original-Lines: 35 Original-NNTP-Posting-Host: 65.92.240.235 Original-X-Complaints-To: abuse@sympatico.ca Original-X-Trace: news20.bellglobal.com 1108046972 65.92.240.235 (Thu, 10 Feb 2005 09:49:32 EST) Original-NNTP-Posting-Date: Thu, 10 Feb 2005 09:49:32 EST Original-Xref: shelby.stanford.edu gnu.emacs.help:128479 Original-To: help-gnu-emacs@gnu.org 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 X-MailScanner-To: geh-help-gnu-emacs@m.gmane.org Xref: main.gmane.org gmane.emacs.help:24011 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:24011 > i got it working....how about the arrow keys on the keyboard > (up/down/right/left), do you have any samples ? > i tried this...but no luck: > (global-set-key [up] 'previous-line) > (global-set-key [down] 'next-line) > (global-set-key [right] 'forward-char) > (global-set-key [left] 'backward-char) Note that both the backspace thingy you asked before and these cursor motions are already the default behavior. I.e. in your case the problem is not that Emacs's key bindings do not suit you, but that for some reason Emacs does not properly recognize the keys you're using. In such a case `global-set-key' is not the right answer (although it can work). You want to use instead: (define-key function-key-map [foo] [bar]) where [foo] is the key-sequence that Emacs thinks he receives and [bar] is the corrected key sequence. Try to hit your `right' key and then do C-h l to see what key-sequence Emacs received when you hit `right'. If it says something like ESC [ 0 ~, then try (define-key function-key-map "\e[0~" [right]) -- Stefan PS: One of the differences between changing function-key-map and using global-set-key is that the former will also work when you use C-x right.