Author Topic: xretrace, xxutils and a few other things  (Read 7998 times)

Graeme

  • Senior Community Member
  • Posts: 2526
  • Hero Points: 329
Re: xretrace, xxutils and a few other things
« Reply #15 on: December 09, 2019, 12:16:30 pm »
Thanks for trying it.  I'll send off a request to slick support at some point.  You're welcome to upload your modified files here if you feel like it.

Regarding the github repo.  jporkkahtc mentioned his github repo here - nearly two years ago.  Time flies.
https://community.slickedit.com/index.php/topic,15156.msg57556.html#msg57556
https://github.com/jporkka/slickMacros.git

It looks like there is one folder for each different "macro/ utility"  -  would that work for you ??  Everything really needs to be tagged with the version of slickedit it works for so you can download the right version of every macro in one go.  Then there needs to be a loader utility that lets people choose which macros to "install" - or at least some easy way of installing.

BTW - I gave up coding on Linux because I couldn't get xretrace to run without crashing/killing slickedit.  We're using centos in vmware like you.


rowbearto

  • Senior Community Member
  • Posts: 1881
  • Hero Points: 122
Re: xretrace, xxutils and a few other things
« Reply #16 on: December 09, 2019, 03:22:15 pm »
It would be annoying to use anything other than its own repo due to the requirement for xretrace directory being directly under the config directory.

By having dedicated xretrace repo, I can git clone it right into my config directory and get xretrace subdirectory. Then if I have changes, I can edit them right there and the push back to git. Then when I was done in Linux and wanted to try it in windows, I easily cloned it under my windows config dir and got working very fast.

If I use a common repository, the xretrace files will not be under the config directory - cloning directly under there won't put them in the right directory. So I would clone somewhere else. Then I would have to copy the files over - which is error prone. Then if I make changes to the files, I have to make sure to copy them back to the git repo for pushing, this is also error prone.

This is why I prefer a dedicated repository for now.

If being a subdirectory of config dir was not a requirement, or if the combined repo could be cloned directly under the config directory and the xretrace macro files could be updated to take this into account, then it would be better. But I don't have the time to invest right now to change this, or to create a loader utility. Perhaps if someone took the time to do that then we could have a common repo, but I can't do it at the moment. So I would propose to make my private repo public and then when someone can invest in making it so that one can clone the combined repo directly under the config directory, or make xretrace usable outside the config directory, then can move it into a common repo.

xretrace works fine for me in Linux x64, CentOS under SlickEdit v24 with my changes. I had to make another minor change to get it to work, change all the #import "dlinklist.e" to #import 'DLinkList.e' as Linux file system is case sensitive.

rowbearto

  • Senior Community Member
  • Posts: 1881
  • Hero Points: 122
Re: xretrace, xxutils and a few other things
« Reply #17 on: December 13, 2019, 02:16:22 pm »
I've attached a xretrace.zip file with the modifications I've made (mentioned in earlier posts) to get xretrace working in my Linux x64 environment.

Graeme

  • Senior Community Member
  • Posts: 2526
  • Hero Points: 329
Re: xretrace, xxutils and a few other things
« Reply #18 on: December 13, 2019, 10:20:00 pm »
Thanks.  I'll have time to look at it in a week or so.  I'm keen to get it on github and I'll look at making it location independent too - it's difficult, if not impossible, to find the location of the source code at runtime from within the macro unless it's in a "known location".  There's a problem to find as well - step through modified lines sometimes goes to the end of a file when it shouldn't  - it started going wrong only a few months ago.

Graeme

  • Senior Community Member
  • Posts: 2526
  • Hero Points: 329
Re: xretrace, xxutils and a few other things
« Reply #19 on: January 09, 2021, 04:40:16 am »
The latest xretrace & xxutils etc. is now available in github - see this thread
https://community.slickedit.com/index.php/topic,15156.msg69252.html#msg69252

xxutilis includes these macros which have slight differences to the built-in macros.

xcursor_to_next_token
xcursor_to_prev_token
xselect_to_next_token
xselect_to_prev_token
xfind_next_whole_word_at_cursor
xfind_prev_whole_word_at_cursor
xquick_search
xquick_reverse_search
« Last Edit: January 09, 2021, 06:43:01 am by Graeme »

rowbearto

  • Senior Community Member
  • Posts: 1881
  • Hero Points: 122
Re: xretrace, xxutils and a few other things
« Reply #20 on: January 11, 2021, 02:13:14 pm »
Thanks Graeme!

I think it would be useful if you added the instructions in the github. Maybe a text file or readme markup in the xretrace folder in the github?

I'm finding myself looking back through this thread for the instructions on what to do when I install the new xretrace.

rowbearto

  • Senior Community Member
  • Posts: 1881
  • Hero Points: 122
Re: xretrace, xxutils and a few other things
« Reply #21 on: April 25, 2021, 03:17:36 am »
Hi Graeme:

Thanks again for the wonderful xretrace macro.

I loaded up your latest one but I was still having issues similar to what I reported before. This time after pressing any key in the menu SE was reporting that I pressed ESC even though I was not pressing ESC. So I made a pull request where I filter out ESC for 500msec after any key is pressed.

