From: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: New $TERM init code
Date: Fri, 29 Jul 2005 16:04:50 -0400 [thread overview]
Message-ID: <jwv3bpxz8j2.fsf-monnier+emacs@gnu.org> (raw)
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
;; The terminal file has been loaded, now call the terminal
;; specific initialization function.
(let ((term-init-func (intern-soft (concat "terminal-init-" term))))
- (when (fboundp term-init-func)
+ (if (not (fboundp term-init-func))
+ ;; Strip off last hyphen and what follows, then try again
+ (setq term
+ (if (setq hyphend (string-match "[-_][^-_]+\\'" term))
+ (substring term 0 hyphend)
+ nil))
+ (setq term nil)
(funcall term-init-func))))))
;; Update the out-of-memory error message based on user's key bindings
next reply other threads:[~2005-07-29 20:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-29 20:04 Stefan Monnier [this message]
2005-07-29 23:56 ` New $TERM init code Dan Nicolaescu
2005-09-12 15:51 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv3bpxz8j2.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).