From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,686004ab0e5b4e75 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: ada-mode missing syntax checking Date: 1999/01/31 Message-ID: #1/1 X-Deja-AN: 439151393 Sender: matt@mheaney.ni.net References: NNTP-Posting-Date: Sun, 31 Jan 1999 14:26:25 PDT Newsgroups: comp.lang.ada Date: 1999-01-31T00:00:00+00:00 List-Id: jerry@jvdsys.stuyts.nl (Jerry van Dijk) writes: > The new ada-mode (well, gnat-mode would be a better name) is quite nice, > I find the project facility especially handy. > > However, what I am really missing is the ada-check-syntax (C-c C-v) command. > Although the keys are defined in adamode.el, the implementation of it seems > to have gone missing. > > Since I use this command a lot (to do a quick check for stupid and not so > stupid errors) while programming, I wonder if anyone knows how to put this > command back in. Actually, I never do just syntax checking. Instead, I prefer to use gnatf, to do a (very) fast compile without generating any object code. Here are my ada-mode bindings: (add-hook 'ada-mode-hook '(lambda () ;;; (define-key ada-mode-map "\C-c\C-r" 'mjh-format-record) (define-key ada-mode-map "\C-c\C-v" 'mjh-ada-check-correctness) (define-key ada-mode-map "\C-c\C-m" 'mjh-ada-compile) (define-key ada-mode-map "\C-x'" 'next-error) (define-key ada-mode-map "\C-cg" 'goto-line) ;;; (define-key ada-mode-map "\C-c\C-n" 'mjh-format-named-list) (define-key ada-mode-map "\C-c\C-o" 'ff-find-other-file) (column-number-mode 1) (turn-on-auto-fill))) The check-correctness defun just calls gnatf (with the option that says to generate detailed cross-reference info, but you might not care about that): (defun mjh-ada-check-correctness () "Checks correctness of Ada unit in current buffer." (interactive) (compile (concat "gnatf -x5 " (buffer-file-name)))) Here's my compile command too. (I think there are variables you can use to specify command line args, but I never bothered playing around with them.) (defun mjh-ada-compile () "Does an Ada compile of the current buffer." (interactive) (compile (concat "gnatmake -gnatao -g " (buffer-file-name)))) If you want to do syntax checking again, then bind the command gcc -c -gnats to the key sequence C-c C-v. Something like (defun mjh-ada-check-syntax () "Check syntax of file associated with current buffer." (interactive) (compile (concat "gcc -c -gnats ") (buffer-file-name))) and then bind it as I've shown above. Note, however, that I'm using Rolf Ebert's ada-mode, with gnat 3.10p. ACT has released its own version of ada-mode, so the information I've given above may have to be adjusted if you're using the ACT version. You may want to post questions like this to the ada-mode mailing list. Here is info about how to subscribe: From: Samuel Tardieu There is a mailing-list indeed (created a long time ago by Rolf)! It is located at ada-mode@inf.enst.fr. If someone wants to subscribe, she has to send a mail with subject "subscribe" to ada-mode-request@inf.enst.fr.