proton 2016-01-29

@maleghast has joined the channel

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

It also annoys me to launch atom from the command line

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

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

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

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

that’s problematic

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

is iex package fails on start?

that’s one of them yes

everything that needs a path basically

I will try to fix this or found some workaround

btw proto-repl will support nRepl connection soon.

PR regarding nRepl remote connection merged.

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

ohh that would be amazing

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

yeah indentation not the best one(

but it much better than it was on previous versions )

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

its possible but you need to edit grammar

i'm not pro for grammar patterns

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

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

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

you need to create grammar package and link it

your grammar can be injected to existing one

in your case injectionSelector probably will be source.clojure

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

there is also another way

you can load your custom grammar from init.coffee

run Command Palette and type init script

select Application: Open your init script

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

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

i'm testing right now, will send in minute

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

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

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

with minimal content

'scopeName': 'mygrammar'

Like

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

open init.coffee script

and put following content:

path = require 'path'

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

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

sweeeeeeeeet! 🎉

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

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

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

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

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

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

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

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

from your comment

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

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

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

'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'
      }
    ]

looking into the theme bit right now

yes but namespace symbol captured for string like:

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

ah I see

you can add custom color to your styles.less

hit SPC f e s

and paste

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

no need to reload atom, styles hot loaded on save

I actually don't use proton 😄

run Command Palette

type stylesheet

select Application: Open your stylesheet

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

@martinklepsch: then you should definitely use proton simple_smile

@geksilla: how did you solve the path problem?

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

i'm not sure that path changed before package loaded

some packages can throw errors when they use path on activation

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

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

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

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

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

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

copy paste shell-path code )

I mean adapt it to clojurescript

why you don't like that we have dependency?

anyway this will happen some day simple_smile

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

because we have 2 package managers now 😛

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

@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

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

elisp was like a alien language

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

navigating into plugin && apm install required only for developers

and we already has note about apm link

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

@lucien.knechtli has joined the channel

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?

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

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

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

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

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

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

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

awesome simple_smile

This is the one I wrote

Starting on line 24

the :target part is unnecessary for file saving

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

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

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

Those steps are straightforward and easy

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

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

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

You're welcome. 😄

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

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

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.

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

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

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

the former

That's just using the atom fuzzy-finder package

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.

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

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

Is that a VCS ignored file?

not that I'm aware of

lemme check

It looks like it is because it's grayed out

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

Okay, that's it then

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

makes sense lol

yup.. that fixed it.

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

think space>_>r