[net.emacs] Gnu EMACS customization for Lisp

smh@mit-eddie.UUCP (Steven M. Haflich) (04/22/85)

Lisp hackers who use Gnu EMACS might want to try this useful
customization.  It emulates the standard keybinding of CCA EMACS
that makes C-Z (i.e. control-Z) a prefix which both CONTROL- and
META-izes to the following keystroke.  This is particularly useful
for Lisp because most of the special Lisp editing commands are bound
to ESC CONTROL characters.

This text can be placed in the personal .emacs file in your home
directory.  The suspend-emacs function previously run by C-Z is
still available as either C-X C-Z or C-Z C-Z .

But first: The two "^Z" strings in the text below have been sanitized
to pass through mailers and, as mailed, contain a two character
sequence representing CONTROL-Z to humans.  You will have to edit
them to contain the single literal character C-Z, which can be typed
in EMACS via the two-keystroke sequence: C-Q C-Z .

======================================
(defun c-m-prefix ()
 "Apply both META and CONTROL to the next command character"
 (interactive)
 (command-execute
  (lookup-key esc-map (char-to-string (logand 31 (read-char))))))

(define-key global-map "^Z" 'c-m-prefix)
(define-key esc-map "^Z" 'suspend-emacs)

crl@purdue-newton (05/08/85)

From: crl@purdue-newton
Better than changing the two-char sequence "^Z" into a real control-Z
is to use the standard GNU EMACS escape convention "\^Z".  Then you
never have to put non-printables into elisp functions that confuse
mailers and make them cause printers and terminals to do funny things.

Charles LaBrec
crl @ purdue-newton.ARPA