proton

https://github.com/dvcrn/proton
dvcrn 2016-01-29T09:34:31.000213Z

@austincrft: merged 🎉

dvcrn 2016-01-29T09:34:43.000214Z

@geksilla: it would be great if we could build automatic path discovery into proton (somehow)

dvcrn 2016-01-29T09:34:51.000215Z

It also annoys me to launch atom from the command line

dvcrn 2016-01-29T09:35:06.000216Z

I played a little bit with it but couldn’t even get the fixes from that issue working

geksilla 2016-01-29T09:43:13.000217Z

@dvcrn yes, I will try to use service provided by environment package. Will see if we can reset process.env.PATH

dvcrn 2016-01-29T09:43:51.000218Z

We just might need to do it somehow before other packages load

dvcrn 2016-01-29T09:44:01.000219Z

e.g. if Elixir loads before we set the env path it will throw an error

dvcrn 2016-01-29T09:44:04.000220Z

that’s problematic

dvcrn 2016-01-29T09:46:55.000221Z

one idea would be to force-deactivate all packages, let proton do it’s thing and then proton re-loads all of them. another one would be to continue what we do already but reload all packages after we set the env. Though the user will still get the errors first

geksilla 2016-01-29T09:49:33.000222Z

is iex package fails on start?

dvcrn 2016-01-29T09:50:59.000223Z

that’s one of them yes

dvcrn 2016-01-29T09:51:05.000224Z

everything that needs a path basically

geksilla 2016-01-29T09:52:06.000225Z

I will try to fix this or found some workaround

geksilla 2016-01-29T09:52:32.000226Z

btw proto-repl will support nRepl connection soon.

geksilla 2016-01-29T09:53:27.000227Z

PR regarding nRepl remote connection merged.

geksilla 2016-01-29T09:53:47.000228Z

so I hope that on the next week it will be released

dvcrn 2016-01-29T09:57:49.000230Z

ohh that would be amazing

dvcrn 2016-01-29T09:58:57.000231Z

the only things where I’m still using spacemacs is: a) REPL integration b) indentation. Sadly atoms auto-indent is really bad compared to what emacs has

geksilla 2016-01-29T10:00:17.000232Z

yeah indentation not the best one(

geksilla 2016-01-29T10:00:59.000233Z

but it much better than it was on previous versions )

martinklepsch 2016-01-29T10:47:13.000234Z

@dvcrn: @geksilla do you know if it's possible to get highlighting of namespace segments in vars similar to how clojure-mode does it?

geksilla 2016-01-29T10:49:55.000237Z

its possible but you need to edit grammar

geksilla 2016-01-29T10:50:07.000238Z

i'm not pro for grammar patterns

martinklepsch 2016-01-29T10:50:24.000239Z

yeah, just found this: https://github.com/atom/language-clojure/blob/master/grammars/clojure.cson#L276-L286

geksilla 2016-01-29T10:53:30.000241Z

i've tried service from environment and it doesn't fix the path (

martinklepsch 2016-01-29T10:56:39.000242Z

do you know if there's a way to edit the grammar or styling for an existing/loaded package?

geksilla 2016-01-29T11:13:49.000243Z

I believe that there is no way to simply define custom user grammar

geksilla 2016-01-29T11:14:15.000244Z

you need to create grammar package and link it

geksilla 2016-01-29T11:15:05.000245Z

your grammar can be injected to existing one

geksilla 2016-01-29T11:15:22.000246Z

for example https://github.com/atom/language-todo

geksilla 2016-01-29T11:15:54.000250Z

in your case injectionSelector probably will be source.clojure

geksilla 2016-01-29T11:20:29.000251Z

but in this case i think it would be better to create issue or send PR to language-clojure

geksilla 2016-01-29T11:20:30.000252Z

)

geksilla 2016-01-29T11:25:14.000253Z

there is also another way

geksilla 2016-01-29T11:25:36.000254Z

you can load your custom grammar from init.coffee

geksilla 2016-01-29T11:27:14.000255Z

run Command Palette and type init script

geksilla 2016-01-29T11:27:37.000256Z

select Application: Open your init script

martinklepsch 2016-01-29T11:28:35.000257Z

opened this for tracking https://github.com/atom/language-clojure/issues/36

👍 1
martinklepsch 2016-01-29T11:32:38.000259Z

@geksilla: do you have a snippet of how this can be done in init.coffee by any chance?

martinklepsch 2016-01-29T11:32:56.000260Z

I found some stuff related to injections but these all seemed to assume .cson files

