Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve single- and multi-line comment support #31

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jacksonrayhamilton
Copy link

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.
 */

Use single-line comments for `comment-region' and respect them for
`fill-paragraph'.  Make `fill-paragraph' behave like `js2-mode', which
is pretty good at handling "//" and "/**/" comments.
@jacksonrayhamilton
Copy link
Author

Bump. Interested in these updates?

@antonj
Copy link
Owner

antonj commented Apr 6, 2015

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

@jacksonrayhamilton
Copy link
Author

Whoops. Try it now.

@jacksonrayhamilton
Copy link
Author

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

@jacksonrayhamilton
Copy link
Author

Hey there. Is this working for you now?

@jacksonrayhamilton
Copy link
Author

Bump.

@jacksonrayhamilton
Copy link
Author

Time for another bump.

@notetiene
Copy link

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
Copy link
Author

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
Copy link

@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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants