;;; These are macros for MicroEMACS for Windows,
;;; to do three simple Hardy operations from the comfort
;;; of your MicroEMACS session:
;;;
;;;   o load the current file of CLIPS constructs
;;;   o batch the current file of CLIPS constructs and commands
;;;   o execute the current CLIPS line
;;;
;;; You need to append this to your emacs.rc file, and make
;;; sure that the tellhrdy.exe program is in your
;;; path.

; Load this file into Hardy
22      store-macro
        set %tmp &cat "tellhrdy.exe L " $cfname
        execute-program %tmp
!endm

; Batch this file into Hardy
23      store-macro
        set %tmp &cat "Hardy.exe B " $cfname
        execute-program %tmp
!endm

; Execute the current line as a CLIPS command.
; The cursor must be on the line. A more sophisticated
; macro could execute a whole CLIPS expression.
; Note that $kill only gets the first 127 characters
; of the region.

24      store-macro
        beginning-of-line
        set-mark
        end-of-line
        copy-region
        set %tmp2 &cat "tellhrdy.exe E " $kill
        execute-program %tmp2
!endm

;;; Bind to function keys 1, 2 and 3.
bind-to-key execute-macro-22		FN1
bind-to-key execute-macro-23		FN2
bind-to-key execute-macro-24		FN3