Here is the pull request:

https://github.com/jporkka/slickMacros/pull/2

Thanks,
Rob

Graeme

  • Senior Community Member
  • Posts: 2526
  • Hero Points: 329
Re: xretrace, xxutils and a few other things
« Reply #22 on: April 25, 2021, 09:36:28 am »
Hi Rob
Thanks.  I'm not sure what the effect of your change is but I've merged and committed.  If you have the user rights, feel free to update xretrace in the master branch yourself.

It's a shame that user macros aren't a bit easier for people to find and download.  I haven't done a very good job of indicating which version of slickedit my macros work with though.

rowbearto

  • Senior Community Member
  • Posts: 1881
  • Hero Points: 122
Re: xretrace, xxutils and a few other things
« Reply #23 on: April 25, 2021, 03:42:37 pm »
Hi Grame:

Thanks for merging it. Since you 'own' this macro I wanted your review first so that is why I didn't attempt to push it to master myself, preferred your buy-in.

In your readme.txt you point to: https://community.slickedit.com/index.php/topic,16598.msg64005.html#msg64005

The instructions in that post first say: "Have a read of the info towards the end of the xload-macros.e source file."

But towards the end of xload-macros it states:

Quote
4) Load this module xload-macros.e then run the command xload_macros.

But there is no 'xload_macros' anymore. So I think this text needs updating.

I ended up going back to your post in the forum and did the "loading xload-macros.e then run the macro xload_macros_default_path_silent"

So the text at the end of xload_macros.e needs an update. I think there is even more outdated stuff there that needs update such as:

Quote
  #define XRETRACE_PATH _ConfigPath() :+ 'xretrace' :+ FILESEP
  #define XRETRACE_MODULE_NAME XRETRACE_PATH :+ 'xretrace.e'
  #define  XRETRACE_DATA_PATH  'c:/temp'
  #define  XRETRACE_USE_SUBFOLDER YES

  It is recommended that XRETRACE_PATH be left as is - anything else is untested.

Thanks again for this great macro!

Rob

rowbearto

  • Senior Community Member
  • Posts: 1881
  • Hero Points: 122
Re: xretrace, xxutils and a few other things
« Reply #24 on: April 25, 2021, 04:02:09 pm »
Hi Graeme:

I have some more confusion maybe you can help.

Initially I did the following:

1. Cloned the github repo in a directory outside the config directory
2. Copied the 'xretrace' directory from the git clone to my <configdir>/25.0.1/xretrace
3. Loaded the file "<configdir>/25.0.1/xretrace/xload-macros.e' into the editor
4. Ran 'load'
5. Ran 'xload_macros_default_path_silent'
6. Ran 'xretrace_cursor_steps' and enabled the macro

Then I noticed the problem with the 'ESC' key so I modified the <configdir>/25.0.1/xretrace/xretrace.e file with my modifications and did 'load'.

But now I notice I have 2 directories with xretrace:

<configdir>/25.0.1/xretrace
<configdir>/25.0.1/UserMacros/xretrace

The one in 'UserMacros' doesn't have my updated xretrace.e.

I tried running 'xload_macros_default_path_silent' thinking that it somehow copied these files to 'UserMacros', but after doing that 'UserMacros' still has the old xretrace.e. However it seems that SE is using my modified xretrace.e from the other config directory outside UserMacros.

Now I would like to have only 1 xretrace directory, and I would like it to migrate when I update SE to a new version.

So which one should stick around? The 'UserMacros' one or the other one under my config?

Now that I don't plan to modify the macro anymore, what is the best way that I should have it installed in just one directory under my config instead of in 2 directories?

I also could not find instructions to 'uninstall' it.

Thanks,
Rob

rowbearto

  • Senior Community Member
  • Posts: 1881
  • Hero Points: 122
Re: xretrace, xxutils and a few other things
« Reply #25 on: April 25, 2021, 04:11:41 pm »
I ended up doing Macro->List User Loaded Modules.

It showed all my xtrace .ex files in the UserMacros except for the xload in my <config>/25.0.1/xretrace dir.

I then used this menu to unload all xretrace's .ex files.

I then deleted both:

<config>/25.0.1/xretrace
<config>/25.0.1/UserMacros/xretrace

Then I copied from the git clone:

cp -rp <gitclone>/xretrace <config>/25.0.1/UserMacros/xretrace

The I loaded the xload-macros.e from the UserMacros dir and ran:

xload_macros_default_path_silent

Then I saw from 'Macro->List User Loaded Modules' that all xretrace .ex files were from the 'UserMacros' directory. And all the .e in UserMacros are the latest ones.

Seems like this is the best way to continue forward and have xretrace kept when I upgrade SE to next version?

Graeme

  • Senior Community Member
  • Posts: 2526
  • Hero Points: 329
Re: xretrace, xxutils and a few other things
« Reply #26 on: April 25, 2021, 11:18:49 pm »
Hi Rob

Thanks for all your comments.  I have a sore wrist at the moment and I'm trying to minimise my typing but I will try to get this sorted out in the next few days.  I'm not sure what the status of the slick plugin mechanism is at the moment but at some stage I will switch it to use that too.