[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New $TERM init code
From: |
Stefan Monnier |
Subject: |
Re: New $TERM init code |
Date: |
Mon, 12 Sep 2005 11:51:41 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
> --- 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
Installed.
> 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?
I don't think so. The reason is that you may have a file term/foo.el which
you've already loaded and which defines terminal-init-foo and then a file
term/foo-bar.el (which defines terminal-init-foo-bar) which you haven't yet
loaded: you do want to load foo-bar before trying the loop, otherwise you'll
end up callnig terminal-init-foo without realizing that there's
a foo-bar.el.
> 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.
I don't think it matters too much whether the file is reloaded many times.
If that's really a problem, we can check load-history, or use (require
'term/foo).
Stefan
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: New $TERM init code,
Stefan Monnier <=