Fork me on GitHub
#emacs
<
2022-07-22
>
otfrom11:07:29

I think I got my general.el keybinding issue sorted out, but I've done it by not using , c as the prefix but instead , ; which is feeling a bit... spooky gas to me

pppaul13:07:40

anyone having issues with indenting in clojure-mode after last release?

pppaul13:07:33

maybe just some weird state i got into, but somehow my indenting completely broke (auto indenting stopped working, highlight region and indent stopped working). resetting clojure-mode on the buffer got things working again, but i've never run into something like this in ~10 years of using clojure on emacs

Drew Verlee22:07:36

Is there a way to search the git log/changelog of clojure libs from a project without traveling to a web browser? if i visit the code in my app it takes me to the m2 cache which as far as i know isn't git/github aware.

ag22:07:37

That's an interesting thought. I guess it's probably possible to write a package that would query maven/clojars and fetch repo location, to allow operations like git-grep/blame/etc.

Drew Verlee23:07:23

Yea. I'm going to look around. If it doesn't exist, maybe i can do something.

mpenet06:07:39

There's git timemachine

mpenet06:07:00

But you would need to go to the gitlibs dir

jumar09:07:51

This is an interesting idea but I think a rather rare use case. Why/when do you want to do that? Occasionally, I have a similar need but then it's quite easy to simply find it on github and display the history through their UI.

ag17:07:56

That's basically the essence of the task - figuring out the host URL of the git forge for the lib. And the rest is very simple - you just need to concoct the git-blame-URL. For GitHub/GitLab it would be like .../blob/blame.... There's a package: http://github.com/sshaw/git-link. Here's a tiny extension to it I use:

(defun git-link-blame ()
  (interactive)
  (cl-flet ((git-link--new* (x) (replace-regexp-in-string "/blob/" "/blame/" x)))
    (advice-add 'git-link--new :override #'git-link--new*)
    (let ((link (call-interactively 'git-link)))
      (advice-remove 'git-link--new #'git-link--new*)
      (git-link--new link))))
You run it in a file - it will produce the git-blame link. It even works for selected region.

ag17:07:36

> Why/when do you want to do that? What do you mean "why"? Emacsen rarely ask that question. "Because I want that shit. That is why..."

jumar17:07:30

But Clojurians often ask that question- that's why I ask why

ag17:07:09

Hehehe. Yah, totally. I constantly have to deal with my inner Emacsen and Clojurist fighting. One wants to write some emacslisp all the time (because I want that shit...). The other one wants to stay pragmatic and avoid writing code as much it is possible (you aren't gonna need it).

Drew Verlee18:07:18

In this case I had updated from clojure 1.8 to 1.9 which caused to dependencies to throw exceptions. From my editor i can quickly go to the location of the Exception but I having something assist me to search for the existing solution to this problem would be useful. I mean, in a better world, there would be no breaking changes, but i don't live in that world. Is it really rare? I feel like every time i'm on wants to keep there libs up to date but is afraid of breaking changes?

Drew Verlee18:07:16

in this case, the small step that would nice to have automated is just going from the dep to it's github repo even. that way i could search in context for the changelog.