unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Simen Heggestøyl" <simenheg@gmail.com>
To: Tom Tromey <tom@tromey.com>
Cc: 21638@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#21638: 25.0.50; font-lock for CSS variables
Date: Tue, 06 Oct 2015 21:24:53 +0200	[thread overview]
Message-ID: <87mvvvkdfe.fsf@gmail.com> (raw)
In-Reply-To: <87twq3ev7w.fsf@tromey.com> (Tom Tromey's message of "Tue, 06 Oct 2015 11:57:07 -0600")

Tom Tromey <tom@tromey.com> writes:
> Right now CSS mode doesn't treat CSS variable definitions as
> properties.  I think it should.
>
> Here's the patch that worked for me:
>
> [...]
>
> Tom

Hi Tom!

Good idea. The patch seems to do the job, but it also has the side
effect that '---foo', '----foo' and so on are recognized as
properties.

Putting it instead at the start of 'css-nmstart-re' seems to fix that:

diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index 5f4eebd..3e84b43 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -215,7 +215,7 @@
 (defconst css-escapes-re
   "\\\\\\(?:[^\000-\037\177]\\|[0-9a-fA-F]+[ \n\t\r\f]?\\)")
 (defconst css-nmchar-re (concat "\\(?:[-[:alnum:]]\\|" css-escapes-re "\\)"))
-(defconst css-nmstart-re (concat "\\(?:[[:alpha:]]\\|" css-escapes-re "\\)"))
+(defconst css-nmstart-re (concat "\\(?:--\\)?\\(?:[[:alpha:]]\\|" css-escapes-re "\\)"))
 (defconst css-ident-re ;; (concat css-nmstart-re css-nmchar-re "*")
   ;; Apparently, "at rules" names can start with a dash, e.g. @-moz-keyframes.
   (concat css-nmchar-re "+"))

Though I'm unsure what 'css-nmstart-re' is intended to contain, since
it's missing a docstring. Maybe Stefan knows?

-- Simen





  reply	other threads:[~2015-10-06 19:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-06 17:57 bug#21638: 25.0.50; font-lock for CSS variables Tom Tromey
2015-10-06 19:24 ` Simen Heggestøyl [this message]
2015-10-06 21:10   ` Tom Tromey
2015-10-07 17:28     ` 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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mvvvkdfe.fsf@gmail.com \
    --to=simenheg@gmail.com \
    --cc=21638@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=tom@tromey.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 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).