Author Topic: v24 User-Loaded Macros List  (Read 1506 times)

jnairb

  • Senior Community Member
  • Posts: 235
  • Hero Points: 11
v24 User-Loaded Macros List
« on: October 03, 2019, 08:00:02 pm »
I'm running v24.0.0.8 x64 now. I just noticed that after reloading one of my macros, the macro is no longer included in the User-Loaded Macros list. I normally reload a macro after editing it with a macro that does a load('<'). I also tried using gui-load to load the macro and the same thing happens.

Is this a new bug? v23 didn't do this.

I also noticed that the list of user macros was changed from just the path-less macro name (e.g. misc.e) to a relative path from my config directory (e.g. ../macros/misc.e), where most of my macros are stored in a subdirectory of my SLICKEDITBASE directory. That directory is on the VSLICKMACROS path.
« Last Edit: October 03, 2019, 09:50:36 pm by jnairb »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6124
  • Hero Points: 470
Re: v24 User-Loaded Macros List
« Reply #1 on: October 03, 2019, 09:14:04 pm »
Can you give me steps to reproduce the first issue?

Can you illustrate your config and user macro directory layout? That will help me check if the relative paths look right.

The new logic does try to make your macros relative to the versioned config directory. That way, if you haven't set VSLICKMACROS path for this case, SlickEdit won't use an absolute path like it previously did.
« Last Edit: October 03, 2019, 09:31:11 pm by Clark »

jnairb

  • Senior Community Member
  • Posts: 235
  • Hero Points: 11
Re: v24 User-Loaded Macros List
« Reply #2 on: October 03, 2019, 09:28:24 pm »
I recreated now with the following steps:
1) vs23 -sc junk (runs SlickEdit 23.0.2)
2) Cancel out of setup
3) Macro/Load Module. Selected my misc.e from C:\Users\BrianJongekryg\SlickEdit\macros directory.
4) Macro/List User-Loaded Modules listed C:\Users\BrianJongekryg\SlickEdit\macros\misc.e
5) Exit VS 23
6) vs -sc junk (runs SlickEdit 24.0.0)
7) Macro/List User-Loaded Modules listed ..\..\..\..\BrianJongekryg\SlickEdit\macros\misc.e (junk directory is C:\Users\bej\Documents\junk)
8) Macro/Load Module. Selected my misc.e again from C:\Users\BrianJongekryg\SlickEdit\macros directory.
9) Macro/List User-Loaded Modules is now empty.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6124
  • Hero Points: 470
Re: v24 User-Loaded Macros List
« Reply #3 on: October 03, 2019, 09:33:23 pm »
Reproduced. If I load a macro more than once, it seems to get deleted.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6124
  • Hero Points: 470
Re: v24 User-Loaded Macros List
« Reply #4 on: October 03, 2019, 09:50:47 pm »
Try loading the attached fix.

First unload the macro (Macro>Unload Module...)

Then load it (Macro>Load Module...). You should be able to load it multiple times without it being removed.

jnairb

  • Senior Community Member
  • Posts: 235
  • Hero Points: 11
Re: v24 User-Loaded Macros List
« Reply #5 on: October 03, 2019, 09:59:08 pm »
I get an error trying to unload slickc.ex:
Problems unloading slickc.ex: Cannot remove module

Ignoring that and after loading slickc.e, I don't see any differences in behavior, so maybe the update didn't get loaded.

jnairb

  • Senior Community Member
  • Posts: 235
  • Hero Points: 11
Re: v24 User-Loaded Macros List
« Reply #6 on: October 03, 2019, 10:01:05 pm »
Or did you mean I was supposed to unload my user macros then reload them and I'd be able to reload them again without the error?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6124
  • Hero Points: 470
Re: v24 User-Loaded Macros List
« Reply #7 on: October 03, 2019, 10:02:21 pm »
I think I confused you. My bad.

Don't unload slickc.e.  Just loaded it with Macro>Load Module.

first unload YOUR macro after you done the above to load slickc.e.  Hope that makes sense.

jnairb

  • Senior Community Member
  • Posts: 235
  • Hero Points: 11
Re: v24 User-Loaded Macros List
« Reply #8 on: October 03, 2019, 10:08:59 pm »
OK, that's what I figured you meant after I read your reply the 2nd time. But that's still not working for me. I loaded the new slickc.e. I unloaded misc.e. I loaded misc.e. It shows up in the User-Loaded macros list. I load misc.e again. It's gone from the User-Loaded macros list.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6124
  • Hero Points: 470
Re: v24 User-Loaded Macros List
« Reply #9 on: October 03, 2019, 11:15:31 pm »
Hmm..Lets double check things.

instead of loading the new slickc.e. Edit it and go to line 3269.

It should look like this:
Code: [Select]
   if (!alreadyPresent) {
      // Remove this macro file to ensure it's not listed twice.
      // With a previously absolute file, this can happen.
      _macfile_delete(filename,_macro_ext'x',false);
   }

Then from the SlickEdit command line with slickc.e active, type the command "load". That will load the current macro file you are editing which should be slickc.e.

I just want to make sure you have the right slickc.e loaded.

jnairb

  • Senior Community Member
  • Posts: 235
  • Hero Points: 11
Re: v24 User-Loaded Macros List
« Reply #10 on: October 03, 2019, 11:38:41 pm »
Nevermind. Your change does work now. I had copied the new slickc.e into the install macros directory. I needed an elevated command prompt to do that. Then I did the Macro/Load of slickc.e from my non-elevated SlickEdit process which doesn't have authority to write to that directory so it couldn't create the compiled slickc.ex. It didn't give any errors though.

I just loaded slickc.e from my download directory and now it's working as you described. Sorry about that.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6124
  • Hero Points: 470
Re: v24 User-Loaded Macros List
« Reply #11 on: October 04, 2019, 12:02:22 am »
Glad it works.

Let me know if there is an issue with the new relative filename code. It is different but everything should still work.