From: "Jostein Kjønigsen" <jostein@secure.kjonigsen.net>
To: Eli Zaretskii <eliz@gnu.org>, jostein@kjonigsen.net
Cc: casouri@gmail.com, 61104@debbugs.gnu.org, theo@thornhill.no
Subject: bug#61104: 29.0.60; typescript-ts-mode does not provide compilation-mode support
Date: Sat, 28 Jan 2023 15:28:04 +0100 [thread overview]
Message-ID: <ac90ae49-0aa3-4d18-e918-b9872b2dc50e@secure.kjonigsen.net> (raw)
In-Reply-To: <83lelnazs1.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1016 bytes --]
On 1/28/23 08:23, Eli Zaretskii wrote:
>
> I don't think doing this in the major-mode file will improve locality,
> because we have compilation-minor-mode, which should be able to do its
> thing even if the relevant major mode is not yet loaded.
Fair enough!
>
>> - adding it in compile.el, to improve ability to oversee all
>> expressions, and be able to optimize those?
>>
>> I see csharp-mode.el has the expressions added directly there. Should I
>> go about preparing patches doing
>> the same for typescript-ts-mode too?
> I don't see why not.
Ok. Attached is a patch which adds Typescript tsc-support to compile.el.
Is this OK to install in emacs-29?
I also see in retrospect that my comment about csharp-mode above may
been somewhat ambiguous and easy to misunderstand (and seemingly you did).
To be clear: csharp-mode includes the compilation-mode regexps in the
major-mode, not in compile.el. Is this also something we should aim to
fix for emacs-29, or should we leave that for master?
--
Jostein
[-- Attachment #2: 0001-Add-support-for-Typescript-compilation-to-compilatio.patch --]
[-- Type: text/x-patch, Size: 1476 bytes --]
From b60c0686fc925290ff201ed79399e48ebc47d6d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jostein=20Kj=C3=B8nigsen?= <jostein@kjonigsen.net>
Date: Sat, 28 Jan 2023 15:23:11 +0100
Subject: [PATCH] Add support for Typescript compilation to compilation-mode
---
lisp/progmodes/compile.el | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 5758eadf996..1e57d0b7bb2 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -649,6 +649,24 @@ compilation-error-regexp-alist-alist
;; we do not know what lines will follow.
(guile-file "^In \\(.+\\..+\\):\n" 1 nil nil 0)
(guile-line "^ *\\([0-9]+\\): *\\([0-9]+\\)" nil 1 2)
+
+ ;; Typescript compilation prior to tsc version 2.7, "plain" format:
+ ;; greeter.ts(30,12): error TS2339: Property 'foo' does not exist.
+ (typescript-tsc-plain
+ ,(concat
+ "^[[:blank:]]*"
+ "\\([^(\r\n)]+\\)(\\([0-9]+\\),\\([0-9]+\\)):[[:blank:]]+"
+ "error [[:alnum:]]+: [^\r\n]+$")
+ 1 2 3 2)
+
+ ;; Typescript compilation after tsc version 2.7, "pretty" format:
+ ;; src/resources/document.ts:140:22 - error TS2362: something.
+ (typescript-tsc-pretty
+ ,(concat
+ "^[[:blank:]]*"
+ "\\([^(\r\n)]+\\):\\([0-9]+\\):\\([0-9]+\\) - [[:blank:]]*"
+ "error [[:alnum:]]+: [^\r\n]+$")
+ 1 2 3 2)
))
"Alist of values for `compilation-error-regexp-alist'.")
--
2.39.1
next prev parent reply other threads:[~2023-01-28 14:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-27 20:14 bug#61104: 29.0.60; typescript-ts-mode does not provide compilation-mode support Jostein Kjønigsen
2023-01-27 20:30 ` Eli Zaretskii
2023-01-27 20:52 ` Jostein Kjønigsen
2023-01-28 7:23 ` Eli Zaretskii
2023-01-28 14:28 ` Jostein Kjønigsen [this message]
2023-02-02 21:01 ` Jostein Kjønigsen
2023-02-03 5:30 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-03 7:06 ` Eli Zaretskii
2023-02-03 8:00 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-04 8:24 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-04 11:59 ` Mattias Engdegård
2023-02-05 20:36 ` Jostein Kjønigsen
2023-02-06 11:19 ` Mattias Engdegård
2023-02-06 17:05 ` Jostein Kjønigsen
2023-02-06 17:34 ` Mattias Engdegård
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=ac90ae49-0aa3-4d18-e918-b9872b2dc50e@secure.kjonigsen.net \
--to=jostein@secure.kjonigsen.net \
--cc=61104@debbugs.gnu.org \
--cc=casouri@gmail.com \
--cc=eliz@gnu.org \
--cc=jostein@kjonigsen.net \
--cc=theo@thornhill.no \
/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).