Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!uflorida!novavax!hcx1!hcx3!shirono From: shirono@hcx3.SSD.HARRIS.COM Newsgroups: comp.emacs Subject: Re: startup.el Message-ID: <94600015@hcx3> Date: 6 Jan 89 15:23:00 GMT References: <2225@imagine.PAWL.RPI.EDU> Lines: 88 Nf-ID: #R:imagine.PAWL.RPI.EDU:2225:hcx3:94600015:000:3413 Nf-From: hcx3.SSD.HARRIS.COM!shirono Jan 6 10:23:00 1989 /* Written 6:35 am Dec 31, 1988 by Dave@imagine.UUCP in hcx3:comp.emacs */ /* ---------- "startup.el" ---------- */ > The scenario: I want to unconditionally bind some global keys in my > .emacs file. These keys emulate sequences sent from the vt100 keypad > (SS3). > > The problem: startup.el chews up .emacs before it reads in the terminal= > dependent stuff, so the global key map for the keypad gets completely > reset. > > I honestly don't understand why .emacs is not the last elisp file loaded ... > it only seems natural that a user should be able to undo things that > he doesn't like which are done by another start-up file. I'd call it > a "programming oversight" rather than a bug. There is a reason for this. Among other things, there are several variables that affect the behavior of startup.el: inhibit-startup-message Variable: *Non-nil inhibits the initial startup messages. inhibit-default-init Variable: *Non-nil inhibits loading the `default' library. term-setup-hook Variable: Function to be called after loading terminal-specific lisp code. The way it is done allows your ~/.emacs to inhibit certain default actions. As a solution for your problem, wrap your global key bindings in a function, and setq term-setup-hook to it: (defun set-SS3-keys () "Unconditionally bind SS3 keys for emulation" ;code here ) (setq term-setup-hook 'set-SS3-keys) Another way of doing it would be to load the term code yourself, and then setq term-file-prefix to nil: (load-library ) (setq term-file-prefix nil) By the way, this is what startup.el has to say about it: ;; Load library for our terminal type. ;; User init file can set term-file-prefix to nil to ;; prevent this. > I have a kludge, but I hate kludges like this ... I can run > `emacs -q -l ~/.emacs'; in fact, I have an alias that says that now. > I can also load the file manually (blech) like I had to do when I > started this reply, because rn starts up emacs from $EDITOR. As most kludges, it sucks. It defeats the purpose of the design of startup.el. > Does anyone have a suggestion? I'd rather not have to move all of > the terminal code from startup.el (and then disable processing of > it in startup.el) because disk-space is very tight here -- every > page is important. Don't you dare move the terminal code from startup.el. It is there for a reason: so it can be inhibited or otherwise superceeded. > Should the order in which .emacs is read be changed? Definitely no. One more thing. In case your startup.el and mine differ, my GNU is GNU Emacs 18.52.10 of Wed Nov 16 1988 on hcx3 (usg-unix-v) HAPPY GNU YEAR --Roberto ______________________________________________________________________________ || Internet: shirono@ssd.harris.com Roberto Shironoshita || Harris Corporation || ...!novavax---\ Computer Systems Division || UUCP: ...!uunet-------!hcx1!shirono || ...!mit-eddie-/ ------------------------------------------------------------------------------ DISCLAIMER: The opinions expressed here are my own; they in no way reflect the opinion or policies of Harris Corporation.