comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: ada-mode missing syntax checking
Date: 1999/01/31
Date: 1999-01-31T00:00:00+00:00	[thread overview]
Message-ID: <m3socr6pr6.fsf@mheaney.ni.net> (raw)
In-Reply-To: F6FH5n.2L@jvdsys.stuyts.nl

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 <filename>

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 <sam@ada.eu.org>

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.






  reply	other threads:[~1999-01-31  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-31  0:00 ada-mode missing syntax checking Jerry van Dijk
1999-01-31  0:00 ` Matthew Heaney [this message]
1999-02-01  0:00   ` Pascal Obry
1999-02-02  0:00     ` robert_dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox