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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fb9cb88204b780c2 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!newsfeed00.sul.t-online.de!t-online.de!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: simple programs -> one file with gps 2008 (gpl)? Date: Tue, 12 Aug 2008 18:03:56 +0100 Organization: Pushface Message-ID: References: <6g3k63Fe28ukU1@mid.individual.net> <31e658e8-f85a-47dc-9d6d-688935dd9e4f@z66g2000hsc.googlegroups.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1218560636 14978 62.49.19.209 (12 Aug 2008 17:03:56 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Tue, 12 Aug 2008 17:03:56 +0000 (UTC) Cancel-Lock: sha1:63MYhwQSQYlvbzafe9oUv8bU1Hc= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2.50 (darwin) Xref: g2news1.google.com comp.lang.ada:1606 Date: 2008-08-12T18:03:56+01:00 List-Id: amado.alves@gmail.com writes: >> > file) Eventually you use this tool to start development from an Ada >> > text. But normally you only do this once at the start of development, >> > because compiler messages will point to the 'new' files, so it's more >> > convenient to edit them instead of the old,... >> >> The -r switch to gnatchop causes error messages to refer to the original >> pre-chopped file. > > Indeed! I stand corrected. This is wonderful. You can work based > on .ada files :-) > Thanks for pointing this out. If you are an Emacs user, I have written a minor mode (gnatchop-mode) so that every time you save the big source file gnatchop (-r) is run on it. Um, I guess I should offer it to ada-mode -- tried that when AdaCore were running it, it wasn't general enough for them (but works for me!) ;; gnatchop.el ;; Copyright (C) 2001 Simon Wright . ;; $Id: gnatchop.el,v 1.1 2001/12/01 06:58:43 simon Exp $ ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; General Public License for more details. ;; Minor mode for use in Ada buffers that don't have the correct file name ;; for use with GNAT, and which therefore need to be "gnatchop"'d before ;; compilation. ;; Reference: Writing GNU Emacs Extensions by Bob Glickstein (O'Reilly ;; & Associates, Inc, 1997). (defvar gnatchop-mode nil "Mode variable for gnatchop minor mode.") (defun gnatchop-mode (&optional arg) "Gnatchop minor mode." (interactive "P") (make-variable-buffer-local 'gnatchop-mode) (make-local-hook 'after-save-hook) (setq gnatchop-mode (if (null arg) (not gnatchop-mode) (> (prefix-numeric-value arg) 0))) (if gnatchop-mode (add-hook 'after-save-hook 'gnatchop-file) (remove-hook 'after-save-hook 'gnatchop-file)) ) (defun gnatchop-file () "Run gnatchop on current buffer's file after save." (if gnatchop-mode (progn (message (concat "chopping " (buffer-file-name))) (let (compilation-read-command (compilation-buffer-name-function (lambda (mode) "*Gnatchop*"))) (compile (concat "gnatchop -w -r " (buffer-file-name))) (bury-buffer (get-buffer "*Gnatchop*"))))) ) (if (not (assq 'gnatchop-mode minor-mode-alist)) (setq minor-mode-alist (cons '(gnatchop-mode " Chop") minor-mode-alist)))