bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20859: 25.0.50; css-mode: Comments within URIs


From: Stefan Monnier
Subject: bug#20859: 25.0.50; css-mode: Comments within URIs
Date: Mon, 22 Jun 2015 11:54:13 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> I think I found a solution, by applying the string syntax class to the
> whole URI.

You're not applying the "string syntax class", but the "word syntax-class".

> +(defun css-syntax-propertize-function (start end)
> +  (save-excursion
> +    (goto-char start)
> +    ;; Allow comment starters to appear inside unquoted URIs, such as
> +    ;; url(http://www.example.com/*/).
> +    (while (re-search-forward
> +            "url\([[:space:]]*\\([^\"'\n[:space:]]+\\)[[:space:]]*\)"
                   ^^                                                ^^
Again, these backslashes will be ignored.

The issue of what to do with "foo(bar)baz)" is still open.

> +      (add-text-properties
> +       (match-beginning 1) (match-end 1)
> +       '(syntax-table (2) font-lock-face font-lock-string-face)))))

The downside of this approach is that M-f, M-b will skip over the whole
URL rather than go one word at a time.


        Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]