Fork me on GitHub
#proton
<
2016-01-29
>
dvcrn09:01:43

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

dvcrn09:01:51

It also annoys me to launch atom from the command line

dvcrn09:01:06

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

geksilla09:01:13

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

dvcrn09:01:51

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

dvcrn09:01:01

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

dvcrn09:01:04

that’s problematic

dvcrn09:01:55

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

geksilla09:01:33

is iex package fails on start?

dvcrn09:01:59

that’s one of them yes

dvcrn09:01:05

everything that needs a path basically

geksilla09:01:06

I will try to fix this or found some workaround

geksilla09:01:32

btw proto-repl will support nRepl connection soon.

geksilla09:01:27

PR regarding nRepl remote connection merged.

geksilla09:01:47

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

dvcrn09:01:49

ohh that would be amazing

dvcrn09:01:57

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

geksilla10:01:17

yeah indentation not the best one(

geksilla10:01:59

but it much better than it was on previous versions )

martinklepsch10:01:13

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

geksilla10:01:55

its possible but you need to edit grammar

geksilla10:01:07

i'm not pro for grammar patterns

geksilla10:01:30

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

martinklepsch10:01:39

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

geksilla11:01:49

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

geksilla11:01:15

you need to create grammar package and link it

geksilla11:01:05

your grammar can be injected to existing one

geksilla11:01:54

in your case injectionSelector probably will be source.clojure

geksilla11:01:29

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

geksilla11:01:14

there is also another way

geksilla11:01:36

you can load your custom grammar from init.coffee

geksilla11:01:14

run Command Palette and type init script

geksilla11:01:37

select Application: Open your init script

martinklepsch11:01:38

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

martinklepsch11:01:56

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

geksilla11:01:17

i'm testing right now, will send in minute

geksilla11:01:28

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

martinklepsch11:01:53

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

geksilla11:01:20

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

geksilla11:01:03

with minimal content

'scopeName': 'mygrammar'

geksilla11:01:38

Like

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

geksilla11:01:00

open init.coffee script

geksilla11:01:26

and put following content:

path = require 'path'

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

geksilla11:01:21

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

martinklepsch11:01:44

sweeeeeeeeet! 🎉

geksilla11:01:17

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

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

geksilla11:01:51

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

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

geksilla11:01:27

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

martinklepsch11:01:42

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

geksilla11:01:13

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

geksilla12:01:37

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

geksilla12:01:51

from your comment

martinklepsch12:01:28

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

geksilla12:01:45

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

martinklepsch12:01:43

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

martinklepsch12:01:24

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

martinklepsch12:01:00

looking into the theme bit right now

geksilla12:01:28

yes but namespace symbol captured for string like:

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

geksilla12:01:18

you can add custom color to your styles.less

geksilla12:01:55

hit SPC f e s

geksilla12:01:24

and paste

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

geksilla12:01:00

no need to reload atom, styles hot loaded on save

martinklepsch12:01:44

I actually don't use proton 😄

geksilla12:01:02

run Command Palette

geksilla12:01:26

type stylesheet

geksilla12:01:42

select Application: Open your stylesheet

martinklepsch12:01:35

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

dvcrn13:01:25

@martinklepsch: then you should definitely use proton simple_smile

dvcrn13:01:44

@geksilla: how did you solve the path problem?

dvcrn13:01:02

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

geksilla13:01:24

i'm not sure that path changed before package loaded

dvcrn13:01:30

let me try

geksilla13:01:49

some packages can throw errors when they use path on activation

geksilla13:01:28

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

geksilla13:01:23

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

martinklepsch13:01:49

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

dvcrn13:01:27

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

martinklepsch13:01:34

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

dvcrn13:01:59

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

geksilla13:01:19

copy paste shell-path code )

geksilla13:01:31

I mean adapt it to clojurescript

geksilla13:01:47

why you don't like that we have dependency?

geksilla13:01:11

anyway this will happen some day simple_smile

dvcrn13:01:29

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

dvcrn13:01:40

because we have 2 package managers now 😛

dvcrn13:01:01

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

martinklepsch13:01:17

@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

dvcrn13:01:39

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

dvcrn13:01:48

elisp was like a alien language

dvcrn14:01:22

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

geksilla14:01:24

navigating into plugin && apm install required only for developers

geksilla14:01:48

and we already has note about apm link

geksilla14:01:11

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

austincrft17:01:59

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?

austincrft19:01:30

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

lucien.knechtli19:01:57

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

austincrft19:01:29

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

austincrft19:01:46

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

austincrft19:01:23

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

lucien.knechtli19:01:41

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

austincrft19:01:13

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

austincrft19:01:49

This is the one I wrote

austincrft19:01:04

Starting on line 24

austincrft19:01:10

That's the format

austincrft19:01:34

the :target part is unnecessary for file saving

lucien.knechtli19:01:54

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

austincrft19:01:13

Yes, you will

austincrft19:01:34

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

lucien.knechtli19:01:58

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

austincrft19:01:37

Those steps are straightforward and easy

lucien.knechtli19:01:12

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

austincrft20:01:31

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

lucien.knechtli20:01:59

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

austincrft20:01:13

You're welcome. 😄

austincrft20:01:18

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

lucien.knechtli20:01:57

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

lucien.knechtli20:01:00

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.knechtli20:01:13

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

austincrft20:01:28

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

austincrft21:01:32

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

austincrft21:01:04

That's just using the atom fuzzy-finder package

austincrft21:01:54

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.

austincrft21:01:28

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

lucien.knechtli21:01:42

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

austincrft21:01:02

Is that a VCS ignored file?

lucien.knechtli21:01:46

not that I'm aware of

austincrft21:01:59

It looks like it is because it's grayed out

lucien.knechtli21:01:42

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

austincrft21:01:56

Okay, that's it then

austincrft21:01:15

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

lucien.knechtli22:01:32

yup.. that fixed it.

sergiodnila23:01:00

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