home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / emacs-19.28-src.tgz / tar.out / fsf / emacs / lisp / amiga-init.elc < prev    next >
Encoding:
Text File  |  1996-09-28  |  7.5 KB  |  176 lines

  1.  
  2. (global-set-key "" (quote amiga-iconify))
  3.  
  4. (setq amiga-map (make-keymap))
  5.  
  6. (global-set-key "" amiga-map)
  7.  
  8. (load "amiga-mouse")
  9.  
  10. (define-key global-map [help] (quote info))
  11.  
  12. (define-key global-map [S-left] [prior])
  13.  
  14. (define-key global-map [S-right] [next])
  15.  
  16. (define-key global-map [S-down] (quote scroll-up))
  17.  
  18. (define-key global-map [S-up] (quote scroll-down))
  19.  
  20. (define-key global-map [C-left] (quote forward-sexp))
  21.  
  22. (define-key global-map [C-right] (quote backward-sexp))
  23.  
  24. (define-key global-map [C-down] (quote scroll-down-1))
  25.  
  26. (define-key global-map [C-up] (quote scroll-up-1))
  27.  
  28. (define-key global-map [M-up] [begin])
  29.  
  30. (define-key global-map [M-down] [end])
  31.  
  32. (define-key global-map [M-left] (quote beginning-of-line))
  33.  
  34. (define-key global-map [M-right] (quote end-of-line))
  35.  
  36. (setq amiga-keypad-map (make-sparse-keymap))
  37.  
  38. (define-key amiga-map "K" amiga-keypad-map)
  39.  
  40. (define-key amiga-keypad-map "[" "[")
  41.  
  42. (define-key amiga-keypad-map "]" "]")
  43.  
  44. (define-key amiga-keypad-map "{" "{")
  45.  
  46. (define-key amiga-keypad-map "}" "}")
  47.  
  48. (define-key amiga-keypad-map "/" [kp-divide])
  49.  
  50. (define-key amiga-keypad-map "*" [kp-multiply])
  51.  
  52. (define-key amiga-keypad-map "-" [kp-subtract])
  53.  
  54. (define-key amiga-keypad-map "+" [kp-add])
  55.  
  56. (define-key amiga-keypad-map "." [kp-decimal])
  57.  
  58. (define-key amiga-keypad-map [RET] [kp-enter])
  59.  
  60. (define-key amiga-keypad-map [0] [kp-0])
  61.  
  62. (define-key amiga-keypad-map [1] [kp-1])
  63.  
  64. (define-key amiga-keypad-map [2] [kp-2])
  65.  
  66. (define-key amiga-keypad-map [3] [kp-3])
  67.  
  68. (define-key amiga-keypad-map [4] [kp-4])
  69.  
  70. (define-key amiga-keypad-map [5] [kp-5])
  71.  
  72. (define-key amiga-keypad-map [6] [kp-6])
  73.  
  74. (define-key amiga-keypad-map [7] [kp-7])
  75.  
  76. (define-key amiga-keypad-map [8] [kp-8])
  77.  
  78. (define-key amiga-keypad-map [9] [kp-9])
  79.  
  80. (defun scroll-down-1 nil "\
  81. Move up one line on screen." (interactive) (byte-code "ÀˆÁÂ!‡" [nil scroll-down 1] 2))
  82.  
  83. (defun scroll-up-1 nil "\
  84. Move down one line on screen." (interactive) (byte-code "ÀˆÁÂ!‡" [nil scroll-up 1] 2))
  85.  
  86. (defun unfocus-frame nil "\
  87. A dummy, used by general mouse.el." (interactive) (byte-code "À‡" [nil] 1))
  88.  
  89. (defun window-frame (w) "\
  90. Return the frame object that window WINDOW is on." (interactive) (byte-code "ÀˆÁ ‡" [nil selected-frame] 2))
  91.  
  92. (setq amiga-arexx-processing nil)
  93.  
  94. (setq amiga-arexx-errors nil)
  95.  
  96. (defvar amiga-arexx-failat 5 "\
  97. Return level from which arexx commands returns cause errors")
  98.  
  99. (defun amiga-arexx-process nil (interactive) (byte-code "ˆ?…Á‰ˆÂÃďˆÂ‰‡" [amiga-arexx-processing t nil (byte-code "ÃÄ ‰…ÅÃÆÇȏˆÉ    
  100. \"*ˆ‚)‡" [arexxcmd rc result nil amiga-arexx-get-next-msg 0 err (byte-code "à   !@ÄÅ!!‰)‡" [expr arexxcmd result read-from-string prin1-to-string eval] 5) ((error (byte-code "ɈÄ
  101. !‰‡" [rc result err 20 prin1-to-string] 3))) amiga-arexx-reply] 5) ((error (byte-code "À‡" [nil] 1)))] 3))
  102.  
  103. (defun amiga-arexx-wait-command (id) "\
  104. Waits for a pending ARexx commands (MSGID) to complete.
  105. Also processes any pending ARexx requests during this interval.
  106. returns the result list associated with this id, which takes the
  107. form: (msgid result-code error-or-string)
  108. ``error-or-string'' depends on ``result-code''.
  109. if ``result-code'' is 0 the command finished successfully and
  110. ``error-or-string'' will be a string or nil, otherwise the command
  111. returned with an error and ``error-or-string'' will be an interger
  112. that is the secondary error code of the arexx command." (byte-code "Á ˆÂ!?…àˆÁ ˆ‚ˆÄ!‡" [id amiga-arexx-process amiga-arexx-check-command amiga-arexx-wait amiga-arexx-get-msg-results] 6))
  113.  
  114. (defconst amiga-arexx-error-messages ["No cause" "Program not found" "Execution halted" "Insufficient memory" "Invalid character" "Unmatched quote" "Unterminated comment" "Clause too long" "Invalid token" "Symbol or string too long" "Invalid message packet" "Command string error" "Error return from function" "Host environment not found" "Requested library not found" "Function not found" "Function did not return value" "Wrong number of arguments" "Invalid argument to function" "Invalid PROCEDURE" "Unexpected THEN or WHEN" "Unexpected ELSE or OTHERWISE" "Unexpected BREAK, LEAVE or ITERATE" "Invalid statement in SELECT" "Missing or multiple THEN" "Missing OTHERWISE" "Missing or unexpected END" "Symbol mismatch" "Invalid DO syntax" "Incomplete IF or SELECT" "Label not found" "Symbol expected" "Symbol or string expected" "Invalid keyword" "Required keyword missing" "Extraneous characters" "Keyword conflict" "Invalid template" "Invalid TRACE request" "Unitialized variable" "Invalid variable name" "Invalid expression" "Unbalanced parentheses" "Nesting limit exceeded" "Invalid expression result" "Expression required" "Boolean value not 0 or 1" "Arithmetic conversion error" "Invalid operand"] "\
  115. The arexx error messages, sorted by number")
  116.  
  117. (defun amiga-arexx-do-command (str as-file) "\
  118. Sends ARexx command STR (like amiga-arexx-send-command).
  119. If AS-FILE is true, STR is an arexx command, otherwise it is a file name.
  120. Waits for the command to return.  If the arexx command fails an error will
  121. be caused.
  122.  
  123. If you would like to get result strings and errors (ie. not cause
  124. a lisp error) use: (amiga-arexx-do-command-with-results)" (interactive "sARexx command:
  125. P") (byte-code "Ȉɠ   
  126. \"?ƒÊË!‚IÌ!Í 8Î 8 ÏVƒF
  127. GWƒ3
  128. H‚8ÐÈÑ
  129. #ÊÒ #)ˆ ‚G
  130. *))‡" [id str as-file reslist rc second error-message amiga-arexx-error-messages nil amiga-arexx-send-command error "Failed to send arexx command." amiga-arexx-wait-command 1 2 0 format "Unknown error %d" "Arexx command failed, level %d, cause %s"] 8))
  131.  
  132. (defun amiga-arexx-do-command-with-results (str as-file) "\
  133. Sends ARexx command STR (like amiga-arexx-do-command).
  134. If AS-FILE is true, STR is an arexx command, otherwise it is a file name.
  135. Waits for the command to return.
  136.  
  137. The return value is one of three things:
  138.  - the command executed succesfully: nil or a result string.
  139.  - the command failed: a list of the form (RC ERROR-CODE)
  140.    where RC is the severity and ERROR-CODE is the secondary error." (interactive "sARexx command:
  141. P") (byte-code "ƈǠ   
  142. \"?ƒÈÉ!‚1Ê!Ë 8Ì 8 …% ÍVƒ.
  143. D‚/
  144. *))‡" [id str as-file reslist rc second nil amiga-arexx-send-command error "Failed to send arexx command." amiga-arexx-wait-command 1 2 0] 6))
  145.  
  146. (define-key amiga-map "X" (quote amiga-arexx-process))
  147.  
  148. (setq amiga-arexx-initialized t)
  149.  
  150. (defun amiga-wb-process nil "\
  151. Process all pending workbench events, ie load all files requested" (interactive) (byte-code "ÁˆÁÁÂÏ)‡" [file nil (byte-code "ÂÁ!‰…ÃÄŏˆ‚‡" [file t amiga-get-wb-event nil (byte-code "Á!‡" [file find-file] 2) ((error (byte-code "À‡" [nil] 1)))] 5) ((error (byte-code "À‡" [nil] 1)))] 3))
  152.  
  153. (define-key amiga-map "W" (quote amiga-wb-process))
  154.  
  155. (setq amiga-wb-initialized t)
  156.  
  157. (setq completion-ignore-case t)
  158.  
  159. (setq version-control (quote never))
  160.  
  161. (defun safe-amiga-paste nil "\
  162. Paste from the amiga clipboard, trapping any errors." (byte-code "…ÁˆÁÂχ" [amiga-new-clip nil (byte-code "À ‡" [amiga-paste] 2) ((error (byte-code "À‡" [nil] 1)))] 3))
  163.  
  164. (defun check-clipboard nil "\
  165. If there is anything new in the clipboard, add it to the emacs kill ring.
  166. Returns t if there was something added, nil otherwise." (byte-code "à   …ǠɈ
  167. …È
  168. !ˆÄ‰ˆ‰)ˆ)‡" [added amiga-new-clip str nil t kill-ring-yank-pointer kill-ring safe-amiga-paste kill-add] 4))
  169.  
  170. (defun update-clipboard (str &optional dummy) (byte-code "Ã!ˆÂ‰‡" [str amiga-new-clip nil amiga-cut] 3))
  171.  
  172. (setq interprogram-cut-function (quote update-clipboard))
  173.  
  174. (setq interprogram-paste-function (quote safe-amiga-paste))
  175.  
  176. (defun amiga-auto-save-check (file-name) "\
  177. Determines that an auto-save-file-name is valid on the Amiga" (byte-code "    GÃ
  178. W…     
  179. HÄU…    
  180. ÅIˆ
  181. T‰ˆ‚ˆ    *‡" [max file-name i 0 58 45] 4))
  182.