Path: utzoo!mnetor!uunet!husc6!think!ames!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hpda!hpsemc!bd From: bd@hpsemc.HP.COM (bob desinger) Newsgroups: comp.emacs Subject: Re: Is there a hook for gnu emacs starting up? Message-ID: <690004@hpsemc.HP.COM> Date: 12 Mar 88 18:28:13 GMT References: <640001@hpcvca.HP.COM> Organization: HP SEMC, Cupertino, CA Lines: 41 Charles Brown (charles@hpcvca.HP.COM) asks: > Is there a hook for gnu emacs starting up? I would like to have the > appropriate term/???.elc loaded depending upon $TERM. At startup, your Gnu Emacs should automatically load the terminal type you're using. If your $TERM is "hp", for instance, you'll get the effect of `(load-library "term/hp")'. [The load-library function loads the .elc file if it exists, or the .el file if not.] For this to work, you'll need an entry in term/ for whatever values of $TERM that you use. There are two ways to make this happen when the number of term/ entries don't match the number of $TERM possibilities: increase the term/ entries or map the $TERM values to what's in term/. If you want to increase the term/ entries, I suggest links. Suppose you edit on either an hp2392 or a new HP 700/92 (called, say, hp70092), and you want both to use the term/bobcat.elc file. First, M-x byte-compile-file term/bobcat.el. Then, to make links: % cd /usr/local/lib/emacs/lisp/term # or wherever % ln bobcat.elc hp2392.elc % ln bobcat.elc hp70092.elc On the other hand, to map $TERM values to bobcat, tell your shell to pretend that you're on a bobcat terminal if you're on a hp2392 or hp70092 with a script or shell function like: case $TERM in hp2392|hp70092) TERM=bobcat gnumacs $*;; esac (I take the easy way out and use in my .emacs file: (load "local/term/hp") ; DWIM with C-h and DEL where /usr/local/lib/emacs/lisp/local/term/hp.elc is a file that maps my arrow keys and terminal editing keys to emacs functions. Jack Repenning posted it many moons ago; I can forward you a copy or post it if there's enough interest.) bob desinger bd@hpsemc%hplabs.HP.COM ucbvax!hpda!hpsemc!bd