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

Enable syntax highlighting for emacs #3

Merged
merged 2 commits into from
Mar 13, 2017

Conversation

casey
Copy link
Contributor

@casey casey commented Mar 13, 2017

Adds a local variable block in the justfile to enable syntax highlighting under emacs.

PS This is a sweet project! I started doing something similar, but yours has many more features. Feel free to cannibalize anything you want from mine. It think the only things that yours is missing that mine has is a simple .travis.yml, as well as a bunch of convenience recipes.

@ssokolow
Copy link
Owner

I welcome the emacs syntax highlight, but could you either use the single-line syntax which Python 2.x uses for character coding overrides (# -*- coding: utf-8 -*- ) or move it above the Vim modeline? (Or both, ideally, since Vim doesn't have a multi-line version, so "emacs above Vim" would be the least footgunny way to end the file.)

Vim only looks within a certain number of lines of the beginning and end of the file (5 by default) and I'd rather not have Vim break unexpectedly some day because someone enhanced the Emacs settings and it grew longer than 4 lines.

Also, thanks for giving me the opportunity to remember that I wanted to add an .editorconfig file to communicate my rustfmt settings to editors in a portable manner.

@casey
Copy link
Contributor Author

casey commented Mar 13, 2017

From this page, it seems that emacs only recognizes the single line form on the first line of a file.

It recognizes the multi-line form as long as it is within 3000 characters of the end of the file, so it should be safe to use that, and put it above the vim modeline. (Stranger things have happened, but it seems unlikely that the vim modeline would balloon to more than 3000 characters.)

@ssokolow ssokolow merged commit aa08d22 into ssokolow:master Mar 13, 2017
@ssokolow
Copy link
Owner

Thanks. Merged. :)

ssokolow pushed a commit that referenced this pull request Mar 13, 2017
ssokolow pushed a commit that referenced this pull request Mar 13, 2017
(Borrowed from casey/boilerplate under "MIT or Apache 2.0" terms as
 encouraged in issue #3)
@ssokolow
Copy link
Owner

ssokolow commented Mar 13, 2017

Feel free to cannibalize anything you want from mine.

I've borrowed your .travis.yml and written my own CONTRIBUTING.md inspired by yours. The justfile, brev, and comparing your and my tweaks to main.rs will have to wait until I can spare more time.

@ssokolow
Copy link
Owner

ssokolow commented Mar 13, 2017

Oh, and I did notice one other difference between our approaches. You have a CUSTOMIZING.md while I've been very careful to limit my "how to start a new project" list to...

cargo new --template rust-cli-boilerplate fooproject
cd fooproject
rm README.md

...to make it as effortless as possible. (That's why I phrased my new CONTRIBUTING.md the way I did.)

@casey
Copy link
Contributor Author

casey commented Mar 13, 2017

That's pretty nice, I didn't know that cargo allowed specifying a template like that.

@ssokolow
Copy link
Owner

The feature has been a long time coming, but got merged into nightly on February 1st and I'm now just waiting for it to ride its way down to stable channel so I don't have to futz around with rustup run nightly ....

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.

2 participants