From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Newsgroups: gmane.emacs.bugs Subject: bug#21230: 25.0.50; scss-mode: Font Lock hangs on Sass lists Date: Sat, 09 Jan 2016 13:55:10 +0100 Message-ID: <1452344110.13259.0@smtp.gmail.com> References: <1439221361.1408.0@smtp.gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-KG/L5XLSA3s409FZ5gHW" X-Trace: ger.gmane.org 1452344201 7263 80.91.229.3 (9 Jan 2016 12:56:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Jan 2016 12:56:41 +0000 (UTC) Cc: Stefan Monnier To: 21230@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 09 13:56:30 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aHt4I-0006xn-1l for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jan 2016 13:56:30 +0100 Original-Received: from localhost ([::1]:40420 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHt4H-00072S-IS for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jan 2016 07:56:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHt3v-0006ah-A3 for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2016 07:56:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHt3q-0007kT-Ae for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2016 07:56:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55434) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHt3q-0007kL-71 for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2016 07:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aHt3p-0006tl-Vh for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2016 07:56:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <1439221361.1408.0@smtp.gmail.com> Resent-From: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Jan 2016 12:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21230 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21230-submit@debbugs.gnu.org id=B21230.145234412026461 (code B ref 21230); Sat, 09 Jan 2016 12:56:01 +0000 Original-Received: (at 21230) by debbugs.gnu.org; 9 Jan 2016 12:55:20 +0000 Original-Received: from localhost ([127.0.0.1]:43654 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aHt39-0006sj-SO for submit@debbugs.gnu.org; Sat, 09 Jan 2016 07:55:20 -0500 Original-Received: from mail-lf0-f54.google.com ([209.85.215.54]:33830) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aHt38-0006sX-Fb for 21230@debbugs.gnu.org; Sat, 09 Jan 2016 07:55:18 -0500 Original-Received: by mail-lf0-f54.google.com with SMTP id d17so25748949lfb.1 for <21230@debbugs.gnu.org>; Sat, 09 Jan 2016 04:55:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:subject:to:cc:message-id:mime-version:content-type; bh=BPbDEYmRvs864A23tAl9IIbhmPgMl3vuWiveBr6BTT0=; b=P2J+Fv2OjVg6/jsd/t5ROeVCGbb2kG/c6wNx+T4ZYOPoJ/i0typqJ2lDY0Jkg+xF3B j4LGgKeRCd380G68mhOULtZW+9Z+x4rJwWDS4bX+ST/VhQgv8ngEH1uGahgzssjDoBck sXOurWn+3JlF81TqEmq52pkCslRqLefmrqYuct50CYkvudZpQWRZhoufn7kDtYDNnrwT ihHwXf/n1PrH12UpaxaR8AU1WpSjhVeMLAwrwhxacADGTXZ5yHjqjk83r6ehA5AJZ4d6 KRccnxAxOEuAvZxBOxLDaL+zI+rJYgTXKwRAtTLmJxWoYMteRUZnSSpGFS4VpNW+SSKq NMqA== X-Received: by 10.25.3.133 with SMTP id 127mr9704007lfd.50.1452344112320; Sat, 09 Jan 2016 04:55:12 -0800 (PST) Original-Received: from [192.168.100.10] (cm-84.210.143.4.getinternet.no. [84.210.143.4]) by smtp.gmail.com with ESMTPSA id b5sm1236696lbc.14.2016.01.09.04.55.10 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 09 Jan 2016 04:55:11 -0800 (PST) X-Mailer: geary/0.10.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111419 Archived-At: --=-KG/L5XLSA3s409FZ5gHW Content-Type: multipart/alternative; boundary="=-uwHpXsAPNFm5eutR/MDK" --=-uwHpXsAPNFm5eutR/MDK Content-Type: text/plain; charset=utf-8; format=flowed It seems that this happens because scss-mode thinks that the list elements are selectors. The attached patch attempts to fix this by disallowing parenthesis in selectors, except for in the function notation that might appear right after pseudo-classes. -- Simen --=-uwHpXsAPNFm5eutR/MDK Content-Type: text/html; charset=utf-8 It seems that this happens because scss-mode thinks that the list
elements are selectors. The attached patch attempts to fix this by
disallowing parenthesis in selectors, except for in the function
notation that might appear right after pseudo-classes.

-- Simen
--=-uwHpXsAPNFm5eutR/MDK-- --=-KG/L5XLSA3s409FZ5gHW Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Disallow-parenthesis-in-non-pseudo-CSS-selectors.patch >From f4ff7b89348142f103412e9aa6b3e2352dbfa567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simen=20Heggest=C3=B8yl?= Date: Sat, 2 Jan 2016 23:44:58 +0100 Subject: [PATCH] Disallow parenthesis in non-pseudo CSS selectors * lisp/textmodes/css-mode.el (css--font-lock-keywords): Disallow parenthesis in selectors except for in the function notation that might appear right after a pseudo-class. --- lisp/textmodes/css-mode.el | 10 +++++----- test/indent/scss-mode.scss | 10 ++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 48c2484..d402fb1 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -257,13 +257,13 @@ css--font-lock-keywords (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][^:{}]+" + "[^@/:{}() \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 "[^:{}#]*\\)*")) + "\\|[^@/:{}() \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 @@ -271,8 +271,8 @@ css--font-lock-keywords "\\|\\::" (regexp-opt css-pseudo-element-ids t) "\\)" "\\(?:([^)]+)\\)?" (if (not sassy) - "[^:{}\n]*" - (concat "[^:{}\n#]*\\(?:" scss--hash-re "[^:{}\n#]*\\)*")) + "[^:{}()\n]*" + (concat "[^:{}()\n#]*\\(?:" scss--hash-re "[^:{}()\n#]*\\)*")) "\\)*" "\\)\\(?:\n[ \t]*\\)*{") (1 'css-selector keep)) diff --git a/test/indent/scss-mode.scss b/test/indent/scss-mode.scss index 7a29929..02a4a98 100644 --- a/test/indent/scss-mode.scss +++ b/test/indent/scss-mode.scss @@ -55,3 +55,13 @@ article[role="main"] { } .box { @include border-radius(10px); } + +// bug:21230 +$list: ( + ('a', #000000, #fff) + ('b', #000000, #fff) + ('c', #000000, #fff) + ('d', #000000, #fff) + ('e', #000000, #fff) + ('f', #000000, #fff) +); -- 2.6.4 --=-KG/L5XLSA3s409FZ5gHW--