; .EnTete "Le-Lisp (c) version 15.2" " " "Macedit"
; .EnPied "macedit.ll" "%" " "
; .SuperTitre "Les macros de l'e'diteur"
;
; .Auteur "Bernard Serpette"
;
; .Centre "*****************************************************************"
; .Centre " (c) Le-Lisp est une marque de'pose'e de l'INRIA                 "
; .Centre "*****************************************************************"
;
; .Centre "$Header: macedit.ll,v 4.1 88/01/13 12:35:26 kuczynsk Rel $"

(unless (>= (version) 15.2)
     (error 'load 'erricf 'macedit))

; .Section "Les macros de l'e'diteur"
; Ce fichier contient toutes les macros concernant la structure edit. Il
; doit e↑tre charge' pour toutes extensions interpre'te'es, il doit e↑tre
; aussi pre'sent dans l'environnement de compilation (cle' include des
; modules).

(defstruct buffer
   (buffer  (vector #:edit:null-strg))
   (modif   3)
   (nolgn   0)
   (markx   ())
   (marky   ())
   (ldo     0) )

(defstruct edit
   (pbuffer (#:buffer:make))
   (curx    0)
   (cury    0) )

(defmacro BUF-NEW             (e)   `(trap-edit 00 ,e ()))
(defmacro BUF-LINK            (e a) `(trap-edit 01 ,e ,a))
(defmacro BUF-UNLINK          (e)   `(trap-edit 02 ,e ()))
(defmacro BUF-READONLY        (e)   `(trap-edit 42 ,e ()))
(defmacro BUF-READWRITE       (e)   `(trap-edit 43 ,e ()))

(defmacro CUR-TOP             (e)   `(trap-edit 03 ,e ()))
(defmacro CUR-BUTTOM          (e)   `(trap-edit 04 ,e ()))
(defmacro CUR-BEGLINE         (e)   `(trap-edit 05 ,e ()))
(defmacro CUR-ENDLINE         (e)   `(trap-edit 06 ,e ()))
(defmacro CUR-LEFT            (e)   `(trap-edit 07 ,e ()))
(defmacro CUR-RIGHT           (e)   `(trap-edit 08 ,e ()))
(defmacro CUR-UP              (e)   `(trap-edit 09 ,e ()))
(defmacro CUR-DOWN            (e)   `(trap-edit 10 ,e ()))
(defmacro CUR-YGOTO           (e a) `(trap-edit 11 ,e ,a))
(defmacro CUR-XGOTO           (e a) `(trap-edit 12 ,e ,a))

(defmacro CHAR-INSERT         (e a) `(trap-edit 13 ,e ,a))
(defmacro CHAR-DELETE         (e)   `(trap-edit 14 ,e ()))
(defmacro CHAR-DELETE-BACK    (e)   `(trap-edit 15 ,e ()))
(defmacro CHAR-TRANSPOSE      (e)   `(trap-edit 41 ,e ()))

(defmacro WORD-INSERT         (e a) `(trap-edit 16 ,e ,a))
(defmacro WORD-DELETE         (e)   `(trap-edit 17 ,e ()))
(defmacro WORD-DELETE-BACK    (e)   `(trap-edit 18 ,e ()))
(defmacro WORD-FIRST-CHAR     (e)   `(trap-edit 19 ,e ()))
(defmacro WORD-LAST-CHAR      (e)   `(trap-edit 20 ,e ()))
(defmacro WORD-LEFT           (e)   `(trap-edit 21 ,e ()))
(defmacro WORD-SEARCH         (e a) `(trap-edit 22 ,e ,a))
(defmacro WORD-REVERSE-SEARCH (e a) `(trap-edit 23 ,e ,a))
(defmacro WORD-GET-SYMBOL     (e)   `(trap-edit 24 ,e ()))

(defmacro LINE-INSERT         (e)   `(trap-edit 25 ,e ()))
(defmacro LINE-NEW            (e a) `(trap-edit 26 ,e ,a))
(defmacro LINE-BREAK          (e)   `(trap-edit 27 ,e ()))
(defmacro LINE-RETURN         (e)   `(trap-edit 28 ,e ()))
(defmacro LINE-DELETE         (e)   `(trap-edit 29 ,e ()))
(defmacro LINE-GET            (e)   `(trap-edit 30 ,e ()))
(defmacro LINE-BOL            (e)   `(trap-edit 31 ,e ()))
(defmacro LINE-EOL            (e)   `(trap-edit 32 ,e ()))

(defmacro MARK-SET            (e)   `(trap-edit 33 ,e ()))
(defmacro MARK-EXCHANGE       (e)   `(trap-edit 34 ,e ()))
(defmacro MARK-COPY           (e)   `(trap-edit 35 ,e ()))
(defmacro MARK-DELETE         (e)   `(trap-edit 36 ,e ()))

(defmacro FILE-READ           (e a) `(trap-edit 37 ,e ,a))
(defmacro FILE-INSERT         (e a) `(trap-edit 38 ,e ,a))
(defmacro FILE-PRINT          (e a) `(trap-edit 39 ,e ,a))

(defmacro BEGIN-EXPR          (e)   `(trap-edit 40 ,e ()))
(defmacro NEXT-EXPR           (e)   `(trap-edit 44 ,e ()))
(defmacro PREVIOUS-EXPR       (e)   `(trap-edit 45 ,e ()))