[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New $TERM init code
From: |
Dan Nicolaescu |
Subject: |
Re: New $TERM init code |
Date: |
Fri, 29 Jul 2005 16:56:32 -0700 |
Stefan Monnier <address@hidden> writes:
How 'bout the patch below which allows terminal-init-$TERM to be autoloaded
and/or defined elsewhere than in term/$TERM.el (e.g. it can be defined in
~/.emacs, or a single term/foo.el can define both terminal-init-foo-bar and
terminal-init-foo-baz, ...)?
Stefan
--- orig/lisp/startup.el
+++ mod/lisp/startup.el
@@ -1004,14 +1004,21 @@
(not (load (concat term-file-prefix term) t t)))
;; Strip off last hyphen and what follows, then try again
(setq term
- (if (setq hyphend (string-match "[-_][^-_]+$" term))
+ (if (setq hyphend (string-match "[-_][^-_]+\\'" term))
(substring term 0 hyphend)
nil)))
- (when term
+ (setq term (getenv "TERM"))
+ (while term
Wouldn't it be better to have this loop before the "load" loop? (1)
Or if it's after only loop if the "load" loop didn't find a terminal
file?
Doing it the (1) way would DTRT for the multi-tty branch, it would
avoid loading the terminal file iff the corresponding terminal-init-
function is defined, which would happen after connecting the first
time from a terminal type.