;ELC ;;; compiled by cthomp@willow on Wed Aug 25 18:02:16 1993 ;;; from file /era/era-working/editor/lisp/modes/mim-mode.el ;;; emacs version 19.8 (beta8) Lucid. ;;; bytecomp version 2.16; 8-aug-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.")) (autoload 'fast-syntax-check-mim "mim-syntax" "\ Checks Mim syntax quickly. Answers correct or incorrect, cannot point out the error context." t) (autoload 'slow-syntax-check-mim "mim-syntax" "\ Check Mim syntax slowly. Points out the context of the error, if the syntax is incorrect." t) (defvar mim-mode-hysterical-bindings t "\ *Non-nil means bind list manipulation commands to Meta keys as well as Control-Meta keys for historical reasons. Otherwise, only the latter keys are bound.") (byte-code "!!   W T #p W T #p W T #p W T #p W T #p # # # # # # # # # # # # # # # # # # # #)3‡" [boundp mim-mode-map nil mim-mode-syntax-table -1 i make-syntax-table 32 modify-syntax-entry " " 127 "_ " 96 122 "w " 64 90 47 57 58 " " 44 "' " 46 39 126 59 35 37 33 34 "\" " 92 "\\ " 40 "() " 60 "(> " 123 "(} " 91 "(] " 41 ")( " 62 ")< " 125 "){ " 93 ")[ " "- " mim-whitespace] 4) (defvar mim-mode-hook nil "\ *User function run after mim mode initialization. Usage: (setq mim-mode-hook '(lambda () ... your init forms ...)).") (define-abbrev-table 'mim-mode-abbrev-table nil) (defconst indent-mim-function 'indent-mim-function "\ Controls (via properties) indenting of special forms. (put 'FOO 'indent-mim-function n), integer n, means lines inside will be indented n spaces from start of form. (put 'FOO 'indent-mim-function 'DEFINE) is like above but means use value of mim-body-indent as offset from start of form. (put 'FOO 'indent-mim-function ) where is a list or pointted list of integers, means indent each form in by the amount specified in . When is exhausted, indent remaining forms by `mim-body-indent' unless is a dotted list, in which case the last cdr is used. Confused? Here is an example: (put 'FROBIT 'indent-mim-function '(4 2 . 1)) ...> Finally, the property can be a function name (read the code).") (defvar indent-mim-comment t "\ *Non-nil means indent string comments.") (defvar mim-body-indent 2 "\ *Amount to indent in special forms which have DEFINE property on `indent-mim-function'.") (defvar indent-mim-arglist t "\ *nil means indent arglists like ordinary lists. t means strings stack under start of arglist and variables stack to right of them. Otherwise, strings stack under last string (or start of arglist if none) and variables stack to right of them. Examples (for values 'stack, t, nil): (FOO \"OPT\" BAR (FOO \"OPT\" BAR (FOO \"OPT\" BAR BAZ MUMBLE BAZ MUMBLE BAZ MUMBLE \"AUX\" \"AUX\" \"AUX\" BLETCH ... BLETCH ... BLETCH ...") (byte-code "######### \\ B#" [put DEFINE indent-mim-function DEFMAC BIND PROG REPEAT CASE FUNCTION MAPF MAPR UNWIND mim-body-indent] 5) (defvar mim-down-parens-only t "\ *nil means treat ADECLs and ATOM trailers like structures when moving down a level of structure.") (defvar mim-stop-for-slop t "\ *Non-nil means {next previous}-mim-object consider any non-whitespace character in column 0 to be a toplevel object, otherwise only open paren syntax characters will be considered.") (define-function 'mdl-mode 'mim-mode) (fset 'mim-mode #[nil "  # # # # # # # # # # # # # # # # # # # # #- # # # # # # # # # # # # !=!!@AP?B!?BC!DCE!FEG!FGH!IHJ!KJL!MLN!NO!POQ!DQRSTUVWXY!" [kill-all-local-variables mim-mode-map make-sparse-keymap define-key "" open-mim-line "" indent-mim-object "" previous-mim-object "" next-mim-object "" beginning-of-DEFINE "" end-of-DEFINE "" transpose-mim-objects "" backward-up-mim-object "" forward-down-mim-object "" mark-mim-object " " forward-kill-mim-object "" forward-mim-object "" backward-mim-object "^" raise-mim-line "\\" fixup-whitespace "" backward-delete-char-untabify "" backward-kill-mim-object "\n" newline-and-mim-indent ";" begin-mim-comment " " indent-mim-line " " mim-mode-hysterical-bindings "!" line-to-top-of-window "o" "p" "n" "a" "e" "t" "u" "d" "k" "f" "b" use-local-map set-syntax-table mim-mode-syntax-table make-local-variable paragraph-start "^$\\|" page-delimiter paragraph-separate paragraph-ignore-fill-prefix t comment-start ";\"" comment-start-skip comment-end "\"" comment-column 40 comment-indent-function indent-mim-comment indent-line-function blink-matching-paren-distance nil indent-tabs-mode mim-mode-abbrev-table local-abbrev-table mim-mode major-mode "Mim" mode-name run-hooks mim-mode-hook] 4 "\ Major mode for editing Mim (MDL in MDL) code. Commands: If value of `mim-mode-hysterical-bindings' is non-nil, then following commands are assigned to escape keys as well (e.g. M-f = M-C-f). The default action is bind the escape keys. \\{mim-mode-map} Other Commands: Use \\[describe-function] to obtain documentation. replace-in-mim-object find-mim-definition fast-syntax-check-mim slow-syntax-check-mim backward-down-mim-object forward-up-mim-object Variables: Use \\[describe-variable] to obtain documentation. mim-mode-hook indent-mim-comment indent-mim-arglist indent-mim-function mim-body-indent mim-down-parens-only mim-stop-for-slop mim-mode-hysterical-bindings Entry to this mode calls the value of mim-mode-hook if non-nil." nil]) (fset 'line-to-top-of-window #[nil "!" [recenter 0] 2 "\ Move current line to top of window." nil]) (fset 'forward-mim-object #[(arg) " !U ! \" !" [abs arg 1 inside-atom-p forward-sexp forward-mim-objects t] 3 "\ Move forward across Mim object. With ARG, move forward that many objects." "p"]) (byte-code "MM" [inside-atom-p #[nil "hgzU zU UzUzUU*" [c2 c1 119 95 33] 3] forward-mim-objects #[(arg &optional skip-bracket-p) " !ŏ`\n!U\n[!)" [mim-sign arg direction conditions (byte-code "U ! !r Zl" [arg 0 forward-sexp direction inside-adecl-or-trailer-p] 3) ((error (byte-code " A\" !` \\b" [skip-bracket-p signal error conditions skip-mim-whitespace direction] 3))) buffer-end skip-mim-whitespace] 3]] 2) (fset 'backward-mim-object #[(&optional arg) " [!" [forward-mim-object arg -1] 2 "\ Move backward across Mim object. With ARG, move backward that many objects." "p"]) (fset 'mark-mim-object #[(&optional arg) "\n!`)!" [push-mark forward-mim-object arg 1] 3 "\ Mark following Mim object. With ARG, mark that many following (preceding, ARG < 0) objects." "p"]) (fset 'forward-kill-mim-object #[(&optional arg) "`\n!`\"" [kill-region forward-mim-object arg 1] 4 "\ Kill following Mim object. With ARG, kill that many objects." "*p"]) (fset 'backward-kill-mim-object #[(&optional arg) " [!" [forward-kill-mim-object arg 1] 2 "\ Kill preceding Mim object. With ARG, kill that many objects." "*p"]) (fset 'raise-mim-line #[(&optional arg) " ‰! Vª U? y``S| Zi+" [mim-sign arg 1 increment 0 direction fixup-whitespace] 4 "\ Raise following line, fixing up whitespace at join. With ARG raise that many following lines. A negative ARG will raise current line and previous lines." "*p"]) (fset 'forward-down-mim-object #[(&optional arg) " ‰! !U ! V! Ygh\nzU\nzU) ! !`` # !)b U?` # !b Zh)" [mim-sign arg 1 direction abs mim-down-parens-only skip-mim-whitespace 0 re-search-forward "\\s'*" c 95 119 forward-sexp inside-adecl-or-trailer-p scan-lists -1 buffer-end] 5 "\ Move down a level of Mim structure forwards. With ARG, move down that many levels forwards (backwards, ARG < 0)." "p"]) (fset 'backward-down-mim-object #[(&optional arg) " [!" [forward-down-mim-object arg -1] 2 "\ Move down a level of Mim structure backwards. With ARG, move down that many levels backwards (forwards, ARG < 0)." "p"]) (fset 'forward-up-mim-object #[(&optional arg) " ‰! U` # !b Zi W )" [mim-sign arg 1 direction 0 scan-lists buffer-end backward-prefix-chars] 5 "\ Move up a level of Mim structure forwards With ARG, move up that many levels forwards (backwards, ARG < 0)." "p"]) (fset 'backward-up-mim-object #[(&optional arg) " [!" [forward-up-mim-object arg -1] 2 "\ Move up a level of Mim structure backwards With ARG, move up that many levels backwards (forwards, ARG > 0)." "p"]) (fset 'replace-in-mim-object #[(old new) "`!`)} \")" [forward-mim-object 1 replace-string old new] 3 "\ Replace string in following Mim object." "*sReplace in object: \nsReplace %s with: "]) (fset 'transpose-mim-objects #[(&optional arg) "\n\"" [transpose-subr forward-mim-object arg 1] 3 "\ Transpose Mim objects around point. With ARG, transpose preceding object that many times with following objects. A negative ARG will transpose backwards." "*p"]) (fset 'beginning-of-DEFINE #[(&optional arg move) " ‰!  W`Tb U $ Zm W`Sb)" [mim-sign arg 1 direction move t 0 re-search-backward "^<" nil] 6 "\ Move backward to beginning of surrounding or previous toplevel Mim form. With ARG, do it that many times. Stops at last toplevel form seen if buffer end is reached." "p"]) (fset 'end-of-DEFINE #[(&optional arg) "WS[!!T[\"!!y" [arg 1 0 beginning-of-DEFINE looking-at "^<" move forward-mim-object] 3 "\ Move forward to end of surrounding or next toplevel mim form. With ARG, do it that many times. Stops at end of last toplevel form seen if buffer end is reached." "p"]) (fset 'next-mim-object #[(&optional arg) " ʼn!V`Tb U$ ZjV`SbW!`!)?!*" [mim-stop-for-slop "^\\S " "^\\s(" mim-sign arg 1 direction search-string 0 re-search-forward nil t forward-mim-object pos-visible-in-window-p recenter] 6 "\ Move to beginning of next toplevel Mim object. With ARG, do it that many times. Stops at last object seen if buffer end is reached." "p"]) (fset 'previous-mim-object #[(&optional arg) " [!" [next-mim-object arg 1] 2 "\ Move to beginning of previous toplevel Mim object. With ARG do it that many times. Stops at last object seen if buffer end is reached." "p"]) (fset 'calculate-mim-indent #[(&optional parse-start) "y` \n   b΍` W` # p\n\n @\nV\n AA@ A@Tb`V #A@\n  \n8Tbi(hU!`V by`)Vw`by`$`U`#@U) `? b?hUu TWۏr W!)`W w`V ^` bgU`!UG w`=!7 bdwgUКT* bi?y`)Vw`by`$`U`#@U) ` bi? @b!!u b!u`x !( Tb bwi)\n)  \"i b. " [0 nil paren-depth where peek start desired-indent last-sexp containing-sexp state retry indent-point parse-start from-the-top (byte-code "ď!b$\" iU?[xou " [t retry nil (forward-sexp -1) ((error (byte-code "" [nil retry] 1))) looking-at ".?[ ]*\"" indent-point re-search-backward "^\\s(" move 1 throw from-the-top 0 mim-whitespace -1 backward-prefix-chars] 6) parse-partial-sexp t 60 forward-sexp 1 " " backward-prefix-chars indent-mim-arglist 40 -1 6 (byte-code "!‡" [forward-sexp -1 t] 2) ((error)) looking-at "DEFINE\\|DEFMAC\\|FUNCTION" last-string eol mim-whitespace 34 3 search-forward "\"" re-search-backward "[^\\]\"" ";[ ]*\"" indent-mim-comment indent-mim-function] 11 "\ Calculate indentation for Mim line. Returns column."]) (fset 'indent-mim-function #[(state indent-point) "A@`\nTb !i`!`{!\nN ͚  y`AA@V \\ b :\n# 9 ! \"++" [state current-indent containing-sexp backward-prefix-chars looking-at "\\sw\\|\\s_" start intern-soft forward-sexp 1 function indent-mim-function method DEFINE mim-body-indent indent-mim-offset indent-point fboundp] 5 "\ Compute indentation for Mim special forms. Returns column or nil."]) (fset 'indent-mim-offset #[(function state indent-point) " N A@ AA@Tb` Wˏx gUh@A[STbi \\-" [mim-body-indent function indent-mim-function state nil indentation last-sexp containing-sexp indentations indent-point (byte-code "!` $" [forward-sexp 1 parse-partial-sexp indent-point t] 5) ((error)) " " backward-prefix-chars 59] 5]) (fset 'indent-mim-comment #[(&optional start) "``yǍb," [old-point nil eol state last-sexp 0 no-comment (byte-code "` \"AA@\n@\"y` $` U\" bx !\" iWj LJ" [parse-partial-sexp eol state last-sexp 3 throw no-comment nil 0 t " " backward-prefix-chars looking-at ";[ ]*\"" delete-horizontal-space comment-column tab-to-tab-stop] 6)] 2 "\ Indent a one line (string) Mim comment following object, if any."]) (fset 'indent-mim-line #[nil "d`Zy` wi U\n`| jdZ`VdZb+" [position 0 bol calculate-mim-indent indent " " nil] 2 "\ Indent line of Mim code." "*"]) (fset 'newline-and-mim-indent #[nil " " [newline indent-mim-line] 1 "\ Insert newline at point and indent." "*"]) (fset 'open-mim-line #[(&optional lines) "y  V y\nj Sm)" [0 calculate-mim-indent indent lines newline -1] 3 "\ Insert newline before point and indent. With ARG insert that many newlines." "*p"]) (fset 'indent-mim-object #[(&optional dont-indent-first-line) "`d$`!d`Z)\n yd`Z V !`w\niU `|\nj\\ W-" [nil start indent bol end parse-partial-sexp 0 t forward-sexp 1 dont-indent-first-line indent-mim-line calculate-mim-indent " " indent-mim-comment] 5 "\ Indent object following point and all lines contained inside it. With ARG, idents only contained lines (skips first line)." "*P"]) (fset 'find-mim-definition #[(name) "ebÏ) by!)" [nil where (byte-code "\nP!`" [re-search-forward "^<\\(DEFINE\\|\\DEFMAC\\|FCN\\|GFCN\\)\\([ ]*\\)" name where] 3) ((error (error "Can't find %s" name))) push-mark 0 recenter] 3 "\ Search for definition of function, macro, or gfcn. You need type only enough of the name to be unambiguous." "sName: "]) (fset 'begin-mim-comment #[nil "`y` #d`Z dZb) \n b` #\n@š\nAA@\nAA@ c\n@?` | \n@š jiV jcc)**" [nil eol 0 bol re-search-forward ";[ ]*\"" t indent-mim-comment where last-sexp state parse-partial-sexp 3 calculate-mim-indent comment-column tab-to-tab-stop comment-start comment-end] 4 "\ Move to existing comment or insert empty comment." "*"]) (byte-code "MM" [skip-mim-whitespace #[(direction) "Y\ndw\nex" [direction 0 mim-whitespace] 2] inside-adecl-or-trailer-p #[(direction) "Y!hU!" [direction 0 looking-at ":\\|!-" 58 "!-"] 2]] 2) (fset 'mim-sign #[(n) "Y‡Ç" [n 0 1 -1] 2 "\ Returns -1 if N < 0, else 1."]) (provide 'mim-mode)