#195 Wrong Initialization Order

Program (402)

It must be Friday.

I added two macro calls to the smart indent macros to
learn a bit about their behaviour.
1. In the common init: dialog("Common Init is called",
2. In several language specific inits:

language_mode_hook() is defined in ~/.NEdit/hooks.nm
which is in turn loaded in autoload.nm:
- - - -
load_macro_file($NEDIT_HOME "/hooks.nm")
- - - -

language_mode_hook() is a also very sophisticated
debugging routine:
- - - -
define language_mode_hook
dialog("New language mode: " $1, "Dismiss")
- - - -

Now, when I start a new server with a language-moded file
nc <filename>
I first get the dialog from common init, after that the
macro error dialog:
Error executing macro: language_mode_hook is not a
function or subroutine.

If I subsequently open new files with nc, I don't get
any dialog; if I open them with 'Open Previous' I get
the language_mode_hook() dialog.

It seems to me that the smart indent macros are run
before the file tree starting from autoload.nm is
completely loaded. This is unexpected; I don't want to
include files from the smart indent macros.


  • Thorsten Haude

    Thorsten Haude - 2002-08-30

    Logged In: YES

    Minor oops: It doesn't matter how subsequent files are
    opened, I always get the call from the language specific
    init. I just happened to open a file where the init did not
    yet include the call to language_mode_hook().

  • Thorsten Haude

    Thorsten Haude - 2003-04-16

    Logged In: YES

    Seems to fixed. Was this done during the Great file.c

  • Eddy De Greef

    Eddy De Greef - 2003-04-17
    • status: open --> closed-fixed
  • Eddy De Greef

    Eddy De Greef - 2003-04-17

    Logged In: YES

    No, it was not fixed.
    As a side effect of the -wait patch, the problem doesn't
    show anymore when starting nedit via nc.
    It was still present when starting nedit directly, but I've
    just fixed it in CVS.


Log in to post a comment.