Author Topic: Associating "extension" with extensionless files  (Read 3386 times)

mzuber

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Associating "extension" with extensionless files
« on: January 22, 2008, 05:44:05 pm »
We have a bunch of files in the build that have no file extensions but are internally python documents.  Is there a way in Slickedit to say "all files matching this pattern (e.g. make*) are to be treated as extension .py"?

I'd like to get colorization, tagging, and such for these files but they don't have an extension and I don't have control over that...

thanks!

hs2

  • Senior Community Member
  • Posts: 2747
  • Hero Points: 288
Re: Associating "extension" with extensionless files
« Reply #1 on: January 22, 2008, 07:06:22 pm »

hs2

  • Senior Community Member
  • Posts: 2747
  • Hero Points: 288
Re: Associating "extension" with extensionless files
« Reply #2 on: January 22, 2008, 09:01:19 pm »
@mzuber: Was a bit short in time ..
This example could work for you in case you're using the 'userSelectEditMode' callback:
Code: [Select]
if ( (get_extension( p_buf_name ) == '') && pos( 'make', strip_filename( p_buf_name, 'PD' ), 1 ) ) {
      select_edit_mode( 'py', origBypassBufferSetup );
      return(0);
}
HS2

mzuber

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Re: Associating "extension" with extensionless files
« Reply #3 on: January 23, 2008, 05:39:36 pm »
that's fantastic.  thanks for the help, worked great. :D