From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Newsgroups: gmane.emacs.bugs Subject: bug#61104: 29.0.60; typescript-ts-mode does not provide compilation-mode support Date: Sun, 5 Feb 2023 21:36:34 +0100 Message-ID: <12a97d26-90cc-4a25-61a5-5aff33915610@secure.kjonigsen.net> References: <792EC2CE-006B-42F1-81C2-453E71C2173C@gmail.com> Reply-To: jostein@kjonigsen.net Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------CnTLUCBzCryYhNBZrQEO4RVr" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5748"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Cc: casouri@gmail.com, 61104@debbugs.gnu.org, Theodor Thornhill , Eli Zaretskii To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , jostein@kjonigsen.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 05 21:37:19 2023 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 1pOllG-0001IJ-Jt for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Feb 2023 21:37:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOll5-00055O-Ca; Sun, 05 Feb 2023 15:37:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOll2-00055D-Mz for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 15:37:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOll2-0004Pq-FG for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 15:37:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pOll0-0007bO-Hb for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2023 15:37:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Feb 2023 20:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61104 X-GNU-PR-Package: emacs Original-Received: via spool by 61104-submit@debbugs.gnu.org id=B61104.167562941129205 (code B ref 61104); Sun, 05 Feb 2023 20:37:02 +0000 Original-Received: (at 61104) by debbugs.gnu.org; 5 Feb 2023 20:36:51 +0000 Original-Received: from localhost ([127.0.0.1]:46564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOlkm-0007ax-A6 for submit@debbugs.gnu.org; Sun, 05 Feb 2023 15:36:49 -0500 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:48755) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOlki-0007ah-Ko for 61104@debbugs.gnu.org; Sun, 05 Feb 2023 15:36:46 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id BF059320083A; Sun, 5 Feb 2023 15:36:37 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 05 Feb 2023 15:36:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:reply-to:sender:subject:subject:to:to; s=fm2; t= 1675629397; x=1675715797; bh=K6RTIcb3ButSFu6WDqxHBLaGZ/UPlFrsiQ8 ub0Pact8=; b=NLSw9slpDnxILd2UfJV+qcT5opVik1yWY1x6Z/3z97J9FrojNzd ciRZPr6/xgznAOcfLR1UbJkyzNCpLH3J9LOkNQduS4f2ynMJcjttGmDxx83TZmSU VvEsK2bvX6Uw3nvjzYbb7cryMXFG83AG3YCMKrRp30HEAfGbHDdXqV7ucnEdKWza c13wkXf0Tnnf2tQv4TnZRn+TVT5i8lq++tnjVBFO7raqQnQdz7WzFi+LInSvrQ5q WF/HTyYZBkAUlcR/0RtGqZOm8lZJNOnEyqSaFzWGm1SalwLMSwT1o2jUoWkszsLC OS5ECSAKoThXuxypZZQqQ0sy9Z0Feyft6ow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1675629397; x=1675715797; bh=K6RTIcb3ButSF u6WDqxHBLaGZ/UPlFrsiQ8ub0Pact8=; b=MsIbhjjRw1tRWeh7wyV3LZX2YbQMR JUsOgkZoerJQ4w6VqajUIIAgKaD+HQ55u4q7B/EoyM4P2fsccse+si5seiGCI/C8 LByyNI28fGZR9A75WM4KF/np5Dnsrha0JhUKRJ/HP4s1pHu21wtLDnCCz6MhW6aa B9M3sj07ziGP+sVgWYVfox1KmLms4+AbGTIgKRggOBHiKzljEaOD7dmcMfNyK7NR r0dZ0sQRimNjJXez663d5EQTuAEXyosgHe9Pj+7huXiMyiDB0J57y3/EZqlHu0KX X5mW7NSMftvTyXjm4U4QTAT3PPMnMh5BrSol7PuBYGNNiyRSa2c7GLI+g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeggedgudefkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpegtkfffgggfrhfuvfevfhfhjgesmhdtreertdefjeenucfhrhhomheplfho shhtvghinhcumfhjpphnihhgshgvnhcuoehjohhsthgvihhnsehsvggtuhhrvgdrkhhjoh hnihhgshgvnhdrnhgvtheqnecuggftrfgrthhtvghrnhepleeihefgveefffelkeelleff ffdtfeevleetheefgfdtgfdtfeeiveekgfevkedvnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepjhhoshhtvghinhesshgvtghurhgvrdhkjhho nhhighhsvghnrdhnvght X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 5 Feb 2023 15:36:36 -0500 (EST) Content-Language: en-GB, nb-NO In-Reply-To: <792EC2CE-006B-42F1-81C2-453E71C2173C@gmail.com> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254893 Archived-At: This is a multi-part message in MIME format. --------------CnTLUCBzCryYhNBZrQEO4RVr Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hey there and thanks for the valuable feedback! I'll try to do my best to provide the info I can, so that we can create the tightest regexps for this, which still are functional on the level users would expect. On 2/4/23 12:59, Mattias EngdegÄrd wrote: > First of all, both regexps match arbitrary amounts of horizontal whitespace at the beginning of a line, but neither message example you supplied contains any such leading whitespace. This means that either the set of test cases needs to be extended, or we could safely remove this leading whitespace matcher. I've gone looking, but I really can't find confirmation that this whitespace is required, at least not when building directly through the tsc TypeScript compiler. I can see in the old test-suite for the MELPA package these two variants were the only test-cases present as well. As such I think it's defiintely safe to remove this leading whitespace. > Similarly the patterns match arbitrary whitespace before the word "error". This seems equally questionable -- would a single space do? If not, please provide actual output demonstrating it that could be added to the test suite, and tell us how it varies (tabs vs spaces, amount of whitespace, etc). I can't see any real use-case for this either. Let's snip it. > The following is a minor point that we'll fix but I thought you may want to know: > > The use of [[:blank:]] and [[:alnum:]] is very likely more expensive than required since they accept Unicode whitespace and letters which obviously never will occur where matched so if it's all the same to you we'll reduce them to ASCII patterns. I've given this a try, and it seems to work fine. I'm OK with such a change. > Similarly, the inclusion of \r in patterns seems to be a misunderstanding: the tail part, "[^\r\n]+$", does not make sense -- normally, carriage returns aren't seen in buffers because line terminator translation convert everything to a single \n, and if a stray CR did occur then that pattern would never match anyway (why?). Fair enough. I've changed the code to only looks for \n instead. Attached is a patch which codifies all these changes, and from what I can tell, still does the job. You make take it as is, or you may further work on it, if you think that is still needed. -- Jostein --------------CnTLUCBzCryYhNBZrQEO4RVr Content-Type: text/x-patch; charset=UTF-8; name="0001-Optimize-compilation-mode-expressions-for-TypeScript.patch" Content-Disposition: attachment; filename*0="0001-Optimize-compilation-mode-expressions-for-TypeScript.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSAxYzZhNzFjZDFkYjViNTg5ZmY5ZmM1ZjRmZTc2ZTkzNTdiN2JlZGJkIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/Sm9zdGVpbj0yMEtqPUMzPUI4bmln c2VuPz0gPGpvc3Rla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AgICAiZXJyb3IgW0EtWjAtOV0rOiBbXlxuXSskIikKICAg ICAgMSAyIDMgMikKIAogICAgIDs7IFR5cGVzY3JpcHQgY29tcGlsYXRpb24gYWZ0ZXIgdHNj IHZlcnNpb24gMi43LCAicHJldHR5IiBmb3JtYXQ6CiAgICAgOzsgc3JjL3Jlc291cmNlcy9k b2N1bWVudC50czoxNDA6MjIgLSBlcnJvciBUUzIzNjI6IHNvbWV0aGluZy4KICAgICAodHlw ZXNjcmlwdC10c2MtcHJldHR5CiAgICAgICwoY29uY2F0Ci0gICAgICAgIl5bWzpibGFuazpd XSoiCi0gICAgICAgIlxcKFteKFxyXG4pXStcXCk6XFwoWzAtOV0rXFwpOlxcKFswLTldK1xc KSAtIFtbOmJsYW5rOl1dKiIKLSAgICAgICAiZXJyb3IgW1s6YWxudW06XV0rOiBbXlxyXG5d KyQiKQorICAgICAgICJcXChbXihcclxuKV0rXFwpOlxcKFswLTldK1xcKTpcXChbMC05XStc XCkgLSAiCisgICAgICAgImVycm9yIFtBLVowLTldKzogW15cbl0rJCIpCiAgICAgIDEgMiAz IDIpCiAgICAgKSkKICAgIkFsaXN0IG9mIHZhbHVlcyBmb3IgYGNvbXBpbGF0aW9uLWVycm9y LXJlZ2V4cC1hbGlzdCcuIikKLS0gCjIuMzkuMQoK --------------CnTLUCBzCryYhNBZrQEO4RVr--