unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Library defaults
@ 2017-01-21 23:19 Lars Ingebrigtsen
  2017-01-24 16:59 ` Davis Herring
  2017-01-26 23:03 ` Ted Zlatanov
  0 siblings, 2 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2017-01-21 23:19 UTC (permalink / raw)
  To: emacs-devel

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-26 23:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-21 23:19 Library defaults Lars Ingebrigtsen
2017-01-24 16:59 ` Davis Herring
2017-01-24 18:08   ` Lars Ingebrigtsen
2017-01-26 23:03 ` Ted Zlatanov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).