geksilla 2016-01-29T11:33:17.000261Z

i'm testing right now, will send in minute

geksilla 2016-01-29T11:35:28.000262Z

@martinklepsch: are you on linux, mac, windows?

martinklepsch 2016-01-29T11:35:42.000263Z

mac

geksilla 2016-01-29T11:35:45.000264Z

cool

martinklepsch 2016-01-29T11:35:53.000265Z

@geksilla: thanks a lot for taking the time, appreciate it 👍

geksilla 2016-01-29T11:36:20.000267Z

create file user-grammar.cson in ~/.atom/

geksilla 2016-01-29T11:37:03.000268Z

with minimal content

'scopeName': 'mygrammar'

geksilla 2016-01-29T11:37:38.000269Z

Like

echo "'scopeName': 'mygrammar'" > ~/.atom/user-grammar.cson

martinklepsch 2016-01-29T11:37:54.000271Z

done

geksilla 2016-01-29T11:38:00.000272Z

open init.coffee script

geksilla 2016-01-29T11:38:26.000273Z

and put following content:

path = require 'path'

atom.grammars.loadGrammarSync(path.join(process.env.ATOM_HOME, './user-grammar.cson'))

geksilla 2016-01-29T11:39:21.000274Z

reload atom and try to add some rules to ~/.atom/user-grammar.cson

martinklepsch 2016-01-29T11:42:44.000275Z

sweeeeeeeeet! 🎉

geksilla 2016-01-29T11:45:17.000276Z

to check out that your grammar loaded open dev tools and execute snippet:

atom.grammars.grammars.filter(x => x.scopeName === 'mygrammar')

geksilla 2016-01-29T11:48:51.000278Z

here is user-grammar.cson i've tested:

'name': 'MyGrammar'
'scopeName': 'mygrammar'
'injectionSelector': 'source.coffee'
'patterns': [
  {
    'match': 'atom'
    'name': 'variable.assigment.coffee'
  }
]

geksilla 2016-01-29T11:49:27.000279Z

you will see that word atom highlighted in your init.coffee

martinklepsch 2016-01-29T11:56:42.000280Z

I just copied the clojure.cson and modified some stuff and after reloading my changes become visible

geksilla 2016-01-29T11:56:52.000281Z

cool

geksilla 2016-01-29T11:58:13.000282Z

you can also edit ~/.atom/packages/language-clojure/grammars/clojure.cson

geksilla 2016-01-29T12:00:37.000283Z

oh, sorry I've missed existing/loaded package (

geksilla 2016-01-29T12:00:51.000284Z

from your comment

martinklepsch 2016-01-29T12:01:28.000285Z

yeah, I was thinking I could just fiddle inside .atom but the file is not there

geksilla 2016-01-29T12:01:45.000286Z

but we found the way to define and load custom grammar )

martinklepsch 2016-01-29T12:02:43.000287Z

so I think there is actually a way symbols and their namespaces are separated, I assume that just most themes don't differentiate them

martinklepsch 2016-01-29T12:03:24.000288Z

'namespace-symbol':
    'patterns': [
      { # copied from #symbol, plus a / at the end. Matches the "app/" part of
        # "app/*config*"
        'match': '([\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]+)/'
        'captures':
          '1':
            'name': 'meta.symbol.namespace.clojure'
      }
    ]
  'symbol':
    'patterns': [
      {
        'match': '([\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]+)'
        'name': 'meta.symbol.clojure'
      }
    ]

martinklepsch 2016-01-29T12:06:00.000289Z

looking into the theme bit right now

geksilla 2016-01-29T12:06:28.000290Z

yes but namespace symbol captured for string like:

(= js/process.platform "win32")
but not for:
(js/process.platform "win32")

martinklepsch 2016-01-29T12:08:26.000292Z

ah I see

geksilla 2016-01-29T12:15:18.000293Z

you can add custom color to your styles.less

martinklepsch 2016-01-29T12:17:55.000294Z

https://github.com/atom/language-clojure/issues/36

martinklepsch 2016-01-29T12:19:18.000295Z

@geksilla: how that? I tried using the snippet here but no luck: https://atom.io/docs/v1.4.1/upgrading-to-1-0-apis-upgrading-your-syntax-theme

geksilla 2016-01-29T12:19:55.000297Z

hit SPC f e s

geksilla 2016-01-29T12:20:24.000298Z

and paste

[data-grammar*="clojure"]::shadow {
  .meta.symbol.namespace.clojure {
    color: red;
  }
}

