From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#20859: 25.0.50; css-mode: Comments within URIs Date: Sun, 21 Jun 2015 21:13:44 -0400 Message-ID: References: <1434812678.1585.2@smtp.gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1434935662 25452 80.91.229.3 (22 Jun 2015 01:14:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Jun 2015 01:14:22 +0000 (UTC) Cc: 20859@debbugs.gnu.org To: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 22 03:14:11 2015 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 1Z6qJP-0000x0-7k for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Jun 2015 03:14:11 +0200 Original-Received: from localhost ([::1]:37725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6qJO-0002Q7-CB for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Jun 2015 21:14:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6qJK-0002PB-NY for bug-gnu-emacs@gnu.org; Sun, 21 Jun 2015 21:14:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z6qJG-0004Wn-JY for bug-gnu-emacs@gnu.org; Sun, 21 Jun 2015 21:14:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52274) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6qJG-0004Wj-Fr for bug-gnu-emacs@gnu.org; Sun, 21 Jun 2015 21:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z6qJG-0007up-9f for bug-gnu-emacs@gnu.org; Sun, 21 Jun 2015 21:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Jun 2015 01:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20859 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20859-submit@debbugs.gnu.org id=B20859.143493563230402 (code B ref 20859); Mon, 22 Jun 2015 01:14:02 +0000 Original-Received: (at 20859) by debbugs.gnu.org; 22 Jun 2015 01:13:52 +0000 Original-Received: from localhost ([127.0.0.1]:53720 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z6qJ6-0007uI-7m for submit@debbugs.gnu.org; Sun, 21 Jun 2015 21:13:52 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:39364) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z6qJ4-0007u5-9e for 20859@debbugs.gnu.org; Sun, 21 Jun 2015 21:13:50 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AwEwA731xV/zDyd0tcgxCEAoVVuzcJhH6CTQQCAoE8ORQBAQEBAQEBgQpBBYNdAQEDAVYjBQsLNBIUGA0kLogJCM8jAQEBAQEFAQEBAR6LOoUFB4QtBZA0owuBRSOEFCKCeAEBAQ X-IPAS-Result: A0AwEwA731xV/zDyd0tcgxCEAoVVuzcJhH6CTQQCAoE8ORQBAQEBAQEBgQpBBYNdAQEDAVYjBQsLNBIUGA0kLogJCM8jAQEBAQEFAQEBAR6LOoUFB4QtBZA0owuBRSOEFCKCeAEBAQ X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="127902726" Original-Received: from 75-119-242-48.dsl.teksavvy.com (HELO ceviche.home) ([75.119.242.48]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 21 Jun 2015 21:13:44 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 4B065660F3; Sun, 21 Jun 2015 21:13:44 -0400 (EDT) In-Reply-To: <1434812678.1585.2@smtp.gmail.com> ("Simen =?UTF-8?Q?Heggest=C3=B8yl?="'s message of "Sat, 20 Jun 2015 17:04:38 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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:104203 Archived-At: > However, css-mode doesn't currently interpret the stuff between the > parenthesis in the quote-less form as strings. This means that URIs > containing /* (or // in scss-mode, which is more common for URIs) will > be interpreted as comment starters by Emacs. Indeed. > I attempted to fix this by setting syntax-propertize-function to the > following: > (syntax-propertize-rules > ("url\\(\(\\)[[:space:]]*[[:graph:]]*[[:space:]]*\\(\)\\)" ^^ ^^ [ Side note: these are the same as the unquoted parens (IOW the backslash there are ineffective, which is actually fine because we don't need them). ] There's also a real problem: how should we treat url(foo)bar) ? > (1 "|") (2 "|"))) > This almost solves the problem, but with the quirk that "(" and ")" > are interpreted as part of the string. Just like single quotes and double quotes are usually highlighted as part of the string. IOW, I think it's OK to highlight the parens as part of the string, tho only when the argument inside the parens is not itself wrapped in '...' or "...". So we should use a regexp that only matches when the contents of the parens is not quoted. > Would it be possible to assign string syntax to the stuff between the > two parenthesis without having any visible string delimiters? I'm > thankful for any hints for getting closer to a solution! If you really care about it you could add a font-lock-keyword which matches "url(...)" and overrides the face on the open and close parens. Stefan