scss-mode icon indicating copy to clipboard operation
scss-mode copied to clipboard

Improve single- and multi-line comment support

Open jacksonrayhamilton opened this issue 9 years ago • 11 comments

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 avatar Mar 21 '15 20:03 jacksonrayhamilton

Bump. Interested in these updates?

jacksonrayhamilton avatar Apr 06 '15 17:04 jacksonrayhamilton

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

antonj avatar Apr 06 '15 18:04 antonj

Whoops. Try it now.

jacksonrayhamilton avatar Apr 06 '15 18:04 jacksonrayhamilton

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

jacksonrayhamilton avatar Apr 06 '15 19:04 jacksonrayhamilton

Hey there. Is this working for you now?

jacksonrayhamilton avatar May 15 '15 17:05 jacksonrayhamilton

Bump.

jacksonrayhamilton avatar Jun 06 '15 04:06 jacksonrayhamilton

Time for another bump.

jacksonrayhamilton avatar Oct 31 '15 03:10 jacksonrayhamilton

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.

notetiene avatar Feb 08 '16 19:02 notetiene

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.

jacksonrayhamilton avatar Feb 08 '16 20:02 jacksonrayhamilton

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

notetiene avatar Feb 08 '16 22:02 notetiene

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.

jacksonrayhamilton avatar Feb 08 '16 23:02 jacksonrayhamilton