DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Backend : portable auto-handling by file extension  (Read 8,561 times)

slowmaker

  • Reinventing the wheel can be fun!
  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 51
    • Programming School - Deluxe Bonus Medal
Backend : portable auto-handling by file extension
« on: February 19, 2010, 07:09 PM »
I just finished a little helper app called Backend, which allows me to try different text editors while keeping my beloved auto-handling (i.e. runs the appropriate compiler or interpreter depending on the file extension of the currently edited doc). Some editors have this, some don't, some have it but make it really, really painful to use; Backend pretty much fixes that.

If you are a fickle text editor user like I (periodically) am, you might save yourself a bit of aggravation with this.
WinXP Home SP3 - PSPad 4.5.4

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • Plugin Coding Medal
    • Participated in NANY Challenge Three Times
Re: Backend : portable auto-handling by file extension
« Reply #1 on: March 16, 2010, 12:21 PM »
Interesting idea.

I was looking through the documentation and backend.ini and the following thoughts occurred:

I use a set up that aspires to be portable and one of the things I do is to launch PStart from a batch file after booting.  The batch file sets some environment variables which then become available to programs I launch via PStart (and I launch FARR from PStart, so FARR gets them too as well as programs launched from FARR).

One of the environment variables I set is called DRIVE and it's set up in the batch file as:

Code
set DRIVE=%~d0%

and subsequent environment variables refer to DRIVE.  I also have an environment variable named PAR (for portable applications root), which is set as:

Code
set PAR=%DRIVE%\apps

In backend.ini I notice you have:

Code
#app_drive_letter#:

as well as:

Code
_apps

I didn't read backend's source, but if it doesn't already, do you think it might be useful for it to handle environment variables?  My recent thinking is that file and folder path information stored by programs being wired to absolute (or even relative, though that seems a bit nicer) paths is an unhappy situation waiting to happen -- and I've been thinking that environment variable support for such things might lead to happier results.

What do you think?

slowmaker

  • Reinventing the wheel can be fun!
  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 51
    • Programming School - Deluxe Bonus Medal
Re: Backend : portable auto-handling by file extension
« Reply #2 on: March 21, 2010, 09:46 PM »
My apologies for the slow reply; I've been caught up in not-so-fun stuff for a while, but I'm beginning to regain some spare time now.

And, yes, I've thought about the environment variables angle; I've  considered adding that to Backend eventually, but I'm not sure yet whether it is actually necessary.

For instance, that capability is technically available in the sense that the command  line passed to the system via Backend can call batch files (which is how I typically use it), and of course those batch files can use environment variables as much as they like.

On the other hand, I've got to dive back into the source for Backend anyway to fix a glitch I noticed in how it handles undefined extensions, so I may play with adding the environment vars at that time.

So, the summary answer is that you can sort-of do it already, and I may add a more direct handling of that sort of thing in future.
WinXP Home SP3 - PSPad 4.5.4

Original address: https://www.donationcoder.com/forum/index.php?topic=21809.0