This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-07
Channels
- # beginners (41)
- # boot (38)
- # cider (17)
- # cljs-dev (52)
- # cljsjs (3)
- # clojure (200)
- # clojure-italy (8)
- # clojure-russia (50)
- # clojure-spec (28)
- # clojure-uk (45)
- # clojurescript (28)
- # core-async (9)
- # core-matrix (2)
- # cursive (16)
- # datascript (15)
- # datomic (50)
- # dirac (5)
- # emacs (20)
- # figwheel (8)
- # flambo (2)
- # hoplon (10)
- # incanter (1)
- # jobs (1)
- # leiningen (2)
- # lumo (26)
- # mount (171)
- # off-topic (22)
- # om (54)
- # onyx (2)
- # pedestal (27)
- # re-frame (10)
- # reagent (12)
- # ring (27)
- # ring-swagger (3)
- # rum (2)
- # slack-help (1)
- # spacemacs (134)
- # specter (6)
- # sql (15)
- # testing (20)
- # uncomplicate (5)
- # unrepl (49)
- # untangled (9)
- # yada (29)
@eggsyntax cheers, this was one of the things I tried to get my work back - but I didn't succeed. Not sure why, because I'm not at that computer at the moment. But an important note was that I hadn't worked on that particular file for months, it had just been laying there in my work dir, uncommitted. I don't know when undo tree files are deleted, maybe it had already been removed by emacs in my case.
@rustam.gilaztdinov Unfortunatelly, I wasn't able to navigate to the source of clojure's java classes (e.g. clojure.lang.PersistentVector
): cider-find-var
responds with "No source location". However, this works for JDK classes like "java.util.ArrayList"
Found a thread regarding "persistent undo" a la vim, which is exactly what I was looking for. Will have do delve deeper into this once I get back to my personal computer 🙂
@reefersleep ah, yeah, I do have undo-tree-auto-save-history
set to true; I'd forgotten that. That's probably what's causing the difference in behavior.
@eggsyntax neat. Do you know what the limits are for that? Does it just naively persist all of your history?
@reefersleep if you need to get back some data after git reset --hard
you might wanna look at git reflog
@jumar that was my first attempt, but I didn't succeed. When you use the reflog
to jump to an earlier point in time, that "point" does not contain uncommitted/unstashed files... Or so it seemed to me. Am I wrong?
Can anyone help with this error: WARNING: clj-refactor and refactor-nrepl are out of sync. Their versions are 2.3.0-SNAPSHOT (package: 20170126.118) and n/a, respectively.
@reefersleep I believe that's correct (re reflog
). I think it persists files naively until/unless you delete them yourself, but I wouldn't swear to that.
2.3.0-SNAPSHOT seems to be the refactor-nrepl version so “respectively” seems to be wrong?
hm, I'd like some documentation on that, will have to dig it up or ask in the right places... Are your persistent save history files created in the same place as the original file, or in some designated (by your or some default settings) location? @eggsyntax
@clojer I believe you no longer need to have them in your personal profiles.clj -- I don't, anyway, and the refactor stuff works fine for me.
@reefersleep my .spacemacs contains the following -- I believe it was in there at install:
;; Location where to auto-save files. Possible values are `original' to
;; auto-save the file in-place, `cache' to auto-save the file to another
;; file stored in the cache directory and `nil' to disable auto-saving.
;; Default value is `cache'.
But unfortunately there's not an actual var there other than undo-tree-auto-save-history
-- maybe that's it? I just have it set to t
. I'm afraid I don't recall if/when I set that myself; too long ago...@eggsyntax Just refactor-nrepl or cider-nrepl as well?
uhm... I do have dotspacemacs-auto-save-file-location 'cache
on my work pc, anyways
I guess I'll have it at home, too
But do you mean that having dotspacemacs-auto-save-file-location 'cache
is the same as having undo-tree-auto-save-history
set?
looks up documentation
@clojer disclaimer: that's just based on what I happen to have, can't swear it's correct 😜 @reefersleep dunno, I'd have to go look at the docs also.
@eggsyntax Just commented-out as suggested but no change in the Spacemacs error.
@reefersleep I've got both dotspacemacs-auto-save-file-location 'cache
and undo-tree-auto-save-history t
-- the former had just gotten misplaced to another part of my .spacemacs
.
@clojer you're on current version of spacemacs? & I assume you did a spacemacs restart?
@eggsyntax Yes to both
Hmm. Dunno then. It's possible that cider-nrepl
isn't actually active for me; I forget what functionality that gives you.
You may want to see https://github.com/clojure-emacs/cider/issues/1140, although that could be outdated.
Oh, yeah, refactor-nrepl
docs say:
*With CIDER and clj-refactor*
If you're using CIDER and clj-refator you don't have to do anything except call cider-jack-in. The dependencies are injected automagically.
Be aware that this isn't the case if you connect to an already running REPL process. See the cider documentation for more details.
hmmmmm... My ~/emacs.d/.cache/auto-save/site/
dir contains a number of files beginning and ending with #
. I assume these are files containing auto-save information. However, there are not nearly as many files as I have ever opened on this PC. Some of them, I haven't opened recently. And the ones I have opened right now are not there.
Another cider/nrepl time-waster. Jeezus. I thought an effort was being made to make cider easier to use.
I'm not sure what to make of that dir. Guess I'll check it at home, see if there's any useful info. I would still like to know the definitive consequences of these settings, so that I can use them properly 🙂
*hoping that some spacemacs authority pics up on this
Anyways, thanks a lot for your help, @eggsyntax , I'm much closer to the answers I'm seeking.
@eggsyntax cider-jack-in solved it but it takes about 40 seconds longer than cider-connect on my workstation
@reefersleep yeah, NP, I’d be curious to hear what you end up finding out.
@clojer ah, yeah, gotcha. I use jack-in
, so it’s a different story. If you’re connecting, I assume you need to have both libs in your personal profiles.
Will keep you posted 🙂
@eggsyntax Doesn’t work with cider-connect either way. I had everything in my ~/.lein/profiles.clj when I posted the error.
@eggsyntax This is a fairly recent development as I didn’t have this error a few months back.
@eggsyntax Correction cider-jack-in is taking 90 seconds with a fairly stock Luminus project without any cljs, swagger etc.
@eggsyntax That makes Spacemacs/Emacs/Cider an non-starter for me, I’m afraid
even on a fresh new project? I’m on Sierra and just updated to the latest spacemacs + updated all my packages
@shan All I can say is cider ran a lot faster when I first tried it a year ago. Even on my 3-yr old Macbook Pro the project took 45 seconds with cider-jack-in
strange. Is this with a fresh install of spacemacs and any cider
references removed from ~/.lein/profiles.clj
Actually, might be worth trying with personal profiles removed entirely (or moved to backup file); I wonder if there could be another plugin/dep slowing things down.
@eggsyntax Good idea. Will try that. Yes, lein is up to date
I'd also be curious about startup time on lein new myproject
rather than a new luminus project.
@shan No, 45 seconds on the original project. 25 from a new basic project with no code.
@eggsyntax 25 seconds is for a new base Clojure project, not Luminus
@shan Removed ~/.lein/profiles.clj entries but still 25 secods for a new blank Clojure app.
FWIW, I'm on a project with > 60 sec startup. It's annoying, but def not a showstopper; I just use workflows that rarely require a full restart.
@eggsyntax Corrrect me if I’m wrong but if I add a new library to a file via :require a repl reboot is required, no? Even with mount or component.
Yep. I think I've seen that there's a workaround to dynamically load it, but I've never used it.
For me personally, I get enough productivity gain from spacemacs to make it worth while.
@eggsyntax I don’t see an M-x clojure-refactor
option in Spacemacs
@eggsyntax Sorry that should have been for @shan
@eggsyntax As far as I can make out SPC m r a p
loads a lib but after I :require it doesn’t appear to be loaded
@eggsyntax Damn. Did it again.
@shan SPC m r a p
seems to add a lib to the projects.clj file but when I :require it nothing is added to the current file’s namespace.
@shan I addeed [selmer.parser] but after a Ctrl c l to load it into the repl the render symbol was not resolved
I could have sworn SPC m r a p
also loaded new libraries into the repl in addition to adding it to project.clj.
@clojer After you do SPC m r a p
, you probably have to say (require '[your.lib :as y])
in the repl.
@beppu For some reason I tried hotloading selmer into a new Clojure project and received what appear to be unrelated errors beginning with:
WARN: org.clojure/clojure version 1.7.0 requested, but 1.9.0-alpha15 already on classpath. Loaded dependencies: [[args4j “2.0.16”] [cheshire “5.6.3"]
@beppu Maybe but why is the process referencing a ton of what appear to be unrelated libs?
Some of those show up here: https://crossclj.info/ns/selmer/1.10.6/project.clj.html
@beppu I add a function to the file and try to reload with C-c C-l
and now receive the error: “Search failed. This means there is unmatched expression somewher or we are at the beginning/end of file.”
@clojer After I add a function to a file, I usually reload the whole buffer with SPC m s b
or , s b
(same thing).
does anyone know how to make cider-find-var
, g g
g d
less stupid? Why the hell it would prompt for the symbol when the cursor is at the symbol?
I thought maybe I could use dumb-jump instead, but I could find a good way of setting spacemacs-jump-handlers-clojure-mode
after it’s set in clojure
layer. Besides sometimes dumb-jump
is just that - too damn “dumb”. But cider-find-var doesn’t seem to be smarter either
Another problem is that cider-find-var
miserably fail if there’s no connected repl. Ideally what should happen I think is:
1) if repl is connected - apply cider-find-var to the current symbol
2) if no connected repl - use dumb-jump
I am to be honest utterly surprised that we haven’t solved this simple problem. Feels really bad of not having something basic like this and let Cursive users to gloat about that
While I agree that that's kinda weak, and your proposed behavior seems like a good fix, I'm just happy to know that dumb-jump
exists; I hadn't run across it.
I'd suggest opening a spacemacs ticket pointing out that cider-find-var
fails without a repl & proposing the fallback behavior that you described.