unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* SCSS parser ideas
@ 2016-04-05 20:51 Etienne Prud'homme
  2016-04-05 21:05 ` Alex Dunn
  0 siblings, 1 reply; 6+ messages in thread
From: Etienne Prud'homme @ 2016-04-05 20:51 UTC (permalink / raw)
  To: emacs-devel

Since I study in the field of Front-End web development, I find it sad
that Emacs lacks features that would otherwise be included in other
text-editors.

One feature that is lacking is discovering SCSS variable values. I’m
thinking something like Eldoc is doing for function declarations in C
or Emacs lisp.

Given that SCSS is a Preprocessor, it’s possible to evaluate a variable
by simply parsing a file. Unless a file changes, a variable will always
stay the same.

I made a basic prototype parser in elisp that did a hash map of all
variable declarations from a buffer. However, I don’t think it’s
suitable in the long-term.

Since I’ve got no experience in grammar parsing implementation, I was
wondering if it could be worth making a CEDET Semantic SCSS parser
(and thus CSS one). It would give much more flexibility. We could
include variables from other files, functions and mixins support or
even a CSS tree structure of a project.

Best regards,



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

* Re: SCSS parser ideas
  2016-04-05 20:51 SCSS parser ideas Etienne Prud'homme
@ 2016-04-05 21:05 ` Alex Dunn
  2016-04-06  2:00   ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Dunn @ 2016-04-05 21:05 UTC (permalink / raw)
  To: Etienne Prud'homme, emacs-devel

I think better built-in support for SCSS would be very welcome,
especially since development of both the scss-mode
(https://github.com/antonj/scss-mode) and sass-mode
(https://github.com/nex3/sass-mode) external packages seems to have
ceased.

Etienne Prud'homme <e.e.f.prudhomme@gmail.com> writes:

> Since I study in the field of Front-End web development, I find it sad
> that Emacs lacks features that would otherwise be included in other
> text-editors.
>
> One feature that is lacking is discovering SCSS variable values. I’m
> thinking something like Eldoc is doing for function declarations in C
> or Emacs lisp.
>
> Given that SCSS is a Preprocessor, it’s possible to evaluate a variable
> by simply parsing a file. Unless a file changes, a variable will always
> stay the same.
>
> I made a basic prototype parser in elisp that did a hash map of all
> variable declarations from a buffer. However, I don’t think it’s
> suitable in the long-term.
>
> Since I’ve got no experience in grammar parsing implementation, I was
> wondering if it could be worth making a CEDET Semantic SCSS parser
> (and thus CSS one). It would give much more flexibility. We could
> include variables from other files, functions and mixins support or
> even a CSS tree structure of a project.
>
> Best regards,



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

* Re: SCSS parser ideas
  2016-04-05 21:05 ` Alex Dunn
@ 2016-04-06  2:00   ` Stefan Monnier
  2016-04-06 16:23     ` Etienne Prud'homme
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2016-04-06  2:00 UTC (permalink / raw)
  To: emacs-devel

> I think better built-in support for SCSS would be very welcome,
> especially since development of both the scss-mode
> (https://github.com/antonj/scss-mode)

What does it offer that Emacs's latest css-mode.el lacks?
[ I don't mean it in a disparaging way, but more as a way to plan for
  what needs to be done.  ]


        Stefan




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

* Re: SCSS parser ideas
  2016-04-06  2:00   ` Stefan Monnier
@ 2016-04-06 16:23     ` Etienne Prud'homme
  2016-04-06 20:37       ` Simen Heggestøyl
  2016-04-07 12:23       ` Stefan Monnier
  0 siblings, 2 replies; 6+ messages in thread
From: Etienne Prud'homme @ 2016-04-06 16:23 UTC (permalink / raw)
  To: emacs-devel

> What does it offer that Emacs's latest css-mode.el lacks?

Third-party SCSS executable. It supports flymake and allows
compiling directly when we save.

Sass has a too different syntax to be included in css-mode.



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

* Re: SCSS parser ideas
  2016-04-06 16:23     ` Etienne Prud'homme
@ 2016-04-06 20:37       ` Simen Heggestøyl
  2016-04-07 12:23       ` Stefan Monnier
  1 sibling, 0 replies; 6+ messages in thread
From: Simen Heggestøyl @ 2016-04-06 20:37 UTC (permalink / raw)
  To: Etienne Prud'homme; +Cc: emacs-devel

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

 > One feature that is lacking is discovering SCSS variable values. 
I’m
 > thinking something like Eldoc is doing for function declarations in C
 > or Emacs lisp.

I'm not sure I understand what you mean. Would you like to be able to
evaluate the value of a SCSS variable (like `C-x C-e' in Emacs Lisp
mode)?

 > Since I study in the field of Front-End web development, I find it 
sad
 > that Emacs lacks features that would otherwise be included in other
 > text-editors.

Which other editors? I'd like to try them to get a better idea of the
features they provide for SCSS editing. Maybe we can get inspiration
from them.

-- Simen

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

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

* Re: SCSS parser ideas
  2016-04-06 16:23     ` Etienne Prud'homme
  2016-04-06 20:37       ` Simen Heggestøyl
@ 2016-04-07 12:23       ` Stefan Monnier
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2016-04-07 12:23 UTC (permalink / raw)
  To: emacs-devel

>> What does it offer that Emacs's latest css-mode.el lacks?
> Third-party SCSS executable.

IIUC scss-mode does not actually provide a third-party executable, right?
It just uses one if available.

> It supports flymake and allows compiling directly when we save.

We can probably re-use scss-mode's code for that.  We should figure out
who's the author of the code and then make sure he's OK with it (and
get his copyright paperwork if it's a non-trivial amount of code).

> Sass has a too different syntax to be included in css-mode.

Indeed.


        Stefan




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

end of thread, other threads:[~2016-04-07 12:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-05 20:51 SCSS parser ideas Etienne Prud'homme
2016-04-05 21:05 ` Alex Dunn
2016-04-06  2:00   ` Stefan Monnier
2016-04-06 16:23     ` Etienne Prud'homme
2016-04-06 20:37       ` Simen Heggestøyl
2016-04-07 12:23       ` Stefan Monnier

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).