Eli Zaretskii <[EMAIL PROTECTED]> writes: > > From: Dan Nicolaescu <[EMAIL PROTECTED]> > > Date: Fri, 22 Jul 2005 20:07:51 -0700 > > Cc: [email protected] > > > > 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?
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) _______________________________________________ Emacs-pretest-bug mailing list [email protected] http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
