From unknown Sat Jun 14 14:26:23 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#53203 <53203@debbugs.gnu.org> To: bug#53203 <53203@debbugs.gnu.org> Subject: Status: Comment with lots of color codes crashes or hangs emacs in scss-mode Reply-To: bug#53203 <53203@debbugs.gnu.org> Date: Sat, 14 Jun 2025 21:26:23 +0000 retitle 53203 Comment with lots of color codes crashes or hangs emacs in sc= ss-mode reassign 53203 emacs submitter 53203 Colin severity 53203 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 12 03:02:45 2022 Received: (at submit) by debbugs.gnu.org; 12 Jan 2022 08:02:46 +0000 Received: from localhost ([127.0.0.1]:56177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7Yaj-0002Ik-0W for submit@debbugs.gnu.org; Wed, 12 Jan 2022 03:02:45 -0500 Received: from lists.gnu.org ([209.51.188.17]:59422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7Xvy-0000nV-K7 for submit@debbugs.gnu.org; Wed, 12 Jan 2022 02:20:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7Xvx-0004JW-Vz for bug-gnu-emacs@gnu.org; Wed, 12 Jan 2022 02:20:38 -0500 Received: from [2607:f8b0:4864:20::62b] (port=34604 helo=mail-pl1-x62b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n7Xvv-00015h-RI for bug-gnu-emacs@gnu.org; Wed, 12 Jan 2022 02:20:37 -0500 Received: by mail-pl1-x62b.google.com with SMTP id a7so89146plh.1 for ; Tue, 11 Jan 2022 23:20:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to :content-language:content-transfer-encoding; bh=vVziLcjGFymK26IHIp+rMkTQN5fG+/YijPQPhVRLQyI=; b=Zj0EaGatrsm4+kM/b6niPVZXg5ZJ2Mbs6hmk0i25Tdf5zR7kPFgB9ZZPLlcVg+BNu6 1FwpGikhJQIFD60+ve0QJVEn20upIMYfxpC0tZb7sswccvLmYgbJqtYOaw7He/hpHFU9 g//xnuJHnqylBWPrRt3zvEfElqMiQ/ocp4DPb1/DUOxnmzc5wsiY3xsJ9F3fgEeaE/rb Vp0SEq1VfYf68W14XKIVu1JSigRJ/zOPJGG00r4vp4D+1Bxw4HO0gSM+HcE/wZGNanfk t80gPori7oPlZ+QOrPdiI51U9HLrMxpskM0x1diAq0+/3B8A1jTCoyV2fw0WTKoqw7+B BTLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:content-language:content-transfer-encoding; bh=vVziLcjGFymK26IHIp+rMkTQN5fG+/YijPQPhVRLQyI=; b=FYfLyHH/3UYBtzF1UwmA79P7wEE9RYsSklAXzq5uzURUIlKRflO1PLFlsmFvxh7sE1 a/NQJ7ubvTkLQBYe8gY7t1EnwoWP7ybFZNgOPAsyF4linriE/6sOpOnxI+AoAdiDxN0w Eq0zFOKMJe24I96CMlM0QlkV0MCMX//JNDsXCLs/ReUHSQfUb7K82IX6PFET5YTAOX56 4DqKRL1qAIUiACxvbXkJnmmspUNiVHjZT0hrQlf1aoPKrucj2yegR9oJKesB8jo6t1CK 73At/j2sGvuGKXUElS5cwrhxImh+5oKG+mGrSiqlT9HBHb2tlcCPVhKPCcRqPuaJAvP6 cogQ== X-Gm-Message-State: AOAM533iQUyGZ2TSy3j7H9GutVFQwLrxCC3KlqVLhdSJurDMnarm9tx2 8UBrOkGSRBRihqDXma0KRfE0qpxtbKY= X-Google-Smtp-Source: ABdhPJyeM0jAN45oNu7cgMgtrJXIM24GMODJwQRQ5sqR0FBU02Tj87eOhtvv7LNgJShUskapkLD2sQ== X-Received: by 2002:a17:90b:3ecc:: with SMTP id rm12mr7187897pjb.225.1641972033025; Tue, 11 Jan 2022 23:20:33 -0800 (PST) Received: from [10.9.8.7] ([122.199.49.224]) by smtp.gmail.com with ESMTPSA id z22sm876493pfe.34.2022.01.11.23.20.31 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Jan 2022 23:20:32 -0800 (PST) Message-ID: Date: Wed, 12 Jan 2022 17:20:24 +1000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 From: Colin Subject: Comment with lots of color codes crashes or hangs emacs in scss-mode To: bug-gnu-emacs@gnu.org Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62b (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=my.old.email.sucked@gmail.com; helo=mail-pl1-x62b.google.com X-Spam_score_int: 17 X-Spam_score: 1.7 X-Spam_bar: + X-Spam_report: (1.7 / 5.0 requ) AC_FROM_MANY_DOTS=2.996, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 12 Jan 2022 03:02:44 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi, I have the following snippet in example.scss file: ``` /* #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff */ ``` On opening the file with emacs -Q (27.1 and a fresh build of git master (29.0.50), emacs hangs. If I remove one/two lines, it appears to burn some CPU and then work, so it looks like an exponential search or something. For now I'll remove the snippet from my code, but an interesting bug nonetheless ;) From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 12 08:17:17 2022 Received: (at 53203) by debbugs.gnu.org; 12 Jan 2022 13:17:17 +0000 Received: from localhost ([127.0.0.1]:56461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7dV3-00063z-CX for submit@debbugs.gnu.org; Wed, 12 Jan 2022 08:17:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7dUy-00063b-5M for 53203@debbugs.gnu.org; Wed, 12 Jan 2022 08:17:11 -0500 Received: from [2001:470:142:3::e] (port=44820 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7dUs-0003md-U0; Wed, 12 Jan 2022 08:17:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=aYIoLQZrt3IgmBarVHmi0A90KLbJOBF6abtlMXPMqcU=; b=mgQM6cEIoQPH GSLTUCq9aRlCuKuU5kzWbwPl6V94bgig2KBfHQyA1zKtRjzbP3gelps4nbza7w1rqaio6fa/o3PVa pPeHrJVGVV0Zq0+3NaBlncqWgV8W4R+Nkb27eGp8FqYYynmurRCJ/YCes07Qes77z/FvdPcg53QgY Ak9Xu49X+NsmvScjjHQIP9u4uitaQ4vsp+mUlGQZ6pBaZTKmKsvQA0Y8sEhi+WrHIylZqZiwtUvoA xrhKU8nBHB6ocyNv1Is4f8lyU6+hvAtOdOs5CsKqmZqSYnNkelF5iurQDDbxRtIvmvP5ueP1MngGR BM2v7vTKTPDKDloBfXXNgA==; Received: from [87.69.77.57] (port=3155 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7dUr-0003lk-PS; Wed, 12 Jan 2022 08:17:02 -0500 Date: Wed, 12 Jan 2022 15:16:57 +0200 Message-Id: <83r19d5c1i.fsf@gnu.org> From: Eli Zaretskii To: Colin In-Reply-To: (message from Colin on Wed, 12 Jan 2022 17:20:24 +1000) Subject: Re: bug#53203: Comment with lots of color codes crashes or hangs emacs in scss-mode References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53203 Cc: 53203@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Wed, 12 Jan 2022 17:20:24 +1000 > From: Colin > > I have the following snippet in example.scss file: > > ``` > > /* > #ffffff #ffffff > #ffffff #ffffff > #ffffff #ffffff > #ffffff #ffffff > #ffffff #ffffff > */ > ``` > > On opening the file with emacs -Q (27.1 and a fresh build of git master > (29.0.50), emacs hangs. > > If I remove one/two lines, it appears to burn some CPU and then work, so > it looks like an exponential search or something. > > For now I'll remove the snippet from my code, but an interesting bug > nonetheless ;) It seems to infloop in JIT font-lock, and the culprit seems to be this part of font-lock-keywords: ;; Even though pseudo-elements should be prefixed by ::, a ;; single colon is accepted for backward compatibility. "\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids css-pseudo-element-ids) t) From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 13 02:00:33 2022 Received: (at 53203) by debbugs.gnu.org; 13 Jan 2022 07:00:34 +0000 Received: from localhost ([127.0.0.1]:59831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7u65-00072v-MS for submit@debbugs.gnu.org; Thu, 13 Jan 2022 02:00:33 -0500 Received: from quimby.gnus.org ([95.216.78.240]:50422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7u62-00072Y-8W for 53203@debbugs.gnu.org; Thu, 13 Jan 2022 02:00:32 -0500 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:In-Reply-To:Date: References: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=bhj5WB6lLwc38UO7dRtO2X2+uJRTFU2QuitKtoe+DHE=; b=oiSCMmnviskjJbHP5d1e3bj+GA x6cg+JycAQUo328mqUkwN6uWqanSmfgl6ion8F/zcMt5fqYgjVpi+uHMx4KkY5WWYsifiI6yba0bU cfB+8TI/M5CnlwA5vAmVjQjYy0D3o/5uZIgSb4ltIvG6IPAu6/e/ssDbGTYJSbMLB2dI=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n7u5s-0008MY-9c; Thu, 13 Jan 2022 08:00:23 +0100 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#53203: Comment with lots of color codes crashes or hangs emacs in scss-mode References: <83r19d5c1i.fsf@gnu.org> X-Now-Playing: Suicide Romeo's _Pictures_: "Modern Romance" Date: Thu, 13 Jan 2022 08:00:18 +0100 In-Reply-To: <83r19d5c1i.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 12 Jan 2022 15:16:57 +0200") Message-ID: <87wnj486il.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: > It seems to infloop in JIT font-lock, and the culprit seems to be this > part of font-lock-keywords: > > ;; Even though pseudo-elements should be prefixed by ::, a > ;; single colon is accepted for [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53203 Cc: 53203@debbugs.gnu.org, Colin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: > It seems to infloop in JIT font-lock, and the culprit seems to be this > part of font-lock-keywords: > > ;; Even though pseudo-elements should be prefixed by ::, a > ;; single colon is accepted for backward compatibility. > "\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids > css-pseudo-element-ids) > t) Trying to understand the regexp used for scss here, I think that bit is somewhat innocuous -- it just matches those words. ;; Even though pseudo-elements should be prefixed by ::, a ;; single colon is accepted for backward compatibility. "\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids css-pseudo-element-ids) t) "\\|::" (regexp-opt css-pseudo-element-ids t) "\\)" But then we get: "\\(?:([^)]+)\\)?" (if (not sassy) "[^:{}()\n]*" (concat "[^:{}()\n#]*\\(?:" scss--hash-re "[^:{}()\n#]*\\)*")) "\\)*" Which is a whole lot of backtracking, presumably exacerbated by the previous ids bit of the regexp. But I've repressed all I once knew about the scss language -- what is it really trying to match here? Anybody? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 13 03:58:46 2022 Received: (at 53203) by debbugs.gnu.org; 13 Jan 2022 08:58:46 +0000 Received: from localhost ([127.0.0.1]:60129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7vwU-0006qB-4f for submit@debbugs.gnu.org; Thu, 13 Jan 2022 03:58:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7vwS-0006px-8L for 53203@debbugs.gnu.org; Thu, 13 Jan 2022 03:58:44 -0500 Received: from [2001:470:142:3::e] (port=39978 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7vwL-00037e-Th; Thu, 13 Jan 2022 03:58:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=kjUr4mSnan+9EljPgpugGWdhWC1CU3LcJBIAdyaG/LE=; b=otzek8dz9WHZ 4+wOV7A1CyaK1Q2DStH/XebMI4GUULA5R4356+7L8iP/4smXMfwwU2kyfuNob/8w+qZqqmU2lj+LK v0PKRHwR8uI0WrYmYCDsHY7yyfi/bto1fCT5L9ctHdfrjlZvT+3arW/1YndGUkIy6MPIl85ssxLar rHyhPuRRTyYJ0SAQGT5oUDKN1AYleHDwUsiRHTbRJjgnj2aWm7nTH8SrrhizvvxIFDF6Joe5z6Lf5 neKRUAhmk8NNx7BDShmLoCHl/F7XiY6g5qonSi19rbtLH+QnRJnPdRlAe1ucbhvbezBUe+eZmtvhn /i2jf1QHtjFM9imnjTVG5A==; Received: from [87.69.77.57] (port=4522 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7vwM-0005qq-0S; Thu, 13 Jan 2022 03:58:38 -0500 Date: Thu, 13 Jan 2022 10:58:34 +0200 Message-Id: <8335ls3tc5.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-Reply-To: <87wnj486il.fsf@gnus.org> (message from Lars Ingebrigtsen on Thu, 13 Jan 2022 08:00:18 +0100) Subject: Re: bug#53203: Comment with lots of color codes crashes or hangs emacs in scss-mode References: <83r19d5c1i.fsf@gnu.org> <87wnj486il.fsf@gnus.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53203 Cc: 53203@debbugs.gnu.org, my.old.email.sucked@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Cc: Colin , 53203@debbugs.gnu.org > Date: Thu, 13 Jan 2022 08:00:18 +0100 > > Eli Zaretskii writes: > > > It seems to infloop in JIT font-lock, and the culprit seems to be this > > part of font-lock-keywords: > > > > ;; Even though pseudo-elements should be prefixed by ::, a > > ;; single colon is accepted for backward compatibility. > > "\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids > > css-pseudo-element-ids) > > t) > > Trying to understand the regexp used for scss here, I think that bit is > somewhat innocuous -- it just matches those words. > > ;; Even though pseudo-elements should be prefixed by ::, a > ;; single colon is accepted for backward compatibility. > "\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids > css-pseudo-element-ids) > t) > "\\|::" (regexp-opt css-pseudo-element-ids t) "\\)" I posted that because I saw this regexp in the backtrace obtained by interrupting the infloop. From debbugs-submit-bounces@debbugs.gnu.org Sat May 14 06:34:38 2022 Received: (at 53203) by debbugs.gnu.org; 14 May 2022 10:34:38 +0000 Received: from localhost ([127.0.0.1]:45790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npp6b-0007uw-S5 for submit@debbugs.gnu.org; Sat, 14 May 2022 06:34:38 -0400 Received: from mailtransmit04.runbox.com ([185.226.149.37]:48150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npp6Z-0007uW-HN for 53203@debbugs.gnu.org; Sat, 14 May 2022 06:34:36 -0400 Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1npp6T-002thi-7k; Sat, 14 May 2022 12:34:29 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=selector2; h=Content-Transfer-Encoding:Content-Type:MIME-Version: Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=cS8b94rkGzEXL0aBzh/1EwoEO4iDvGqKqfAk6rpf8Gw=; b=P+Y0+LoOtMoSesN+EQLGSz52hg NDN7Y9XOFsj5uY22P8Bnt0EuxuTxNR1jFNbPiCbjh/bJqTZYaCrxD7DxworfGTioUJHLK3ty0ymIW 4Bqa1h8ZW58dIW/rEUdvp0q4/bLMgwFjkjmXV1ItoqbOjNRbrtWRFYIBottOICcvMJw6QnypGFGuf TnOBqIIUtwW7xmkXsr1IvdFb6xV1Z+YTbquuzDqPugPdALnriFyzx5w1lbX2KDJcIF+HRAPbBpuAF 8r+PJ1SC21Mx7xw1Hp1SI/Cp/e2vtjh5U8Zxqq4Vq2W5xA+sTyRbUSLSi9cngW4b/1DT0ebX19JNh /DdGpwow==; Received: from [10.9.9.74] (helo=submission03.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1npp6S-0006w9-Ld; Sat, 14 May 2022 12:34:28 +0200 Received: by submission03.runbox with esmtpsa [Authenticated ID (963757)] (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1npp6Q-0000PD-8k; Sat, 14 May 2022 12:34:26 +0200 From: =?utf-8?Q?Simen_Heggest=C3=B8yl?= To: Lars Ingebrigtsen Subject: Re: bug#53203: Comment with lots of color codes crashes or hangs emacs in scss-mode References: <83r19d5c1i.fsf@gnu.org> <87wnj486il.fsf@gnus.org> Date: Sat, 14 May 2022 12:34:25 +0200 In-Reply-To: <87wnj486il.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 13 Jan 2022 08:00:18 +0100") Message-ID: <87mtfks8r2.fsf@runbox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53203 Cc: Eli Zaretskii , 53203@debbugs.gnu.org, Colin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen writes: > But then we get: > > "\\(?:([^)]+)\\)?" > (if (not sassy) > "[^:{}()\n]*" > (concat "[^:{}()\n#]*\\(?:" scss--hash-re "[^:{}()\n#]*\\)*")) > "\\)*" > > Which is a whole lot of backtracking, presumably exacerbated by the > previous ids bit of the regexp. By the ancient scientific method of commenting out code, it seems to me that the culprit is rather the last group of the regexp starting on line 955: (concat "\\(?:" scss--hash-re "\\|[^@/:{}() \t\n#]\\)" "[^:{}()#]*\\(?:" scss--hash-re "[^:{}()#]*\\)*")) That is, this part: \\(?:" scss--hash-re "[^:{}()#]*\\)* Though I'm rather clueless on how proceed debugging/optimizing it. =F0=9F= =98=95 > But I've repressed all I once knew about the scss language -- what is > it really trying to match here? Anybody? It's supposed to match selectors like the one on line 39 in test/manual/indent/scss-mode.scss: p.#{$name} var From debbugs-submit-bounces@debbugs.gnu.org Sat May 14 08:03:07 2022 Received: (at 53203) by debbugs.gnu.org; 14 May 2022 12:03:07 +0000 Received: from localhost ([127.0.0.1]:45941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npqUF-0004OB-Fn for submit@debbugs.gnu.org; Sat, 14 May 2022 08:03:07 -0400 Received: from quimby.gnus.org ([95.216.78.240]:48502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npqUE-0004Nb-Gg for 53203@debbugs.gnu.org; Sat, 14 May 2022 08:03:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: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=Cvx7FJ6qK9zusogX1B8HELnyv/b1CXh1TYCre1zm4O4=; b=aaVqhcoKG7JgqDdBsbePxoiauV qDxoHuedAN3Zl1ip4ECaqGSt42m4jLAMHGxOpkc9GQ8KxhFuUCBF9X6sgAOHT3vMdnLCNW1OcNRGp a/o3DNwGVUHpWFunbT7/6vGx4ExfC2BYni/grcF/kQUTGJxvUFFADNxc29hH/HOLBVMI=; Received: from 77.18.168.214.tmi.telenormobil.no ([77.18.168.214] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1npqU4-0003mT-Fq; Sat, 14 May 2022 14:02:59 +0200 From: Lars Ingebrigtsen To: Simen =?utf-8?Q?Heggest=C3=B8yl?= Subject: Re: bug#53203: Comment with lots of color codes crashes or hangs emacs in scss-mode References: <83r19d5c1i.fsf@gnu.org> <87wnj486il.fsf@gnus.org> <87mtfks8r2.fsf@runbox.com> Date: Sat, 14 May 2022 14:02:54 +0200 In-Reply-To: <87mtfks8r2.fsf@runbox.com> ("Simen =?utf-8?Q?Heggest=C3=B8yl?= =?utf-8?Q?=22's?= message of "Sat, 14 May 2022 12:34:25 +0200") Message-ID: <87h75sl3td.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Simen Heggestøyl writes: >> But I've repressed all I once knew about the scss language -- what is >> it really trying to match here? Anybody? > > It's supposed to match selectors like the one on line 39 in > test/manual/inden [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53203 Cc: Eli Zaretskii , 53203@debbugs.gnu.org, Colin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Simen Heggest=C3=B8yl writes: >> But I've repressed all I once knew about the scss language -- what is >> it really trying to match here? Anybody? > > It's supposed to match selectors like the one on line 39 in > test/manual/indent/scss-mode.scss: > > p.#{$name} var Ah, I see -- it wants to match a selector followed by braces. I.e., these things: p.#{$name} var { } p.#{$name}, f.#{$bar}:active, f.bar::after { } p.#{$name} f.#{$bar} k.var #{$bar} #{$bar} { } p.#{$name} { } Hm... --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat May 14 08:38:34 2022 Received: (at 53203) by debbugs.gnu.org; 14 May 2022 12:38:35 +0000 Received: from localhost ([127.0.0.1]:45958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npr2Y-0005Nh-L7 for submit@debbugs.gnu.org; Sat, 14 May 2022 08:38:34 -0400 Received: from quimby.gnus.org ([95.216.78.240]:48846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npr2W-0005NU-A0 for 53203@debbugs.gnu.org; Sat, 14 May 2022 08:38:33 -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:In-Reply-To:Date: References: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=4p8KimEFPZrjtWW/KekUOpbZQcYFfxlxKVMEyYcQKxA=; b=DSLsZ17wxid3dqVM3qTe4g962d ilHHmH/Wj7UCBLcpDSpfnvJEJ2v9ROMN4cuolzH1/NNyjRNge6G2VPTIyACKvnjWLrh8Ga9xLLvSf K2EXEbUlYDFy1RZeizkWeJGCGdTnb0f8E/JOmvMPNbTDBTEzHa/GPSLbG2hsieiJdocs=; Received: from 77.18.168.214.tmi.telenormobil.no ([77.18.168.214] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1npr2M-00046f-UG; Sat, 14 May 2022 14:38:25 +0200 From: Lars Ingebrigtsen To: Simen =?utf-8?Q?Heggest=C3=B8yl?= Subject: Re: bug#53203: Comment with lots of color codes crashes or hangs emacs in scss-mode References: <83r19d5c1i.fsf@gnu.org> <87wnj486il.fsf@gnus.org> <87mtfks8r2.fsf@runbox.com> Date: Sat, 14 May 2022 14:38:21 +0200 In-Reply-To: <87mtfks8r2.fsf@runbox.com> ("Simen =?utf-8?Q?Heggest=C3=B8yl?= =?utf-8?Q?=22's?= message of "Sat, 14 May 2022 12:34:25 +0200") Message-ID: <87czggl26a.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: OK, I think I understand most of the regexp now, but it's a strange mix of strictness and sloppiness. (,(concat "^[ \t]*\\(" (if (not sassy) ;; We don't allow / as first char, so as not to ;; take a comment as the beginning of a selector. "[^@/:{}() \t\n][^:{}()]*" ;; Same as for non-sassy except we [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53203 Cc: Eli Zaretskii , 53203@debbugs.gnu.org, Colin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) OK, I think I understand most of the regexp now, but it's a strange mix of strictness and sloppiness. (,(concat "^[ \t]*\\(" (if (not sassy) ;; We don't allow / as first char, so as not to ;; take a comment as the beginning of a selector. "[^@/:{}() \t\n][^:{}()]*" ;; Same as for non-sassy except we do want to allow { and } ;; chars in selectors in the case of #{$foo} ;; variable interpolation! (concat "\\(?:" scss--hash-re "\\|[^@/:{}() \t\n#]\\)" "[^:{}()#]*\\(?:" scss--hash-re "[^:{}()#]*\\)*")) ;; Even though pseudo-elements should be prefixed by ::, a ;; single colon is accepted for backward compatibility. "\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids css-pseudo-element-ids) t) "\\|::" (regexp-opt css-pseudo-element-ids t) "\\)" "\\(?:([^)]+)\\)?" First we work really hard to see whether we have something that looks like a selector, i.e. a line that starts with, p p::after p:active or in the scss case p#{foo}:active and then we allow any kind of junk for the rest of the line, like p.a *[line noise]* p.b { } with this bit: (if (not sassy) "[^:{}()\n]*" (concat "[^:{}()\n#]*\\(?:" scss--hash-re "[^:{}()\n#]*\\)*")) "\\)*" "\\)\\(?:\n[ \t]*\\)*{") (1 'css-selector keep)) Anyway, I still don't grok this bit: (concat "\\(?:" scss--hash-re "\\|[^@/:{}() \t\n#]\\)" "[^:{}()#]*\\(?:" scss--hash-re "[^:{}()#]*\\)*")) That is, we're matching an scss/css selector first, and then... possibly another one? Which we're doing later, anyway. So just getting rid of that bit seems to lead to the same highlighting (and gets rid of the original reported problem). But like I said, I don't understand quite what it's trying to do there. Can anybody come up with an scss example this breaks? diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 1139fd1976..fd47a7b83b 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -953,14 +953,13 @@ css--font-lock-keywords ;; chars in selectors in the case of #{$foo} ;; variable interpolation! (concat "\\(?:" scss--hash-re - "\\|[^@/:{}() \t\n#]\\)" - "[^:{}()#]*\\(?:" scss--hash-re "[^:{}()#]*\\)*")) + "\\|[^@/:{}() \t\n][^:{}()]\\)*")) ;; Even though pseudo-elements should be prefixed by ::, a ;; single colon is accepted for backward compatibility. "\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids css-pseudo-element-ids) t) - "\\|::" (regexp-opt css-pseudo-element-ids t) "\\)" + "\\|::" (regexp-opt css-pseudo-element-ids t) "\\)?" "\\(?:([^)]+)\\)?" (if (not sassy) "[^:{}()\n]*" -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat May 14 09:30:38 2022 Received: (at 53203) by debbugs.gnu.org; 14 May 2022 13:30:39 +0000 Received: from localhost ([127.0.0.1]:45999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nprqw-0006tN-Ks for submit@debbugs.gnu.org; Sat, 14 May 2022 09:30:38 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nprqv-0006t6-6H for 53203@debbugs.gnu.org; Sat, 14 May 2022 09:30:37 -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:In-Reply-To:Date: References: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=JoX8JILU1pb9iNvunTB5nn1qDhGYBg+NDaLsixcdbi8=; b=GigsGQ61A8+gjlaXEz54XqJr2+ NhVoiPL0dgEWJyBFHi9z99nKaqahxLA14tagG/1yy8J0OqTO5FANl4FIN2utnCa1BROgNqqLUNYO9 iUWAvU6AU3LK/UIxCILGiyHUGE5cc3lpfy8GA3RSJTAacUVe82vzy1WyqJKl0RtOtfEk=; Received: from 77.18.168.214.tmi.telenormobil.no ([77.18.168.214] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nprql-0004aC-L9; Sat, 14 May 2022 15:30:30 +0200 From: Lars Ingebrigtsen To: Simen =?utf-8?Q?Heggest=C3=B8yl?= Subject: Re: bug#53203: Comment with lots of color codes crashes or hangs emacs in scss-mode References: <83r19d5c1i.fsf@gnu.org> <87wnj486il.fsf@gnus.org> <87mtfks8r2.fsf@runbox.com> <87czggl26a.fsf@gnus.org> Date: Sat, 14 May 2022 15:30:26 +0200 In-Reply-To: <87czggl26a.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 14 May 2022 14:38:21 +0200") Message-ID: <878rr4kzrh.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: But how about just trying to make it stricter? That is, just allow any number of selectors, with the separators between. The following seems to work fine in the test cases. diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 1139fd1976..4db3ae82f0 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -944,29 +944,29 @@ css--fo [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53203 Cc: Eli Zaretskii , 53203@debbugs.gnu.org, Colin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) But how about just trying to make it stricter? That is, just allow any number of selectors, with the separators between. The following seems to work fine in the test cases. diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 1139fd1976..4db3ae82f0 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -944,29 +944,29 @@ css--font-lock-keywords ;; I use `keep' this should work better). But really the part of the ;; selector between [...] should simply not be highlighted. (,(concat - "^[ \t]*\\(" + "^[ \t]*\\(\\(?:" (if (not sassy) ;; We don't allow / as first char, so as not to ;; take a comment as the beginning of a selector. - "[^@/:{}() \t\n][^:{}()]*" + "[[:alnum:]%*#.>]+" ;; Same as for non-sassy except we do want to allow { and } ;; chars in selectors in the case of #{$foo} ;; variable interpolation! (concat "\\(?:" scss--hash-re - "\\|[^@/:{}() \t\n#]\\)" - "[^:{}()#]*\\(?:" scss--hash-re "[^:{}()#]*\\)*")) + "\\|[[:alnum:]%*#.>]+\\)")) ;; Even though pseudo-elements should be prefixed by ::, a ;; single colon is accepted for backward compatibility. "\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids css-pseudo-element-ids) t) - "\\|::" (regexp-opt css-pseudo-element-ids t) "\\)" + "\\|::" (regexp-opt css-pseudo-element-ids t) "\\)\\)?" + ;; Braces after selectors. + "\\(?:\\[[^]]+\\]\\)?" + ;; Parentheses after selectors. "\\(?:([^)]+)\\)?" - (if (not sassy) - "[^:{}()\n]*" - (concat "[^:{}()\n#]*\\(?:" scss--hash-re "[^:{}()\n#]*\\)*")) - "\\)*" - "\\)\\(?:\n[ \t]*\\)*{") + ;; Separators between selectors. + "[ \t,+~>]*" + "\\)+\\)\\(?:\n[ \t]*\\)*{") (1 'css-selector keep)) ;; In the above rule, we allow the open-brace to be on some subsequent ;; line. This will only work if we properly mark the intervening text -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat May 14 11:33:24 2022 Received: (at 53203) by debbugs.gnu.org; 14 May 2022 15:33:24 +0000 Received: from localhost ([127.0.0.1]:47273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nptlk-0002Mq-24 for submit@debbugs.gnu.org; Sat, 14 May 2022 11:33:24 -0400 Received: from quimby.gnus.org ([95.216.78.240]:50172) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nptli-0002MW-Jy for 53203@debbugs.gnu.org; Sat, 14 May 2022 11:33:23 -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:In-Reply-To:Date: References: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=5cm3MEHlnyKjJ/Bev9e6HgVWBJuesuabIuC6X/nW1oQ=; b=nsdXsEM+JwKGgbQEZLcTIa1CiH 9xr5yYwLLwQbmoZPfaXdUe0fxO/0q8yRs6qMrRs1whePOOzH85I+De47Jx5TwZ9Wc6IEY5ikm/2TL PVA90v4IWZAZjBST3FQQ/5O5wOURprYIha0cbKPvPOjcLnSKm9NNpTf3HZBbMYE1bbiY=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nptlY-0005Ze-Ll; Sat, 14 May 2022 17:33:15 +0200 From: Lars Ingebrigtsen To: Simen =?utf-8?Q?Heggest=C3=B8yl?= Subject: Re: bug#53203: Comment with lots of color codes crashes or hangs emacs in scss-mode References: <83r19d5c1i.fsf@gnu.org> <87wnj486il.fsf@gnus.org> <87mtfks8r2.fsf@runbox.com> <87czggl26a.fsf@gnus.org> <878rr4kzrh.fsf@gnus.org> Date: Sat, 14 May 2022 17:33:11 +0200 In-Reply-To: <878rr4kzrh.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 14 May 2022 15:30:26 +0200") Message-ID: <874k1sku2w.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: > But how about just trying to make it stricter? That is, just allow any > number of selectors, with the separators between. The following seems > to work fine in the test cases. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53203 Cc: Eli Zaretskii , 53203@debbugs.gnu.org, Colin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen writes: > But how about just trying to make it stricter? That is, just allow any > number of selectors, with the separators between. The following seems > to work fine in the test cases. I've now done something like this in Emacs 29, and added a bunch of tests. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat May 14 11:33:31 2022 Received: (at control) by debbugs.gnu.org; 14 May 2022 15:33:31 +0000 Received: from localhost ([127.0.0.1]:47276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nptlr-0002NC-86 for submit@debbugs.gnu.org; Sat, 14 May 2022 11:33:31 -0400 Received: from quimby.gnus.org ([95.216.78.240]:50188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nptlp-0002My-Vt for control@debbugs.gnu.org; Sat, 14 May 2022 11:33:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=doWJOaLNJbpOSDtX9xs9HmLHG0kE2o4UunGLyLEl0N0=; b=uRdXBKSs/FpnpjhPeR5pPfKNTU R4WUX3CIz3k4hVtvnTSBwb7/aWf/tz+tyjIr1fppIs6aVd15wjqSwZHroI2SI3Fn3vy021ke6Fh75 RdLcMKOqAk4DDVXFZqjQW7ukMganYXV4OmBZNiyjeLiPGKXKKR3RGGaPyCKvaHy50Z3Y=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nptli-0005Zp-7P for control@debbugs.gnu.org; Sat, 14 May 2022 17:33:24 +0200 Date: Sat, 14 May 2022 17:33:21 +0200 Message-Id: <8735hcku2m.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #53203 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 53203 29.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 53203 29.1 quit From debbugs-submit-bounces@debbugs.gnu.org Sun May 15 06:45:36 2022 Received: (at 53203) by debbugs.gnu.org; 15 May 2022 10:45:36 +0000 Received: from localhost ([127.0.0.1]:48590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqBkg-0004Rp-BP for submit@debbugs.gnu.org; Sun, 15 May 2022 06:45:36 -0400 Received: from mailtransmit05.runbox.com ([185.226.149.38]:59936) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqBkW-0004RS-19 for 53203@debbugs.gnu.org; Sun, 15 May 2022 06:45:28 -0400 Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit05.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1nqBkP-005073-N8; Sun, 15 May 2022 12:45:13 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=selector2; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From; bh=J7RItNLiuGGqizC4Ae1LK/ckPMVgeFTzQCkeK0KZ5bE=; b=CtIS/YAwA0+yWYf7D80qycKzXU q+6OSYyN/fVFSOxL+LnHxcJCF3xmzeHEZ/L1xt6mo6TQOjmkWR15sNt+zNG8IrV9sxQiLznNr04j+ bja2CyB9Ea4sNAqzUShiB95g0vks9dY1nzZKNbOUjX/o+oxcVF1MycK0baOQNZpMfG+2/DGZ7702J IrBA0Sqb4M4X5NkyRKsYlcskwiZlkIWtREPsmTVoai0HxDIKnUXrl3c7Qit2bm7oUsFAUI5LR2V3w eOBUZ/d1DTVrwz2eX055+n6tibUVSkOeqXANXlz39tjsNydOZ+FUdtcnf1LBkr35olcTP42zrXEKg wPI8lnxw==; Received: from [10.9.9.74] (helo=submission03.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1nqBkP-0003Dc-31; Sun, 15 May 2022 12:45:13 +0200 Received: by submission03.runbox with esmtpsa [Authenticated ID (963757)] (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1nqBkO-0004Ft-PA; Sun, 15 May 2022 12:45:12 +0200 From: =?utf-8?Q?Simen_Heggest=C3=B8yl?= To: Lars Ingebrigtsen Subject: Re: bug#53203: Comment with lots of color codes crashes or hangs emacs in scss-mode References: <83r19d5c1i.fsf@gnu.org> <87wnj486il.fsf@gnus.org> <87mtfks8r2.fsf@runbox.com> <87czggl26a.fsf@gnus.org> <878rr4kzrh.fsf@gnus.org> <874k1sku2w.fsf@gnus.org> Date: Sun, 15 May 2022 12:45:11 +0200 In-Reply-To: <874k1sku2w.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 14 May 2022 17:33:11 +0200") Message-ID: <87y1z3nkg8.fsf@runbox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53203 Cc: Eli Zaretskii , 53203@debbugs.gnu.org, Colin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen writes: > Lars Ingebrigtsen writes: > >> But how about just trying to make it stricter? That is, just allow any >> number of selectors, with the separators between. The following seems >> to work fine in the test cases. > > I've now done something like this in Emacs 29, and added a bunch of tests. Hm, I can't seem to find it, did you push it yet? I tested a bit with the patch you posted 15:30 yesterday, but it seems to have some problems: Pasting this into a CSS mode buffer now freezes up Emacs: /* * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */ Selectors with hyphens are no longer highlighted, e.g.: .foo-bar { Only the last part of multi line selectors are now highlighted, e.g. only `body` here: div, body { From debbugs-submit-bounces@debbugs.gnu.org Sun May 15 08:14:43 2022 Received: (at 53203) by debbugs.gnu.org; 15 May 2022 12:14:43 +0000 Received: from localhost ([127.0.0.1]:48706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqD90-0000V9-V7 for submit@debbugs.gnu.org; Sun, 15 May 2022 08:14:43 -0400 Received: from quimby.gnus.org ([95.216.78.240]:58964) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqD8y-0000Us-RO for 53203@debbugs.gnu.org; Sun, 15 May 2022 08:14:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: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=tb0a8quKGN71AYG31Rn1doWhCUwTiKFOHWLuic69RJ4=; b=inUHXe9QqitOIcyHSeMR6MayS5 6hOHqBrXCAjU/Zd2fyjbddDYZcsb1CxFla5v740xQ6gH+aAdPqejLtxqA4Q0spOfzsSxh1L0PCtiB uAeW1wHh8djwI1zOJ+xapXsc0dB+M08ivKpoLv9m6JWzZbTmJ/3dYDPOvpR8+pyyNpEg=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nqD8o-0000HC-U5; Sun, 15 May 2022 14:14:33 +0200 From: Lars Ingebrigtsen To: Simen =?utf-8?Q?Heggest=C3=B8yl?= Subject: Re: bug#53203: Comment with lots of color codes crashes or hangs emacs in scss-mode References: <83r19d5c1i.fsf@gnu.org> <87wnj486il.fsf@gnus.org> <87mtfks8r2.fsf@runbox.com> <87czggl26a.fsf@gnus.org> <878rr4kzrh.fsf@gnus.org> <874k1sku2w.fsf@gnus.org> <87y1z3nkg8.fsf@runbox.com> Date: Sun, 15 May 2022 14:14:30 +0200 In-Reply-To: <87y1z3nkg8.fsf@runbox.com> ("Simen =?utf-8?Q?Heggest=C3=B8yl?= =?utf-8?Q?=22's?= message of "Sun, 15 May 2022 12:45:11 +0200") Message-ID: <87v8u7hu1l.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Simen Heggestøyl writes: > Hm, I can't seem to find it, did you push it yet? Nope; forgot to, and it seems like a good thing. :-) Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53203 Cc: Eli Zaretskii , 53203@debbugs.gnu.org, Colin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Simen Heggest=C3=B8yl writes: > Hm, I can't seem to find it, did you push it yet? Nope; forgot to, and it seems like a good thing. :-) > I tested a bit with the patch you posted 15:30 yesterday, but it seems > to have some problems: > > Pasting this into a CSS mode buffer now freezes up Emacs: > > /* > * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx > */ > > Selectors with hyphens are no longer highlighted, e.g.: > > .foo-bar { > > Only the last part of multi line selectors are now highlighted, > e.g. only `body` here: > > div, > body { I've now fixed these and pushed the change. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun May 15 10:47:22 2022 Received: (at 53203) by debbugs.gnu.org; 15 May 2022 14:47:22 +0000 Received: from localhost ([127.0.0.1]:50394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqFWk-00073I-4C for submit@debbugs.gnu.org; Sun, 15 May 2022 10:47:22 -0400 Received: from mailtransmit04.runbox.com ([185.226.149.37]:53526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqFWi-000735-Ks for 53203@debbugs.gnu.org; Sun, 15 May 2022 10:47:21 -0400 Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1nqFWc-005GkD-Az; Sun, 15 May 2022 16:47:14 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=selector2; h=Content-Transfer-Encoding:Content-Type:MIME-Version: Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=Mke6Y+/p65OG+hM3KdmRKUrRetqxyCpuY/E+vWpJTU0=; b=JgUZvY9dnFH4qzGUL0HHXk/yz0 IuN8+BNZpUUnT8i2S9HhvOs06q7PbE2/zZFt5nqx6FN4+733Wnqohi+0voQzFSO11R3FEpbEIvqLV IZIsSVPRXdvGpTs4rjK8S3COho1Nx0w+QKUvDzdopZgMV0T1dzHf820H3FtPPqrfxOncRPrjGyI+C WkoODFR1I40C1rUr/TJitYMMJNtWcAurm1npYjFwSJo4P7x21Zp7Nl4c5HfZ6HpbUN1rq0WZh0NSh tXdntYs/uMwBQdXBaEjbGF4HtZhqR0R7765SbkERXv6BbvMdSVhK//tIbQ3FnJCc/Mz8PpHeUtFLU F8X94+Kw==; Received: from [10.9.9.74] (helo=submission03.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1nqFWb-0004aC-Kl; Sun, 15 May 2022 16:47:13 +0200 Received: by submission03.runbox with esmtpsa [Authenticated ID (963757)] (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1nqFWL-00040j-V0; Sun, 15 May 2022 16:46:57 +0200 From: =?utf-8?Q?Simen_Heggest=C3=B8yl?= To: Lars Ingebrigtsen Subject: Re: bug#53203: Comment with lots of color codes crashes or hangs emacs in scss-mode References: <83r19d5c1i.fsf@gnu.org> <87wnj486il.fsf@gnus.org> <87mtfks8r2.fsf@runbox.com> <87czggl26a.fsf@gnus.org> <878rr4kzrh.fsf@gnus.org> <874k1sku2w.fsf@gnus.org> <87y1z3nkg8.fsf@runbox.com> <87v8u7hu1l.fsf@gnus.org> Date: Sun, 15 May 2022 16:46:57 +0200 In-Reply-To: <87v8u7hu1l.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 15 May 2022 14:14:30 +0200") Message-ID: <87czgedfa6.fsf@simenheg@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 53203 Cc: Eli Zaretskii , 53203@debbugs.gnu.org, Colin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Lars Ingebrigtsen writes: > Simen Heggest=C3=B8yl writes: > >> I tested a bit with the patch you posted 15:30 yesterday, but it seems >> to have some problems: >> >> Pasting this into a CSS mode buffer now freezes up Emacs: >> >> /* >> * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >> */ >> >> Selectors with hyphens are no longer highlighted, e.g.: >> >> .foo-bar { >> >> Only the last part of multi line selectors are now highlighted, >> e.g. only `body` here: >> >> div, >> body { > > I've now fixed these and pushed the change. Thanks! Looks good. The new selector tests makes it much less scary to tweak the regexp. From unknown Sat Jun 14 14:26:23 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 13 Jun 2022 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator