proton

https://github.com/dvcrn/proton
beetlefeet 2016-11-14T08:16:49.000194Z

Is there any updated documentation nr a tutorial about creating your own layer for personal customisations in proton? This document https://github.com/dvcrn/proton/blob/master/HOW-TO-LAYER.md doesn’t really have specifics about where to put files etc, and seems more tailored to creating a layer to add to the proton project proper (I mainly want to set up some keybindings with proper context etc and need a layer to do that).

dvcrn 2016-11-14T08:20:40.000196Z

@beetlefeet having your own 'private' layer is currently not possible just because of how clojurescript works. In contrast to elisp (emacs, spacemacs), clojurescript has to get compiled to javascript first to be usable inside atom. Layers are built with normal clojurescript and therefore currently can't get evaluated during runtime

dvcrn 2016-11-14T08:20:58.000197Z

.proton works because it is edn and not clojurescript. That's why you can't actually use functions in it

dvcrn 2016-11-14T08:23:02.000198Z

there is some big progress on bootstrap cljs, aka clojurescript compiling clojurescript but that's not ready for prime time last time I checked

beetlefeet 2016-11-14T08:23:52.000199Z

Right, that all makes sense. I’m just revisiting something I tried to do a while back, that is bind some additional ‘spacemacs’ shortcuts that require context. I use ‘copy project path’ a lot and would like to have that as SPC p y Not sure how to achieve that..

dvcrn 2016-11-14T08:24:17.000200Z

hmmm

beetlefeet 2016-11-14T08:25:40.000201Z

I can just bind it to the sequence outside of proton’s knowledge, but then I don’t get the nice menu and consisten behaviour

dvcrn 2016-11-14T08:26:04.000202Z

there were also talks of completely isolating the keyhelper so you can put things in it independently of proton

dvcrn 2016-11-14T08:26:57.000203Z

alternatively, we could maybe try to configure a function proton should execute from .proton. In that case you could package your own plugin and just wire it to proton

dvcrn 2016-11-14T08:27:26.000204Z

actually that should be already possible

dvcrn 2016-11-14T08:27:41.000205Z

:keybindings {:c {:category "github"
                    :y {:title "test"
                        :action "hello"}}}
:action is a atom action, it can come from a plugin or from atom core

beetlefeet 2016-11-14T08:27:41.000206Z

It feels like when you trigger an atom command from the key helper (like copy project path) it should somehow just have the right context, no idea what is technically the issue there though 🙂

beetlefeet 2016-11-14T08:28:28.000208Z

Yes I’ve done that, but the issue is that only commands that don’t have a particular scope (especially ‘current editor’ type one) don’t work.

dvcrn 2016-11-14T08:29:27.000209Z

I see

beetlefeet 2016-11-14T08:29:42.000210Z

ie: from https://github.com/dvcrn/proton/blob/master/MANUAL.md#custom-spc-keybinding : "As a limitation you can not specify a :target or a :fx key that describes where or how your custom command should get executed. If you definitely need this functionality, I'd recommend to create a layer and compile proton with it."

dvcrn 2016-11-14T08:30:27.000212Z

we could allow a css selector as :target but doesn't seem like that's helping in your case

beetlefeet 2016-11-14T08:30:29.000213Z

maybe some way of having target set by default

beetlefeet 2016-11-14T08:30:45.000214Z

it might?

beetlefeet 2016-11-14T08:30:59.000215Z

actually no

beetlefeet 2016-11-14T08:31:28.000216Z

it needs the specific editor not just like “atom-text-editor” 🙂

dvcrn 2016-11-14T08:32:32.000219Z

hmm

dvcrn 2016-11-14T08:35:32.000220Z

how about a predefined selection of possible targets? :workspace :current-editor :window etc

beetlefeet 2016-11-14T08:36:11.000221Z

that would be excellent

dvcrn 2016-11-14T08:36:54.000222Z

wondering if there's a simple way to give the user full control over that

beetlefeet 2016-11-14T08:38:51.000225Z

Any security concern around that? I guess if someone is editing your .proton you might have other issues 🙂

dvcrn 2016-11-14T08:39:10.000226Z

never tried it, so not quite sure how trivial it is

beetlefeet 2016-11-14T09:02:10.000227Z

Oh I figured something out from looking at the proton code. You can specify: :target ".editor.is-focused” and it will use that selector to find a DOM element and it works for :action "editor:copy-project-path” \o/

beetlefeet 2016-11-14T09:08:00.000228Z

Also works for reveal in tree view, my other bug bear. Yay, thanks for the pointers dvcrn.

:keybindings {
    :p {:category "project"
        :y {:title "copy project path"
            :action "editor:copy-project-path",
            :target ".editor.is-focused"}
       }
    :f {:category "files"
        :t {:title "reveal in tree view"
            :action "tree-view:reveal-active-file",
            :target ".editor.is-focused"}
       }
  }

beetlefeet 2016-11-14T09:10:37.000229Z

❤️

dvcrn 2016-11-14T09:15:55.000230Z

oh haha 👍

dvcrn 2016-11-14T09:16:23.000231Z

if you are good with wording, it would be great if you could add this into the MANUAL and create a PR @beetlefeet

beetlefeet 2016-11-14T09:17:49.000232Z

will do

🙆‍♀️ 1
jpinnix 2016-11-14T21:45:20.000233Z

Has anyone else run into:

Error starting rsense
exec error: Error: Command failed: ~/.gem/ruby/2.3.0/bin/rsense start --port 47367 --path /Users/jpinnix/Code/Elixir/ProgrammingElixir
/bin/sh: /Users/jpinnix/.gem/ruby/2.3.0/bin/rsense: No such file or directory

jpinnix 2016-11-14T21:46:46.000234Z

I get this each time I open up files in Atom (using only proton)

dvcrn 2016-11-14T22:46:59.000235Z

@jpinnix looks like ruby layer. If you install rsense, does the problem disappear?

dvcrn 2016-11-14T22:47:21.000236Z

not sure why that plugin starts even when not editing ruby files

jpinnix 2016-11-14T22:54:02.000237Z

@dvcrn Installing rsense did not fix the problem. Indeed, I’m not working in ruby right now, so I’m really confused by that. So I removed ruby from my proton settings. Opened up the directory, it ran proton and removed ruby stuff. Closed and opened again, it’s fine now. Of course, I do work in ruby, so I’m not quite sure what will happen when I have to turn that back on.