From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Simen Heggestøyl" <simenheg@gmail.com>
Cc: 20859@debbugs.gnu.org
Subject: bug#20859: 25.0.50; css-mode: Comments within URIs
Date: Mon, 22 Jun 2015 11:54:13 -0400 [thread overview]
Message-ID: <jwvtwtzrbtz.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <1434908291.13002.0@smtp.gmail.com> ("Simen Heggestøyl"'s message of "Sun, 21 Jun 2015 19:38:11 +0200")
> 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
next prev parent reply other threads:[~2015-06-22 15:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-20 15:04 bug#20859: 25.0.50; css-mode: Comments within URIs Simen Heggestøyl
2015-06-21 17:38 ` Simen Heggestøyl
2015-06-22 15:54 ` Stefan Monnier [this message]
2015-06-22 1:13 ` Stefan Monnier
2015-08-21 21:08 ` Simen Heggestøyl
2015-08-22 4:04 ` Stefan Monnier
2015-08-22 8:19 ` Simen Heggestøyl
2015-08-22 14:47 ` Stefan Monnier
2015-08-22 17:21 ` Simen Heggestøyl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvtwtzrbtz.fsf-monnier+emacsbugs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=20859@debbugs.gnu.org \
--cc=simenheg@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.