Author Topic: Problem loading macros in a "fresh" configuration  (Read 2365 times)

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5240
  • Hero Points: 432
Re: Problem loading macros in a "fresh" configuration
« Reply #15 on: October 24, 2017, 02:15:33 pm »
Q1: I think it will work but you need to copy in the versioned state file (has .ver in the name) that comes with the hot fix.

Q2: The -p option wasn't designed for saving the state file. Saving the state file would cause other issues. The -r option will save the state file because you still need to do a normal exit.

Q3: The -p switch must be the last option. That allows it to have double quoted arguments. You could use multiple -# options instead but it doesn't support double quotes inside of double quotes.

vs "-#load no-spaces-here/robutils.e" "-#save-config" "-#safe-exit"

rowbearto

  • Senior Community Member
  • Posts: 1644
  • Hero Points: 119
Re: Problem loading macros in a "fresh" configuration
« Reply #16 on: October 24, 2017, 02:45:12 pm »
Thanks.

For Q2, I was asking about using -mdihide with "-r custom-init-with-safe-exit". When I try this, next time I run SE all my tool windows are gone. Is this a real limitation or is it a bug? If I use "-r custom-init-with-safe-exit" without the -mdihide, there is no issue on the next launch of SE. As I'm not using -p, but using -r instead, state file will get saved. But since I have -mdihide does the -mdihide alter the state file to get rid of the tool windows? But I do see the tool windows after I use "-mdihide -p load robutils.e" (with no initial state file)

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5240
  • Hero Points: 432
Re: Problem loading macros in a "fresh" configuration
« Reply #17 on: October 24, 2017, 09:07:12 pm »
-mdihide is too specialized. Changing it would break other invocations.

I'm curious if the undocumented plugin stuff would work for you. Right now, it's not only undocumented but if you use it I can't guarantee there won't be a format compatibility change in the next major release. I'm using this for my own macros to do pretty close to what you're doing. I use a new -sp plugin directory option to specify where my macro plugins are. When the -sp <plugin-dir> invocation option isn't specified, SlickEdit defaults to the versioned config directory/plugins. The plugin loader automatically figures out whether plugins have been added or removed at startup.

The general idea is this. Load the "plgman.e" macro. Create a plugin using the "new-plugin" and "open-plugin" commands. You can add one or more macro files and config information to your plugin. Your plugin will be a bit like an export of your macros and options. If you need more config info than what's in your user.cfg.xml and macros, you'll have to copy in more than just what's necessary for the plugins directory.

All plugins are a zip file. However, plugins with macros (.e files), need to be unzipped when installed. Since you should not try using the plugin_manager command yet, you'll have to unzip/copy in files as necessary.

Attached is a sample plugins directory with one plugin that I use. It's a pretty small plugin so it should be pretty obvious what the structure of a plugin is.

After unzipping my plugin, you can try out my plugins with a command like this:

vs +new -sc <any-config-dir> -sp some-path\plugins