pashky / restclient.el

HTTP REST client tool for emacs
2k stars 171 forks source link

Emacs >= 26.2 required for restclient-jq #259

Open josterpi opened 3 years ago

josterpi commented 3 years ago

restclient-jq.el calls restclient-remove-var which uses assoc-delete-all which wasn't introduced until Emacs 26.2.

I haven't been paying attention to releases and am still on 26.1. I should probably just upgrade, but it might be worth a note in the Known Issues that the jq hook won't work on Emacs < 26.2. I would be happy to submit a pull request for this.

Before I got to the bottom of this, I ended up defining assoc-delete-all myself instead of modifying the source of restclient.el. It doesn't actually delete all, but I think it works for this.

(defun assoc-delete-all (key a-list)
  (setq a-list (delq (assoc key a-list) a-list)))

If you want to support older versions, it shouldn't be too hard to avoid assoc-delete-all, but it doesn't really matter to me. I'm happy to just upgrade.

After I got it all working, using jq-set-var really streamlined my OAuth authentication. Very slick!

texaco commented 3 years ago

I am running emacs from debian repository and they still ship it on version 26.1.

It would be appreciated if it is updated for a more compatible version. If not, update documentation could help.