Loading ...
Sorry, an error occurred while loading the content.

Template changed by directory?

Expand Messages
  • Jeremy Cowgar
    Is it possible to change new templates base upon directory? For instance, I may be working on one project for work, then turn around and work on a GNU project
    Message 1 of 3 , Oct 11, 2007
    • 0 Attachment
      Is it possible to change new templates base upon directory? For
      instance, I may be working on one project for work, then turn around and
      work on a GNU project which require a totally different template. Any
      thoughts?

      Jeremy Cowgar
    • Phillips, Steven
      Jeremy, I have 3 potential solutions for this, I m sure there are more. 1) Make use of sessions - I have an ME running for each main project area and each one
      Message 2 of 3 , Oct 12, 2007
      • 0 Attachment
        Jeremy,
         
        I have 3 potential solutions for this, I'm sure there are more.
         
        1) Make use of sessions - I have an ME running for each main project area and each one uses a different session (so each has a different color scheme so I can easily tell them apart), this can be used to solve your problem as follows:
         
        !if &exi %session-name
            set-variable $search-path &spr "%s%s;%s" $user-path %session-name $search-path
        !endif
         
        Put this into your startup macro file, it puts '<your user path>/<session name>' into the search path so if your user path is 'c:/me/jeremy' & session is 'gnu' then it adds 'c:/me/jeremy/gnu', put all your gnu project override files (i.e. gnu etf templates) into this directory.
         
        2) Similar to (1) you could create simple macros to set the path in the same session, add the following to your user file:
         
        set-variable %init-search-path $search-path
         
        define-macro GNU-project
            set-variable $search-path &spr "%sgnu;%s" $user-path %init-search-path
        !emacro
         
        Simply execute the GNU-project command when you need to start using GNU templates.
         
        3) A more manual solution is to use multiple templates in the etf files. When you create a new file it will always insert the first template, but if this is the wrong one then delete it and use the insert-template command to insert the correct one. Following is an example of an etf file containing multiple templates:
         
        ---------------------
        $TEMPLATES$Temp1$Temp2$Temp3$
         
        $TEMPLATE_START$Temp1$
        This is template example 1
         
           Created By : $USER_NAME$ Created : $ASCII_TIME$
         
        $TEMPLATE_END$Temp1$
        $TEMPLATE_START$Temp2$
        This is template example 2
         
           $COMPANY_NAME$ : $USER_NAME$ - $ASCII_TIME$
         
        $TEMPLATE_END$Temp2$
        $TEMPLATE_START$Temp3$
        This is template example 3
         

          Created: $ASCII_TIME$ Synopsis: Authors: $USER_NAME$
         
        $TEMPLATE_END$Temp3$
        ----------------
         
        The $TEMPLATES$ line must be on the first line, the template names (Temp1, Temp2 & Temp3 in this example) can be anything you like and you can also have as many as you like.
        Steve
         


        From: jasspa@yahoogroups.com [mailto:jasspa@yahoogroups.com] On Behalf Of Jeremy Cowgar
        Sent: 11 October 2007 15:15
        To: jasspa@yahoogroups.com
        Subject: [jasspa] Template changed by directory?

        Is it possible to change new templates base upon directory? For
        instance, I may be working on one project for work, then turn around and
        work on a GNU project which require a totally different template. Any
        thoughts?

        Jeremy Cowgar

      • cp200205
        Thanks. I got it working. However, one note, I am on Linux (Debian) and the %s%s;%s was really giving me fits. Took a while in my slow brain to realize it
        Message 3 of 3 , Dec 27, 2007
        • 0 Attachment
          Thanks. I got it working. However, one note, I am on Linux (Debian)
          and the %s%s;%s was really giving me fits. Took a while in my slow
          brain to realize it should have been a : .. once I got that,
          everything worked great.

          Thanks,

          Jeremy

          --- In jasspa@yahoogroups.com, "Phillips, Steven" <sphillips@...> wrote:
          >
          > Jeremy,
          >
          > I have 3 potential solutions for this, I'm sure there are more.
          >
          > 1) Make use of sessions - I have an ME running for each main project
          > area and each one uses a different session (so each has a different
          > color scheme so I can easily tell them apart), this can be used to solve
          > your problem as follows:
          >
          > !if &exi %session-name
          > set-variable $search-path &spr "%s%s;%s" $user-path %session-name
          > $search-path
          > !endif
          >
          > Put this into your startup macro file, it puts '<your user
          > path>/<session name>' into the search path so if your user path is
          > 'c:/me/jeremy' & session is 'gnu' then it adds 'c:/me/jeremy/gnu', put
          > all your gnu project override files (i.e. gnu etf templates) into this
          > directory.
          >
          > 2) Similar to (1) you could create simple macros to set the path in the
          > same session, add the following to your user file:
          >
          > set-variable %init-search-path $search-path
          >
          > define-macro GNU-project
          > set-variable $search-path &spr "%sgnu;%s" $user-path
          > %init-search-path
          > !emacro
          >
          > Simply execute the GNU-project command when you need to start using GNU
          > templates.
          >
          > 3) A more manual solution is to use multiple templates in the etf files.
          > When you create a new file it will always insert the first template, but
          > if this is the wrong one then delete it and use the insert-template
          > command to insert the correct one. Following is an example of an etf
          > file containing multiple templates:
          >
          > ---------------------
          > $TEMPLATES$Temp1$Temp2$Temp3$
          >
          > $TEMPLATE_START$Temp1$
          > This is template example 1
          >
          > Created By : $USER_NAME$ Created : $ASCII_TIME$
          >
          > $TEMPLATE_END$Temp1$
          > $TEMPLATE_START$Temp2$
          > This is template example 2
          >
          > $COMPANY_NAME$ : $USER_NAME$ - $ASCII_TIME$
          >
          > $TEMPLATE_END$Temp2$
          > $TEMPLATE_START$Temp3$
          > This is template example 3
          >
          >
          > Created: $ASCII_TIME$ Synopsis: Authors: $USER_NAME$
          >
          > $TEMPLATE_END$Temp3$
          > ----------------
          >
          > The $TEMPLATES$ line must be on the first line, the template names
          > (Temp1, Temp2 & Temp3 in this example) can be anything you like and you
          > can also have as many as you like.
          >
          > Steve
          >
          >
          >
          >
          > ________________________________
          >
          > From: jasspa@yahoogroups.com [mailto:jasspa@yahoogroups.com] On
          > Behalf Of Jeremy Cowgar
          > Sent: 11 October 2007 15:15
          > To: jasspa@yahoogroups.com
          > Subject: [jasspa] Template changed by directory?
          >
          >
          >
          >
          > Is it possible to change new templates base upon directory? For
          > instance, I may be working on one project for work, then turn
          > around and
          > work on a GNU project which require a totally different
          > template. Any
          > thoughts?
          >
          > Jeremy Cowgar
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.