From: Adam Porter <adam@alphapapa.net>
To: emacs-devel@gnu.org
Subject: Emacs HTTP libraries [was: Re: How to contribute new package to GNU ELPA?]
Date: Sun, 20 Dec 2020 06:29:05 -0600 [thread overview]
Message-ID: <87v9cwek4u.fsf_-_@alphapapa.net> (raw)
In-Reply-To: CAL1eYuLDX8cVOe_k4ASK-p5N2foqO1e6ezg85VYFdDPvg-VTsQ@mail.gmail.com
stardiviner <numbchild@gmail.com> writes:
> More importantly: what do you want to do about `request`?
>
> About this, I really suggest ELPA can include it. Because I hate to
> write more complex url requests with `url.el`. If someone want to
> adopt kiwix.el request to use `url.el`. I also can't accept
> it. Because I still need to write code on it. Also as you said, a
> wrapper on `url.el` is good for developer. Emacs will need it. Really
> helpful.
Emacs definitely needs an alternative to url.el. It has some issues
that are not easily solved nor worked around, such as potentially
calling callbacks multiple times[0], requests not timing out, and some
of its API being in the form of undocumented variables that must be
let-bound around calls to its functions.
I wrote a macro that wraps `url-retrieve' to help alleviate some of the
issues.[1] Using it in matrix-client.el seems to make its use of url.el
much more reliable (requests time out properly, etc). But I don't know
if it would be suitable for general use, and it basically "papers over"
some of these issues.
request.el is a widely used library, and it works well for many things.
However, it has its own not-easily-resolved issues that, IME, forced me
to use url.el in the end--except for the things which url.el couldn't
handle properly, such as some file uploads, which forced me to use
request.el for those. Having to use two different HTTP libraries in
matrix-client.el is...not ideal.
Besides that, I doubt that request.el could be easily merged into ELPA
since, apparently, not all of its contributors have done FSF copyright
assignment. An issue that was raised about merging it into ELPA was
closed without discussion or consideration.[2] And that leads to another
concern, one I raised about its current governance, which has been
ignored for a year now.[3]
As Chris Wellons noted in some discussions I've had with him[4], it's
relatively simple to write a Curl wrapper in Elisp that precludes having
to use url.el. He did this for Elfeed, and it works very well.
However, quite understandably, he isn't interested in factoring it out
and maintaining it as a library.
So in Ement.el[5], I've been using a simple Curl wrapper library that
I've started.[6] It's rather primitive, but it seems to work well.
It's relatively easy to use, IMHO. I haven't written documentation yet
(other than docstrings), but you can see how it's used in the tests.[7]
If it were useful, I'd be glad to contribute it to ELPA.
Of course, it would be ideal if Emacs had a built-in HTTP library that
didn't require an external dependency like Curl, but Curl does work
well. The only issue I have with it is that certain data can only be
passed via either the command line (leaving it visible to the whole
system) or temporary files (which have to be carefully handled), which
is a concern for, e.g. cookies, authentication tokens, passwords, etc.
Unfortunately, when that issue was raised and a solution proposed in
2003, it was quickly rejected.[8]
It's primarily that issue that has left me hesitant to advertise plz.el,
because I wouldn't want to recommend that anyone use it for sensitive
applications, even if the risk is probably minimal on one's personal
system. Nevertheless, that issue remains in request.el when it uses its
Curl backend, so it's not worse in that respect.
Well, food for thought. :)
Adam
0: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20159
1: https://github.com/alphapapa/elexandria/blob/83a1b08d0711fdce07a5b33525535cc3a457c6ee/elexandria.el#L429
2: https://github.com/tkf/emacs-request/issues/112
3: https://github.com/tkf/emacs-request/issues/172
4: https://github.com/skeeto/elisp-latch/issues/1#issuecomment-397910988
5: https://github.com/alphapapa/ement.el
6: https://github.com/alphapapa/plz.el
7: https://github.com/alphapapa/plz.el/blob/master/tests/test-plz.el
8: https://curl.se/mail/archive-2003-08/0099.html
next prev parent reply other threads:[~2020-12-20 12:29 UTC|newest]
Thread overview: 85+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-17 12:11 How to contribute new package to GNU ELPA? stardiviner
2020-12-19 6:22 ` Stefan Monnier
2020-12-19 7:08 ` stardiviner
2020-12-19 15:35 ` Stefan Monnier
2020-12-20 2:12 ` stardiviner
2020-12-20 12:29 ` Adam Porter [this message]
2020-12-20 13:44 ` Emacs HTTP libraries [was: Re: How to contribute new package to GNU ELPA?] Daniel Brooks
2021-03-28 1:47 ` T.V Raman
2021-03-28 22:42 ` Vladimir Sedach
2021-03-29 9:00 ` Sv: " arthur miller
2021-03-29 22:03 ` Jose E. Marchesi
2021-03-29 22:09 ` Darshit Shah
2021-03-30 11:12 ` Arthur Miller
2021-03-30 12:03 ` Daniel Martín
2021-03-30 12:46 ` Stefan Kangas
2021-03-30 12:50 ` Eli Zaretskii
2021-03-30 13:14 ` Lars Ingebrigtsen
2021-03-30 13:39 ` Eli Zaretskii
2021-03-30 13:48 ` Lars Ingebrigtsen
2021-03-30 13:55 ` Eli Zaretskii
2021-03-30 14:25 ` Eli Zaretskii
2021-03-30 14:34 ` Lars Ingebrigtsen
2021-03-30 15:15 ` Eli Zaretskii
2021-03-31 13:36 ` Lars Ingebrigtsen
2021-03-30 16:13 ` Clément Pit-Claudel
2021-03-30 16:21 ` Eli Zaretskii
2021-03-30 16:49 ` Clément Pit-Claudel
2021-03-30 17:03 ` Eli Zaretskii
2021-03-30 19:53 ` Clément Pit-Claudel
2021-03-31 1:08 ` Stefan Monnier
2021-03-31 6:22 ` Eli Zaretskii
2021-03-31 5:54 ` Eli Zaretskii
2021-03-30 20:53 ` T.V Raman
2021-03-31 6:02 ` Eli Zaretskii
2021-03-31 16:01 ` read-process-output-max (was: Emacs HTTP libraries) Stefan Monnier
2021-03-31 17:13 ` Eli Zaretskii
2021-03-31 23:05 ` read-process-output-max Stefan Monnier
2021-04-01 7:12 ` read-process-output-max Eli Zaretskii
2021-03-30 18:08 ` Sv: Emacs HTTP libraries [was: Re: How to contribute new package to GNU ELPA?] Arthur Miller
2021-03-31 8:59 ` Robert Pluim
2021-03-31 17:21 ` Daniel Brooks
2021-04-01 14:23 ` Robert Pluim
2021-04-01 16:09 ` Daniel Brooks
2021-04-02 12:10 ` Robert Pluim
2021-04-01 16:57 ` tomas
2021-03-29 23:56 ` Daniel Brooks
2020-12-20 13:56 ` David Engster
2020-12-20 17:27 ` Lars Ingebrigtsen
2020-12-20 14:36 ` Stefan Monnier
2020-12-20 15:17 ` Jean Louis
2020-12-20 15:23 ` Helmut Eller
2020-12-20 16:02 ` Daniel Brooks
2020-12-21 5:47 ` Richard Stallman
2020-12-21 14:17 ` Stefan Monnier
2020-12-22 5:17 ` Richard Stallman
2020-12-21 16:59 ` Philip K.
2020-12-21 17:23 ` Eli Zaretskii
2020-12-21 17:41 ` Arthur Miller
2020-12-21 18:13 ` Eli Zaretskii
2020-12-21 18:18 ` Arthur Miller
2020-12-21 23:51 ` Philip K.
2020-12-22 3:32 ` Lars Ingebrigtsen
2020-12-22 3:35 ` Eli Zaretskii
2020-12-22 10:38 ` Philip K.
2020-12-22 16:02 ` Eli Zaretskii
2020-12-22 16:59 ` Philip K.
2020-12-22 17:15 ` Eli Zaretskii
2020-12-22 5:20 ` Richard Stallman
2020-12-22 6:42 ` Arthur Miller
2020-12-22 10:49 ` Philip K.
2020-12-22 12:03 ` Jean Louis
2020-12-22 13:23 ` Philip K.
2020-12-23 4:26 ` Richard Stallman
2020-12-22 13:04 ` Arthur Miller
2020-12-23 4:26 ` Richard Stallman
2020-12-23 11:27 ` Arthur Miller
2020-12-24 5:51 ` Richard Stallman
2020-12-24 12:59 ` Arthur Miller
2020-12-25 4:41 ` Richard Stallman
2020-12-20 14:18 ` How to contribute new package to GNU ELPA? Stefan Monnier
2020-12-21 14:03 ` stardiviner
2020-12-26 9:09 ` stardiviner
2020-12-26 15:21 ` dick.r.chiang
2020-12-26 20:24 ` Adam Porter
2020-12-26 20:39 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v9cwek4u.fsf_-_@alphapapa.net \
--to=adam@alphapapa.net \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.