From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/43105 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.gnus.general Subject: Re: display-time, mail-icon and POP3 mailboxes Date: 14 Feb 2002 10:41:21 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: <5xlmdwe6ym.fsf__20053.2075170942$1042212465@kfs2.cua.dk> References: <200202081357.g18Dvfw05454@aztec.santafe.edu> <5x1yfva7m8.fsf@kfs2.cua.dk> <5xn0yhrtye.fsf@kfs2.cua.dk> <200202111848.g1BIm0406891@aztec.santafe.edu> <5x3d07iojn.fsf@kfs2.cua.dk> <5x4rkmfcp8.fsf@kfs2.cua.dk> <200202140312.g1E3CMf09146@aztec.santafe.edu> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035178253 15776 80.91.224.250 (21 Oct 2002 05:30:53 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 05:30:53 +0000 (UTC) Cc: emacs-devel@gnu.org, ding@gnus.org Return-Path: Original-Received: (qmail 4967 invoked from network); 14 Feb 2002 14:08:12 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 14 Feb 2002 14:08:12 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16bMY3-0007bo-00; Thu, 14 Feb 2002 08:07:44 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 14 Feb 2002 08:07:42 -0600 (CST) Original-Received: from epithumia.math.uh.edu (epithumia.math.uh.edu [129.7.128.2]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id IAA13063 for ; Thu, 14 Feb 2002 08:07:35 -0600 (CST) Original-Received: (from tibbs@localhost) by epithumia.math.uh.edu (8.11.2/8.11.1) id g1EE7XR01894 for ding@hpc.uh.edu; Thu, 14 Feb 2002 08:07:33 -0600 Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id DAA12412 for ; Thu, 14 Feb 2002 03:41:11 -0600 (CST) Original-Received: (qmail 14594 invoked by alias); 14 Feb 2002 09:41:06 -0000 Original-Received: (qmail 14586 invoked from network); 14 Feb 2002 09:41:05 -0000 Original-Received: from mail.filanet.dk (195.215.206.179) by gnus.org with SMTP; 14 Feb 2002 09:41:05 -0000 Original-Received: from kfs2.cua.dk.cua.dk (kfs2.local.filanet.dk [192.168.1.182]) by mail.filanet.dk (Postfix) with SMTP id 183387C048; Thu, 14 Feb 2002 09:40:09 +0000 (GMT) Original-To: rms@gnu.org In-Reply-To: <200202140312.g1E3CMf09146@aztec.santafe.edu> Original-Lines: 47 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:43105 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:43105 Richard Stallman writes: > If it is non-nil, a non-blocking connect is attempted - if supported > by the o/s (and the emacs code) - and when the connection is > established, the argument (which must be a function) is called to > initiate using the connection. > > Would it make sense to use the sentinel function for this? It already > does a similar job. Yes, that sounds like a good idea. The steps for making a non-blocking open-network-stream could be: (defun my-stream-connected (p) ...) (defun my-sentinel (p s) (cond ((equal s "connected\n") ...) ;; connection established (my-stream-connected p)) ((equal s "failed\n") ...) ;; connect failed ) (t ...))) (defun ... (setq p (open-network-stream .... t)) (when p (cond ((eq (process-status p) 'connecting) ;; New return value ;; connecting, so set sentinel (set-process-sentinel p 'my-sentinel)) ((eq (process-status p) 'open) ;; non-blocking connect not supported, connected (my-stream-connected p)) ((eq (process-status p) 'closed) ;; failure... ;; will this happen? -- open-network-stream should return nil instead (delete-process p) ;; necessary? (setq p nil))))) Doesn't seem to be too complicated to use... -- Kim F. Storm http://www.cua.dk