# DME V1.4
# 1989 by Volker Rudolph
# Mit Ergnzungen von Franz Dimbeck

#Number of chars for tabs
set tabs 2
set proj m2:programme
margin            70
tabstop        $tabs
pageset           90

#  topedge 145
#  height  198
#  leftedge 4
#  width 735

  topedge 14
  height  198
  leftedge 4
  width 600

map help       (iconify)
map sc-nk1     (ping 1)
map sc-nk2     (ping 2)
map sc-nk3     (ping 3)

map  c-nk1     (pong 1)
map  c-nk2     (pong 2)
map  c-nk3     (pong 3)

map a-nk0 (ping 8 right wleft while ca (ifelse cl (tlate -32 right) right) pong 8)
map a-nk. (ping 8 right wleft while ca (ifelse cu (tlate +32 right) right) pong 8)
map a-nk1 (ping 8 right wleft if cl (tlate -32) pong 8)
map a-nk3 (if cu (tlate +32 right))
map a-nk2 (if cl (tlate -32 right))
map a-nk7 (scanf %1s findstr \$scanf next)
map a-nk8 (scanf %s findstr \$scanf next)
map a-enter (resize 76 6)
map sa-enter (resize 76 28)
map a-up (scanf %s findstr \$scanf ctags next)
map a-down ref
map c-s (left left scanf %1s del right (\$scanf))
map    f1       nexterr
map  s-f1       preverr
map    f2       currenterr
map  s-f2       firsterr
map  s-f3      (set oldfile \$filename newfile \$filename firsterr)
map  a-f3      (chfilename \$oldfile)
map    f3      (escimm (newfile `))
map    f4      (newwindow escimm (newfile `))
map    f5      (escimm (chfilename `))
map  s-f5      (newwindow f5)
map    f6      (saveold quit)
map    f7       arpsave
map    f8       quit
map    f9      (escimm (set proj `) cd \$proj/txt sac-nk9)
map  s-f9      (f9 execute (m2:m2Project  -b -r \$proj))
map    f10     (saveold)

map  c-i       (ignorecase toggle)
map  c-f       (escimm (find `))
map  c-n        next
map  c-p        prev
map  c-r       (escimm (multireplace ))
map sc-f       (escimm (findr ))
map sc-n        nextr
map sc-p        prevr

map  c-b       (toggle 9 if 9 unblock block)
map  c-u       (resettoggle 9 unblock)
map  c-e       (resettoggle 9 bsave t:dme.block bdelete)
map sc-e       (insfile t:dme.block)
map  c-m       (resettoggle 9 bmove)
map  c-d        bcopy
map sc-s       (goto block bsave t:dme.block execute (sort T:dme.block T:dme.sort) bdelete insfile T:dme.sort execute (delete T:dme.sort T:dme.block) resettoggle 9)

map    tab     (ifelse cb (goto block while cb (first repeat \$tabs (( )) down) goto block) (repeat tr (( ))))
map  s-tab     (ifelse cb (goto block while cb (first repeat \$tabs (if c=32 del) down) goto block) (repeat tl left) )
map  c-l       (escimm (insfile `))
map  c-w       (escimm (bsave `))

map  s-bs      (left while !ca (del left) while ca (del left) right)
map  s-del     (while !ca (ifelse r abort del) while ca del)
map  c-bs      (while !l bs)
map  c-del      remeol

map  c-o       (insertmode toggle)
map  c-j       (last join del)
map  c-s       (-return up last)
map  c-y        deline
map sc-y        undeline
map  c-x       (insline down first if !r (while !ca (up ( ) down)) up)

map sc-u        undo
map  c-g       (escimm (goto ))
map sc-w       (wordwrap toggle)
map sc-r        reformat
map sc-m       (escimm (margin ))
map  c-\\      (escimm (execute `))

map    c-tab   (first while c=32 right c-bs up while c=32 (ifelse r (down abort) (down ( ) up)) down)
map    return  (ifelse x=1 (insline down) (ifelse r (downadd first insline c-tab) (split down c-tab) ))
map  s-return  (firstnb down)
map    enter    return
map  s-up       pageup
map  s-down     pagedown
map  s-left     wleft
map  s-right    wright
map  c-up       top
map  c-down     bottom
map  c-left     first
map  c-right    last
map  a-help    (pushmark unblock block block bsource popmark)

menuoff

menuadd  Project  (Load          F3 )   (arpload)
menuadd  Project  (Insert           )   (arpinsfile)
menuadd  Project  (Load window   F4 )   (newwindow arpload)
menuadd  Project  (-------------)      (null)
menuadd  Project  (New Name      F5 )   (f5)
menuadd  Project  (New Window  s-F5 )   (s-f5)
menuadd  Project  (Save Quit     F6 )   (f6)
menuadd  Project  (Save As       F7 )   (f7)
menuadd  Project  (Quit          F8 )   (f8)
menuadd  Project  (Save          F10)   (f10)

