From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: New $TERM init code Date: Fri, 29 Jul 2005 16:56:32 -0700 Message-ID: <200507292356.j6TNuaKE025755@scanner2.ics.uci.edu> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1122681718 18034 80.91.229.2 (30 Jul 2005 00:01:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 30 Jul 2005 00:01:58 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 30 02:01:51 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DyenW-0007EF-2s for ged-emacs-devel@m.gmane.org; Sat, 30 Jul 2005 02:01:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dyeq1-0006At-2j for ged-emacs-devel@m.gmane.org; Fri, 29 Jul 2005 20:04:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dyep1-0005qd-UF for emacs-devel@gnu.org; Fri, 29 Jul 2005 20:03:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dyeow-0005mx-6w for emacs-devel@gnu.org; Fri, 29 Jul 2005 20:03:21 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dyeov-0005lh-1y for emacs-devel@gnu.org; Fri, 29 Jul 2005 20:03:17 -0400 Original-Received: from [128.195.1.36] (helo=scanner2.ics.uci.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dyeuj-0007I7-9Q for emacs-devel@gnu.org; Fri, 29 Jul 2005 20:09:17 -0400 Original-Received: from vino.ics.uci.edu (dann@vino.ics.uci.edu [128.195.11.198]) by scanner2.ics.uci.edu (8.12.10/8.12.10) with ESMTP id j6TNuaKE025755; Fri, 29 Jul 2005 16:56:36 -0700 (PDT) Original-To: Stefan Monnier Original-Lines: 34 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-100, required 5, USER_IN_WHITELIST) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:41324 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:41324 Stefan Monnier 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.