- ;; Do not change the :init-value below, without corresponding
- ;; changes in the related code in startup.el.
- :init-value (unless (or noninteractive
- window-system
- (null term-file-prefix))
- (let ((term (getenv "TERM"))
- hyphend)
- (while
- (and term
- (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))
- (substring term 0 hyphend)
- nil)))
- (and term
- (string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)"
- term)
- t)))