unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattias.engdegard@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 60830@debbugs.gnu.org, "Rudolf Adamkovič" <salutis@me.com>,
	"Stefan Kangas" <stefankangas@gmail.com>
Subject: bug#60830: 30.0.50; The *Compilation* buffer does not recognize Lua errors
Date: Sat, 7 Oct 2023 13:18:51 +0200	[thread overview]
Message-ID: <A43220F1-318F-42B5-A5F0-0B46688EEA4A@gmail.com> (raw)
In-Reply-To: <jwvzg0v3dj2.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]

6 okt. 2023 kl. 18.49 skrev Stefan Monnier <monnier@iro.umontreal.ca>:

> How 'bout we only activate a handful of rules, and then use a "low
> priority background" search for matches to the non-active rules and when
> we find such a match we bring it to the users' attention that maybe they
> should enable that extra rule?

"It looks like you are compiling a Pascal program using a Sun compiler from 1989. Would you like me to parse the error messages for you?"

Even if we were to pull off the 'low priority background' part, it seems difficult to balance such a mechanism so that it's never annoying yet relevant when it needs to be.

In any case we would benefit from a better way to select rules. One problem is that packages (and users) go wild modifying both CERA and CERAA. Here is a patch that I'm not satisfied with but tries to make CERA easier to customise interactively.

Its main limitation is assuming that explicit rule specs precede symbols that refer to CERAA, which makes some kind of sense (new rules are added for a reason so they should take priority) but may not correspond to reality. Not sure what to do about that, but at least it's a start.


[-- Attachment #2: cera-type.diff --]
[-- Type: application/octet-stream, Size: 1884 bytes --]

diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 9e441dbfcf7..f683859a179 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -748,11 +748,32 @@ compilation-error-regexp-alist
 variable, the `compilation-transform-file-match-alist' variable
 is then consulted.  It allows further transformations of the
 matched file names, and weeding out false positives."
-  :type '(repeat (choice (symbol :tag "Predefined symbol")
-			 (sexp :tag "Error specification")))
+  :type '(list :tag "Rules"
+               (repeat :inline t
+                       :tag "Custom message rules"
+                       (list :tag "Rule specification"
+                             regexp
+                             (sexp :tag "File")
+                             (sexp :tag "Line")
+                             (sexp :tag "Column")
+                             (sexp :tag "Type")
+                             (sexp :tag "Hyperlink")
+                             (repeat :inline t
+                                     :tag "Highlights"
+                                     (list :tag "Highlight"
+                                           (natnum :tag "Submatch")
+                                           (sexp :tag "Face")))))
+               (set :inline t
+                    :tag "Predefined rules"
+                    :convert-widget compilation--predef-rules-widgets))
   :link `(file-link :tag "example file"
 		    ,(expand-file-name "compilation.txt" data-directory)))
 
+(defun compilation--predef-rules-widgets (widget)
+  (widget-put widget :args (mapcar (lambda (x) (list 'const (car x)))
+                                   compilation-error-regexp-alist-alist))
+  widget)
+
 (defvar compilation-error-case-fold-search nil
   "If non-nil, use case-insensitive matching of compilation errors.
 If nil, matching is case-sensitive.

  reply	other threads:[~2023-10-07 11:18 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-15 11:33 bug#60830: 30.0.50; The *Compilation* buffer does not recognize Lua errors Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-13 14:55 ` Stefan Kangas
2023-10-02 12:04   ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-02 18:37     ` Stefan Kangas
2023-10-03  8:12       ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-03  9:37         ` Stefan Kangas
2023-10-03 20:03           ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-05 11:27         ` Mattias Engdegård
2023-10-05 16:21           ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-06 11:38             ` Mattias Engdegård
2023-10-06 13:21               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-06 14:00                 ` Mattias Engdegård
2023-10-06 14:47                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-06 16:20                     ` Mattias Engdegård
2023-10-06 16:49                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-07 11:18                         ` Mattias Engdegård [this message]
2023-10-07 15:22                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-08 10:45                             ` Mattias Engdegård
2023-10-08 14:47                               ` Mattias Engdegård
2023-10-07 21:02               ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-08  9:59                 ` Mattias Engdegård
2023-10-12  8:12                   ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-12  8:17                     ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-12 14:32                     ` Mattias Engdegård
2023-12-10 22:53                       ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-10 13:48                         ` Stefan Kangas
2024-01-10 16:37                           ` Mattias Engdegård
2024-01-10 17:09                             ` Stefan Kangas
2024-01-10 17:45                               ` Mattias Engdegård
2023-10-08 15:49                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-12  8:14                   ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A43220F1-318F-42B5-A5F0-0B46688EEA4A@gmail.com \
    --to=mattias.engdegard@gmail.com \
    --cc=60830@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=salutis@me.com \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).