Re: dired keymap and (vt100) terminal setup hooks

sandy@ibm550.sissa.it
Mon, 14 Mar 1994 16:38:17 +0100


>>>>> On Mon, 14 Mar 94 15:26:21 SET,
      Joerg-Martin Schwarz <UPH508@unidozr.hrz.uni-dortmund.de> said:

 > Calling emacs as 'emacs /anonymous@ftp.germany.eu.net:/pub/'
 > causes the dired have a bad keymap.
 > The key vt100 arrow keys, equivalent to "\M-[", are replaced
 > by dired-prev-subdir.

 > The reason is that dired maps all keys globally bound to
 > previous-paragraph with dired-previous-subdir; and the terminal
 > setup hook which takes care of the arrow key bindings
 > is apparently run only after the files on the
 > command line have been visited.

 > Any ideas to  fix this problem ?

I would argue that when emacs is invoked by giving a file on the
command line, the term-setup-hook should run before the file is
actually visited.  Major modes may need to look at the keymap.

In fact, from the emacs 18 lisp manual:

----------------------------------------

   The order of operations performed (in `startup.el') by Emacs when
it is started up is as follows:

  1. It loads `.emacs' unless `-q' was specified on command line. 
     (This is not done in `-batch' mode.)  `.emacs' is found in the
     user's home directory; the `-u' option can specify the user name
     whose home directory should be used.

  2. It loads `default.el' unless `inhibit-default-init' is
     non-`nil'.  (This is not done in `-batch' mode or if `-q' was
     specified on command line.)

  3. It loads the terminal-specific Lisp file, if any, except when in
     batch mode.

  4. It runs `term-setup-hook'.

  5. It runs `window-setup-hook'.

  6. It displays copyleft and nonwarranty, plus basic use
     information, unless the value of `inhibit-startup-message' is
     non-`nil'.

        This display is also inhibited in batch mode, and if the
     current buffer is not `*scratch*'.

  7. It processes any remaining command line arguments.

----------------------------------------

However, a quick look in V18 startup.el indicates that the
term-setup-hook gets run _after_ command line args are processed.  Can
someone who knows explain why?

--sandy