geksilla 2016-01-29T12:21:00.000299Z

no need to reload atom, styles hot loaded on save

martinklepsch 2016-01-29T12:23:44.000300Z

I actually don't use proton 😄

geksilla 2016-01-29T12:23:51.000301Z

ok )

geksilla 2016-01-29T12:24:02.000302Z

run Command Palette

geksilla 2016-01-29T12:24:26.000303Z

type stylesheet

geksilla 2016-01-29T12:24:42.000304Z

select Application: Open your stylesheet

martinklepsch 2016-01-29T12:26:35.000305Z

nice! I didn't have the data-grammar thing :simple_smile:

dvcrn 2016-01-29T13:50:25.000306Z

@martinklepsch: then you should definitely use proton :simple_smile:

dvcrn 2016-01-29T13:50:44.000307Z

@geksilla: how did you solve the path problem?

dvcrn 2016-01-29T13:51:02.000308Z

like - how does the path get changed before packages are loaded

geksilla 2016-01-29T13:51:24.000309Z

i'm not sure that path changed before package loaded

dvcrn 2016-01-29T13:51:30.000310Z

let me try

geksilla 2016-01-29T13:52:49.000311Z

some packages can throw errors when they use path on activation

geksilla 2016-01-29T13:53:28.000312Z

but most of them use PATH specific commands only when user triggers action

geksilla 2016-01-29T13:54:23.000313Z

so for example you can try to toggle proto-repl with/without my PR

martinklepsch 2016-01-29T13:54:49.000314Z

@dvcrn: I've never used spacemacs so that whole "everything via SPC" is a bit alien to me 😄

dvcrn 2016-01-29T13:55:27.000315Z

@martinklepsch: if you like vim, give it a shot!

martinklepsch 2016-01-29T13:55:34.000316Z

I use vim mode :simple_smile: (and use evil when using emacs)

dvcrn 2016-01-29T13:55:59.000318Z

@geksilla: hmm is there a solution without shell-path? Now we have node dependencies for one dependency

geksilla 2016-01-29T13:56:19.000319Z

copy paste shell-path code )

dvcrn 2016-01-29T13:56:23.000320Z

lol

geksilla 2016-01-29T13:56:31.000321Z

I mean adapt it to clojurescript

geksilla 2016-01-29T13:56:47.000322Z

why you don't like that we have dependency?

geksilla 2016-01-29T13:57:11.000323Z

anyway this will happen some day :simple_smile:

dvcrn 2016-01-29T13:57:29.000324Z

I think it makes things a little bit more complex because we have to navigate into plugin/ first and then do npm install. Maybe we can trigger it from leiningen

dvcrn 2016-01-29T13:57:40.000325Z

because we have 2 package managers now 😛

geksilla 2016-01-29T13:57:45.000326Z

))

dvcrn 2016-01-29T13:58:01.000327Z

@martinklepsch: it’s still just vim-mode with some functionality on the spacebar :simple_smile:

martinklepsch 2016-01-29T13:59:17.000329Z

@dvcrn: I might give it a try when I'm a bit more fluent w/ atom. In the past I systematically avoided any kind of configuration packaging so that might also play a role :simple_smile:

dvcrn 2016-01-29T13:59:39.000330Z

for me that was the only way to get emacs usable coming from vim

dvcrn 2016-01-29T13:59:48.000331Z

elisp was like a alien language

dvcrn 2016-01-29T14:01:22.000332Z

hmm I wanna get rid of the proton-mode repository somehow. It’s silly to have a binary git repo just for release

geksilla 2016-01-29T14:15:24.000333Z

navigating into plugin && apm install required only for developers

geksilla 2016-01-29T14:15:48.000334Z

and we already has note about apm link

geksilla 2016-01-29T14:17:11.000335Z

so I added note about apm install to readme along with apm link

2016-01-29T17:05:59.000337Z

So I think I'm going to recreate a Sublime Text plugin I made, but for Atom. I figured this would give me a good chance to get more used to clojure. Did you guys have trouble getting clojurescript to play nice with Atom?

2016-01-29T19:22:30.000338Z

@dvcrn: What do you think about SPC B for a bookmarks menu?

lucien.knechtli 2016-01-29T19:31:57.000339Z

is there an easy way to add key binds for existing functions? One that I miss from spacemacs is Space>f>s to save a file

2016-01-29T19:36:29.000340Z

In the :keybindings {} part of your .proton file

2016-01-29T19:36:46.000341Z

