all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: emacs-devel@gnu.org
Subject: Library defaults
Date: Sun, 22 Jan 2017 00:19:23 +0100	[thread overview]
Message-ID: <878tq480hw.fsf@gnus.org> (raw)

Controlling things like cookies and caching is an application-level
thing and not a library level thing (i.e., a browser like eww should
allow the user to control whether to send cookies or not; not a global
setting that affects the lower-level library).

But still, nice defaults in a low-level library is also nice.  This is
the current signature for `with-url':

(with-url (URL &key WAIT TIMEOUT READ-TIMEOUT (VERBOSE 5) (COOKIES t)
(CACHE t) DEBUG HEADERS IGNORE-ERRORS (METHOD "GET") DATA
(DATA-CHARSET 'utf-8) DATA-ENCODING) &body BODY)

The three defaults up for discussion are `verbose', `cookies' and
`cache'.

In application use, most would set verbose to 0 (no messages), but
perhaps it's nice to see a "Connecting to..." message if you're
developing an app `with-url' at first?

Developing with cookies switched on by default...  I don't know.  Most
applications will have that on, but perhaps having a library like that
alter files under ~/.emacs.d/url/cookies should be something that you
opt in to?  Or perhaps it should default to `write', which means that it
sends cookies, but never updates them.

All apps will run with caching switched on (unless the user has
specified something else), but it's the same thing as with cookies: With
a default of t, just fiddling with this function may end up storing
things in ~/.emacs.d/url/cache, which may not be what you want.  So nil
as a default?

So it's really: Make the defaults developer-friendly or source code
friendly?  Because all calls from applications will end up looking like

(with-url ("http..." :cookies t
                     :cache t
                     :verbose 0)
   ...)

And that's kinda sad, too.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





             reply	other threads:[~2017-01-21 23:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-21 23:19 Lars Ingebrigtsen [this message]
2017-01-24 16:59 ` Library defaults Davis Herring
2017-01-24 18:08   ` Lars Ingebrigtsen
2017-01-26 23:03 ` Ted Zlatanov

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=878tq480hw.fsf@gnus.org \
    --to=larsi@gnus.org \
    --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.