Crunch CRiSP File Editor 6 User Manual

Page 44

Advertising
background image

Page 44

new file.

17

(REG_FILE_MOD) This is the modified file trigger. It is called when Crisp detects that
the corresponding file on disk for a buffer has been modified. This is used to detect
situations where Crisp hasn't completely read in a file but maybe another editing session
has destroyed the file. The calling macro should return an integer value to indicate
whether the buffer should continue to be edited, or truncated at the current load point. A
value of zero means to stop further editing. A value greater than zero means to continue
editing of the buffer.

18

(REG_WINDOW_EVENT) This trigger is reserved for GUI related windowing events.
The macro will be called with a string. The current values are: "OPEN" will be passed
when the window is mapped to the screen (i.e. uniconised); "CLOSE" when the window
is iconised (unmapped).

19

(REG_SCROLLBAR) Reserved.

20

(REG_KEY_ACTIVITY). This is used to detect any keyboard input. It is similar to the
REG_TYPED (0) trigger but may be used to detect a key being pressed even if no key is
inserted into the buffer. This trigger is only called when CRiSP is waiting in the current
process() level input loop. It will not necessarily be triggered by the various primitives
which wait for a key (e.g. read_char()).

21

(REG_SCREEN). The current screen has changed, e.g. the user has moved the mouse
into another screen window. The macro is called with a single integer argument
indicating the screen number which was selected. The calling macro would normally call
set_screen() to allow the screen change to take place. If this function is not called then
the user cannot change to the designated screen.

22

(REG_PROC_DIED). This triggers calls the specified macro within the context of the
buffer which died, indicating that an attached process buffer has terminated.

23

(REG_UNTYPED). This is the exact converse of REG_TYPED, i.e. a trigger will be
called after any keystroke which does NOT insert a character.

24

(REG_WRITE_FILE). Called whenever a file is successfully written. Used to allow the
audit macro to make a log fo all files which are modified. The registered macro is called
with the filename of the buffer which has just successfully been written.

25

(REG_LOCKING). Reserved.

26

(REG_SIGNAL). A SIGUSR1 or SIGUSR2 signal has been received.

27

(REG_EXCEPTION). This callback is used to intercept macro execution errors. The
callback macro is passed an error code and a name indicating the macro or variable
causing the exception condition.

28

(REG_NEW_FILE_CLASS)

29

(REG_NEW_FILE_INSTANCE)

30

(REG_BOOKMARK) A bookmark has been dropped or deleted.

31

(REG_BUFFER_DELETED) A buffer has been deleted. This trigger is called twice when
a buffer is deleted. The first time it is called with an argument which is the buffer-id of the
buffer about to be deleted. The second time it is called after the buffer is deleted (buffer
id arg is blank or zero).

32

(REG_UNDEFINED_MACRO) An undefined macro was called. Argument passed is
name of macro.

33

(REG_INSERT_MODE) Insert mode has changed.

34

(REG_REMEMBER) A keystroke macro is being recorded or has stopped recording.

35

(REG_DELETE_SCREEN) Screen is about to be destroyed.

36

(REG_BUFFER_MOD) Buffer has been modified. This is in contrast to REG_FILE_MOD
which indicates something external to CRiSP has modified a file being edited.
REG_BUFFER_MOD will happen the first time you insert or delete characters into a
clean buffer. This trigger is also called when the buffer is 'unmodified', e.g. if you keep on

Advertising