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

new recipe: psci #2124

Merged
merged 1 commit into from
Oct 29, 2014
Merged

new recipe: psci #2124

merged 1 commit into from
Oct 29, 2014

Conversation

ardumont
Copy link
Contributor

Hello, here is psci (purescript repl) major mode.

https://github.com/ardumont/emacs-psci.git

I'm the maintainer.

Package creation ok

Install package ok.

Package creation ok + install package ok.
@purcell
Copy link
Member

purcell commented Oct 29, 2014

Thanks!

You'll need to depend on (emacs "24.3") because you're using setq-local. Better would be to just use (set (make-local-variable 'var-name) val) instead, so that people with older versions can still use the code.

It seems very odd to me that this major mode would rely on the projectile minor mode. It looks like you're just using projectile-project-root. There must be a better solution.

Also, you should quote the names of shell command arguments. (format "rm -rf %s" ...) strikes fear into my heart! What if the dir name has spaces in it? shell-quote-argument is your friend... :-)

Finally, instead of unconditionally modifying purescript-mode-map here, define a minor mode which the user can optionally enable.

Hope that helps!

@ardumont
Copy link
Contributor Author

Hello,

You'll need to depend on (emacs "24.3") because you're using setq-local. Better would be to just use (set (make-local-variable 'var-name) val) instead, so that people with older versions can still use the code.

Yes! Thanks for this.
I really love it when you take the time to give such information, thanks!

It seems very odd to me that this major mode would rely on the projectile minor mode. It looks like you're just using projectile-project-root. There must be a better solution.

There surely is!
That's what I meant here https://github.com/ardumont/emacs-psci#miscellaneous.
I indeed want just to determine the root folder (the one holding .psci).
As a correctness approach, I wanted to get this out of the way first.
Then removed unneeded deps.

Also, you should quote the names of shell command arguments. (format "rm -rf %s" ...) strikes fear into my heart! What if the dir name has spaces in it? shell-quote-argument is your friend... :-)

Thanks!
It did not shock me until now!

Finally, instead of unconditionally modifying purescript-mode-map here, define a minor mode which the user can optionally enable.

Lol, indeed, now that you mention it!
Adding a minor mode and then hooking it to purescript-mode seems way more acceptable!

Thanks again for the heads up!!

I will take all of this into consideration for the future version!

Cheers,

@purcell
Copy link
Member

purcell commented Oct 29, 2014

Happy to help.

I indeed want just to determine the root folder (the one holding .psci).

Here's how to get the root folder, then:

(locate-dominating-file default-directory ".psci")

@ardumont
Copy link
Contributor Author

Happy to help.

Yes. I enjoy helping too (when I can :D)
And I enjoy being helped too!

I indeed want just to determine the root folder (the one holding .psci).

Here's how to get the root folder, then:

(locate-dominating-file default-directory ".psci")

Thanks.
I'm working on modifications right now.

Cheers,

@purcell
Copy link
Member

purcell commented Oct 29, 2014

As an additional nitpick, I'd suggest you remove the version var and function. It simply won't return a meaningful value in most cases. Just rely on the package version.

Finally, I strongly suggest avoiding the psci/ prefix. It should simply be psci-, as per the elisp tradition. The / has arrived from Clojure, but it is not idiomatic, even if you've seen it elsewhere. For private identifiers, use psci--.

@ardumont
Copy link
Contributor Author

As an additional nitpick, I'd suggest you remove the version var and function. It simply won't return a meaningful value in most cases. Just rely on the package version.

Ok.

Finally, I strongly suggest avoiding the psci/ prefix. It should simply be psci-, as per the elisp tradition. The / has arrived from Clojure, but it is not idiomatic, even if you've seen it elsewhere. For private identifiers, use psci--.

Arf, I like the / better than simply - (and indeed, it's clojure written all other it :)
It's simpler and clearer to read with a / than the simple -.
(It's also true for the /-- versus --)

strongly

why strongly?

Cheers,

@ardumont
Copy link
Contributor Author

Hop!
All done (except for the namespace delimiter :)...

Cheers,

@purcell
Copy link
Member

purcell commented Oct 29, 2014

why strongly?

https://www.gnu.org/software/emacs/manual/html_node/elisp/Coding-Conventions.html

Different languages have different conventions, and "-" is the Emacs convention, just like "/" is the Clojure convention. I could technically choose to name my elisp symbols just_like_this if I wanted, but the argument that it looks nice and works well for Ruby is not a very convincing one. :-)

I'm not going to refuse to merge this just because of the /, but I really think it's worth reconsidering.

purcell added a commit that referenced this pull request Oct 29, 2014
@purcell purcell merged commit a0f4526 into melpa:master Oct 29, 2014
@ardumont ardumont deleted the add-new-recipe-psci branch October 30, 2014 10:26
@ardumont
Copy link
Contributor Author

Hello,

https://www.gnu.org/software/emacs/manual/html_node/elisp/Coding-Conventions.html

Yes, of course conventions.
I read it some time ago but a refresher is always good!

It's good to follow conventions but we can bend them a little sometimes, don't you think?
(Otherwise, if we systematically stick to the established rules or conventions, we would never improve or create anything...)

Also, for me, in this case, readability is more important than convention.

Different languages have different conventions, and "-" is the Emacs convention, just like "/" is the Clojure convention. I could technically choose to name my elisp symbols just_like_this if I wanted, but the argument that it looks nice and works well for Ruby is not a very convincing one. :-)

Yes, but I do not follow this one because it works well in clojure or look nice.
I follow it because I believe the readability is better.

When I read the namespace/my-function, my brain can drop the namespace name and focus on the my-function name.
I also distinguish more easily between private and public identifiers this way.

(Could it be because I have a bad vision?)

I'm not going to refuse to merge this just because of the /,

Cool, thanks.

but I really think it's worth reconsidering.

Well, I hope you know me a little by now, I'm a reasonable guy so sure I'll give it some thought.
Fortunately, those modifications are transparent for the recipe.

Again, thanks for the exchange, feedback, information.
It's cool to work that way.

Cheers,

@purcell purcell added the recipes label Nov 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants