all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
Cc: Magnus Henoch <mange@freemail.hu>, emacs-devel@gnu.org
Subject: Re: url-retrieve may cause hang
Date: Wed, 25 Oct 2006 10:22:10 -0400	[thread overview]
Message-ID: <87mz7kwk4t.fsf@stupidchicken.com> (raw)
In-Reply-To: <E1GbyF7-0004ma-PN@fencepost.gnu.org> (Richard Stallman's message of "Mon\, 23 Oct 2006 07\:45\:21 -0400")

Richard Stallman <rms@gnu.org> writes:

>     I made "status" an extra argument at the beginning of the argument
>     list (so if CBARGS has N elements, the callback is called with N+1
>     arguments).  I described this in the docstring of url-retrieve in my
>     patch below (not yet committed).
>
> Is this new argument _unconditionally_ present?

>From my reading of the code, it is unconditionally present (though it
can be an empty list).

> I can't tell, and I see comments that seem to suggest
> that it might not be so:
>
> +       (setf (car url-callback-arguments)
> + 	    (nconc (list :error (list 'error 'connection-failed why
> + 				      :host (url-host url-current-object)
> + 				      :service (url-port url-current-object)))
> + 		   (car url-callback-arguments)))

The car of url-callback-arguments is the new STATUS argument, so this
is correct.

> And this:
>
>       It is called as (apply CALLBACK STATUS CBARGS), where STATUS
>     ! is a list with an even number of elements representing what happened
>     ! during the request, with most recent events first.  Each pair is one
>     ! of:
>     ! 
>     ! \(:redirect REDIRECTED-TO) - the request was redirected to this URL
>     ! \(:error (ERROR-SYMBOL . DATA)) - an error occurred.  The error can be
>     ! signaled with (signal ERROR-SYMBOL DATA).

This is pretty clear: it says there is a STATUS argument; it
definitely doesn't say that argument can be elided (and it isn't).

> I don't like that variability, and it is easy to avoid.  If we are to
> change the API of these callbacks now, let's change it to something
> more consistent: add a single argument unconditionally.  That added
> argument can be a property list in which :redirect and :error may
> occur.

I don't see anything wrong with the patch.  I suggest checking it in
and beginning the pretest.  OK?

  reply	other threads:[~2006-10-25 14:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-16 22:33 url-retrieve may cause hang David Reitter
2006-10-17  0:42 ` Magnus Henoch
2006-10-17  8:05   ` Kim F. Storm
2006-10-17 14:57     ` Magnus Henoch
2006-10-17 15:38       ` Stefan Monnier
2006-10-23  2:01         ` Magnus Henoch
2006-10-23 11:45           ` Richard Stallman
2006-10-25 14:22             ` Chong Yidong [this message]
2006-10-25 23:00               ` Magnus Henoch
2006-10-26  5:23               ` Richard Stallman
2006-10-17 16:24       ` Magnus Henoch
2006-10-17 17:48       ` David Reitter
2006-10-18 16:23         ` Michaël Cadilhac
2006-10-18  5:12       ` Richard Stallman
2006-10-18  9:03         ` Magnus Henoch
2006-10-18 14:01           ` Stefan Monnier
2006-10-18 17:54           ` Richard Stallman

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=87mz7kwk4t.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=mange@freemail.hu \
    /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.