all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Simen Heggestøyl" <simenheg@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, 22211@debbugs.gnu.org
Subject: bug#22211: [PATCH] Add a face for CSS/SCSS variables
Date: Sun, 27 Dec 2015 19:38:30 +0100	[thread overview]
Message-ID: <1451241510.20532.1@smtp.gmail.com> (raw)
In-Reply-To: <87d1treog7.fsf@gnus.org>


[-- Attachment #1.1: Type: text/plain, Size: 234 bytes --]

On Sun, Dec 27, 2015 at 7:28 PM, Lars Ingebrigtsen <larsi@gnus.org> 
wrote:
> The patch is corrupted.  Try including it as an attachment instead.

Thanks for catching that, Lars. I've included it as an attachement 
instead.

-- Simen

[-- Attachment #1.2: Type: text/html, Size: 372 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Highlight-CSS-variables-with-variable-name-face.patch --]
[-- Type: text/x-patch, Size: 1728 bytes --]

From 84bea3c332b32626d0579e8f8be164d832d0a557 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simen=20Heggest=C3=B8yl?= <simenheg@gmail.com>
Date: Sun, 27 Dec 2015 19:12:58 +0100
Subject: [PATCH] Highlight CSS variables with variable name face

* lisp/textmodes/css-mode.el (css-nmstart-re): Don't match variables.
(css--font-lock-keywords): Highlight variables in
`font-lock-variable-name-face'.
---
 lisp/textmodes/css-mode.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index 3e84b43..0bcd1ee 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -215,7 +215,7 @@ css-syntax-propertize-function
 (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 "+"))
@@ -246,6 +246,8 @@ css--font-lock-keywords
     ;; Since "An at-rule consists of everything up to and including the next
     ;; semicolon (;) or the next block, whichever comes first."
     (,(concat "@" css-ident-re) (0 font-lock-builtin-face))
+    ;; Variables.
+    (,(concat "--" css-ident-re) (0 font-lock-variable-name-face))
     ;; Selectors.
     ;; FIXME: attribute selectors don't work well because they may contain
     ;; strings which have already been highlighted as f-l-string-face and
-- 
2.6.4


  reply	other threads:[~2015-12-27 18:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-19 11:12 bug#22211: [PATCH] Add a face for CSS/SCSS variables Simen Heggestøyl
2015-12-19 14:18 ` Stefan Monnier
2015-12-27 18:19   ` Simen Heggestøyl
2015-12-27 18:28     ` Lars Ingebrigtsen
2015-12-27 18:38       ` Simen Heggestøyl [this message]
2016-01-31 14:29         ` 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=1451241510.20532.1@smtp.gmail.com \
    --to=simenheg@gmail.com \
    --cc=22211@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    /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.