;ELC ;;; compiled by jwz@thalidomide on Fri Dec 31 01:59:13 1993 ;;; from file /th/jwz/emacs19/lisp/modes/modula2.el ;;; emacs version 19.9 Lucid (beta9). ;;; bytecomp version 2.22; 22-dec-93. ;;; 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-mode 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 " \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") (fset '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-hook 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 Control-C followed by the first character of the construct. \\{m2-mode-map} Control-c b begin Control-c c case Control-c d definition Control-c e else Control-c f for Control-c h header Control-c i if Control-c m module Control-c l loop Control-c o or Control-c p procedure Control-c Control-w with Control-c r record Control-c s stdio Control-c t type Control-c u until Control-c v var Control-c w while Control-c x export Control-c y import Control-c { begin-comment Control-c } end-comment Control-c Control-z suspend-emacs Control-c Control-t toggle Control-c Control-c compile Control-x ` next-error Control-c Control-l 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]) (fset 'm2-newline #[nil "  j)" [current-indentation hpos newline] 1 "\ Insert a newline and indent following line like previous line." nil]) (fset 'm2-tab #[nil " T _j" [current-indentation m2-indent] 2 "\ Indent to next tab stop." nil]) (fset 'm2-begin #[nil "c " ["BEGIN" m2-newline m2-tab] 1 "\ Insert a BEGIN keyword and indent for the next line." nil]) (fset '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]) (fset '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]) (fset '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]) (fset '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]) (fset '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]) (fset '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]) (fset 'm2-loop #[nil "c c " ["LOOP" m2-newline "END (* loop *);" 0 m2-tab] 1 "\ Build skeleton LOOP (with END)." nil]) (fset '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 "MMMMMMMMMMMMMMMMM" [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" ["\n>FROM 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\n>FROM 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 \") !\n\n!)\n\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]] 2) (fset 'm2-toggle #[nil " OØ OP! OƘ OP! OȘ OP! 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])