Fork me on GitHub

Is there any ggtags package for clojure? if not, where should I contribute it? I have noticed that clojure tags are generating correctly with the right .globalrc, but not queried correctly using ggtags-mode


in particular for things like namespace/symbol, I need to specify a file on top of the global command


@arrdem Is there currently any way from emacs to pull in all of grimoire and refer to it as static files, rather than making one-off HTTP requests? I'm super excited to use cider-grimoire (it scratches an itch I've had for a couple months) but I'd rather update the docs once every six months rather than insert a 1 to 2 second network delay into my lookup workflow.


It seems feasible to change cider-grimoire such that it caches the retrieved data, and uses a configurable time-to-live to decide when to go get the remote URL again.


The obvious downside would be, if you visited a particular topic in grimoire less often than the configured TTL, then basically the caching wouldn’t help.


@bozhidar does cider include any jump-to-symbol functionality? If not, where does that live? I am trying to use ggtags-mode in Clojure


a further question on top of this is whether there should be a separate gtags hook for static info rather then dynamically fetching stuff from the REPL, I was actually able to generate tags with global -u and universal-ctags.

New To Clojure18:12:59

@richiardiandrea See cider-find-var in cider-client.el


thanks! however I don't use cider, so I wonder whether this functionality should go instead in clojure-mode?


@daveliepmann So Grimoire the website is a thin wrapper around lib-grimoire which provides a consistent API between making requests to Grimoire the service and to the filesystem store that Grimoire the service uses under the hood. I’ve thought in the past about how to distribute a zipfile or some other archive containing a snapshot of Grimoire (early versions of Grimoire which were all static HTML were available this way) but right now there’s no blessed local or cached client. I just never got around to building one.


I extremely don't have time to do this work right now, but a standalone grimoire-mode based on such an archive would be awesome. I might be able to hack on it after the holidays, though. That would require moving forward with some kind of static files. What do you think the best format would be for distribution? My naive assumption would be that the easiest would be git clone but I wonder what other options you see.


Yeah there’s been some ideas back and forth on stuff like this before. Grimoire actually has a script in the main repo that clones down the data repos, builds the data directory structure and sets everything up for lib-grimoire. It shouldn’t be that hard to adapt the same toolset to maintaining a local copy in ~/.grim or wherever. Maybe once I get some headway on the current improving doc writing projects.


It’s definitely doable, just a couple separate git repos you could keep cloned into ~/.grim or somewhere.


@richiardiandrea It’s not possible. This relies on var metadata. It can easily be added to inf-clojure, though.


(meta #'map)
{:arglists ([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]), :doc "Returns a lazy sequence consisting of the result of applying f to\n  the set of first items of each coll, followed by applying f to the\n  set of second items in each coll, until any one of the colls is\n  exhausted.  Any remaining items in other colls are ignored. Function\n  f should accept number-of-colls arguments. Returns a transducer when\n  no collection is provided.", :added "1.0", :static true, :line 2618, :column 1, :file "clojure/core.clj", :name map, :ns #namespace[clojure.core]}


You just need to :column, :line and :file from the meta.


@gonewest818 I like the idea of caching for grimoire. If that’s combined with the ability to fetch all entries for a certain namespace I think it’d would solve much of the aforementioned problem. It would also be nice if this was moved to a middleware and started using lib-grimoire as that would simplify the code and make it accessible to other editors - e.g. @dominicm’s beloved vim. 🙂


I have been thinking about moving grimoire into the nrepl, I've been working on an improved doc. I wanted runnable examples and stuff.


So I would appreciate this work


It’s doable. I test Grimoire using lib-grimoire loaded into a REPL. Been sketching at more structured examples / REPL sessions notation recently.


Just takes dev time I’m not able to commit to.


Part of the problem is that as-is markdown-clj doesn’t give you a data based intermediate representation and I just haven’t gone and fixed that yet.


> I’ve been working on an improved doc. I wanted runnable examples and stuff.


@dominicm That sounds interesting!


@bozhidar shouldn't that go to clojure-mode? Also, meta is a runtime thing


tags are built statically


That’s why it can’t go to clojure-mode - it relies on a having a REPL.


Ok let me ask this, would you be open to a patch to clojure-mode that hooks up ggtags?


Building tags is a step most people dislike having to deal with, that’s why I’m not particularly interested in trying to do something about this in clojure-mode - you always need to build some command to run this, you need to install something.


I am using projectile and everything works pretty well, but I see the point and felt the pain when installing all these tagging tools


If you come up with something I might consider it, but overall, I think getting this info at runtime is a pretty decent approach.


@bozhidar ok I will put in a separate package for now..

New To Clojure19:12:30

cljr-rename-symbol fails to rename anagrams-for in I just position cursor at anagrams-for and press M-x cljr-rename-symbol RET. It tells that project needs to be evaluated, I type y RET, and then if fails with Wrong type argument: char-or-string-p, nil. Is this a bug? lein test compiles this code and runs successfully. clj-refactor.el version: 2.3.1


Yeah I think cljr is currently busted.


It's never worked consistently for me. There are some clojure mode refactoring I need to learn more

New To Clojure20:12:08

It seems that nobody needs Clojure refactoring. Otherwise somebody would have done it already.


Clojure-mode and cljr refactor both provide it. I've had some success with the cljr refactor in the past. I think both are great and refactoring tools are great


cljr is great, and the best implementation thereof I’m aware of outside of cursive.


Not sure why it’s currently broken tho.