From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jesper Harder Newsgroups: gmane.emacs.help Subject: Re: Any hope of being able to redefine C-x without problems??? Date: Sun, 21 Sep 2003 21:38:07 +0200 Organization: http://purl.org/harder/ Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1064173602 29245 80.91.224.253 (21 Sep 2003 19:46:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 21 Sep 2003 19:46:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Sep 21 21:46:40 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A1AAK-0004or-00 for ; Sun, 21 Sep 2003 21:46:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A1A9f-0001xb-FN for geh-help-gnu-emacs@m.gmane.org; Sun, 21 Sep 2003 15:45:59 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: ^RrvqCr7c,P$zTR:QED"@h9+BTm-"fjZJJ-3=OU7.)i/K]<.J88}s>'Z_$r; 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 Xref: main.gmane.org gmane.emacs.help:12701 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:12701 Jesper Harder writes: > seberino@spawar.navy.mil (Christian Seberino) writes: > >> There is no way to write some lisp code that makes me able to >> define C-x and alter gdb to not have a problem? I thought you >> could do anything in elisp? > > It's possible. But `C-x' is used as prefix by hundreds of basic > Emacs functions -- not just gdb. You'll have redefine the bindings > for all of them. > > A lot of tedious work for something which can easily be avoided by > using another key-binding which is guaranteed not to conflict with any > pre-defined Emacs bindings. OK, it's not so tedious after all. If you want to bind a function, say, `my-function' to `C-x' you can do this: (keyboard-translate ?\C-x 'foo) (global-set-key [foo] 'my-function) If you need to call a function that's normally bound to a C-x sequence you can redefine another key, e.g. F5, to act as C-x: (define-key key-translation-map [f5] "\C-x") Then you can type `F5 C-f' to call `find-file' which is bound to `C-x C-f'.