unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#20859: 25.0.50; css-mode: Comments within URIs
@ 2015-06-20 15:04 Simen Heggestøyl
  2015-06-21 17:38 ` Simen Heggestøyl
  2015-06-22  1:13 ` Stefan Monnier
  0 siblings, 2 replies; 9+ messages in thread
From: Simen Heggestøyl @ 2015-06-20 15:04 UTC (permalink / raw)
  To: 20859

[-- Attachment #1: Type: text/plain, Size: 1372 bytes --]

In CSS, the syntax of URIs is described as follows:

  The format of a URI value is 'url(' followed by optional white space
  followed by an optional single quote (') or double quote (")
  character followed by the URI itself, followed by an optional single
  quote (') or double quote (") character followed by optional white
  space followed by ')'. The two quote characters must be the
  same. [1]

This means that all of the following are legal URI entries:

  url("http://www.example.com/")
  url('http://www.example.com/')
  url(http://www.example.com/)

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.

I attempted to fix this by setting syntax-propertize-function to the
following:

  (syntax-propertize-rules
     ("url\\(\(\\)[[:space:]]*[[:graph:]]*[[:space:]]*\\(\)\\)"
      (1 "|") (2 "|")))

This almost solves the problem, but with the quirk that "(" and ")"
are interpreted as part of the string.

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!

-- Simen


[1] http://www.w3.org/TR/CSS21/syndata.html#uri

[-- Attachment #2: Type: text/html, Size: 2048 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-08-22 17:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).