menuadd  Search   (Ignore case    c-i)  (c-i)
menuadd  Search   (------------)        (null)
menuadd  Search   (Find           c-f)  (c-f)
menuadd  Search   (Find Next      c-n)  (c-n)
menuadd  Search   (Find Prev.     c-p)  (c-p)
menuadd  Search   (Find Letter  a-nk7) (a-nk7)
menuadd  Search   (Find Word    a-nk8) (a-nk8)
menuadd  Search   (------------ )      (null)
menuadd  Search   (Replace     c-r)    (c-r)

menuadd  Block    (Mark       c-b)      (c-b)
menuadd  Block    (Unmark     c-u)      (c-u)
menuadd  Block    (-----------)         (null)
menuadd  Block    (Move       c-m)      (c-m)
menuadd  Block    (Erase      c-e)      (c-e)
menuadd  Block    (UnErase   sc-e)      (c-e)
menuadd  Block    (Duplicate  c-d)      (c-d)
menuadd  Block    (Indent     tab)      (tab)
menuadd  Block    (Backdent s-tab)      (s-tab)
menuadd  Block    (----------- )        (null)
menuadd  Block    (Load       c-l)      (arpinsfile)
menuadd  Block    (Write      c-w)      (c-w)
menuadd  Block    (Sort      sc-s)      (sc-s)

menuadd  Line     (Split   return) (-return)
menuadd  Line     (Join    c-j)    (c-j)
menuadd  Line     (Del     c-y)    (c-y)
menuadd  Line     (Undel  sc-y)    (sc-y)
menuadd  Line     (Ins     c-x)    (c-x)
menuadd  Line     (Undo   sc-u)    (sc-u)
menuadd  Line     (----------)     (null)
menuadd  Line     (Top    c-cu)    (c-up)
menuadd  Line     (End    c-cd)    (c-down)



menuadd  Misc     (Overwrite mode c-o)  (c-o)
menuadd  Misc     (Goto           c-g)  (c-g)
menuadd  Misc     (Swap           c-s)  (c-s)
menuadd  Misc     (--------------)      (null)
menuadd  Misc     (Wordwrap      sc-w)  (sc-w)
menuadd  Misc     (Reformat      sc-r)  (sc-r)
menuadd  Misc     (Margin        sc-m)  (sc-m)
menuadd  Misc     (-------------- )     (null)
menuadd  Misc     (Set mark 1   sc-nk1) (sc-nk1)
menuadd  Misc     (Set mark 2   sc-nk2) (sc-nk2)
menuadd  Misc     (Set mark 3   sc-nk3) (sc-nk3)
menuadd  Misc     (Goto mark 1   c-nk1) (c-nk1)
menuadd  Misc     (Goto mark 2   c-nk2) (c-nk2)
menuadd  Misc     (Goto mark 3   c-nk3) (c-nk3)
menuadd  Misc     (--------------  )    (null)
menuadd  Misc     (CTags          a-up) (a-up)
menuadd  Misc     (Reference    a-down) (a-down)
menuadd  Misc     (ProcList      a-nk9) (a-nk9)
menuadd  Misc     (Cli command    c-\\) (c-\\)
Menuadd  Misc     (Iconify        help) (help)
Menuadd  Misc     (Datum              ) ( execute (date >Env:datum) ($datum) bs )
menuadd  Errors   (Next  Error      F1) (f1)
menuadd  Errors   (Previous Error s-F1) (s-f1)
menuadd  Errors   (Current Error    F2) (f2)
menuadd  Errors   (First Error    s-F2) (s-f2)
menuadd  Errors   (Re-read File   s-F3) (s-f3)
menuadd  Errors   (Set OldName    a-F3) (a-f3)
map sac-nk9       (ping 8 top first (\$proj) -return up last left while ca left right scanf %s set nam \$scanf deline pong 8)
menuadd  M2        Save-Compile       (f10 execute ( m2:m2c -d \$filename) )
menuadd  M2        Link               (execute  ( m2:m2l \$proj/obj/\$nam))
menuadd  M2        Run                (execute ( \$proj/\$nam))
menuadd  M2        -----------        (null)
menuadd  M2        M2-Path            (tmpwidth 250 tmpheight 50 newwindow newfile m2:path)
menuadd  M2       (Set M2-Proj.   F9)   (s-f9)
menuadd  M2       (New M2-Proj. s-F9)   (s-f9)
Menuadd  M2       (Icon fr File   ) (execute (copy m2:icons/txt.info \$filename.info))
Menuadd  M2       (PROC-Liste) (ping 4 newwindow ping 5 pong 4 top ping 4 find PROCEDURE repeat -1 (unblock block block pong 5 downadd ping 5 bcopy pong 4 down next ping 4))
menuon
#Search-path for dme.refs  + dme.tags
addpath M2:
addpath m2:programme
addpath m2:definitionen
map   -i ((i))
map  s-i ((I))
map   -a ((a))
map  s-a ((A))
map   -e ((e))
map  s-e ((E))

map  a-k (firstnb `(* ' last right `*)')
map sa-k (first findstr `*' next left del del del next del del bs firstnb)

map s-help (( := ))
map a-= (( := ))

