[gnu.emacs.bug] keyboard-quit cannot be bound to a key

dale@AI.MIT.EDU (Dale DePriest) (09/21/89)

In GNU Emacs 18.52.10 of Mon Feb 13 1989 on snuggle (berkeley-unix)

The keyboard-quit command normally bound to ^g cannot be bound to another
key.  I tried to use the command:

(global-set-key "\177" 'keyboard-quit)

to define the del key as a cancel function.

This cancels the input as expected but leaves the M-x prompt and doesn't
actually perform the function of keyboard-quit.

jbw@bucsf.bu.edu (Joe Wells) (09/27/89)

In article <8909201803.AA05492@snearth.daisy.com> daisy!dale@AI.MIT.EDU (Dale  DePriest) writes:

   The keyboard-quit command normally bound to ^g cannot be bound to another
   key.  I tried to use the command:

   (global-set-key "\177" 'keyboard-quit)

   to define the del key as a cancel function.

   This cancels the input as expected but leaves the M-x prompt and doesn't
   actually perform the function of keyboard-quit.

C-g also has bindings in several keymaps that are used as the local keymap
in the minibuffer.  Try doing this also:

(define-key minibuffer-local-must-match-map "\C-?" 'abort-recursive-edit)
(define-key minibuffer-local-map "\C-?" 'abort-recursive-edit)
(define-key minibuffer-local-ns-map "\C-?" 'abort-recursive-edit)
(define-key minibuffer-local-completion-map "\C-?" 'abort-recursive-edit)
(define-key repeat-complex-command-map "\C-?" 'abort-recursive-edit)

It might actually be easier to play around with the value of
keyboard-translate-table.  In any case, you will not get the full
functionality of C-g on C-?, since the value 7 is hardcoded into 20 or 30
different places in the GNU Emacs C source code.  Pressing a C-g will
still deliver an interrupt signal to the Emacs process, which will be
handled as before.

Enjoy,

--
Joe Wells <jbw@bucsf.bu.edu>
jbw%bucsf.bu.edu@bu-it.bu.edu
...!harvard!bu-cs!bucsf!jbw