Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!zaphod.mps.ohio-state.edu!rpi!bu.edu!husc6!encore!pierson From: pierson@encore.com (Dan L. Pierson) Newsgroups: comp.emacs Subject: Re: Binding VT100 keypad keys with GNU Emacs .emacs Message-ID: Date: 10 Aug 90 14:07:06 GMT References: <2460@vela.acs.oakland.edu> Sender: news@Encore.COM Organization: Encore Computer Corporation Lines: 56 In-reply-to: moconnor@vela.acs.oakland.edu's message of 9 Aug 90 19:34:16 GMT This has been gone over recently but I'll try to make this worthwhile by giving a bit more detail on Emacs startup. You're running into the rather obscure initialization sequence in GNU Emacs startup. Roughly it's as follows: 1. Internal initialization. 2. Load the user's .emacs file (or the system default if the user doesn't have one). -q or -no-init-file Don't do this -u or -user Use another user's file 4. Create the *scratch* buffer and put it in initial-major-mode. 3. Load "term/$TERM" from the load path. If in a window system, (assume X), load "term/$TERMx-win" instead (i.e. append (concat (symbol-name window-system) "-win") to term-file-prefix before use) While haven't found a file to load, strip off last "-.*" and try again. This lets TERM values like "vt100-wide" work. This is where the VT100 stuff is set up Set term-file-prefix to nil to prevent this 4. Funcall term-setup-hook. 5. Funcall window-setup-hook. Read the lisp source "startup.el" for more details, including how to define your own command line switches. Now what's happening to you is that "term/vt100.el" is redefining M-O after your .emacs has run. To fix this, take all of your commands that redefine M-O and wrap them in something like: (let ((term (getenv "TERM"))) (cond ((string-equal term "vt100") (setq term-setup-hook '(lambda () YOUR COMMANDS HERE ))))) Note: I used a cond instead of an if because I have more than two terminal types to check, your mileage may vary. If you're using M-O as a prefix key, vt100.el sets this up for you so you should change anything of the form:j (global-set-key "\M-O..." '+++) to (define-key SS3-map "..." '+++) -- dan In real life: Dan Pierson, Encore Computer Corporation, Research UUCP: {talcott,linus,necis,decvax}!encore!pierson Internet: pierson@encore.com