Fork me on GitHub
#cider
<
2018-10-04
>
bozhidar06:10:51

@dpsutton There was some ticket about this back in the day - I think @malabarba had found there was some security problem with this, but I don’t remember the details.

bozhidar06:10:22

Generally there are so many security wholes that I wonder if we should care about who can set what in their local setup. 😄

bozhidar06:10:11

@benedek might remember more, as once we spoke about this.

bozhidar06:10:26

I also wondered about the way the default deps were added.

benedek08:10:54

i think this is just generic how you should handle local vars in emacs thing. ref https://www.gnu.org/software/emacs/manual/html_node/emacs/Safe-File-Variables.html

benedek08:10:15

also these contain dependencies which will injected in your repl at start up time

benedek08:10:39

so they can not really be safe by default i suppose

bozhidar08:10:22

@benedek Yeah, I get this but we already eval so much code on behalf of the user anyways, so I don’t know how practical of a concern this is.

bozhidar08:10:42

Probably we can just make all of those defcustoms and leave people to do with them whatever they want.

benedek08:10:47

i guess you can argue it is not practical, it is decent tho 😉

benedek08:10:04

these are defvars i think

benedek08:10:15

so in theory not supposed to be changed by users

benedek08:10:21

i think…

bozhidar08:10:24

I know, but they can be defcustoms just as easily.

benedek08:10:54

using vars here explicity kinda hints that these are not supposed to be meddled with

bozhidar08:10:57

I’m just trying to figure out if we consider this implementation detail or something customizable.

benedek09:10:10

i think this is more the former

bozhidar09:10:14

Given how people often touch those they don’t seem like an implementation details to me.

bozhidar09:10:26

(and 3rd party packages as well)

benedek09:10:29

ah ok. this may be different for cljs and clj deps?

benedek09:10:53

maybe i am more talking about clj deps than cljs ones…

bhauman11:10:18

Every time I type clojure at jack in time I want to add alias args i.e -A:fig

bhauman11:10:10

since these are very fluid, and I switch between different aliases quite often

shen12:10:08

Hi. Not sure where's a good place to ask, but since this error pops up in *cider-error*...

shen12:10:35

This happens after I call cljr-clean-ns, which runs correctly

shen13:10:50

Using cider 18, cljr-refactor 0.2.4 etc.

shen13:10:54

all latest

shen13:10:43

app builds fine, it seems piggieback (?) is not correctly following the dependencies?

bozhidar14:10:32

> This happens after I call cljr-clean-ns, which runs correctly

bozhidar14:10:58

How can this run file if you’re getting an exception? 🙂 Maybe the command got routed to the cljs connection, but it doesn’t work over it or something like this? I’m curious what’s triggering the cljs evaluation that’s in your stacktrace.

shen14:10:03

I'm curious too. Did some digging, and cider-load-buffer seems to trigger the same.

shen20:10:28

Going back to ClojureScript 1.9 fixes this, after much trial and error

bozhidar14:10:02

@bhauman What would be an ideal interface for you? Predefined profiles you aliases you can select from or something like this perhaps?

bhauman14:10:34

I think just being able to provide the extra flags at launch would be the most natural/flexible interface

bhauman14:10:17

predefined flags aren’t flexible

bhauman14:10:33

perhaps named repl configurations such that I can configure in my init.el

bhauman14:10:49

being able to supply the flags would be fantastic clojure -A:fig:other

bhauman14:10:17

as it is very responsive and mirrors command line usage

bhauman14:10:35

thus muscle memory has been trained

bozhidar14:10:58

@bhauman Isn’t this what C-u C-c C-x j j does even now?

bhauman14:10:11

oh does it!!?

bhauman14:10:19

what function is that?

bozhidar14:10:37

We used to have special support for lein profiles in the early days but we dropped it in favour of being able to pass whatever you want.

bozhidar14:10:42

cider-jack-in 🙂

bhauman14:10:28

no it doesn’t do that for me

bhauman14:10:36

it auto completes

bhauman14:10:00

and prevents extra characters

bozhidar14:10:04

(defun cider-jack-in-clj (params)
  "Start an nREPL server for the current project and connect to it.
PARAMS is a plist optionally containing :project-dir and :jack-in-cmd.
With the prefix argument, prompt for all these parameters."
  (interactive "P")
  (let ((params (thread-first params
                  (cider--update-project-dir)
                  (cider--check-existing-session)
                  (cider--update-jack-in-cmd))))
    (nrepl-start-server-process
     (plist-get params :project-dir)
     (plist-get params :jack-in-cmd)
     (lambda (server-buffer)
       (cider-connect-sibling-clj params server-buffer)))))

bhauman14:10:35

let me try with the prefix correctly

bhauman14:10:51

C-u wasn’t working right

bozhidar14:10:57

Just tried it and it works fine for me - first it asks about the project and afterwards about the command to run.

bhauman14:10:57

yeah that isn’t really ideal either, but I see your point

bhauman14:10:12

I’d like the type arg to take the additional params as its a common need

bhauman14:10:20

for clojure tools

bhauman14:10:49

without having to edit the long line

bhauman14:10:10

I think other folks would want this as well

bhauman14:10:43

I’m been writing up figwheel.main docs for Emacs and this is a sticky part

bhauman14:10:32

the support is fantastic if you place your libs at the top level of deps.edn, but if you isolate it gets much trickier

bozhidar14:10:17

Got it. File a ticket for this and I’ll see what we can do. Should be relatively straightforward to tweak the existing approach. Maybe some defcustom controlling what to prompt for or a different behavior if you use two prefix args. The UX for this is the hard thing for me to figure out - implementing something will be easy.

bhauman14:10:03

yeah, the only reason I bring it up is because when you use the clojure tools on the command line you normally add some aliases of some kind to scope your classpath. And folks are quite used to that, using a configuration cuts that expressivity and brevity.

bhauman14:10:17

thanks 🙂

richiardiandrea21:10:33

Would folks be ok with a patch to clojure-mode that unifies the colors of the two s/ top level entries there? Is it even possible?

dumrat22:10:34

Is there some bug that causes multiple windows to be opened when clojure throws an error (and neotree is open)?