unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23188: [PATCH] Support completion of at-rules in SCSS mode
@ 2016-04-01 19:57 Etienne Prud'homme
  2016-04-03 11:18 ` Simen Heggestøyl
  0 siblings, 1 reply; 4+ messages in thread
From: Etienne Prud'homme @ 2016-04-01 19:57 UTC (permalink / raw)
  To: 23188

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

The attached patch adds support for at-rules completion in SCSS mode.
It’s more or less the same code from bug#23135 (Support completion of
bang-rules in CSS mode).

[-- Attachment #2: 0001-Support-completion-of-at-rules-in-SCSS-mode.patch --]
[-- Type: text/x-patch, Size: 1909 bytes --]

From 4ad8f21f11ed9c48f986cfdd8d50883389fa8d2a Mon Sep 17 00:00:00 2001
From: Etienne Prud'homme <e.e.f.prudhomme@gmail.com>
Date: Fri, 1 Apr 2016 15:09:15 -0400
Subject: [PATCH] Support completion of at-rules in SCSS mode

---
 lisp/textmodes/css-mode.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index cbef3d4..02a5b11 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -56,6 +56,15 @@
   '("charset" "font-face" "import" "media" "namespace" "page")
   "Identifiers that appear in the form @foo.")
 
+(defconst scss-at-ids
+  '("at-root" "content" "debug" "each" "else" "else if" "error" "extend" "for"
+    "function" "if" "import" "include" "mixin" "return" "warn" "while")
+  "Additional identifiers that appear in the form @foo in SCSS.")
+
+(defvar css--at-ids css-at-ids
+  "List of at-rules for the current mode.")
+(make-variable-buffer-local 'css--at-ids)
+
 (defconst css-bang-ids
   '("important")
   "Identifiers that appear in the form !foo.")
@@ -759,7 +768,7 @@ cannot be completed sensibly: `angle', `element-reference',
     (let ((pos (point)))
       (skip-chars-backward "-[:alnum:]")
       (when (eq (char-before) ?\@)
-        (list (point) pos css-at-ids)))))
+        (list (point) pos css--at-ids)))))
 
 (defvar css--property-value-cache
   (make-hash-table :test 'equal :size (length css-property-alist))
@@ -969,6 +978,7 @@ pseudo-elements, pseudo-classes, at-rules, and bang-rules."
   (setq-local comment-continue " *")
   (setq-local comment-start-skip "/[*/]+[ \t]*")
   (setq-local comment-end-skip "[ \t]*\\(?:\n\\|\\*+/\\)")
+  (setq-local css--at-ids (append css-at-ids scss-at-ids))
   (setq-local css--bang-ids (append css-bang-ids scss-bang-ids))
   (setq-local font-lock-defaults
               (list (scss-font-lock-keywords) nil t)))
-- 
2.8.0


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

* bug#23188: [PATCH] Support completion of at-rules in SCSS mode
  2016-04-01 19:57 bug#23188: [PATCH] Support completion of at-rules in SCSS mode Etienne Prud'homme
@ 2016-04-03 11:18 ` Simen Heggestøyl
  2016-04-04 19:44   ` Etienne Prud'homme
  0 siblings, 1 reply; 4+ messages in thread
From: Simen Heggestøyl @ 2016-04-03 11:18 UTC (permalink / raw)
  To: Etienne Prud'homme; +Cc: 23188

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

Hello, Etienne.

Many thanks for the patch. I've tested it and it seems to work as
intended.

Have you made a copyright assignment to the FSF before? Otherwise I
think we can mark the patch exempt, since it changes just a few lines.

Also, the commit message should follow the format described in
CONTRIBUTE (see section "Commit messages"). I can fix this for you if
you want to.

-- Simen

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

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

* bug#23188: [PATCH] Support completion of at-rules in SCSS mode
  2016-04-03 11:18 ` Simen Heggestøyl
@ 2016-04-04 19:44   ` Etienne Prud'homme
  2016-04-05 21:18     ` Simen Heggestøyl
  0 siblings, 1 reply; 4+ messages in thread
From: Etienne Prud'homme @ 2016-04-04 19:44 UTC (permalink / raw)
  To: Simen Heggestøyl; +Cc: 23188

On Sun, 03 Apr 2016 13:18:30 +0200,
Simen Heggestøyl <simenheg@gmail.com> wrote:

> Also, the commit message should follow the format described in
> CONTRIBUTE (see section "Commit messages"). I can fix this for you if
> you want to.

Thanks for pointing me that out. Could you fix it, since it’s the first
time I contribute to a GNU project and I’m not sure how to do it?

Best regards,





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

* bug#23188: [PATCH] Support completion of at-rules in SCSS mode
  2016-04-04 19:44   ` Etienne Prud'homme
@ 2016-04-05 21:18     ` Simen Heggestøyl
  0 siblings, 0 replies; 4+ messages in thread
From: Simen Heggestøyl @ 2016-04-05 21:18 UTC (permalink / raw)
  To: Etienne Prud'homme; +Cc: 23188-done

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

On Mon, Apr 4, 2016 at 9:44 PM, Etienne Prud'homme 
<e.e.f.prudhomme@gmail.com> wrote:
> Thanks for pointing me that out. Could you fix it, since it’s the 
> first
> time I contribute to a GNU project and I’m not sure how to do it?
> 
> Best regards,

No problem. Fixed and installed in master.

Thanks again!

-- Simen

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

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

end of thread, other threads:[~2016-04-05 21:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-01 19:57 bug#23188: [PATCH] Support completion of at-rules in SCSS mode Etienne Prud'homme
2016-04-03 11:18 ` Simen Heggestøyl
2016-04-04 19:44   ` Etienne Prud'homme
2016-04-05 21:18     ` 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).