antonj / scss-mode

Emacs mode for SCSS files (http://sass-lang.com)
200 stars 39 forks source link

Improve single- and multi-line comment support #31

Open jacksonrayhamilton opened 9 years ago

jacksonrayhamilton commented 9 years ago

Oftentimes when browsing SCSS files I stumble across a comment that flies off the screen. Habitually I place point inside the comment and do M-q with the expectation that Emacs will magically prevent any words from spanning across the sacred 80-column mark. But alas, when I do that, the following

// Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children.

becomes

// Blessed is he who, in the name of charity and good will, shepherds the weak
through the valley of darkness, for he is truly his brother's keeper and the
finder of lost children.

Another issue: I want my multi-line comments to have stars along the left side. But when I try to fill this:

/*
 * Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children.
 */

I get this:

/* * Blessed is he who, in the name of charity and good will, shepherds the weak
through the valley of darkness, for he is truly his brother's keeper and the
finder of lost children.  */

With this PR, indentation will instead behave as expected for the aforementioned cases, respectively:

// Blessed is he who, in the name of charity and good will, shepherds the weak
// through the valley of darkness, for he is truly his brother's keeper and the
// finder of lost children.
/*
 * Blessed is he who, in the name of charity and good will, shepherds the weak
 * through the valley of darkness, for he is truly his brother's keeper and the
 * finder of lost children.
 */
jacksonrayhamilton commented 9 years ago

Bump. Interested in these updates?

antonj commented 9 years ago

Yes, just tried it, I get an error fill-paragraph: Symbol's function definition is void: c-fill-paragraph though...

jacksonrayhamilton commented 9 years ago

Whoops. Try it now.

jacksonrayhamilton commented 9 years ago

Added an additional fix for M-j when within a multiline comment.

jacksonrayhamilton commented 9 years ago

Hey there. Is this working for you now?

jacksonrayhamilton commented 9 years ago

Bump.

jacksonrayhamilton commented 9 years ago

Time for another bump.

notetiene commented 8 years ago

I'm seconding @jacksonrayhamilton. Is this project dead? Else, I'll fork it since I've got several useful functions to be added to the mode.

jacksonrayhamilton commented 8 years ago

FWIW, Emacs 25 is providing its own scss-mode which is almost the same as this one. (It's embedded inside css-mode.el on Emacs' master branch.) Might be better to focus our energy there, instead.

notetiene commented 8 years ago

@jacksonrayhamilton Thanks for the info! Native Emacs doesn't (and shouldn't?) implement something like rainbow-mode. It's sad that Emacs doesn't include things like that as Sublime does. The compilation process is also not present.

jacksonrayhamilton commented 8 years ago

IMO, it's no big deal if the editor doesn't ship with some packages. That's the great thing about an extensible editor, and an extensible language like LISP: It's easy to add anything you want.

For compilation in particular, I don't think it's necessary for that to be built into SCSS mode. That belongs in a build file, which one can run via a keybinding. External build systems decouple your project from a particular editor, which avoids vendor lock-in and allows anyone on a team to use their favorite IDE.