Subject: bug#23188: closed (Re: bug#23188: [PATCH] Support completion of at-rules in SCSS mode)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 05 Apr 2016 21:19:02 +0000

Your bug report

#23188: [PATCH] Support completion of at-rules in SCSS mode

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
23188: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23188
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#23188: [PATCH] Support completion of at-rules in SCSS mode
From: Simen Heggestøyl <[email-masked]>
To: Etienne Prud'homme <[email-masked]>
Cc: [email-masked]
Date: Tue, 05 Apr 2016 23:18:46 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

On Mon, Apr 4, 2016 at 9:44 PM, Etienne Prud'homme 
<[email-masked]> 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

Subject: [PATCH] Support completion of at-rules in SCSS mode
From: Etienne Prud'homme <[email-masked]>
To: [email-masked]
Date: Fri, 1 Apr 2016 15:57:07 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

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).
>From 4ad8f21f11ed9c48f986cfdd8d50883389fa8d2a Mon Sep 17 00:00:00 2001
From: Etienne Prud'homme <[email-masked]>
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