;ELC ;;; compiled by rms@mole.gnu.ai.mit.edu on Thu Feb 1 23:45:08 1996 ;;; from file /home/fsf/rms/e19/lisp/ada-mode.el ;;; emacs version 19.30.90.5. ;;; 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.29"))) (error "`ada-mode.el' was compiled for Emacs 19.29 or later")) #@39 *Defines the size of Ada indentation. (defvar ada-indent 3 (#$ . -474)) #@60 *# of columns to indent the continuation of a broken line. (defvar ada-broken-indent 2 (#$ . -552)) #@34 *# of columns to indent a label. (defvar ada-label-indent -4 (#$ . -658)) #@110 *# of columns to indent a statement end keyword in a separate line. Examples are 'is', 'loop', 'record', ... (defvar ada-stmt-end-indent 0 (#$ . -739)) #@72 *Defines the indentation for 'when' relative to 'exception' or 'case'. (defvar ada-when-indent 3 (#$ . -897)) #@68 *Defines the indentation for 'record' relative to 'type' or 'use'. (defvar ada-indent-record-rel-type 3 (#$ . -1013)) #@54 *If non-nil, comment-lines get indented as Ada code. (defvar ada-indent-comment-as-code t (#$ . -1137)) #@76 *If non-nil, 'is separate' or 'is abstract' on a single line are indented. (defvar ada-indent-is-separate t (#$ . -1247)) #@66 *If non-nil, indent according to the innermost open parenthesis. (defvar ada-indent-to-open-paren t (#$ . -1375)) #@55 *Search that many characters for an open parenthesis. (defvar ada-search-paren-char-count-limit 3000 (#$ . -1495)) #@418 *Control behaviour of the TAB key. Must be one of `indent-rigidly', `indent-auto', `gei', `indent-af' or `always-tab'. `indent-rigidly' : always adds ada-indent blanks at the beginning of the line. `indent-auto' : use indentation functions in this file. `gei' : use David Kgedal's Generic Indentation Engine. `indent-af' : use Gary E. Barnes' ada-format.el `always-tab' : do indent-relative. (defvar ada-tab-policy (quote indent-auto) (#$ . -1617)) #@90 *If non-nil, `ada-move-to-start' moves point to the subprog declaration, not to 'begin'. (defvar ada-move-to-declaration nil (#$ . -2097)) #@37 *Suffix of Ada specification files. (defvar ada-spec-suffix ".ads" (#$ . -2242)) #@28 *Suffix of Ada body files. (defvar ada-body-suffix ".adb" (#$ . -2329)) #@39 *Do we program in `ada83' or `ada95'? (defvar ada-language-version (quote ada95) (#$ . -2407)) #@142 *Function to call to adjust the case of Ada keywords. It may be `downcase-word', `upcase-word', `ada-loose-case-word' or `capitalize-word'. (defvar ada-case-keyword (quote downcase-word) (#$ . -2509)) #@147 *Function to call to adjust the case of an Ada identifier. It may be `downcase-word', `upcase-word', `ada-loose-case-word' or `capitalize-word'. (defvar ada-case-identifier (quote ada-loose-case-word) (#$ . -2718)) #@144 *Function to call to adjust the case of Ada attributes. It may be `downcase-word', `upcase-word', `ada-loose-case-word' or `capitalize-word'. (defvar ada-case-attribute (quote capitalize-word) (#$ . -2941)) #@166 *Non-nil automatically changes case of preceding word while typing. Casing is done according to `ada-case-keyword', `ada-case-identifier' and `ada-cacse-attribute'. (defvar ada-auto-case t (#$ . -3156)) #@76 *If non-nil, `remove-trailing-spaces' and `untabify' buffer before saving. (defvar ada-clean-buffer-before-saving nil (#$ . -3365)) #@117 *List of functions to call when Ada Mode is invoked. This is a good place to add Ada environment specific bindings. (defvar ada-mode-hook nil (#$ . -3504)) #@56 *External pretty printer to call from within Ada Mode. (defvar ada-external-pretty-print-program "aimap" (#$ . -3666)) #@68 *Directory to store the temporary file for the Ada pretty printer. (defvar ada-tmp-directory "/tmp/" (#$ . -3791)) #@74 *This is inserted in the first columns when filling a comment paragraph. (defvar ada-fill-comment-prefix "-- " (#$ . -3912)) #@120 *This is inserted at the end of each line when filling a comment paragraph. with `ada-fill-comment-paragraph-postfix'. (defvar ada-fill-comment-postfix " --" (#$ . -4044)) #@119 *Argument of gnatk8, a string containing the max number of characters. Set to 0, if you don't use crunched filenames. (defvar ada-krunch-args "0" (#$ . -4223)) #@32 Abbrev table used in Ada mode. (defvar ada-mode-abbrev-table nil (#$ . 4389)) (define-abbrev-table (quote ada-mode-abbrev-table) nil) #@33 Local keymap used for Ada Mode. (defvar ada-mode-map nil (#$ . 4529)) #@54 Syntax table to be used for editing Ada source code. (defvar ada-mode-syntax-table nil (#$ . 4605)) #@56 Syntax table for Ada, where `_' is a word constituent. (defvar ada-mode-symbol-syntax-table nil (#$ . 4711)) #@51 regular expression for looking at Ada83 keywords. (defconst ada-83-keywords "\\<\\(abort\\|abs\\|accept\\|access\\|all\\|and\\|array\\|at\\|begin\\|body\\|case\\|constant\\|declare\\|delay\\|delta\\|digits\\|do\\|else\\|elsif\\|end\\|entry\\|exception\\|exit\\|for\\|function\\|generic\\|goto\\|if\\|in\\|is\\|limited\\|loop\\|mod\\|new\\|not\\|null\\|of\\|or\\|others\\|out\\|package\\|pragma\\|private\\|procedure\\|raise\\|range\\|record\\|rem\\|renames\\|return\\|reverse\\|select\\|separate\\|subtype\\|task\\|terminate\\|then\\|type\\|use\\|when\\|while\\|with\\|xor\\)\\>" (#$ . 4826)) #@51 regular expression for looking at Ada95 keywords. (defconst ada-95-keywords "\\<\\(abort\\|abs\\|abstract\\|accept\\|access\\|aliased\\|all\\|and\\|array\\|at\\|begin\\|body\\|case\\|constant\\|declare\\|delay\\|delta\\|digits\\|do\\|else\\|elsif\\|end\\|entry\\|exception\\|exit\\|for\\|function\\|generic\\|goto\\|if\\|in\\|is\\|limited\\|loop\\|mod\\|new\\|not\\|null\\|of\\|or\\|others\\|out\\|package\\|pragma\\|private\\|procedure\\|protected\\|raise\\|range\\|record\\|rem\\|renames\\|requeue\\|return\\|reverse\\|select\\|separate\\|subtype\\|tagged\\|task\\|terminate\\|then\\|type\\|until\\|use\\|when\\|while\\|with\\|xor\\)\\>" (#$ . 5425)) #@49 Regular expression for looking at Ada keywords. (defvar ada-keywords ada-95-keywords (#$ . 6084)) #@63 Variable to save key binding of RET when casing is activated. (defvar ada-ret-binding nil (#$ . 6188)) #@63 Variable to save key binding of LFD when casing is activated. (defvar ada-lfd-binding nil (#$ . 6297)) #@46 Regexp matching Ada (qualified) identifiers. (defconst ada-ident-re "[a-zA-Z0-9_\\.]+" (#$ . 6406)) #@47 Regexp used to find Ada procedures/functions. (defvar ada-procedure-start-regexp "^[ ]*\\(procedure\\|function\\|task\\)[ \n]+\\([a-zA-Z0-9_\\.]+\\)" (#$ . 6512)) #@34 Regexp used to find Ada packages (defvar ada-package-start-regexp "^[ ]*\\(package\\)" (#$ . 6683)) #@42 Regexp for keywords starting Ada blocks. (defvar ada-block-start-re "\\<\\(begin\\|select\\|declare\\|private\\|or\\|generic\\|exception\\|loop\\|else\\|\\(\\(limited\\|abstract\\|tagged\\)[ ]+\\)*record\\)\\>" (#$ . 6790)) #@89 Regexp of possible ends for a non-broken statement. A new statement starts after these. (defvar ada-end-stmt-re "\\(;\\|=>\\|^[ ]*separate[ ]+([a-zA-Z0-9_\\.]+)\\|\\<\\(begin\\|else\\|record\\|loop\\|select\\|do\\|declare\\|generic\\|private\\)\\>\\|^[ ]*\\(package\\|procedure\\|function\\)[ a-zA-Z0-9_\\.]+is\\|^[ ]*exception\\>\\)" (#$ . 7021)) #@33 Regexp for the start of a loop. (defvar ada-loop-start-re "\\<\\(for\\|while\\|loop\\)\\>" (#$ . 7380)) #@39 Regexp for the start of a subprogram. (defvar ada-subprog-start-re "\\<\\(procedure\\|protected\\|package\\|function\\|task\\|accept\\|entry\\)\\>" (#$ . 7490)) #@73 Imenu generic expression for Ada mode. See `imenu-generic-expression'. (defvar ada-imenu-generic-expression (quote ((nil "^\\s-*\\(procedure\\|function\\)\\s-+\\([A-Za-z0-9_]+\\)" 2) ("Type Defs" "^\\s-*\\(sub\\)?type\\s-+\\([A-Za-z0-9_]+\\)" 2))) (#$ . 7657)) (defalias 'ada-xemacs #[nil "\n\" \n\"" [string-match "Lucid" emacs-version "XEmacs"] 3]) #@39 Create the syntax table for Ada Mode. (defalias 'ada-create-syntax-table #[nil " ! # # # # # # # # # # # # # # # # # # # # # # # # # # # !((#" [make-syntax-table ada-mode-syntax-table set-syntax-table modify-syntax-entry 37 "\"" 34 35 "$" 58 "." 59 38 124 43 42 47 61 60 62 36 91 93 123 125 46 92 39 45 ". 12" 12 "> " 10 95 "_" 40 "()" 41 ")(" copy-syntax-table ada-mode-symbol-syntax-table "w"] 4 (#$ . 8022)]) #@2580 Ada Mode is the major mode for editing Ada code. Bindings are as follows: (Note: 'LFD' is control-j.) Indent line '\[ada-tab]' Indent line, insert newline and indent the new line. '\[newline-and-indent]' Re-format the parameter-list point is in '\[ada-format-paramlist]' Indent all lines in region '\[ada-indent-region]' Call external pretty printer program '\[ada-call-pretty-printer]' Adjust case of identifiers and keywords in region '\[ada-adjust-case-region]' Adjust case of identifiers and keywords in buffer '\[ada-adjust-case-buffer]' Call EXTERNAL pretty printer (if you have one) '\[ada-call-pretty-printer]' Fill comment paragraph '\[ada-fill-comment-paragraph]' Fill comment paragraph and justify each line '\[ada-fill-comment-paragraph-justify]' Fill comment paragraph, justify and append postfix '\[ada-fill-comment-paragraph-postfix]' Next func/proc/task '\[ada-next-procedure]' Previous func/proc/task '\[ada-previous-procedure]' Next package '\[ada-next-package]' Previous package '\[ada-previous-package]' Goto matching start of current 'end ...;' '\[ada-move-to-start]' Goto end of current block '\[ada-move-to-end]' Comments are handled using standard GNU Emacs conventions, including: Start a comment '\[indent-for-comment]' Comment region '\[comment-region]' Uncomment region '\[ada-uncomment-region]' Continue comment on next line '\[indent-new-comment-line]' If you use imenu.el: Display index-menu of functions & procedures '\[imenu]' If you use find-file.el: Switch to other file (Body <-> Spec) '\[ff-find-other-file]' or '\[ff-mouse-find-other-file] Switch to other file in other window '\[ada-ff-other-window]' or '\[ff-mouse-find-other-file-other-window] If you use this function in a spec and no body is available, it gets created with body stubs. If you use ada-xref.el: Goto declaration: '\[ada-point-and-xref]' on the identifier or '\[ada-goto-declaration]' with point on the identifier Complete identifier: '\[ada-complete-identifier]' Execute Gnatf: '\[ada-gnatf-current]' (defalias 'ada-mode #[nil " !!!!!\n!\f!!!!!!!q !t \" \"\" !*= ,- *= /-0 " [kill-all-local-variables make-local-variable require-final-newline t comment-start "-- " comment-end "" comment-start-skip "--+[ ]*" indent-line-function ada-indent-current-function fill-column 75 comment-column 40 parse-sexp-ignore-comments case-fold-search fill-paragraph-function ada-fill-comment-paragraph imenu-generic-expression ada-imenu-generic-expression font-lock-defaults ((ada-font-lock-keywords ada-font-lock-keywords-1 ada-font-lock-keywords-2) nil t ((95 . "w")) beginning-of-line) ada-mode major-mode "Ada" mode-name blink-matching-paren use-local-map ada-mode-map ada-mode-syntax-table set-syntax-table ada-create-syntax-table ada-clean-buffer-before-saving add-hook local-write-file-hooks ada-remove-trailing-spaces ada-untabify-buffer ada-add-ada-menu run-hooks ada-mode-hook ada-language-version ada83 ada-83-keywords ada-keywords ada95 ada-95-keywords ada-auto-case ada-activate-keys-for-case] 3 (#$ . 8564) nil]) #@66 Fills current comment paragraph and justifies each line as well. (defalias 'ada-fill-comment-paragraph-justify #[nil "!" [ada-fill-comment-paragraph t] 2 (#$ . 12291) nil]) #@117 Fills current comment paragraph and justifies each line as well. Prompts for a postfix to be appended to each line. (defalias 'ada-fill-comment-paragraph-postfix #[nil "\"" [ada-fill-comment-paragraph t] 3 (#$ . 12474) nil]) #@274 Fills the current comment paragraph. If JUSTIFY is non-nil, each line is justified as well. If POSTFIX and JUSTIFY are non-nil, `ada-fill-comment-postfix' is appended to each filled and justified line. If `ada-indent-comment-as-code' is non-nil, the paragraph is idented. (defalias 'ada-fill-comment-paragraph #[(&optional justify postfix) " ! - - \" = = \"! !Z !Z y E y b !} !} y h y i ) b\fP# ! )by# ! )\" Z#GZ G Z\"S #\" \\#G\\ G \\\"by )b j#cS#6#P!y j) sssbS#_P!K\"iZGZ\"c)Sb!)! b.߇" [point-marker nil "" fill-prefix ada-fill-comment-old-postfix indent end-2 end begin opos ada-in-comment-p error "not inside comment" justify postfix read-from-minibuffer "enter new postfix string: " ada-fill-comment-postfix "enter already existing postfix string: " message "filling comment paragraph ..." back-to-indentation looking-at "--.*$" "--[ ]*$" 1 0 -1 ada-indent-current re-search-forward "\n" t replace-match "^[ ]*--[ ]*" fill-column ada-fill-comment-prefix fill-region -2 insert-char 10 delete-char "filling comment paragraph ... done"] 7 (#$ . 12710) "P"]) #@321 Calls the external Pretty Printer. The name is specified in `ada-external-pretty-print-program'. Saves the current buffer in a directory specified by `ada-tmp-directory', starts the pretty printer as external process on that file and then reloads the beautified program in the buffer and cleans up `ada-tmp-directory'. (defalias 'ada-call-pretty-printer #[nil "p`!!\f!P \n! !!!!! %!O \"T !!!n !\n! !r ! !!! b." [buffer-file-name nil file-name-directory file-name-nondirectory ada-tmp-directory tmp-file-with-directory filename-without-path file-path mesgbuf orgpos curbuf filename-with-path message "saving current buffer to temporary file ..." write-file auto-save-mode "saving current buffer to temporary file ... done" "running external pretty printer ..." get-buffer-create "Pretty Printer Messages" call-process ada-external-pretty-print-program t buffer-modified-p display-buffer kill-buffer "running external pretty printer ... done" y-or-n-p "Really replace current buffer with pretty printer output ? " set-buffer-modified-p find-file "old buffer contents restored" delete-file set-visited-file-name] 9 (#$ . 14045) nil]) (defalias 'ada-after-keyword-p #[nil "v`eU !!)? P!)" [-1 backward-char 1 looking-at "_" ada-keywords "[^_]"] 3]) (defalias 'ada-after-char-p #[nil "`V u!)" [2 -2 looking-at "'"] 2]) #@219 Adjust the case of the word before the just typed character. Respect options `ada-case-keyword', `ada-case-identifier', and `ada-case-attribute'. If FORCE-IDENTIFIER is non-nil then also adjust keyword as identifier. (defalias 'ada-adjust-case #[(&optional force-identifier) "u`VU U U U `Sfz=U v`eU/ !!)> !U \nP P \f!U !u" [-1 1 ada-in-string-p ada-in-comment-p ada-after-char-p 119 backward-char looking-at "'" ada-case-attribute force-identifier ada-after-keyword-p ada-case-keyword ada-case-identifier] 2 (#$ . 15481)]) (defalias 'ada-adjust-case-interactive #[(arg) "= =2 c ! =% E =E E => E !! =Q !S )" [last-command-char lastk 10 13 " " ada-adjust-case delete-backward-char 1 ada-lfd-binding ada-ret-binding 9 ada-tab self-insert-command prefix-numeric-value arg 95 t] 4 nil "P"]) (defalias 'ada-activate-keys-for-case #[nil " ! !\"" [ada-ret-binding key-binding " " ada-lfd-binding "\n" mapcar #[(key) " !#" [define-key ada-mode-map char-to-string key ada-adjust-case-interactive] 4] (96 126 33 64 35 36 37 94 38 42 40 41 45 61 43 91 123 93 125 95 92 124 59 58 39 34 60 44 46 62 63 47 10 32 13)] 3]) #@133 Capitalizes the first letter and the letters following `_'. ARG is ignored, it's there to fit the standard casing functions' style. (defalias 'ada-loose-case-word #[(&optional arg) "`x \n#' g\"! \nb*" [t first pos "a-zA-Z0-9_" nil search-forward "_" insert-char 1 delete-char] 4 (#$ . 16712)]) #@110 Adjusts the case of all words in the region. Attention: This function might take very long for big regions ! (defalias 'ada-adjust-case-region #[(from to) "Ŏ!b#V `Z`Z\"u `P!w\nK !P !\fb !." [nil reldiff keywordp end begin ((set-syntax-table ada-mode-syntax-table)) set-syntax-table ada-mode-symbol-syntax-table to re-search-backward "[^a-zA-Z0-9_]\\([a-zA-Z0-9_]+\\)[^a-zA-Z0-9_]" from t message "adjusting case ... %5d characters left" 1 ada-in-string-or-comment-p looking-at ada-keywords "[^_]" "a-zA-Z0-9_" ada-case-keyword -1 ada-case-identifier "adjusting case ... done"] 4 (#$ . 17042) "*r"]) #@116 Adjusts the case of all words in the whole buffer. ATTENTION: This function might take very long for big buffers ! (defalias 'ada-adjust-case-buffer #[nil "ed\"" [ada-adjust-case-region] 3 (#$ . 17711) "*"]) #@280 Reformats a parameter list. ATTENTION: 1) Comments inside the list are killed ! 2) If the syntax is not correct (especially, if there are semicolons missing), it can get totally confused ! In such a case, use `undo', correct the syntax and try again. (defalias 'ada-format-paramlist #[nil "Ŏ! !\fP#$!`!`!$u`\fT\"\f\nS|\fb !-" [nil paramlist delend end begin ((set-syntax-table ada-mode-syntax-table)) set-syntax-table ada-mode-symbol-syntax-table ada-in-paramlist-p error "not in parameter list" ada-search-ignore-string-comment ada-subprog-start-re "\\|\\
" t "(" backward-char 1 forward-sexp delete-char -1 "[^ \n]" ada-scan-paramlist ada-insert-paramlist] 5 (#$ . 17928) nil]) (defalias 'ada-scan-paramlist #[(begin end) " b ` $4 \n@\nA7 b!ДЕ{C\f$`\f$:C\" b\f$:C\" b\f$:C\" b ! v !ؔؕ{C\"ؕb\f$ \n@\f{C\"C\"\f = b !." [nil t match-cons semipos epos apos notend param paramlist begin ada-goto-next-non-ws ada-search-ignore-string-comment "[ \n]*;" end looking-at "\\([a-zA-Z0-9_, \n]*[a-zA-Z0-9_]\\)[ \n]*:[^=]" 1 ":" append "\\