emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: async.el: A simple asynchronous framework for Emacs


From: John Wiegley
Subject: Re: async.el: A simple asynchronous framework for Emacs
Date: Wed, 20 Jun 2012 00:34:46 -0500
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1 (darwin)

>>>>> Stefan Monnier <address@hidden> writes:

> The byte-compiler uses prin1 to generate the .elc files, so I'm pretty sure
> there's a way to solve this problem ;-)

Actually, I was being too pessimistic.  Byte-compiled forms are handled just
fine!

What I did run into is a bug communicating with the subprocess over stdin.
It happens if I use this function:

    (defun async-smtpmail-send-it ()
      (async-start
       `(lambda ()
          (require 'smtpmail)
          (with-temp-buffer
            (insert ,(buffer-substring-no-properties (point-min) (point-max)))
            ;; Pass in the variable environment for smtpmail
            ;;,(async-inject-variables
            ;;  "\\`\\(smtpmail\\|\\(user-\\)?mail\\)-"
            ;;  (lambda (symbol)
            ;;    (or (not (functionp sym))
            ;;        (symbolp sym)))
            ;;  
"\\(\\`mail-header-format-function\\|-syntax-table\\|-mode-map\\)\\'")
            (setq mail-extr-trailing-comment-start-pattern 
'"[-{]\\|--\\|address@hidden></;]")
            (setq smtpmail-debug-info 'nil)
            (setq mail-abbrev-mode-regexp
                  '"^\\(Resent-\\)?\\(To\\|From\\|CC\\|BCC\\|Reply-to\\):")
            (setq mail-send-actions 'nil)
            (setq mail-source-imap-streams
                  '((const gssapi)
                    (const kerberos4)
                    (const tls)
                    (const ssl)
                    (const network)
                    (const shell)
                    (const starttls)))
            (smtpmail-send-it))))
       'ignore))

All I see from the stdout of the child process is around 20 ^G characters, and
then it blocks waiting for input.  However, If I delete *any one* of the setq
statements above (it doesn't matter which), it works just fine.  So it doesn't
appear to be triggered by the length, or by any special characters.  I'm
having a tough time figuring this one out.

I've also implemented a message-passing scheme so one can implement status
updates for long-running async jobs, but I'm hesitant to enable it because it
relies on communicating over the pipe.

Until then, I pass the async lambda as a program argument, which means I'm
limited on maximum length to the OS limit (around 4k on Mac, I believe).

John



reply via email to

[Prev in Thread] Current Thread [Next in Thread]