From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Library defaults Date: Sun, 22 Jan 2017 00:19:23 +0100 Organization: Programmerer Ingebrigtsen Message-ID: <878tq480hw.fsf@gnus.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1485040827 701 195.159.176.226 (21 Jan 2017 23:20:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 21 Jan 2017 23:20:27 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 22 00:20:22 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cV4xJ-0008AM-VO for ged-emacs-devel@m.gmane.org; Sun, 22 Jan 2017 00:20:22 +0100 Original-Received: from localhost ([::1]:33662 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cV4xO-00038q-TG for ged-emacs-devel@m.gmane.org; Sat, 21 Jan 2017 18:20:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cV4xD-00037c-Fv for emacs-devel@gnu.org; Sat, 21 Jan 2017 18:20:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cV4xA-0008Cs-Bp for emacs-devel@gnu.org; Sat, 21 Jan 2017 18:20:15 -0500 Original-Received: from [195.159.176.226] (port=56326 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cV4xA-0008Cj-5D for emacs-devel@gnu.org; Sat, 21 Jan 2017 18:20:12 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cV4wm-0005OL-8o for emacs-devel@gnu.org; Sun, 22 Jan 2017 00:19:48 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 45 Original-X-Complaints-To: usenet@blaine.gmane.org Mail-Copies-To: never Cancel-Lock: sha1:wtjxgoiR20jSXaEWodeZQSjh8l0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211513 Archived-At: 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