Magic Comments

114 views
Skip to first unread message

pedz

unread,
May 12, 2013, 9:31:34 AM5/12/13
to emacs-o...@googlegroups.com
This is a suggestion.  If folks seem to like it I may take a stab at implementing it.

The problem is the typical Rails philosophy is that we separate everything into separate files.  We put the javascript here, the CSS there, the view other yonder.  There is no real standard of where folks put these three pieces.

I'm thinking it would be nice if we could add comments.  e.g. in the javascript file we add comments that point us to the view and the CSS for that piece.  etc.  The point is to add a way to layer, on top of the existing web of connections rinari already knows about, customizable connections between various pieces of code.

Thoughts?

(I was going to create an issue on the git repository.  I'm not sure which one gets more views.)

Dmitry Gutov

unread,
May 12, 2013, 7:45:54 PM5/12/13
to pedz, public-emacs-on-rails-...@plane.gmane.org


pedz <pedzsan-Re5JQEe...@public.gmane.org> writes:

> This is a suggestion. If folks seem to like it I may take a stab at
> implementing it.
>
> The problem is the typical Rails philosophy is that we separate
> everything into separate files. We put the javascript here, the CSS
> there, the view other yonder. There is no real standard of where folks
> put these three pieces.
>
> I'm thinking it would be nice if we could add comments. e.g. in the
> javascript file we add comments that point us to the view and the CSS
> for that piece. etc. The point is to add a way to layer, on top of the
> existing web of connections rinari already knows about, customizable
> connections between various pieces of code.
>
> Thoughts?

Following the principle of convention over configuration, your js, css
and view files organization probably also follows some project-wide
convention.

In that case, instead of writing magic comments in every file, maybe you
should be able to extend the jump.el specs to new file types and then
use them in existing and new commands.

Chris Thompson

unread,
May 12, 2013, 7:48:54 PM5/12/13
to emacs-o...@googlegroups.com

I like Dmitry's idea.

--

---
You received this message because you are subscribed to the Google Groups "Rails On Emacs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emacs-on-rail...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Dmitry Gutov

unread,
May 28, 2013, 10:07:36 PM5/28/13
to pedz, public-emacs-on-rails-...@plane.gmane.org


> In that case, instead of writing magic comments in every file, maybe you
> should be able to extend the jump.el specs to new file types and then
> use them in existing and new commands.

Here's an example of something similar from the Vim world:

http://robots.thoughtbot.com/post/50107717967/extending-rails-vim-with-custom-commands

Reply all
Reply to author
Forward
0 new messages