Author Topic: Aliases not expanding for some extensions  (Read 4062 times)

Margaret

  • Community Member
  • Posts: 70
  • Hero Points: 0
Aliases not expanding for some extensions
« on: May 30, 2012, 11:49:03 AM »
Context: v9.0 under XPProSP3

The alias expansion doesn't trigger on space or ctl-space.  E.g., '<fun ' should expand to a function skeleton, but doesn't.  Currently this problem is affecting 2 custom extensions, one of which refers-to the other, but in the past it has effected predeclared ones (e.g. .js). 

The 'syntax expansion' box is checked.  Tools->Options->File Extension Setup shows the correct extension and the correct alias filename, and clicking the Aliases button shows the correct alias definitions.

I haven't noticed any pattern to the behavior, and neither re-starting the editor nor re-booting is guaranteed to help.

The only thing that I know fixes the problem is a re-install(!), but that's pretty drastic and I'd obviously rather not do it if there's some cheaper way that I'm consistently failing to find.

I did a search on 'aliases' but nothing stood out as being relevant.  Any ideas?

Graeme

  • Senior Community Member
  • Posts: 2827
  • Hero Points: 347
Re: Aliases not expanding for some extensions
« Reply #1 on: May 30, 2012, 02:01:23 PM »
Are you saying that alias expansion has stopped working for certain file extensions and it previously used to work?

Quote
I haven't noticed any pattern to the behavior, and neither re-starting the editor nor re-booting is guaranteed to help.
Does this mean it sometimes works and sometimes doesn't?
Does this mean that re-starting the editor sometimes fixes it?
If re-starting the editor fixes it, how long before it goes wrong again?

How do you know that re-installing fixes it  - how many re-installs have you done?
If re-installing fixes it, how long before it goes wrong again?
If you re-install, do you also create a brand new configuration folder or do you continue with your existing configuration folder and alias files?

Does it make any difference if you have a selection active at the time?

Some things you could try.

First
Try a brand new configuration folder by using the -sc switch when you invoke slickedit
vs.exe +new -sc "some-empty-folder"
Slick should create a new config folder.  In your new configuration folder, you should see some *,als files.  Make a copy of them into some other folder e.g. tempalias.
Then add some aliases and see if they work reliably.  If they do work reliably then, 1. it suggests the problem is in your configuration folder and that re-installing should never be needed  2. You could compare the alias files in tempalias (and also your modified alias files)with your old alias files in your old config folder.
If a new config folder fixes the problem reliably, you could go back to your old config folder, close slickedit, make a backup copy of your entire config folder, then delete vslick.sta from your config folder.  Run slickedit and see if aliases work.  You might lose a small amount of configuration settings doing this.  If you need to, you can restore your config folder from the backup you made.

Alternatively
Type what-is on the slick command line, then press the key combination you use to invoke the alias expansion.  Slickedit should tell you the name of the function bound to that key.
On the slick command line, type
fp function-name
where function-name is the name of the function bound to your key.
Slick should then open the file where that function is located.
You could try to understand the code you see if you want ...  but it's probably complicated, so, depending on the answers you give to my earlier questions, you could try re-loading the macro file by using the load-module command on the macro menu.  Reloading a macro file like this can occasionally fix a problem.


Margaret

  • Community Member
  • Posts: 70
  • Hero Points: 0
Re: Aliases not expanding for some extensions
« Reply #2 on: May 30, 2012, 04:09:03 PM »
Thanks for your response!

Are you saying that alias expansion has stopped working for certain file extensions and it previously used to work?

Yes.

Quote
Does this mean it sometimes works and sometimes doesn't?

Not in the way you possibly mean it -- it doesn't flicker on and off like a lightbulb that's on its way out.  Something will happen and it will stop working and stay that way for days or until I get fed up and re-install.

Quote
Does this mean that re-starting the editor sometimes fixes it?
If re-starting the editor fixes it, how long before it goes wrong again?

I probably shouldn't have phrased it that way, because while I don't clearly remember a re-start fixing it, I seem to have a vague recollection that once or twice it did.  But it was some time ago, and I can't recall details at all.

