all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Timeout for reading file across network
@ 2010-09-02 13:43 Ali Pang
  2010-09-03  0:56 ` PJ Weisberg
  0 siblings, 1 reply; 3+ messages in thread
From: Ali Pang @ 2010-09-02 13:43 UTC (permalink / raw)
  To: Help-gnu-emacs


Hi,

I'd like to load my .emacs from a remote location if possible. The problem
is I'm on windows, and the time-out before recognizing that the file is
unavailable is ridiculously long (minutes). Thus if the file is unavailable,
emacs blocks for a long time at startup. I've tried basically doing

(if (with-timeout (4) 
      (file-exists-p remote-.emacs))
  (load remote-.emacs))

but I guess with-timeout does not do what I want. Any ideas about what I
could use instead?
-- 
View this message in context: http://old.nabble.com/Timeout-for-reading-file-across-network-tp29604481p29604481.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




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

* Re: Timeout for reading file across network
       [not found] <mailman.3.1283436363.15631.help-gnu-emacs@gnu.org>
@ 2010-09-02 20:45 ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2010-09-02 20:45 UTC (permalink / raw)
  To: help-gnu-emacs

> (if (with-timeout (4) 
>       (file-exists-p remote-.emacs))
>   (load remote-.emacs))

Emacs is not too good at non-blocking operations, timeouts, or
threading.  The only support for it is basically through asynchronous
processes.  So your best bet is to call start-process to run a separate
program that will try and access the file.
You can then wait with a sleep-for (or with some with-timeout maybe).


        Stefan



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

* Re: Timeout for reading file across network
  2010-09-02 13:43 Ali Pang
@ 2010-09-03  0:56 ` PJ Weisberg
  0 siblings, 0 replies; 3+ messages in thread
From: PJ Weisberg @ 2010-09-03  0:56 UTC (permalink / raw)
  To: Ali Pang; +Cc: Help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1017 bytes --]

I'm no Emacs expert, but from a quick look at the documentation for
with-timeout it looks like you should use:

(with-timeout (4)
     (load remote-.emacs))

What actually happens when you do that?  Nothing at all?  Waits longer than
four seconds?

On Thu, Sep 2, 2010 at 6:43 AM, Ali Pang <ali_pang@hotmail.com> wrote:

>
> Hi,
>
> I'd like to load my .emacs from a remote location if possible. The problem
> is I'm on windows, and the time-out before recognizing that the file is
> unavailable is ridiculously long (minutes). Thus if the file is
> unavailable,
> emacs blocks for a long time at startup. I've tried basically doing
>
> (if (with-timeout (4)
>      (file-exists-p remote-.emacs))
>  (load remote-.emacs))
>
> but I guess with-timeout does not do what I want. Any ideas about what I
> could use instead?
> --
> View this message in context:
> http://old.nabble.com/Timeout-for-reading-file-across-network-tp29604481p29604481.html
> Sent from the Emacs - Help mailing list archive at Nabble.com.
>
>
>

[-- Attachment #2: Type: text/html, Size: 1517 bytes --]

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

end of thread, other threads:[~2010-09-03  0:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.3.1283436363.15631.help-gnu-emacs@gnu.org>
2010-09-02 20:45 ` Timeout for reading file across network Stefan Monnier
2010-09-02 13:43 Ali Pang
2010-09-03  0:56 ` PJ Weisberg

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.