emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Library defaults


From: Lars Ingebrigtsen
Subject: Library defaults
Date: Sun, 22 Jan 2017 00:19:23 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]