all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: New $TERM init code
Date: Mon, 12 Sep 2005 11:51:41 -0400	[thread overview]
Message-ID: <jwv3boaqoda.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <jwv3bpxz8j2.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 29 Jul 2005 16:04:50 -0400")

>     --- 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

      parent reply	other threads:[~2005-09-12 15:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-29 20:04 New $TERM init code Stefan Monnier
2005-07-29 23:56 ` Dan Nicolaescu
2005-09-12 15:51 ` Stefan Monnier [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv3boaqoda.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.