;ELC ;;; compiled by jimb@geech.gnu.ai.mit.edu on Mon Jul 5 23:40:53 1993 ;;; from file /gd/gnu/emacs/19.0/lisp/modula2.el ;;; emacs version 19.15.16. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "This file was compiled for Emacs 19")) (defvar m2-mode-syntax-table nil "\ Syntax table in use in Modula-2 buffers.") (defvar m2-compile-command "m2c" "\ Command to compile Modula-2 programs") (defvar m2-link-command "m2l" "\ Command to link Modula-2 programs") (defvar m2-link-name nil "\ Name of the executable.") (byte-code "L \n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n)" [m2-mode-syntax-table make-syntax-table table modify-syntax-entry 92 "\\" 40 ". 1" 41 ". 4" 42 ". 23" 43 "." 45 61 37 60 62 39 "\""] 4) (defvar m2-mode-map nil "\ Keymap used in Modula-2 mode.") (byte-code " \n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n#\n)" [m2-mode-map make-sparse-keymap map define-key " " m2-tab "b" m2-begin "c" m2-case "d" m2-definition "e" m2-else "f" m2-for "h" m2-header "i" m2-if "m" m2-module "l" m2-loop "o" m2-or "p" m2-procedure "" m2-with "r" m2-record "s" m2-stdio "t" m2-type "u" m2-until "v" m2-var "w" m2-while "x" m2-export "y" m2-import "{" m2-begin-comment "}" m2-end-comment "\n" m2-newline "" suspend-emacs "" m2-visit "" m2-toggle " " m2-link "" m2-compile] 4) (defvar m2-indent 5 "\ *This variable gives the indentation in Modula-2-Mode") (defalias 'modula-2-mode #[nil " \n!!!\n !!P!!!!!!!!!!" [kill-all-local-variables use-local-map m2-mode-map modula-2-mode major-mode "Modula-2" mode-name make-local-variable comment-column 41 end-comment-column 75 set-syntax-table m2-mode-syntax-table paragraph-start "^$\\|" page-delimiter paragraph-separate paragraph-ignore-fill-prefix t require-final-newline comment-start "(* " comment-end " *)" comment-start-skip "/\\*+ *" comment-indent-function c-comment-indent parse-sexp-ignore-comments run-hooks m2-mode-hook] 2 "\ This is a mode intended to support program development in Modula-2. All control constructs of Modula-2 can be reached by typing C-c followed by the first character of the construct. \\ \\[m2-begin] begin \\[m2-case] case \\[m2-definition] definition \\[m2-else] else \\[m2-for] for \\[m2-header] header \\[m2-if] if \\[m2-module] module \\[m2-loop] loop \\[m2-or] or \\[m2-procedure] procedure Control-c Control-w with \\[m2-record] record \\[m2-stdio] stdio \\[m2-type] type \\[m2-until] until \\[m2-var] var \\[m2-while] while \\[m2-export] export \\[m2-import] import \\[m2-begin-comment] begin-comment \\[m2-end-comment] end-comment \\[suspend-emacs] suspend Emacs \\[m2-toggle] toggle \\[m2-compile] compile \\[m2-next-error] next-error \\[m2-link] link `m2-indent' controls the number of spaces for each indentation. `m2-compile-command' holds the command to compile a Modula-2 program. `m2-link-command' holds the command to link a Modula-2 program." nil]) (defalias 'm2-newline #[nil "  j)" [current-indentation hpos newline] 1 "\ Insert a newline and indent following line like previous line." nil]) (defalias 'm2-tab #[nil " T _j" [current-indentation m2-indent] 2 "\ Indent to next tab stop." nil]) (defalias 'm2-begin #[nil "c " ["BEGIN" m2-newline m2-tab] 1 "\ Insert a BEGIN keyword and indent for the next line." nil]) (defalias 'm2-case #[nil "!\nı \nDZ) " [read-string "Case-Expression: " name "CASE " " OF" m2-newline "END (* case " " *);" 0 m2-tab] 3 "\ Build skeleton CASE statment, prompting for the ." nil]) (defalias 'm2-definition #[nil "c! ű)!" ["DEFINITION MODULE " read-string "Name: " name ";\n\n\n\nEND " ".\n" previous-line 3] 5 "\ Build skeleton DEFINITION MODULE, prompting for the ." nil]) (defalias 'm2-else #[nil " \n\"c " [m2-newline backward-delete-char-untabify m2-indent nil "ELSE" m2-tab] 3 "\ Insert ELSE keyword and indent for next line." nil]) (defalias 'm2-for #[nil "c!ÉDZ!c!ʘ' c  б+ " ["FOR " read-string "Loop Initialiser: " nil by limit name " TO " "Limit: " "Step: " "" " BY " " DO" m2-newline "END (* for " " to " " *);" 0 m2-tab] 6 "\ Build skeleton FOR loop statment, prompting for the loop parameters." nil]) (defalias 'm2-header #[nil "c!cc cc c ˰cc" ["(*\n Title: " read-string "Title: " "\n Created: " current-time-string "\n Author: " user-full-name "\n <" user-login-name "@" system-name ">\n" "*)\n\n"] 5 "\ Insert a comment block containing the module title, author, etc." nil]) (defalias 'm2-if #[nil "c!ı DZ) " ["IF " read-string ": " thecondition " THEN" m2-newline "END (* if " " *);" 0 m2-tab] 4 "\ Insert skeleton IF statment, prompting for ." nil]) (defalias 'm2-loop #[nil "c c " ["LOOP" m2-newline "END (* loop *);" 0 m2-tab] 1 "\ Build skeleton LOOP (with END)." nil]) (defalias 'm2-module #[nil "c! ű! ϱ) " ["IMPLEMENTATION MODULE " read-string "Name: " name ";\n\n\n\nEND " ".\n" previous-line 3 m2-header m2-type newline m2-var m2-begin m2-begin-comment " Module " " Initialisation Code " m2-end-comment m2-tab] 5 "\ Build skeleton IMPLEMENTATION MODULE, prompting for ." nil]) (byte-code "\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"" [defalias m2-or #[nil " \n!c " [m2-newline backward-delete-char-untabify m2-indent "|" m2-tab] 2 nil nil] m2-procedure #[nil "c!Ʊ!ȱ!ʘ$ c c c cc *" ["PROCEDURE " read-string "Name: " nil args name " (" "Arguments: " ")" "Result Type: " "" " : " ";" m2-newline "BEGIN" "END " 0 m2-tab] 3 nil nil] m2-with #[nil "c!cc DZ) " ["WITH " read-string "Record-Type: " name " DO" m2-newline "END (* with " " *);" 0 m2-tab] 4 nil nil] m2-record #[nil "c c " ["RECORD" m2-newline "END (* record *);" 0 m2-tab] 1 nil nil] m2-stdio #[nil "c" ["\nFROM TextIO IMPORT \n WriteCHAR, ReadCHAR, WriteINTEGER, ReadINTEGER,\n WriteCARDINAL, ReadCARDINAL, WriteBOOLEAN, ReadBOOLEAN,\n WriteREAL, ReadREAL, WriteBITSET, ReadBITSET,\n WriteBasedCARDINAL, ReadBasedCARDINAL, WriteChars, ReadChars,\n WriteString, ReadString, WhiteSpace, EndOfLine;\n\nFROM SysStreams IMPORT sysIn, sysOut, sysErr;\n\n"] 1 nil nil] m2-type #[nil "c " ["TYPE" m2-newline m2-tab] 1 nil nil] m2-until #[nil "c c!ű " ["REPEAT" m2-newline "UNTIL " read-string ": " ";" 0 m2-tab] 2 nil nil] m2-var #[nil " c " [m2-newline "VAR" m2-tab] 1 nil nil] m2-while #[nil "c!ı DZ) " ["WHILE " read-string ": " name " DO" m2-newline "END (* while " " *);" 0 m2-tab] 4 nil nil] m2-export #[nil "c" ["EXPORT QUALIFIED "] 1 nil nil] m2-import #[nil "c!cc" ["FROM " read-string "Module: " " IMPORT "] 2 nil nil] m2-begin-comment #[nil "n \"c" [indent-to comment-column 0 "(* "] 3 nil nil] m2-end-comment #[nil "njc" [end-comment-column "*)"] 1 nil nil] m2-compile #[nil "  Q!" [buffer-name modulename compile m2-compile-command " "] 4 nil nil] m2-link #[nil " \n \nQ! \"Q!" [buffer-name modulename m2-link-name compile m2-link-command " " read-string "Name of executable: "] 6 nil nil] execute-monitor-command #[(command) " !Ú lj\nP&*" [shell-file-name shell file-name-nondirectory "csh" csh call-process nil t "-cf" "exec " command] 8] m2-visit #[nil "!! P!ebˏ͏ /\n/ \") D !\nK\n!)K\nK\n!+" [nil modulename modfile deffile read-string "Module name: " switch-to-buffer "*Command Execution*" execute-monitor-command "m2whereis " (byte-code "!”•{" [re-search-forward "\\(.*\\.def\\) *$" 1 deffile] 2) ((search-failed)) (byte-code "!”•{" [re-search-forward "\\(.*\\.mod\\) *$" 1 modfile] 2) ((search-failed)) error "I can find neither definition nor implementation of %s" find-file] 3 nil nil]] 3) (defalias 'm2-toggle #[nil " OØ OP! OƘ( OP! OȘ< OP! OɘO OP!" [buffer-name -4 nil ".def" find-file-other-window 0 ".mod" -3 ".mi" ".md"] 4 "\ Toggle between .mod and .def files for the module." nil])