Quote
How do you know that re-installing fixes it  - how many re-installs have you done?

One way or another, probably a dozen.  Maybe more. 

Quote
If re-installing fixes it, how long before it goes wrong again?

There's no fixed period that I've been able to determine. That's the basic problem:  there isn't enough invariance for me to get a handle on anything.   

For example, this time it seems to have been caused by me experimenting with the "selective display" feature.  It complained that selective display wasn't available for my custom extensions and that I should load the proper module.  The files are really php files, the extensions being changed for security reasons. 

Anyway, like a dope instead of faking up a little dummy file with a php extension to do a preliminary test, I set the refers-to to php.  It didn't work, so I tried to undo the refers-to binding.  But it was so unwilling to let go that I finally had to delete the php extension.  That's when I found that the alias expansion had stopped working.


Quote
If you re-install, do you also create a brand new configuration folder or do you continue with your existing configuration folder and alias files?

I'd like to continue with the existing ones since they take forever to rebuild, but it seems to always create fresh ones.  That's one of the biggest annoyances, for me:  the installer follows the Windows model and shoves everything onto C: so that if anything happens to C: the mess is global.

Quote
Does it make any difference if you have a selection active at the time?

I can't recall ever having had one active.  Since alias expansion doesn't seem to work except in an empty line, I just use it for inserting skeletons and calling-sequence info.

Quote
Some things you could try.

First
Try a brand new configuration folder by using the -sc switch when you invoke slickedit
vs.exe +new -sc "some-empty-folder"
Slick should create a new config folder.  In your new configuration folder, you should see some *,als files.  Make a copy of them into some other folder e.g. tempalias.
Then add some aliases and see if they work reliably.  If they do work reliably then, 1. it suggests the problem is in your configuration folder and that re-installing should never be needed  2. You could compare the alias files in tempalias (and also your modified alias files)with your old alias files in your old config folder.
If a new config folder fixes the problem reliably, you could go back to your old config folder, close slickedit, make a backup copy of your entire config folder, then delete vslick.sta from your config folder.  Run slickedit and see if aliases work.  You might lose a small amount of configuration settings doing this.  If you need to, you can restore your config folder from the backup you made.

Alternatively
Type what-is on the slick command line, then press the key combination you use to invoke the alias expansion.  Slickedit should tell you the name of the function bound to that key.
On the slick command line, type
fp function-name
where function-name is the name of the function bound to your key.
Slick should then open the file where that function is located.
You could try to understand the code you see if you want ...  but it's probably complicated, so, depending on the answers you give to my earlier questions, you could try re-loading the macro file by using the load-module command on the macro menu.  Reloading a macro file like this can occasionally fix a problem.

Thanks.  I'll go try them.
« Last Edit: May 30, 2012, 06:21:34 PM by Margaret »

Graeme

  • Senior Community Member
  • Posts: 2827
  • Hero Points: 347
Re: Aliases not expanding for some extensions
« Reply #3 on: May 31, 2012, 02:53:26 AM »
ok.  It sounds like deleting vslick.sta might fix it.  If you get a stable configuration folder set up again, I suggest you make a backup copy of it so that you can restore it if something goes wrong again.  If you have the disk space you could do a daily backup so that you have a choice of what you go back to.  If you re-install and recreate your settings, the first thing you should is make a backup.

Margaret

  • Community Member
  • Posts: 70
  • Hero Points: 0
Re: Aliases not expanding for some extensions
« Reply #4 on: May 31, 2012, 10:40:29 AM »
Thanks! You were right: corrupted .sta file.   I'll remember that for next time.

I also have to thank you for telling me about the cmd-line switches.  I've owned and used slick since v4 (replacing Brief of sainted memory), but could never find documentation on the switches tho I was sure there must be some.  Probably the reason I couldn't find them was that they appear to be documented only under the Unix section and I've never had the slightest trouble with slick under Unix, surprise surprise.

(Edit:  it turns out that there's still some brokenness:  the \ key is producing the Yen glyph in the alias editor.)
« Last Edit: May 31, 2012, 10:57:10 AM by Margaret »