.emacsrc 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. ; EMACS.RC: Startup file for MicroEMACS 3.8
  2. ;
  3. ; This file is executed everytime the
  4. ; editor is entered
  5. set $discmd "FALSE"
  6. write-message "[Setting up....]"
  7. ; If you screen "SNOWS", uncomment this line
  8. ; set $flicker "TRUE"
  9. ; If you are on an IBM-PC EGA card and want to force the
  10. ; screen to EGA mode, uncomment the following line
  11. ; set $sres "EGA"
  12. ; ***** Rebind the Function key group
  13. bind-to-key search-forward FN;
  14. bind-to-key search-reverse FN<
  15. bind-to-key hunt-forward FN=
  16. bind-to-key hunt-backward FN>
  17. bind-to-key next-window FN?
  18. bind-to-key execute-macro FN@
  19. bind-to-key find-file FNA
  20. bind-to-key execute-file FNB
  21. bind-to-key save-file FNC
  22. bind-to-key exit-emacs FND
  23. bind-to-key apropos FNV
  24. bind-to-key describe-key FNW
  25. bind-to-key fill-paragraph FNX
  26. bind-to-key shell-command FN\
  27. bind-to-key i-shell FN]
  28. ; set screen colors
  29. add-global-mode "blue"
  30. ; toggle function key window off
  31. 1 store-macro
  32. save-window
  33. 1 next-window
  34. !if &sequal "Function Keys" $cbufname
  35. delete-window
  36. !endif
  37. bind-to-key execute-macro-14 FNT
  38. !force restore-window
  39. write-message "[Function key window OFF]"
  40. !endm
  41. ; toggle function key window back on
  42. 14 store-macro
  43. 1 next-window
  44. !if &sequal $cbufname "emacs.hlp"
  45. execute-macro-11
  46. !endif
  47. !if &not &sequal $cbufname "Function Keys"
  48. 1 split-current-window
  49. select-buffer "Function Keys"
  50. add-mode "red"
  51. !force 5 resize-window
  52. beginning-of-file
  53. !endif
  54. bind-to-key execute-macro-1 FNT
  55. 2 next-window
  56. write-message "[Function key window ON]"
  57. !endm
  58. ; Enter Help
  59. 2 store-macro
  60. 1 next-window ;Make sure the function key window isn't up!
  61. !if &sequal $cbufname "Function Keys"
  62. delete-window
  63. bind-to-key execute-macro-14 FNT
  64. !endif
  65. help
  66. 8 resize-window
  67. bind-to-key execute-macro-12 FNI
  68. bind-to-key execute-macro-13 FNQ
  69. bind-to-key execute-macro-11 FNU
  70. bind-to-key execute-macro-15 ^XO
  71. bind-to-key execute-macro-15 ^XP
  72. bind-to-key execute-macro-15 FN?
  73. add-mode "red"
  74. beginning-of-file
  75. 2 forward-character
  76. clear-message-line
  77. !endm
  78. ; Exit Help
  79. 11 store-macro
  80. bind-to-key previous-page FNI
  81. bind-to-key next-page FNQ
  82. bind-to-key execute-macro-2 FNU
  83. bind-to-key next-window ^XO
  84. bind-to-key previous-window ^XP
  85. bind-to-key next-window FN?
  86. delete-window
  87. clear-message-line
  88. !endm
  89. ; don't allow these commands from within the HELP screen
  90. 15 store-macro
  91. write-message "[Use F2 to exit HELP]"
  92. !endm
  93. ; last help page
  94. 12 store-macro
  95. beginning-of-line
  96. search-reverse "=>"
  97. 1 redraw-display
  98. !endm
  99. ; next help page
  100. 13 store-macro
  101. beginning-of-line
  102. 2 forward-character
  103. search-forward "=>"
  104. 1 redraw-display
  105. !endm
  106. ; reformat indented paragraph
  107. 6 store-macro
  108. write-message " [Fixing paragraph]"
  109. set $discmd "FALSE"
  110. kill-region
  111. 2 split-current-window
  112. select-buffer "[temp]"
  113. yank
  114. beginning-of-file
  115. replace-string "~n " "~n"
  116. 66 set-fill-column
  117. fill-paragraph
  118. 77 set-fill-column
  119. beginning-of-file
  120. handle-tab
  121. replace-string ~n "~n "
  122. end-of-file
  123. 2 delete-previous-character
  124. beginning-of-file
  125. set-mark
  126. end-of-file
  127. kill-region
  128. unmark-buffer
  129. delete-window
  130. yank
  131. delete-buffer "[temp]"
  132. set $discmd "TRUE"
  133. write-message " [Fixed paragraph]"
  134. !endm
  135. ; indent region
  136. 7 store-macro
  137. write-message " [Indenting region]"
  138. kill-region
  139. 2 split-current-window
  140. select-buffer "[temp]"
  141. yank
  142. beginning-of-file
  143. handle-tab
  144. replace-string "~n" "~n "
  145. end-of-file
  146. 4 delete-previous-character
  147. beginning-of-file
  148. set-mark
  149. write-message " [Indenting region]"
  150. end-of-file
  151. kill-region
  152. unmark-buffer
  153. delete-window
  154. yank
  155. delete-buffer "[temp]"
  156. write-message " [Region Indented]"
  157. !endm
  158. ; undent region
  159. 8 store-macro
  160. write-message " [Undenting region]"
  161. kill-region
  162. 2 split-current-window
  163. select-buffer "[temp]"
  164. yank
  165. beginning-of-file
  166. delete-next-character
  167. replace-string "~n " "~n"
  168. end-of-file
  169. 2 delete-previous-character
  170. beginning-of-file
  171. set-mark
  172. write-message " [Undenting region]"
  173. end-of-file
  174. kill-region
  175. unmark-buffer
  176. delete-window
  177. yank
  178. delete-buffer "[temp]"
  179. write-message " [Region undented]"
  180. !endm
  181. ; bring up the function key window
  182. 1 split-current-window
  183. select-buffer "Function Keys"
  184. add-mode "red"
  185. 5 resize-window
  186. insert-string "f1 search f2 search back | F1 toggle function list F2 toggle help file~n"
  187. insert-string "f3 hunt f4 hunt back | F3 find command/apropos F4 describe key~n"
  188. insert-string "f5 next window f6 exec macro | F5 reformat paragraph F6 ref undented region~n"
  189. insert-string "f7 find file f8 exec file | F7 indent region F8 undent region~n"
  190. insert-string "f9 save file f10 exit emacs | F9 execute DOS command F10 shell up~n"
  191. beginning-of-file
  192. unmark-buffer
  193. next-window
  194. set $discmd "TRUE"
  195. write-message "[Emacs is READY]"