[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rxvt vs xterm keybindings

From: Dan Nicolaescu
Subject: Re: rxvt vs xterm keybindings
Date: Sat, 23 Jul 2005 08:25:15 -0700

Eli Zaretskii <address@hidden> writes:

  > > From: Dan Nicolaescu <address@hidden>
  > > Date: Fri, 22 Jul 2005 20:07:51 -0700
  > > Cc: address@hidden
  > > 
  > > This actually brings us a step closer to another proposal that is
  > > needed for the multi-tty branch: each one of the term/*.el files
  > > should define an autoloaded function called
  > > TERMNAME-initialize-terminal. Then when emacs wants to initialize a
  > > terminal TERMNAME it does something like:
  > > (if (fboundp 'TERMNAME-initialize-terminal)
  > >     (TERMNAME-initialize-terminal))
  > > instead of having the terminal initialization performed (as it is
  > > currently done) by doing (load "term/TERMNAME") 
  > Sorry, I don't understand how this will work.  If the function
  > TERMNAME-initialize-terminal is autoloaded (i.e. it will have an
  > autoload cookie that would cause it to go into loaddefs.el), the
  > fboundp test is going to yield t for every such function, regardless
  > of the TERMINAL part, right?


  > What am I missing?

Here are 3 (I hope) illustrative examples:

1. TERM=xterm   
(fboundp 'xterm-initialize-terminal) is t, so it is  called.

2. TERM=xterm-256color 
(fboundp 'xterm-256color-initialize-terminal) is false
now we truncate the "xterm-256color" name to "xterm", 
(fboundp 'xterm-initialize-terminal) is to, so it is called.

3. TERM=somenewterminal
(fboundp 'somenewterminal-initialize-terminal) does not exist, nor can
the name "somenewterminal" be truncated so that the corresponding
function can be called.

The main idea behind this is to move the terminal initialization to a
function, instead of being performed because the term/*.el files have
forms at the top level that are evaluated when the file is loaded.
The role of the autoload is to only load each term/*.el file once.
This is a win for big files (like term/xterm.el) because Emacs from
the multi-tty branch needs to perform terminal initialization each
time an emacsclient connects to it, causing all the functions in
term/xterm.el to be redefined -- which just causes extra consing.
(for readers not familiar with the multi-tty branch, the idea is to
have an emacs always running, and then connect to it from either X or
ttys, it can support any number of simultaneous tty and X connections)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]