From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: New $TERM init code Date: Mon, 12 Sep 2005 11:51:41 -0400 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1126540767 25009 80.91.229.2 (12 Sep 2005 15:59:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 12 Sep 2005 15:59:27 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 12 17:59:24 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EEqew-0005Y1-1t for ged-emacs-devel@m.gmane.org; Mon, 12 Sep 2005 17:55:54 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EEqev-0001YN-Gt for ged-emacs-devel@m.gmane.org; Mon, 12 Sep 2005 11:55:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EEqd2-00010B-Bx for emacs-devel@gnu.org; Mon, 12 Sep 2005 11:53:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EEqcz-0000yQ-CH for emacs-devel@gnu.org; Mon, 12 Sep 2005 11:53:55 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EEqcz-0000xQ-AX for emacs-devel@gnu.org; Mon, 12 Sep 2005 11:53:53 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EEqbc-0001jf-4g for emacs-devel@gnu.org; Mon, 12 Sep 2005 11:52:28 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 76DF92CF5CB; Mon, 12 Sep 2005 11:51:47 -0400 (EDT) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id EE2A74AC00A; Mon, 12 Sep 2005 11:51:41 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id DA424E6C18; Mon, 12 Sep 2005 11:51:41 -0400 (EDT) Original-To: emacs-devel@gnu.org In-Reply-To: (Stefan Monnier's message of "Fri, 29 Jul 2005 16:04:50 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-4.845, requis 5, autolearn=not spam, AWL 0.06, BAYES_00 -4.90) X-MailScanner-From: monnier@iro.umontreal.ca 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:42847 Archived-At: > --- 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