From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#6416: next-error mis-highlights ocaml error message locations Date: Sun, 13 Jun 2010 18:46:25 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1276469919 1136 80.91.229.12 (13 Jun 2010 22:58:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 13 Jun 2010 22:58:39 +0000 (UTC) Cc: 6416@debbugs.gnu.org To: Jacques Le Normand Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 14 00:58:37 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ONw8R-0003At-5P for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Jun 2010 00:58:35 +0200 Original-Received: from localhost ([127.0.0.1]:55979 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ONw8Q-0006TB-8I for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Jun 2010 18:58:34 -0400 Original-Received: from [140.186.70.92] (port=59809 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ONw8L-0006Sw-CZ for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2010 18:58:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ONw8J-0002WJ-3W for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2010 18:58:29 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39354) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONw8J-0002Vg-24 for bug-gnu-emacs@gnu.org; Sun, 13 Jun 2010 18:58:27 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1ONvxF-0000GK-W0; Sun, 13 Jun 2010 18:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Jun 2010 22:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6416 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6416-submit@debbugs.gnu.org id=B6416.1276469193999 (code B ref 6416); Sun, 13 Jun 2010 22:47:01 +0000 Original-Received: (at 6416) by debbugs.gnu.org; 13 Jun 2010 22:46:33 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONvwm-0000G1-Rf for submit@debbugs.gnu.org; Sun, 13 Jun 2010 18:46:33 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONvwk-0000Ft-7I for 6416@debbugs.gnu.org; Sun, 13 Jun 2010 18:46:31 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAMP8FExMCoQR/2dsb2JhbACed3K9RIUaBI0C X-IronPort-AV: E=Sophos;i="4.53,411,1272859200"; d="scan'208";a="67962376" Original-Received: from 76-10-132-17.dsl.teksavvy.com (HELO pastel.home) ([76.10.132.17]) by ironport2-out.pppoe.ca with ESMTP; 13 Jun 2010 18:46:25 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 245A980BC; Sun, 13 Jun 2010 18:46:25 -0400 (EDT) In-Reply-To: (Jacques Le Normand's message of "Sun, 13 Jun 2010 14:26:45 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 13 Jun 2010 18:47:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:37758 Archived-At: > let foo : int = > "foo" > ^ > "bar" > it gives me the error > File "/home/palomer/temp/test.ml", line 2, characters 1-21: > ... > which refers to: > "foo" > ^ > "bar" How does 1-21 refer to that, exactly? The first " seems to be either at position 2 or 3 depending on whether you start counting at 0 or 1, so how can it be 1-21 rather than 2-? Second, the 1-21 range refers to bytes in the file, right? (i.e. does it count a TAB as 1 or as 8? how about a CR+LF?). > next-error will try and highlight characters 1 to 21 on line 2. however, > line 2 only contains 10 or so characters. This is because character 21 > actually refers to character 8 on line 4. Instead of highlighting 3 lines, > only 1 line is highlighted. Indeed, it's on purpose: I've never heard of a format of error messages of a form like the one you describe, so compile.el makes no attempt to handle such things, AFAIK. Usually error messages that can refer to several lines take a form like "LINE.COL - LINE'.COL'" or something like that where the end-line is specified explicitly. So in the present case, compile.el guesses that the 21 is really an error (maybe because it refers to some other version of the file or something) and just stops the line's end. This behavior is The Right Thing for most tools where such errors can never span multiple lines. The questions above would help us figure out how to best adjust compile.el and compilation-regexp-error-alist to handle such errors correctly. Of course, the better solution would be to change OCaml so as to use more standard error messages, such as the GNU format, so it would "just work". So I suggest you also file a bug-report to the OCaml guys that their error messages use a non-standard format and are confusing since they only say "line 2, chars 1-21" even for a message that spans lines 2-4. Stefan