home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / wp_dtp / xdme1820.lha / XDME / Macros / BN / .EDRC next >
Text File  |  1993-01-27  |  33KB  |  756 lines

  1. #set 0 1
  2. #set asyncrexx 0
  3. #rx ('say "los: "time()')
  4. ##
  5. ## .edrc for DME V1.51
  6. ## "$VER: .edrc 1.152 (11.11.92)"
  7. ## (C)1992 by Bernd Noll nach dem Vorbild von Volker Rudolph
  8. ## to stay a little bit compatible to AUISG i tried not to use too much  A-... mappings
  9. ##
  10. ########################################################################
  11. ##
  12. ##   Replacements for former Commands
  13. ##
  14. ##   Which have turned to BUILTIN Macros now !!!!!!!!
  15. ##   ---------------------------------------
  16. ##
  17. ##
  18. ## alias
  19. ## - note: when using alias there must one escape-level be added
  20. ##
  21. #   if $dmeversion<150 (setmacro alias   2 (setmacro \\\$arg1 0 \\\$arg2))
  22. #   if $dmeversion<150 (setmacro unalias 1 (unsetmacro \\\$arg1))
  23. ##
  24. ## scan
  25. ##
  26. #   if $dmeversion<150 (setmacro ref         0 (vref \\\$currentword))
  27. #   if $dmeversion<150 (setmacro ctags       0 (vctags \\\$currentword))
  28. #   if $dmeversion<150 (setmacro fastscan    1 (set \\\$arg1 \$currentword))
  29. #   if $dmeversion<150 (setmacro scanf       2 (vscanf  \\\$restofline \\\$arg1 \\\$arg2))
  30. #   if $dmeversion<150 (setmacro scanf1      2 (vscanf1 \\\$restofline \\\$arg1 \\\$arg2 \\\$arg3))
  31. #   if $dmeversion<150 (setmacro scanf2      2 (vscanf2 \\\$restofline \\\$arg1 \\\$arg2 \\\$arg3 \\\$arg4))
  32. #   if $dmeversion<150 (setmacro grab        2 (vgrab  \\\$currentline \\\$arg1 \\\$arg2))
  33. #   if $dmeversion<150 (setmacro grab1       3 (vgrab1 \\\$currentline \\\$arg1 \\\$arg2 \\\$arg3))
  34. ##
  35. ## math
  36. ##
  37. #   if $dmeversion<150 (setmacro add 2 (math2 add \\\$arg1 \\\$arg2))
  38. #   if $dmeversion<150 (setmacro sub 2 (math2 sub \\\$arg1 \\\$arg2))
  39. #   if $dmeversion<150 (setmacro mul 2 (math2 mul \\\$arg1 \\\$arg2))
  40. #   if $dmeversion<150 (setmacro div 2 (math2 div \\\$arg1 \\\$arg2))
  41. #   if $dmeversion<150 (setmacro mod 2 (math2 mod \\\$arg1 \\\$arg2))
  42. #   if $dmeversion<150 (setmacro neg 1 (math1 neg \\\$arg1))
  43. #   if $dmeversion<150 (setmacro inc 1 (math1 inc \\\$arg1))
  44. #   if $dmeversion<150 (setmacro dec 1 (math1 dec \\\$arg1))
  45. ##
  46. ## spcvars
  47. ##
  48. #   if $dmeversion<150 (setmacro activefront   1 (set activefront   \\\$arg1))
  49. #   if $dmeversion<150 (setmacro anychar       1 (set anychar       \\\$arg1))
  50. #   if $dmeversion<150 (setmacro ignorecase    1 (set ignorecase    \\\$arg1))
  51. #   if $dmeversion<150 (setmacro infixmode     1 (set infixmode     \\\$arg1))
  52. #   if $dmeversion<150 (setmacro insertmode    1 (set insertmode    \\\$arg1))
  53. #   if $dmeversion<150 (setmacro modified      1 (set modified      \\\$arg1))
  54. #   if $dmeversion<150 (setmacro noicons       1 (set noicons       \\\$arg1))
  55. #   if $dmeversion<150 (setmacro savetabs      1 (set savetabs      \\\$arg1))
  56. #   if $dmeversion<150 (setmacro viewmode      1 (set viewmode      \\\$arg1))
  57. #   if $dmeversion<150 (setmacro windowcycling 1 (set windowcycling \\\$arg1))
  58. #   if $dmeversion<150 (setmacro wordwrap      1 (set wordwrap      \\\$arg1))
  59. #   if $dmeversion<150 (setmacro setparcol     1 (set parcol        \\\$arg1))
  60. #   if $dmeversion<150 (setmacro chfilename    1 (set filename      \\\$arg1))
  61. ##
  62. ## move
  63. ##
  64. #   if $dmeversion<150 (setmacro firstwindow 0 (window  1))
  65. #   if $dmeversion<150 (setmacro lastwindow  0 (window  0))
  66. #   if $dmeversion<150 (setmacro nextwindow  0 (window +1))
  67. #   if $dmeversion<150 (setmacro prevwindow  0 (window -1))
  68. ##
  69. ## flags
  70. ##
  71. #   if $dmeversion<150 (setmacro settoggle   1 (flag \\\$arg1 set))
  72. #   if $dmeversion<150 (setmacro resettoggle 1 (flag \\\$arg1 reset))
  73. #   if $dmeversion<150 (setmacro toggle      1 (flag \\\$arg1 toggle))
  74. ##
  75. ##
  76. ########################################################################
  77. ##
  78. ##  Some small additional Macros
  79. ##
  80. ##
  81. ## misc
  82. ##
  83.     setmacro visitfile     1 (newwindow newfile \$arg1 viewmode 1)
  84.     setmacro aslvisitfile 0 (newwindow aslload viewmode 1)
  85.     setmacro baksaveold  0 (execute (delete >NIL: <NIL: \$filename.bak) execute (rename >NIL: <NIL: \$filename \$filename.bak) saveold)
  86.     setmacro baksaveas     1 (execute (delete >NIL: <NIL: \$filename.bak) execute (rename >NIL: <NIL: \$filename \$filename.bak) saveas \$arg1)
  87. ##
  88. ## shortcuts
  89. ##
  90.     setmacro so 0 (saveold)
  91.     setmacro nf 1 (newfile \$arg1)
  92.     setmacro tg 1 (toggle \$arg1)
  93. ##
  94. ## CBM-style cut&paste
  95. ##
  96.     setmacro copy  0 ( bsave t:dme_clip execute (tool:clipftxt > NIL: w t:dme_clip)                    execute (delete > NIL: t:dme_clip))
  97.     setmacro paste 0 (                  execute (tool:clipftxt > NIL: r t:dme_clip) insfile t:dme_clip execute (delete > NIL: t:dme_clip))
  98.     setmacro cut   0 ( copy bdelete )
  99. ##
  100. ##
  101. ########################################################################
  102. ##
  103. ##  "Constant" declarations
  104. ##
  105. ## Be careful there are some more special variables - look below
  106. ##
  107. ##
  108. ## take these vars as constants so you can play with return/c-tab more easily
  109. ##
  110.     set tabs        4
  111.     set number        0123456789
  112.     set upper        ABCDEFGHIJKLMNOPQRSTUVWXYZ
  113.     set lower        abcdefghijklmnopqrstuvwxyz
  114.     set alphanum    _$number$upper$lower
  115.     set _hasedrc    255
  116.     set _mouseblock 254
  117.     set _blockon    253  rem (block is highlighted)
  118.     set _block2     252  rem (blockbegin is set)
  119.     set _m2patch    251
  120.     set _movemark   250  rem (or 9 see below)
  121.     set _caser        249
  122. ##
  123. ##
  124. ##  perhaps tell caller-process that s:.edrc was sourced
  125. ##  --- not neccessary , if u do not use -no[sedrc]
  126. ##
  127.     settoggle    $_hasedrc
  128. ##
  129. ##
  130. ## check, which version is active: I also use a modified version of dme that
  131. ## has Modula-2/Oberon errorsupport
  132. settoggle $_m2patch rem ()  resettoggle $_m2patch
  133. #set m2check (ifelse !$_m2patch (title (wrong DME-Version!)))
  134. ifelse $_m2patch (set m2check (if $_m2patch)) (set m2check rem)
  135. ##
  136. ##  preferences
  137. ##
  138.     set margin        80
  139.     set tabstop     $tabs
  140.     pageset        90
  141. ##
  142. ##
  143. ########################################################################
  144. ########################################################################
  145. ##
  146. ## own macro-definitions:
  147. ##
  148. ########################################################################
  149. ########################################################################
  150. ##
  151. ##  word completition, is called on every [LMR]-tab in escimm-mode
  152. ##  used Variables:
  153. ##   _M_QUEST            - Searchstring
  154. ##   _M_COUNT            - Number of last string in List
  155. ##   _M_RES            - Matching String
  156. ##  used Macros:
  157. ##   startmatching newsearch - define New Searchstring and do first searching
  158. ##   endmatching         - reset all used Variables
  159. ##   matchnext             - do the next searching
  160. ##
  161.     set tabfile     env:dme.commands
  162.     setmacro endmatching    0 (set _M_COUNT 0 set _M_QUEST () set _M_RES ())
  163.     setmacro startmatching  1 (endmatching set _M_QUEST (\$arg1) matchnext)
  164. #    setmacro matchnext      0 (untitle (rxs (trace results; x=LS_FIND("\$tabfile",\$_M_COUNT,"\$_M_QUEST",a); "set" _M_COUNT WORD(x,1)+1" set _M_RES ("DELWORD(x,1,1)")")) titlevar _M_RES)
  165.     setmacro matchnext        0 (untitle (rx ('x=LS_FIND("\$tabfile",\$_M_COUNT,"\$_M_QUEST",a); "set" _M_COUNT WORD(x,1)+1" set _M_RES ("DELWORD(x,1,1)")"')) titlevar _M_RES)
  166.     endmatching
  167. ##  the first endmatching initializes all Variables
  168. ##
  169. #   map   -tab    (ifelse cb (goto block while cb (first repeat \$tabs (( )) down) goto block) (ifelse esc (if !l (wleft fastscan scanf qualifier LMR set TABCOUNTER 0 LMR-tab)) (repeat tr (space))))
  170. #   map LMR-tab (if esc (untitle (rx (getcompleteword \$scanf \$TABCOUNTER \$tabfile RESULT TABCOUNTER)) title (\\\$RESULT) qualifier LMR))
  171. #   map LMR-tab (if esc (untitle (rx ('x=LS_FIND("\$tabfile",\$TABCOUNTER,"\$scanf",a); "set" TABCOUNTER LEFT(x,4)+1; "set RESULT ("DELWORD(x,1,1)")"')) titlevar RESULT qualifier (LMR))
  172. #   map (LMR- ) (if esc (while ca del (\$RESULT)))
  173. #   map LMR-esc (set RESULT ())
  174. #   map   -tab    (ifelse cb (goto block while cb (first repeat \$tabs (( )) down) goto block) (ifelse esc (if !l (wleft fastscan scanf startmatching \$scanf qualifier LMR)) (repeat tr (space))))
  175. #   map LMR-tab (if esc (matchnext  qualifier (LMR))
  176. #   map (LMR- ) (if esc (while ca del (\$_M_RES) endmatching))
  177. #   map LMR-esc (endmatching)
  178.     setmacro matchfend     0 (endmatching filter q x x x)
  179.     setmacro matchf2     1 (eval (ifelse \$arg1>2 (ifelse \$arg1>3 (while ca del (\$_M_RES) matchfend if \$arg1>4 return) (matchnext)) (ifelse \$arg1>0 (matchfend) (title (forbidden key)))))
  180.     setmacro matchfilter 0 (filter amb (q x esc tab ( ) return enter) _M_FIL (matchf2 \\\$_M_FIL))
  181.     setmacro matchfstart 0 (if !l wleft eval (startmatching \$currentword matchfilter))
  182.     map   -tab        (ifelse cb (goto block while cb (first repeat \$tabs (( )) down) goto block) (ifelse esc (matchfstart) (repeat tr (space))))
  183. ##
  184. ########################################################################
  185. ##
  186. ## find the different brackets but do NOT change findstr
  187. ##
  188.     setmacro schweifauf  1 (pushvar findstr findstr (\{) eval \$arg1 popvar findstr)
  189.     setmacro schweifzu     1 (pushvar findstr findstr (\}) eval \$arg1 popvar findstr)
  190.     setmacro eckauf     1 (pushvar findstr findstr (\[) eval \$arg1 popvar findstr)
  191.     setmacro eckzu     1 (pushvar findstr findstr (\]) eval \$arg1 popvar findstr)
  192.     setmacro rundauf     1 `pushvar findstr findstr `\(' eval \$arg1 popvar findstr'
  193.     setmacro rundzu     1 `pushvar findstr findstr `\)' eval \$arg1 popvar findstr'
  194.     setmacro rundauf     1 (pushvar findstr findstr (\\\() eval \$arg1 popvar findstr)
  195.     setmacro rundzu     1 (pushvar findstr findstr (\\\)) eval \$arg1 popvar findstr)
  196. ##
  197. ########################################################################
  198. ##
  199. ##   That are my RETURN - Mappings   :-)
  200. ##
  201. ##
  202. ## there are several variables used:
  203. ## _crl _crc blockbeginner blockender
  204. ##
  205. ## these vars are used on every -return and so they should also not be used
  206.     set _crl 0
  207.     set _crc 0
  208. ##
  209. ##
  210. ##   First simple macros
  211. ##
  212.     setmacro cr   0 (split down adjustline)
  213.     setmacro spdw 0 (split down first)
  214. #   setmacro fcr  0 (split down firstnb)
  215. ##
  216. ##
  217. ##  Then the better(?) and bigger ones
  218. ##
  219. ##
  220. ## language dependent : fill this variable with the keywords that request an
  221. ## indent in the next line; only the first word of a line is checked
  222. ##  Normal Typing
  223.     set blockbeginner ()
  224.     set blockender    ()
  225. ##  Modula-2 Style
  226. #   set blockbeginner (IF ELSE ELSIF REPEAT LOOP WHILE WITH CASE FOR)
  227. #   set blockender    (END ELSE ELSIF UNTIL)
  228. ##  C Sytle
  229. #   set blockbeginner (if else while for switch case FOREVER)
  230. #   set blockender    (else case)
  231. ##
  232. ## with getcolno/getlineno You need not worry about the recursiondepth and number of escapes before a variable
  233. ##
  234.     setmacro getcolno  1 (set \$arg1 \$colno)
  235.     setmacro getlineno 1 (set \$arg1 \$lineno)
  236. ##
  237. ## that command will find the last not-empty line
  238. ##
  239.     setmacro prevline  0 (if !top (up first while right (if top break up)) firstnb)
  240. ##
  241. ## with check[un]blockers you can check if you are in a indented block
  242. ##
  243.     setmacro checkblockers   1 (untitle (firstnb if ca (rx ("if find('\$blockbeginner','\$currentword') ~= 0 then 'add \$arg1 \$tabstop'"))))
  244.     setmacro checkunblockers 1 (untitle (firstnb if ca (rx ("if find('\$blockender','\$currentword') ~= 0 then 'sub \$arg1 \$tabstop'"))))
  245. ##
  246. ## for C-language You would need other functions
  247. ## /* some c-possibilities are not respected here:
  248. ##    "if ((...) <cr> (...)) { <cr>" would cause 2 tabs
  249. ##    " } else <cr> would cause no tab */
  250. ##  Attention: these macros are NOT up to date
  251. ##
  252. #   setmacro checkblockers   1 (unfail (last left if !ca (add \$arg1 \$tabstop if c=123 abort if c=58 abort sub \$arg1 \$tabstop) if c=59 abort firstnb if ca (rx ("if find('\$blockbeginner','\$currentword') ~= 0 then 'add \$arg1 \$tabstop'"))))
  253. #   setmacro checkunblockers 1 (firstnb ifelse c=125 (sub \$arg1 \$tabstop) (firstnb if ca (rx ("if find('\$blockender','\$currentword') ~= 0 then 'sub \$arg1 \$tabstop'"))))
  254. ##
  255. ## that's my "prettyprinter"
  256. ##
  257.     setmacro startlinewith   1 (firstnb while x<\$arg1 space while x>\$arg1 bs)
  258.     setmacro equalizeline    0 (pushdot quiet (prevline firstnb getcolno _crc popdot) startlinewith \$_crc)
  259.     setmacro adjustline      0 (quiet (getlineno _crl prevline firstnb getcolno _crc checkblockers _crc goto \\\$_crl) firstnb checkunblockers _crc startlinewith \\\$_crc)
  260.     setmacro freeline         0 (last ifelse left adjustline cr)
  261. ##
  262. ##
  263. ##         __that part calls the right indention also for the currentline__ :-) only the last three commands are neccessary for return
  264. #         getcolno _crx last sub _crx \$colno neg _crx
  265. #   map -return (set _crx -\$colno last add _crx \$colno adjustline last col -\$_crx split down adjustline)
  266.     map c-tab     (adjustline)
  267. ##
  268. ##  oh - the viewmode-difference was done to have something like a Pager
  269. ##
  270.     map  -return (ifelse \$viewmode=1 (down) (split down adjustline))
  271.     map (- )     (ifelse \$viewmode=1 (pagedown) (( )))
  272.     map  -bs     (eval (ifelse \$viewmode=1 (ifelse e (back) (pageup)) (back)))
  273. ##
  274. ########################################################################
  275. ##
  276. ## start of word / end of word ... only works, if cursor on a word
  277. ##
  278.     setmacro sow     0 (while !left  (ifelse ca (left)  (right break)))
  279.     setmacro eow     0 (while !right (ifelse ca (right) (left  break)))
  280. ##
  281. ## some small macros to change Case-Spelling
  282. ##
  283.     setmacro upper_char  0 (if cl (tlate -32))
  284.     setmacro lower_char  0 (if cu (tlate +32))
  285.     setmacro upper_word  0 (sow while ca (if cl (tlate -32) right))
  286.     setmacro lower_word  0 (sow while ca (if cu (tlate +32) right))
  287. ##
  288. ########################################################################
  289. ##
  290. ##  such macros make variable - escaping much easier
  291. ##
  292.     setmacro titlevar     1 (eval (title ($\$arg1)))
  293.     setmacro writevar     1 (eval (($\$arg1)))
  294.     setmacro rxshowvar     1 (eval (rx ("say $\$arg1")))
  295. ##
  296. ########################################################################
  297. ##
  298. ##  interactive Multireplace
  299. ##
  300. ##  note the mr_... commands are supportfunctions that cannot be called
  301. ##  directly
  302. ##
  303.     setmacro mr_this  0 (right prevr next)
  304.     setmacro mr_quit  0 (filter q () () () abort)
  305.     setmacro mr_all   0 (unfail (repeat -1 mr_this) mr_quit)
  306.     setmacro mr_title 0 (title (replace (y/n/q/a)))
  307.     setmacro multireplace 2 (findstr \$arg1 repstr \$arg2 next mr_title filter m (( ) y n q a) (mr_res) (ifelse \\\$mr_res=1 (mr_this) (ifelse \\\$mr_res=2 (next) (ifelse \\\$mr_res=3 (mr_quit) (if \\\$mr_res=4 (mr_all)))) mr_title))
  308. ##
  309. ########################################################################
  310. ##
  311. ##  Blocks
  312. ##
  313. ## these vars are NO constants, they are used by mousemarker-macros
  314. ## are therefor should not be used otherwise, as their values may change anytime
  315. #   set _markl 0 set _markc 0
  316. ## i've put these two variable together to shorten search time
  317.     set _markj        null
  318. ## Mausmarker-Modus
  319.     setmacro startblock 0 (unblock resettoggle $_blockon settoggle $_block2 block)
  320.     setmacro endblock    0 (if $_blockon abort if !$_block2 abort block settoggle $_blockon resettoggle $_block2)
  321.     setmacro clearblock 0 (unblock resettoggle $_blockon resettoggle $_block2 )
  322. ##
  323.     settoggle    $_mouseblock
  324.     resettoggle $_movemark
  325. ## control  Block-Modus
  326.     resettoggle $_blockon
  327. ##
  328. ##
  329.     map  c-d        (bcopy)
  330.     map sc-b        (resettoggle $_blockon bsource)
  331.     map  c-b        (toggle $_blockon if $_blockon unblock block)
  332.     map  c-e        (resettoggle $_blockon bdelete)
  333.     map  c-m        (resettoggle $_blockon bmove)
  334.     map sc-s        (goto block bsave t:dme.block execute (sort T:dme.block to T:dme.sort) pushmark bdelete insfile T:dme.sort popmark execute (delete T:dme.sort T:dme.block) rem (resettoggle $_blockon))
  335.     map  c-u        (resettoggle $_blockon unblock)
  336. ##
  337. ## some different ways to manage block-marking with mouse:
  338. ##
  339. ## 1) old: doubleclick for start and for end of block
  340. #   map L-lmb (tomouse if $_mouseblock (if x=\$_markc (if y=\$_markl (c-b resettoggle $_mouseblock )) ifelse $_mouseblock (set _markc \$colno set _markl \$lineno ) (settoggle $_mouseblock set _markc -1)))
  341. ##
  342. ## 2) new: draw mouse while pressing button to mark a block
  343. ## ATTENTION: that mode only works with SMALL blocks!!!! Use QUIET !!!!
  344. #   map L-lmb (tomouse if $_mouseblock ( set _markc \$colno set _markl \$lineno resettoggle $_movemark ))
  345. #   map L-mmove (ifelse !$_mouseblock ( tomouse ) ( ifelse $_movemark ( quiet (pushdot unblock goto \$_markl col \$_markc block popdot) tomouse block ) ( toggle $_movemark )))
  346. ##
  347. ## 3) faster, but blocks a ping/pong - slot:
  348. #   set _movemark 9 rem ( instead of 250: to be able to use     valid pong-vars )
  349. #   map L-lmb (tomouse if $_mouseblock ( ping $_movemark                        resettoggle $_movemark ))
  350. #   map L-mmove (ifelse !$_mouseblock ( tomouse ) ( ifelse $_movemark ( unblock pong $_movemark block tomouse block ) ( toggle $_movemark )))
  351. ##
  352. ## 4) fast, any size of Blocks but uses 2 ping-pong-slots
  353. #   set _movemark 9 set _movemark2 8
  354. #   map L-mmove (ifelse !$_mouseblock ( tomouse ) ( ifelse $_movemark ( unblock tomouse ping $_movemark2 pong $_movemark block rem (tomouse) pong $_movemark2 block ) ( toggle $_movemark )))
  355. ##
  356. ## 5) any size of Blocks and no pingpong slot used - but slow
  357. ##    these macros use the DOTstack (pushdot/popdot) and the new quiet command - very nice
  358.     map L-lmb (tomouse if $_mouseblock ( set _markj (col \$colno goto \$lineno) resettoggle $_movemark ))
  359.     map L-mmove (ifelse !$_mouseblock ( tomouse ) ( ifelse $_movemark ( quiet (pushdot unblock \$_markj block popdot) tomouse block ) ( toggle $_movemark )))
  360. ##
  361. ##
  362. ##  That way U have an alternative to double-clicking
  363.     map aL-lmb (tomouse c-b)
  364. ##
  365. ########################################################################
  366. ##
  367. ##  These Goodies are for 1-hand typing,
  368. ##  if the other is at your girlfriend, the mouse or ...
  369. ##
  370. ##  if You do not like space and enter, simply redefine
  371. ##  QAdd and QBrk in the following lines and source again
  372. ##  (as it is not possible to store variable keys)
  373. ##
  374. #   set QAdd  (f1)
  375. #   set QBrk  (enter)
  376. #   set QBreak ( [abort with <$QBrk>])
  377. ##
  378. ##  So You can add a usual Keyboard Qualifier
  379. ##
  380. #   map (-$QAdd)     (title ($QBreak))
  381. #   map (a-$QAdd)    (qualifier a   title (Alt-  $QBreak))
  382. #   map (A-$QAdd)    (qualifier A   title (Amiga-$QBreak))
  383. #   map (s-$QAdd)    (qualifier s   title (Shift-$QBreak))
  384. #   map (c-$QAdd)    (qualifier c   title (Ctl-  $QBreak))
  385. #   map (s-$QAdd)    (qualifier s   title (Shift-$QBreak))
  386. #   map (Aa-$QAdd)   (qualifier Aa  title (Amiga-Alt-  $QBreak))
  387. #   map (Ac-$QAdd)   (qualifier Ac  title (Amiga-Ctl-  $QBreak))
  388. #   map (As-$QAdd)   (qualifier As  title (Amiga-Shift-$QBreak))
  389. #   map (ac-$QAdd)   (qualifier ac  title (Alt-Ctl-    $QBreak))
  390. #   map (as-$QAdd)   (qualifier as  title (Alt-Shift-  $QBreak))
  391. #   map (sc-$QAdd)   (qualifier sc  title (Shift-Ctl-  $QBreak))
  392. #   map (Aac-$QAdd)  (qualifier Aac title (Amiga-Alt-Ctl-  $QBreak))
  393. #   map (Aas-$QAdd)  (qualifier Aas title (Amiga-Alt-Shift-$QBreak))
  394. #   map (Asc-$QAdd)  (qualifier Asc title (Amiga-Shift-Ctl-$QBreak))
  395. #   map (asc-$QAdd)  (qualifier asc title (Alt-Shift-Ctl-  $QBreak))
  396. #   map (Aasc-$QAdd) (qualifier Aasc title (Amiga-Alt-Shift-Ctl- $QBreak))
  397. ##
  398. ##  Perhaps You wanna espace that mode?
  399. ##
  400. #   map (Aasc-$QBrk) (null)
  401. #   map (asc-$QBrk)  (null)
  402. #   map (Asc-$QBrk)  (null)
  403. #   map (Aac-$QBrk)  (null)
  404. #   map (Aas-$QBrk)  (null)
  405. #   map (sc-$QBrk)   (null)
  406. #   map (ac-$QBrk)   (null)
  407. #   map (as-$QBrk)   (null)
  408. #   map (Aa-$QBrk)   (null)
  409. #   map (As-$QBrk)   (null)
  410. #   map (Ac-$QBrk)   (null)
  411. #   map (c-$QBrk)    (null)
  412. #   map (s-$QBrk)    (null)
  413. #   map (a-$QBrk)    (null)
  414. #   map (A-$QBrk)    (null)
  415. ##
  416. ##
  417. ### # # # # # # # # # # # # # # # # # # # # # # # # #
  418. ##
  419. ## there is a alternative:
  420. ## but * U cannot Use all Qualifiers
  421. ##     * work with 10 Toggles
  422. ##     * do not see what qualifier is pressed
  423. ## ( is there a suggestion for A)
  424. ##
  425.     set QPre (`)
  426.     set QQualList (q ( ) s a c x y l m r)
  427.     set QTitle2 (Q-Quit Space-Continue sacxyzlmr - Qualifiers)
  428. ##
  429. ##
  430.     setmacro qquit  0 (filter q () () () set 240 0 set 241 0 set 242 0 set 243 0 set 244 0 set 245 0 set 246 0 set 247 0 set 248 0)
  431.     setmacro qcont  0 (qcheck 240 s qcheck 241 a qcheck 242 c qcheck 243 x qcheck 244 y qcheck 245 z qcheck 246 R qcheck 247 M qcheck 248 L qquit )
  432.     setmacro qcheck 2 (if \$arg1 (qualifier +\$arg2 ))
  433. #   setmacro qset   1 (ifelse \$arg1<240 (ifelse \$arg1=239 (qcont) (ifelse \$arg1=238 (qquit) (titlevar QTitle2))) (toggle \\\$arg1 titlevar QTitle2))
  434.     setmacro qset   1 (ifelse \$arg1<240 (ifelse \$arg1=239 (qcont) (ifelse \$arg1=238 (qquit) (titlevar QTitle2))) (toggle \\\$arg1 titlevar QTitle2))
  435.     map   (a-$QPre) (titlevar QTitle2 filter (am) (q ( ) s a c x y z l m r ) (QNum) (add QNum 238 titlevar QNum qset \\\$QNum)
  436. #(ifelse \\\$QNum<2 (ifelse \\\$QNum=0 qquit qcont) (add QNum 238 eval (toggle \\\\\\\$QNum) title ($QTitle2))))
  437. ##
  438. ##
  439. ########################################################################
  440. ##
  441. ##  Menu-Bar
  442. ##
  443. ##
  444.     menuoff
  445. ##
  446. ##  auisg-menus: Project & Edit
  447. ##
  448.     menuadd Project (New)           (newwindow)
  449.     menuadd Project (Open...)       (newwindow aslload)
  450.     menuadd Project (Visit...)      (aslvisitfile)
  451.     menuadd Project (-------)       (null)
  452.     menuadd Project (Save)          (saveold)
  453.     menuadd Project (Save As...)    (aslsave)
  454.     menuadd Project (------- )      (null)
  455.     menuadd Project (Iconify)       (iconify)
  456.     menuadd Project (Close)         (quit)
  457.     menuadd Project (-------  )     (null)
  458.     menuadd Project (About...)      (NULL)
  459.     menuadd Project (-------   )    (null)
  460.     menuadd Project (Quit DME)      (repeat \$textnum closewindow)
  461. ##
  462.     menuadd Edit (Cut)      (cut)
  463.     menuadd Edit (Copy)     (copy)
  464.     menuadd Edit (Paste)    (paste)
  465.     menuadd Edit (-----)    (null)
  466.     menuadd Edit (Erase)    (bdelete)
  467.     menuadd Edit (----- )   (null)
  468. #menuadd Project (Load window  F4)       (f4)      rem ( == Open ... )
  469. #menuadd Project (Load         F3)       (f3)      rem ( == Open ... )
  470. #menuadd Project (-------------)         (null)
  471. #menuadd Project (New Name     F5)       (f5)
  472. #menuadd Project (New Window s-F5)       (s-f5)    rem ( == New )
  473. #menuadd Project (------------- )        (null)
  474. #menuadd Project (Save Quit    F6)       (f6)
  475. #menuadd Project (Save         F10)      (f10)     rem ( == Save )
  476. #menuadd Project (Save As      F7)       (f7)      rem ( == Save As ... )
  477. #menuadd Project (Quit         F8)       (f8)      rem ( == Exit | Quit )
  478. #menuadd Project (-------------  )       (null)
  479. #menuadd Project (Iconify)               (iconify) rem ( == Hide )
  480. ##
  481. ##
  482. ##
  483. ##  additional menus
  484. ##
  485.     menuadd Search  (<<< Find >>>)          (null)
  486.     menuadd Search  (Set FindStr )          (right wleft scanf %[$alphanum] findstr \$scanf)
  487.     menuadd Search  (Find        c-f)       (c-f)
  488.     menuadd Search  (Find Next   c-n)       (next)
  489.     menuadd Search  (Find Prev.  c-p)       (prev)
  490.     menuadd Search  (Corresponding)         (findmatch)
  491.     menuadd Search  ( )                     ()
  492.     menuadd Search  (Push to Stack)         (pushvar  findstr title pushed)
  493.     menuadd Search  (Pop from Stack)        (popvar   findstr title popped)
  494.     menuadd Search  (Swap with Stack)       (swapvar  findstr title swapped)
  495.     menuadd Search  (Clear Stack)           (purgevar findstr title cleared)
  496. ##
  497.     menuadd Search  (------------ )         (null)
  498.     menuadd Search  (<< Replace >>)         (null)
  499.     menuadd Search  (Set RepStr  )          (right wleft scanf %[$alphanum] repstr \$scanf)
  500.     menuadd Search  (Replace     c-r)       (c-r)
  501.     menuadd Search  (Repl.Next  sc-n)       (nextr)
  502.     menuadd Search  (Repl.Prev  sc-p)       (prevr)
  503.     menuadd Search  (  )                    ()
  504.     menuadd Search  (Push to Stack )        (pushvar  repstring title pushed)
  505.     menuadd Search  (Pop from Stack )       (popvar   repstring title popped)
  506.     menuadd Search  (Swap with Stack )      (swapvar  repstring title swapped)
  507.     menuadd Search  (Clear Stack )          (purgevar repstring title cleared)
  508.     menuadd Search  (------------  )        (null)
  509.     menuadd Search  (Ignore case c-i)       (c-i)
  510.     menuadd Search  (------------)          (null)
  511. ##
  512.     menuadd Block   (Mark       c-b)        (c-b)
  513.     menuadd Block   (Unmark     c-u)        (c-u)
  514.     menuadd Block   (-----------)           (null)
  515.     menuadd Block   (Move       c-m)        (c-m)
  516.     menuadd Block   (Erase      c-e)        (c-e)
  517.     menuadd Block   (Duplicate  c-d)        (c-d)
  518.     menuadd Block   (Indent     tab)        (tab)
  519.     menuadd Block   (Backdent s-tab)        (s-tab)
  520.     menuadd Block   ( )                     (null)
  521.     menuadd Block   (Push To Stack)         (pushmark  title pushed)
  522.     menuadd Block   (Pop From Stack)        (popmark   title popped)
  523.     menuadd Block   (Swap With Stack)       (swapmark  title swapped)
  524.     menuadd Block   (Clear Stack)           (purgemark title cleared)
  525.     menuadd Block   (-----------  )         (null)
  526.     menuadd Block   (Execute   sc-b)        (bsource)
  527.     menuadd Block   (Load       c-l)        (aslinsfile)
  528.     menuadd Block   (Write      c-w)        (c-w)
  529.     menuadd Block   (Sort      sc-s)        (sc-s)
  530. ##
  531.     menuadd Line    (Split   c-s)           (c-s)
  532.     menuadd Line    (Join    c-j)           (c-j)
  533.     menuadd Line    (Del     c-y)           (c-y)
  534.     menuadd Line    (Undel  sc-y)           (sc-y)
  535.     menuadd Line    (Ins     c-x)           (c-x)
  536.     menuadd Line    (Undo   sc-u)           (sc-u)
  537.     menuadd Line    (Exec  sc-hp)           (sc-help)
  538.     menuadd Line    (Dos   Ac-hp)           (Ac-help)
  539.     menuadd Line    (Rexx  ac-hp)           (ac-help)
  540. ##
  541.     menuadd Move    (First Position)        (first)
  542.     menuadd Move    (First Char)            (firstnb)
  543.     menuadd Move    (Last Char)             (last)
  544.     menuadd Move    (--------------)        (null)
  545.     menuadd Move    (Goto Line     c-g)     (escimm (goto ))
  546.     menuadd Move    (Top Line      c-cu)    (top)
  547.     menuadd Move    (Last Line     c-cd)    (bottom)
  548.     menuadd Move    (-------------- )       (null)
  549.     menuadd Move    (Set mark 1  sc-nk1)    (ping 1)
  550.     menuadd Move    (Set mark 2  sc-nk2)    (ping 2)
  551.     menuadd Move    (Set mark 3  sc-nk3)    (ping 3)
  552.     menuadd Move    (Goto mark 1  c-nk1)    (pong 1)
  553.     menuadd Move    (Goto mark 2  c-nk2)    (pong 2)
  554.     menuadd Move    (Goto mark 3  c-nk3)    (pong 3)
  555.     menuadd Move    ( )                     (null)
  556.     menuadd Move    (Push To Stack)         (pushdot  title pushed)
  557.     menuadd Move    (Pop From Stack)        (popdot   title popped)
  558.     menuadd Move    (Swap With Stack)       (swapdot  title swapped)
  559.     menuadd Move    (Clear Stack)           (purgedot title cleared)
  560.     menuadd Move    (--------------  )      (null)
  561.     menuadd Move    (Previous-Char)         (ifelse l (ifelse t (( ) left) (up last)) left)
  562.     menuadd Move    (Next-Char)             (ifelse r (ifelse b right (down first)) right)
  563.     menuadd Move    (AnyChar Mode   c-a)    (c-a)
  564. ##
  565.     menuadd Misc    (Scanf)                 (set scanf \$currentword title \$scanf)
  566.     menuadd Misc    (ScanRes)               ((\$scanf))
  567.     menuadd Misc    (Reference    c-help)   (c-help)
  568.     menuadd Misc    (Show ASCII)            (title \$ascii)
  569.     menuadd Misc    (--------------)        (null)
  570.     menuadd Misc    (Cli command    c-\\)   (c-\\)
  571.     menuadd Misc    (Show-Text)             (escimm (execute `UTIS:MuchMore :))
  572.     menuadd Misc    (Manual)                (escimm (execute `run execute script:man )
  573.     menuadd Misc    (--------------  )      (null)
  574.     menuadd Misc    (Word_To_Upper)         (upper_word )
  575.     menuadd Misc    (Word_To_Lower)         (lower_word )
  576.     menuadd Misc    (--PREFS-------)        (null)
  577.     menuadd Misc    (Overwrite Mode c-o)    (c-o)
  578.     menuadd Misc    (Use mouse to block)    (toggle $_mouseblock ifelse $_mouseblock (title (MOUSEBLOCK ON)) (title (MOUSEBLOCK OFF)))
  579.     menuadd Misc    (View Mode      )       (toggle viewmode)
  580.     menuadd Misc    (--PREFS------- )       (null)
  581.     menuadd Misc    (Wordwrap      sc-w)    (sc-w)
  582.     menuadd Misc    (Reformat      sc-r)    (sc-r)
  583.     menuadd Misc    (Margin        sc-m)    (sc-m)
  584. ##
  585.     menuadd User    (Add Text)              (right wleft scanf %s menuoff menuadd User (\$scanf) ((\$scanf)) () menuon execute (echo >> dme.rsc "menuadd User (\$scanf) ((\$scanf))"))
  586.     menuadd User    (Add Comm)              (right wleft escimm  (set name `) escimm (set function `) menuoff menuadd User (\$name) (\$function) menuon execute (echo >> dme.rsc "menuadd User (\$name) (\$function)"))
  587.     menuadd User    (Del Item)              (escimm (menudel User `))
  588.     menuadd User    («««« USER: »»»»)       ()
  589. ##
  590.     menuon
  591. ##
  592. ##
  593. ########################################################################
  594. ##
  595. ##  Debugging purposes
  596. ##
  597.     menuoff
  598.     menuadd User tg_debug    (toggle 0)
  599.     menuadd User tg_asynrexx (toggle asyncrexx)
  600.     menuadd User end_filter  (filter q (( )) () () null)
  601.     menuadd User end_rexxview (rx ("closerexxview"))
  602.     menuon
  603. ##
  604. ########################################################################
  605. ##
  606. ##  Keymapping
  607. ##
  608. map sc-nk1    (ping 1)
  609. map sc-nk2    (ping 2)
  610. map sc-nk3    (ping 3)
  611. map  c-nk1    (pong 1)
  612. map  c-nk2    (pong 2)
  613. map  c-nk3    (pong 3)
  614. map  a-nk1    (window 01)
  615. map  a-nk2    (window 02)
  616. map  a-nk3    (window 03)
  617. map  a-nk+    (window +1)
  618. map  a-nk-    (window -1)
  619.  
  620. map   -f2    (qualifier x)
  621. map   -f3    (aslload)
  622. map   -f4    (newwindow chfilename () -f3)
  623. map   -f5    (escimm (chfilename `))
  624. map  s-f5    (newwindow -f5)
  625. map   -f6    (if modified baksaveold quit)
  626. map   -f7    (aslsave)
  627. map   -f8    (quit)
  628. map   -f10    (if modified baksaveold)
  629. map  s-f10    (iconify)
  630.  
  631. map  a-9    ((()) left)
  632. map sa-9    ((`') left)
  633.  
  634. map  c-a    (set anychar toggle)
  635. map  c-f    (escimm (find `))
  636. map sc-f    (escimm (findr ))
  637. map  c-g    (escimm (goto ))
  638. map  c-i    (ignorecase toggle)
  639. map  c-j    (last join)
  640. map sc-j    (last join del)
  641. map  c-l    (escimm (insfile `))
  642. map sc-m    (escimm (margin ))
  643. map  c-n    (next)
  644. map sc-n    (nextr)
  645. map  c-o    (insertmode toggle)
  646. map  c-p    (prev)
  647. map sc-p    (prevr)
  648. map sc-r    (reformat)
  649. map  c-s    (-return up last)
  650. map sc-u    (undo)
  651. map  c-w    (escimm (bsave `))
  652. map sc-w    (wordwrap toggle)
  653. map  c-x    (insline down firstnb rem (first if !r (while !ca (up ( ) down))) up)
  654. map  c-y    (deline)
  655. map sc-y    (undeline)
  656.  
  657. map   -enter    (return)
  658. map  c-bs    (while !l bs)
  659. map  c-del    (remeol)
  660. map  s-bs    (left while !ca (del left) while ca (del left) right)
  661. map  s-del    (while !ca (ifelse r (break) (del)) while ca (del))
  662. map  s-return    (firstnb down)
  663. map  s-tab    (ifelse cb (goto block while cb (first repeat \$tabs (if c=32 del) down) goto block) (repeat tl left) )
  664. ##
  665. ##
  666. map ac-help    (title (REXX Parses ...) rx ('\$currentline'))
  667. map Ac-help    (title (DOS Parses ...) execute (\$currentline))
  668. map sc-help    (title (DME Parses ...) eval (\$currentline))
  669. map xac-help    (esc (rx ("")) col -2)
  670. map xAc-help    (esc (execute ()) left)
  671. map xsc-help    (esc (eval ()) left)
  672. ##
  673. map  s-help    (ctags)
  674. map   -help    (ref)
  675. map  x-help    (esc (vctags ()) left)
  676. map sx-help    (esc (vref ()) left)
  677. ##
  678. ########################################################################
  679. ##
  680. ##  movement
  681. ##
  682.     map  a-down     (pagedown)
  683.     map  a-left     (wleft)
  684.     map  a-right    (wright)
  685.     map  a-up        (pageup)
  686.     map  s-down     (bottom)
  687.     map  s-left     (first)
  688.     map  s-right    (last)
  689.     map  s-up        (top)
  690.     map  c-up        (scrollup)
  691.     map  c-down     (scrolldown)
  692.     map  c-left     (wleft)
  693.     map  c-right    (wright)
  694. ##
  695. ##
  696. ########################################################################
  697. ##
  698. ##  This allows U to use a small additional Project-rc
  699. ##  it works together with the entries in the User-Menu
  700. ##
  701.     menuoff
  702.     source dme.rsc
  703.     menuon
  704. ##
  705. ##
  706. ########################################################################
  707. ##
  708. ##  if there is no text: display the filereq
  709. ##
  710.     resettoggle 1 if t (if b (if r (if $textnum=1 (rx ("if '$filename'='unnamed' then ''toggle 1")))) if 1 (aslload resettoggle 1)
  711. ##
  712. ##  The following Mode was highly dangerous!!! - an elder version of DME
  713. ##  crashed on changing the path in AREXX
  714. #   if t (if b (if r (if $textnum=1 (rx ("if '$fname'='unnamed' then aslload"))))
  715. ##
  716. ########################################################################
  717. ##
  718.     1 (source ed:xdme.edrc)    rem (that command is only known by XDME)
  719. ##
  720.  
  721.  
  722.  
  723. # any editor addenda are here in my system
  724. addpath ed:
  725.  
  726.  
  727. map (c-`)        ((\'))
  728. #map  c-tab     (set _crl \$lineno if !t (up firstnb while r (up firstnb)) set _crc \$colno goto \$_crl firstnb while x>\$_crc bs while x<\$_crc (( )))
  729. map c-r (escimm (multireplace ))
  730. #map   -return     (split down set _crl \$lineno quiet (prevline firstnb if ca (rx ("if ~(pos('\\\$currentword','\$blockbeginner')=0) then 'tab'")) goto \$_crl eval (startlinewith \\\\\\\$colno)) right left)
  731. #if  $_m2patch     (map -return cr)
  732.  
  733.  
  734. # control support
  735. map  c-\\    (escimm (execute `))
  736.     map  a-0 (((  );) left left left)
  737. #   map  s-nk* (((*  *)) left left left)
  738. #   map  c-k (firstnb `(* ' last right `*)')
  739. #   map sc-k `first if c=40 `ifelse t `` 'left'`up last'' findstr `(*' next del del del last findstr `*)' prev del del firstnb'
  740. #   map  sa-nk[  (({})left) map sa-nk] sa-nk[
  741. #   map   a-nk[  (([])left) map  a-nk]  a-nk[
  742.  
  743. #   map a-right (findstr (;) next)
  744. #   map a-left    (findstr (;) prev prev right wright)
  745.  
  746.  
  747. #   map -left Move-Previous-Char
  748. #   map -right Move-Next-Char
  749.  
  750.  
  751. #rx ('say "stop: "time()')
  752. #   set asyncrexx 1
  753.  
  754.  
  755. savetabs on
  756.