Closed aureliar8 closed 2 years ago
What version of emacs are you using?
v0.8.4 does not have this problem.
emacs-version
gives GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14) of 2020-03-26, modified by Debian
I'm on ubuntu 20.04.3, emacs installed via apt install emacs
I'm sorry, I didn't realize that. Maybe we need to add an explicit (require 'url-util)
. If you do that manually does the error go away?
Oops, (require 'url-util)
is already included as it should be, otherwise it should have failed previously already for you, since url-hexify-string
is already used for the branchname and the error message would be different anyway. So I suppose it's related to the Emacs Version. Let me see if I can find out.
Hi @bitti, it's because on 26 url-hexify-string
requires a vector and the position of elements in the vector must correspond to the character code (if I recall, read this this morning) to be escaped.
For 26 support we could rebuild this structure that, I assume, will also work with 27+
(url-hexify-string filename)
works for me (it doesn't crash anymore and I get a valid github link)
Yes at least for github not escaping /
is merely a cosmetic thing. I'm not sure how other git repo hosting providers would handle it though, therefore I think it's safer to not escape it.
For 26 support we could rebuild this structure that, I assume, will also work with 27+
I see, seems there was a bug which got fixed in Emacs 27.0.90: https://github.com/emacs-mirror/emacs/commit/9aa13cd4beccfe41e8f4930cb029bd60e7788e93. So we'd have to wrap the second argument explicitly with url--allowed-chars
to avoid a regression for earlier versions. Do you want me to do the PR or do you handle it?
If you could do a PR that would be —as the kids say: amaaaazing!
Ok, I opened https://github.com/sshaw/git-link/pull/94 now. It's more or less a trivial fix.
Fixed in v0.8.6. Thanks again @bitti 💪:octocat:
I just installed git-link from melpa (version 20220206.1802).
When doing
M-x git-link
in a git repo I getmapconcat:
Wrong type argument: arrayp, (47 97 98 99 100 101 102 103 104 105 ...)` in the minibuffer.Here is the stack trace:
Do you have an idea to solve it ? Thanks
EDIT:
Changing this line https://github.com/sshaw/git-link/blob/a715c116341162ff1a49fff684a45dec8ac0b0af/git-link.el#L762
to
(url-hexify-string filename)
works for me (it doesn't crash anymore and I get a valid github link)