Lugaru's Epsilon
Programmer's
Editor

Context:
Epsilon User's Manual and Reference
   Commands by Topic
      . . .
      Starting and Stopping Epsilon
         Session Files
         File Associations and DDE
         Sending Files to a Prior Session
         MS-Windows Integration Features
      Running Other Programs
         The Concurrent Process
         Compiling From Epsilon
         DOS Concurrent Process
      Repeating Commands
         Repeating a Single Command
         Keyboard Macros
      . . .

Previous   Up    Next
The Concurrent Process  Commands by Topic   DOS Concurrent Process


Epsilon User's Manual and Reference > Commands by Topic > Running Other Programs >

Compiling From Epsilon

Many compilers produce error messages in a format that Epsilon can interpret with its next-error command on Ctrl-X Ctrl-N. The command searches in the process buffer (beginning at the place it reached last time, or at the beginning of the last command) for a line that contains a file name, a line number, and an error message. If it finds one, it uses the find-file command to retrieve the file (if not already in a window), then goes to the appropriate line in the file. With a numeric argument, it finds the nth next error message, or the nth previous one if negative. In particular, a numeric argument of 0 repeats the last message. The previous-error command on Ctrl-X Ctrl-P works similarly, except that it searches backward instead of forward.

The Ctrl-X Ctrl-N and Ctrl-X Ctrl-P keys move back and forth over the list of errors. If you move point around in a process buffer, it doesn't change the current error message. You can use the find-linked-file command on Ctrl-X Ctrl-L to reset the current error message to the one shown on the current line. (The command also goes to the indicated source file and line, like Ctrl-X Ctrl-N would.)

Actually, Ctrl-X Ctrl-N runs the next-position command, not next-error. The next-position command usually calls next-error. After you use the grep command (see Searching Multiple Files), however, next-position calls next-match instead, to move to the next match of the pattern you searched for. If you use any command that runs a process, or run next-error explicitly, then next-position will again call next-error to move to the next error message.

Similarly, Ctrl-X Ctrl-P actually runs previous-position, which decides whether to call previous-error or previous-match based on whether you last ran a compiler or searched across files.

To locate error messages, the next-error command performs a regular-expression search using a pattern that matches most compiler error messages. See Regular Expressions for an explanation of regular expressions. The command uses the ERROR_PATTERN macro, defined in the file proc.e. You can change this pattern if it doesn't match your compiler's error message format. The next-error command also uses another regular-expression pattern to filter out any error messages Epsilon should skip over, even if they match ERROR_PATTERN. The variable ignore-error stores this regular expression. For example, if ignore-error contains the pattern ".*warning", Epsilon will skip over any error messages that contain the word "warning".

The command view-process on Shift-F3 can be convenient when there are many long error messages in a compilation. It pops up a window showing the process buffer and its error messages, and lets you move to a particular line with an error message and press <Enter>. It then goes to the source file and line in error. You can also use it to see the complete error message from the compiler, when next-error's one-line display is inadequate.

The make command on Ctrl-X M functions somewhat like the push command. It always runs a single program, rather than an interactive command processor shell, and always captures the output of the program, regardless of the setting of the variable capture-output. It automatically runs next-error for you when the process returns. By default, it runs a program called "make", but with a numeric argument it will prompt for the command line to execute just like the push command does. It will use that command line from then on, if you invoke make without a numeric argument. See the variable start-make-in-buffer-directory to control which directory the new process starts in.

Epsilon uses a template for the command line (stored in the push-cmd variable), so you can define a command line that depends on the current file name. See Backup Files for information on templates. For example, cl %f runs the cl command, passing it the current file name.

If a concurrent process already exists, Epsilon will attempt to run the program concurrently by typing its name at the end of the process buffer (in those environments where Epsilon isn't capable of creating more than one process buffer). When Epsilon uses an existing process buffer in this way, it will run next-error only if you've typed no keys during the execution of the concurrent program. You can set the variable concurrent-make to 0 to force Epsilon to exit any concurrent process, before running the "make" command. Set it to 2 to force Epsilon to run the command concurrently, starting a new concurrent process if it needs to. When the variable is 1 (the default), the make command runs the compiler concurrently if a concurrent process is already running, non-concurrently otherwise.

Whenever push or make exit from a concurrent process to run a command non-concurrently, they will restart the concurrent process once the command finishes. Set the restart-concurrent variable to zero if you don't want Epsilon to restart the concurrent process in this case.

Before make runs the program, it checks to see if you have any unsaved buffers. If you do, it asks if it should save them first, displaying the buffers using the bufed command. If you say yes, then the make command saves all of your unsaved buffers using the save-all-buffers command (which you can also invoke yourself with Ctrl-X S). You can modify the save-when-making variable to change this behavior. If it has a value of 0, Epsilon won't warn you that you have unsaved buffers. If it has a value of 1, Epsilon will automatically save all the buffers without asking. If it has a value of 2 (as it has normally), Epsilon asks.

The compile-buffer command on Alt-F3 is somewhat similar to make, but tries to compile only the current file, based on its extension. There are several variables like compile-cpp-cmd you can set to tell Epsilon the appropriate compilation command for each extension. If Epsilon doesn't know how to compile a certain type of file, it will prompt for a command line. While Epsilon's make command is good for compiling entire projects, compile-buffer is handy for compiling simple, one-file programs.

The command is especially convenient for EEL programmers because compile-buffer automatically loads the EEL program into Epsilon after compiling it. In Epsilon for 32-bit Windows and Unix, the EEL compiler is integrated into Epsilon, so Epsilon doesn't need to run another program to compile. When Epsilon compiles EEL code using its internal EEL compiler, it looks in the compile-eel-dll-flags variable for EEL command line flags.

The buffer-specific concurrent-compile variable tells compile-buffer whether to run the compiler concurrently. The value 2 means always run the compiler concurrently, 0 means never run concurrently, and 1 means run concurrently if and only if a concurrent process is already running. The value 3 (the default) means use the value of the variable concurrent-make instead. (The concurrent-make variable tells the make command whether to run its program concurrently, and takes on values of 0, 1, or 2 with the same meaning as for concurrent-compile.)

Standard bindings:

  Ctrl-X Ctrl-N  next-position
 Ctrl-X Ctrl-P  previous-position
   next-error
   previous-error
 Shift-F3  view-process
 Ctrl-X M  make
 Alt-F3  compile-buffer
 



Previous   Up    Next
The Concurrent Process  Commands by Topic   DOS Concurrent Process


Lugaru Copyright (C) 1984, 2020 by Lugaru Software Ltd. All rights reserved.