home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!yale!gumby!wmichgw!754clifton
- From: 754clifton@gw.wmich.edu
- Newsgroups: comp.os.os2.apps
- Subject: Elisp code to map alt to meta:
- Message-ID: <1992Aug21.151018.5047@gw.wmich.edu>
- Date: 21 Aug 92 15:10:18 EST
- Organization: Western Michigan University
- Lines: 86
-
- By popular demand here is the elisp code to use alt for meta on some
- (not all) of your keys.
-
- This is from Eberhard Mattes, prolific porter of GCC, Emacs and author
- of emTeX:
-
- -------------------------------- snip, snip --------------------------------
- ;; em-meta.el
- ;;
- (defun em-alt-meta (code name)
- "Put the meta NAME (a string) binding on extended scan code CODE."
- (let ((definition (lookup-key esc-map name)))
- (if (eq definition 'digit-argument)
- (setq definition 'em-alt-digit-argument))
- (if definition
- (define-key ext-map (char-to-string code) definition))))
-
- (defun em-alt-digit-argument (arg)
- "A version of digit-argument which works with A-digit keys."
- (interactive "P")
- (setq last-command-char
- (if (or (= last-command-char 129) (= last-command-char -127))
- ?0
- (- last-command-char 71)))
- (digit-argument arg))
-
- (em-alt-meta 14 "\^?")
- (em-alt-meta 16 "q")
- (em-alt-meta 17 "w")
- (em-alt-meta 18 "e")
- (em-alt-meta 19 "r")
- (em-alt-meta 20 "t")
- (em-alt-meta 21 "y")
- (em-alt-meta 22 "u")
- (em-alt-meta 23 "i")
- (em-alt-meta 24 "o")
- (em-alt-meta 25 "p")
- (em-alt-meta 26 "[")
- (em-alt-meta 27 "]")
- (em-alt-meta 28 "\r")
- (em-alt-meta 30 "a")
- (em-alt-meta 31 "s")
- (em-alt-meta 32 "d")
- (em-alt-meta 33 "f")
- (em-alt-meta 34 "g")
- (em-alt-meta 35 "h")
- (em-alt-meta 36 "j")
- (em-alt-meta 37 "k")
- (em-alt-meta 38 "l")
- (em-alt-meta 39 ";")
- (em-alt-meta 40 "`")
- (em-alt-meta 43 "\\")
- (em-alt-meta 44 "z")
- (em-alt-meta 45 "x")
- (em-alt-meta 46 "c")
- (em-alt-meta 47 "v")
- (em-alt-meta 48 "b")
- (em-alt-meta 49 "n")
- (em-alt-meta 50 "m")
- (em-alt-meta 51 ",")
- (em-alt-meta 52 ".")
- (em-alt-meta 53 "/")
- (em-alt-meta 120 "1")
- (em-alt-meta 121 "2")
- (em-alt-meta 122 "3")
- (em-alt-meta 123 "4")
- (em-alt-meta 124 "5")
- (em-alt-meta 125 "6")
- (em-alt-meta 126 "7")
- (em-alt-meta 127 "8")
- (em-alt-meta 128 "9")
- (em-alt-meta 129 "0")
- (em-alt-meta 130 "-")
- (em-alt-meta 131 "=")
- -------------------------------- snip, snip -------------------------------
-
- Create a file called alt-meta.el, put it in your Emacs lisp directory and
- and add the following line to your .emacs file:
-
- (load "alt-meta.el")
-
- Enjoy,
-
- /Doug
- --
- Douglas Clifton [99clifto@lab.cc.wmich.edu]
-