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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,35a94ab214d4934f,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-14 08:38:34 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!opentransit.net!jussieu.fr!univ-lyon1.fr!news.ens-lyon.fr!news.imag.fr!not-for-mail From: Matthieu Moy Newsgroups: comp.lang.ada Subject: References in error message for use with Emacs. Date: 14 Jan 2002 17:38:28 +0100 Organization: Verimag Message-ID: NNTP-Posting-Host: ubaye.imag.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: trompette.imag.fr 1011026308 7887 129.88.43.88 (14 Jan 2002 16:38:28 GMT) X-Complaints-To: abuse@imag.fr NNTP-Posting-Date: 14 Jan 2002 16:38:28 GMT X-Home-Page: http://www-ensimag.imag.fr/eleves/Matthieu.Moy/ X-Face: %xEb27l:C~bcH,tGGRk8m'o_}XBMb*NoIbS$sp(:3s+l@PwMH+C*7Vf@Y_]%rP)*/'`Lpt[O9C;jbVo?Qp User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:18914 Date: 2002-01-14T16:38:28+00:00 List-Id: I use gnat as a compiler and Emacs as editor. Error messages like list_brackets.adb:46:07: not type conformant with declaration at list_brackets.ads:22 Bored me because Emacs could only show me the reference in the begining of line, and not the declaration referenced at the end. I wrote a small wrapper for that (for unix) : The directory ~/bin must be in the begining of the path. Then, put an executable file in this directory containg the following code: #!/bin/sh # This is a small wrapper for gnatgcc. It adds some lines when a # reference is cited in an error message, such as # # list_brackets.adb:31:18: left operand has type "Ptr_String" defined at basic_types.ads:16 # # Who becomes # # # list_brackets.adb:31:18: left operand has type "Ptr_String" defined at basic_types.ads:16 # basic_types.ads:16: (Reference cited in previous line) # /usr/bin/gnatgcc "$@" 2>&1 | sed 's/^\([^:]*:.* \([^ ]*\.ad[bs]:[0-9]*\).*\)$/\1\ \2: (Reference cited in previous line)/g' and from now, gnatmake will show this kind of error messages : list_brackets.adb:46:07: not type conformant with declaration at list_brackets.ads:22 list_brackets.ads:22: (Reference cited in previous line) and Emacs can lead you to both references. May I suggest, if this is not the case, that the next versions of gnat give this kind of message without any wrapper (as gcc does for C) ? -- | Matthieu MOY