SPC _ d to open your dotfile, that part should be near the bottom

2016-01-29T19:47:23.000342Z

I'm not sure how to specify the :target actions/get-active-editor inside the .proton file, though

lucien.knechtli 2016-01-29T19:48:41.000343Z

thanks. Is there somewhere I can see what kind of format it expects for the map?

2016-01-29T19:54:13.000344Z

Yeah, take a look at some of the layers for formatting. I'll link you to one.

lucien.knechtli 2016-01-29T19:54:41.000345Z

awesome :simple_smile:

2016-01-29T19:54:49.000348Z

This is the one I wrote

2016-01-29T19:55:04.000349Z

Starting on line 24

2016-01-29T19:55:10.000350Z

That's the format

2016-01-29T19:55:34.000351Z

the :target part is unnecessary for file saving

lucien.knechtli 2016-01-29T19:55:54.000352Z

I assume that if I want to make my own layer, I need to go through the build process?

2016-01-29T19:56:13.000353Z

Yes, you will

2016-01-29T19:56:34.000354Z

If you're just using the binary one, you won't have the source available. Just the compiled JS

lucien.knechtli 2016-01-29T19:57:58.000355Z

to switch to building it, should I uninstall the plugin and build from the repo / link?

2016-01-29T19:58:08.000356Z

Yes

2016-01-29T19:58:25.000357Z

https://github.com/dvcrn/proton#compiling

2016-01-29T19:58:37.000359Z

Those steps are straightforward and easy

lucien.knechtli 2016-01-29T19:59:12.000360Z

yea, read that. Just wasn't clear on whether or not I had to remove the binary or if it would overwrite it

2016-01-29T20:00:31.000361Z

Um, not sure. I suppose it's possible there will be some conflicts. I would recommend removing the proton-mode just in case.

lucien.knechtli 2016-01-29T20:00:59.000362Z

yea, better to be safe. Thanks for the help :simple_smile:

2016-01-29T20:01:13.000363Z

You're welcome. 😄

2016-01-29T20:02:18.000364Z

@dvcrn or @geksilla, how would I go about specifying a :target in the :keybindings vector of the .proton file?

lucien.knechtli 2016-01-29T20:11:57.000368Z

I'm inclined to say that yes, it should be in a layer

lucien.knechtli 2016-01-29T20:47:00.000369Z

hm.. how do I get proton to recognize that a folder named "data" is actually a python module and not to be ignored when doing a project file search? adding it to projects.cson didn't work.

lucien.knechtli 2016-01-29T20:50:13.000371Z

(yea, I know its a bad name for a module, but still..)

2016-01-29T20:59:28.000372Z

You mean using Atom's "Find in Project" feature?

2016-01-29T21:01:32.000373Z

Using what keybinding? SPC p f or SPC p /?

lucien.knechtli 2016-01-29T21:10:24.000374Z

the former

2016-01-29T21:31:04.000375Z

That's just using the atom fuzzy-finder package

2016-01-29T21:31:54.000376Z

In core settings, there is a config option for Ignored Names. If you don't have data in there, then it shouldn't be ignoring the files in that folder.

lucien.knechtli 2016-01-29T21:34:15.000377Z

ah

2016-01-29T21:34:28.000378Z

The results for fuzzy-finder get cached, so you may need to refresh the editor if they were recently added files

lucien.knechtli 2016-01-29T21:42:42.000379Z

I don't see data as being an ignored name in settings - and it's been in the project since I first created it

2016-01-29T21:56:02.000380Z

Is that a VCS ignored file?

lucien.knechtli 2016-01-29T21:56:46.000381Z

not that I'm aware of

lucien.knechtli 2016-01-29T21:56:59.000382Z

lemme check

2016-01-29T21:56:59.000383Z

It looks like it is because it's grayed out

lucien.knechtli 2016-01-29T21:57:42.000384Z

oh wait. I'm dumb. I ignored it globally when working on another project

2016-01-29T21:57:56.000385Z

Okay, that's it then

2016-01-29T21:58:15.000387Z

^^ That setting is checked by default, which would stop it from showing up

lucien.knechtli 2016-01-29T21:58:40.000388Z

makes sense lol

lucien.knechtli 2016-01-29T22:01:32.000389Z

yup.. that fixed it.

2016-01-29T22:07:46.000390Z

🎉

2016-01-29T23:53:00.000391Z

how to apply the changes to .proton without a restart?

lucien.knechtli 2016-01-29T23:55:09.000392Z

think space>_>r