Author Topic: Setting macro variables programmatically  (Read 3619 times)

jbhurst

  • Senior Community Member
  • Posts: 405
  • Hero Points: 33
Setting macro variables programmatically
« on: January 21, 2007, 12:26:12 AM »
Hi,

Whenever possible I like to put my customizations in a version-controlled .e file, and load that, rather than using the GUIs tediously to set all my many keyboard bindings and macro variables. (The GUI dialogs for this are indispensable, but they are not suitable for repetitive use for standard settings.)

I've found that some macro variables can be set in a definit() in my .e file, such as def_fast_open:


definit {
  def_fast_open = 1; // works great
}


When this file is loaded, the macro variable is set, and the customization takes effect.

Others, such as def_undo_with_cursor, don't work in definit(). Loading the file makes no difference to the macro variable's value.

I don't know why this is. The ones I've noticed that don't work seem to be defined in stdcmds.e, while the ones that work are in main.e.

I have found that doing it like this instead does work:


definit() {
  set_var('def_undo_with_cursor 1');
  set_var('def_fast_open 1');
}


But this doesn't seem like the "natural" way to do SlickEdit configuration.

Anybody know why stdcmds.e variables are different from main.e variables?


John Hurst