RSS

 
  Macro package

Auto Mode

ZIP FileWindows 9x SFXWindows NT SFX
WinEdt_AutoMode.zip
(10 K)
WinEdt_AutoMode_9x.exe
(36 K)
WinEdt_AutoMode_NT.exe
(36 K)
Last update on: 17.12.2001

About

Lot of people are writing multi-mode projects, i.e. files of different modes are opened in one project. For example HTML and CSS, HTML and Perl (CGI) or LaTeX and HTML. While editing a user can choose a mode specific layout (tool bar and menus [Insert, Accessories and Help]) but this way editing is comfortable only in "main" mode, in others you have to manage yourself.

One way of overcoming this problem is to append a second mode menu to "main" menu. But what if you are working with 5 mode files?

AutoMode changes the layout (tool bar and menus [Insert, Accessories and Help]) automatically according to definitions found in %b\Config\AutoMode\modes.edt. This way you can work on a LaTeX file (and have all the LaTeX mode benefits) and move to a HTML file and have HTML tool bar and HTML Insert, Accessories and Help menu. When you click back you have a LaTeX layout again. It may cause a little flickering on the screen but this is the price of comfortable editing. Also it can be easily turned off.

Installation

The contents of a ZIP file should be extracted in %b\Config\AutoMode directory. Note that %b is different from %B. While %B always means the WinEdt program directory (usually it is C:\Program Files\WinEdt Team\WinEdt) %b means:

on Windows 95/98/Me:
equals %B
(usually it is C:\Program Files\WinEdt Team\WinEdt)
on Windows NT/2000/XP working as Administrator (or single user mode):
equals %B
(usually it is C:\Program Files\WinEdt Team\WinEdt)
on Windows NT/2000/XP working as an ordinary user:
equals <userprofile>\Application Data\WinEdt
(usually it is C:\Documents and Settings\<username>\Application Data\WinEdt or C:\WinNT\Profiles\<username>\Application Data\WinEdt)

To make this easier this macro component is distributed in three packages:

  1. Plain ZIP file WinEdt_AutoMode.zip for general purpose. Unzip it to %b\Config\AutoMode and execute install.edt
  2. Self extracting ZIP file with installer WinEdt_AutoMode_9x.exe for users that are using Windows 9x/Me or Windows NT/2000/XP as Administrator. By default the installer sets the target directory to C:\Program Files\WinEdt Team\WinEdt\Config\AutoMode After installation the Explorer opens in the target directory allowing you to open install.edt in WinEdt and execute it via Macros|Execute Macro...|install.edt
  3. Self extracting ZIP file with installer WinEdt_AutoMode_NT.exe for users that are using Windows NT/2000/XP as an ordinary user. By default the installer sets the target directory to <userprofile>\Application Data\WinEdt\Config\AutoMode (usually C:\Documents and Settings\<username>\Application Data\WinEdt\Config\AutoMode or C:\WinNT\Profiles\<username>\Application Data\WinEdt\Config$name). After installation the Explorer opens in the target directory allowing you to open install.edt in WinEdt and execute it via Macros|Execute Macro...|install.edt

What does it contain?

After installation a menu Options|Auto Mode (Figure 1) is added. Using it you can

    Add Mode
    Add new mode definition
    Remove mode
    Remove one of the existing defintions
    Edit default mode
    Set the default mode (this mode will be applied when none of the defined modes is matched)
    Enable Auto Mode
    Enable automode
    Disable Auto Mode
    Sometimes you would like to disable it :-)

Adding a mode

  1. Choose Options|Auto Mode|Add Mode
  2. Enter a mode. Be careful to enter an existing mode! (Figure 2)
  3. Enter a macro to execute for that mode (Figure 3) or leave it blank for browse (Figure 4)
  4. That's it

Removing a mode

  1. Choose Options|Auto Mode|Remove Mode
  2. Choose a mode from the list (Figure 5)
  3. Confirm the deletion (Figure 6)
  4. The mode is deleted

Setting the default mode

  • Choose Options|Auto Mode|Edit Default Mode
  • Enter a new default mode, current default mode is shown by default (Figure 7)
  • Mode contributed by D Stancer (denis@srce.hr)