From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#58007: 28.1; compilation-error-properties skips non-matching FILE indices Date: Sat, 24 Sep 2022 12:29:53 +0200 Message-ID: <8735ch12vy.fsf@gnus.org> References: <87edw23wd5.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36543"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 58007@debbugs.gnu.org To: Axel Forsman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 24 12:31:16 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oc2RH-0009Li-S7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Sep 2022 12:31:15 +0200 Original-Received: from localhost ([::1]:39126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oc2RG-0000TQ-AF for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Sep 2022 06:31:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oc2R4-0000T0-NV for bug-gnu-emacs@gnu.org; Sat, 24 Sep 2022 06:31:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43365) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oc2R4-0000be-Ff for bug-gnu-emacs@gnu.org; Sat, 24 Sep 2022 06:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oc2R4-0005RS-6J for bug-gnu-emacs@gnu.org; Sat, 24 Sep 2022 06:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Sep 2022 10:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58007 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58007-submit@debbugs.gnu.org id=B58007.166401540720761 (code B ref 58007); Sat, 24 Sep 2022 10:31:02 +0000 Original-Received: (at 58007) by debbugs.gnu.org; 24 Sep 2022 10:30:07 +0000 Original-Received: from localhost ([127.0.0.1]:42443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oc2QA-0005On-1k for submit@debbugs.gnu.org; Sat, 24 Sep 2022 06:30:06 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:46692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oc2Q7-0005Na-0v for 58007@debbugs.gnu.org; Sat, 24 Sep 2022 06:30:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=lJqWpHbiVZtYOY8++xD8gFE+G2Pj7wWucPsT52GgS6I=; b=YNgCnnQiM/s1f6TK+t5PRkkJUV F/M3/NCqdqrDdX+qfX10C6hDiwIrphp5h4g6mUkDvTuQxjAOZL7WAqlKLlUr9VW9B4yzuidWita2m v0ecfm9xHIyY8UKgvUIB24M95P9IDugzUGSHatxE51QURk61Xr/nrqyTLEg7ib744NVc=; Original-Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oc2Py-0002dI-Cz; Sat, 24 Sep 2022 12:29:56 +0200 In-Reply-To: (Axel Forsman's message of "Fri, 23 Sep 2022 20:29:12 +0200") X-Now-Playing: Smersh's _Third Noise Principle (Formative North American Electronica 1975-1984) (3)_: "What the Peeper Saw" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:243514 Archived-At: Axel Forsman writes: > Yes, so what I initially wanted to do was parse dialyzer errors > when running using the rebar3 package manager with `rebar3 dialyzer`. > See attachment for example output. > > This is what I ended up with > > (setq compilation-error-regexp-alist > (cons > '("^\\(?:\n\\(.*\\)\n\\)?Line \\([0-9]+\\)\\(?: Column > \\([0-9]+\\)\\)?: " 1 2 3 1) > (cons > ;; This next error regexp should not be necessary > according to documentation. > '("^Line \\([0-9]+\\)\\(?: Column \\([0-9]+\\)\\)?: " nil 1 2 1) > (eval (car (get 'compilation-error-regexp-alist > 'standard-value)))))) > > only with the 2nd error regexp does all errors get parsed. > Though this is unexpected: In the 1st regexp > when the first subexpression containing the file name does not match, > the docs say it should act the same as the 2nd error regexp. > > When I have `eval-defun`:ed the patched version of > `compilation-error-properties`, > the 1st error regexp suffices as expected. Ah, thanks. >> I think this change might be too large to apply without having an FSF >> copyright assignment on file -- would you be willing to sign such >> paperwork? > > The patch is mostly all indentation changes, > but yes, if needed I would be willing > though I would have to consult with my employer first. Reading the patch again, you're right -- since most of the changes are indentation changes, we can apply the patch without a copyright assignment. However, your patch leads to a test failure -- can you have a look at that? Test compile-test-functions backtrace: file-name-absolute-p(("my-file")) compilation-error-properties((closure (t) nil '("my-file")) (closure compilation-parse-errors(1 17) (let ((rule (nth 0 test)) (str (nth 1 test)) (pos (nth 2 test)) (col (let ((ert--infos (cons (cons "testcase: " (format "%S" test)) ert-- compile--test-error-line((my-rule "My error message" 1 (39 . 24) (12 (let ((compilation-num-errors-found 0) (compilation-num-warnings-fou (progn (font-lock-mode -1) (let ((compilation-num-errors-found 0) (c (unwind-protect (progn (font-lock-mode -1) (let ((compilation-num-er (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current (let* ((file-fun #'(lambda nil '("my-file"))) (line-start-fun #'(lam (closure (t) nil (let* ((file-fun #'(lambda nil '("my-file"))) (line ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test ert-run-test(#s(ert-test :name compile-test-functions :documentation ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m ert-run-tests((not (or (tag :expensive-test) (tag :unstable))) #f(co ert-run-tests-batch((not (or (tag :expensive-test) (tag :unstable))) ert-run-tests-batch-and-exit((not (or (tag :expensive-test) (tag :un eval((ert-run-tests-batch-and-exit '(not (or (tag :expensive-test) ( command-line-1(("-L" ":." "-l" "ert" "-l" "lisp/progmodes/compile-te command-line() normal-top-level() Test compile-test-functions condition: testcase: (my-rule "My error message" 1 (39 . 24) (123 . 134) "my-file" 2) (wrong-type-argument stringp ("my-file")) FAILED 2/3 compile-test-functions (0.000089 sec) at lisp/progmodes/compile-tests.el:522 passed 3/3 compile-test-grep-regexps (0.001284 sec) Ran 3 tests, 2 results as expected, 1 unexpected (2022-09-24 12:26:55+0200, 0.083845 sec) 1 unexpected results: FAILED compile-test-functions