From mboxrd@z Thu Jan 1 00:00:00 1970 Path: quimby.gnus.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: display-time, mail-icon and POP3 mailboxes Date: 14 Feb 2002 10:41:21 +0100 Message-ID: <5xlmdwe6ym.fsf@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: quimby2.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: quimby2.netfonds.no 1013680427 28288 195.204.10.66 (14 Feb 2002 09:53:47 GMT) X-Complaints-To: usenet@quimby2.netfonds.no NNTP-Posting-Date: 14 Feb 2002 09:53:47 GMT Cc: emacs-devel@gnu.org, ding@gnus.org Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby2.netfonds.no with esmtp (Exim 3.12 #1 (Debian)) id 16bIaJ-0007MA-00 for ; Thu, 14 Feb 2002 10:53:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.33 #1 (Debian)) id 16bIP3-0003Oy-00; Thu, 14 Feb 2002 04:42:09 -0500 Original-Received: from mail.filanet.dk ([195.215.206.179]) by fencepost.gnu.org with smtp (Exim 3.33 #1 (Debian)) id 16bIN9-0003Lw-00; Thu, 14 Feb 2002 04:40:12 -0500 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 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: quimby.gnus.org gmane.emacs.devel:1118 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:1118 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 _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel