From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/15736 Path: news.gmane.org!not-for-mail From: Kevin Brubeck Unhammer Newsgroups: gmane.emacs.gnus.user Subject: delayed sending of mail Date: Wed, 22 Aug 2012 15:06:26 +0200 Message-ID: <87harvnkj1.fsf@fsfe.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3826985038611541698==" X-Trace: ger.gmane.org 1345640829 25652 80.91.229.3 (22 Aug 2012 13:07:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Aug 2012 13:07:09 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Wed Aug 22 15:07:06 2012 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T4AeA-0001Cz-SL for gegu-info-gnus-english@m.gmane.org; Wed, 22 Aug 2012 15:06:58 +0200 Original-Received: from localhost ([::1]:36204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4Ae9-0001EW-Am for gegu-info-gnus-english@m.gmane.org; Wed, 22 Aug 2012 09:06:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4Ae3-0001ED-4M for info-gnus-english@gnu.org; Wed, 22 Aug 2012 09:06:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4Ady-0003hU-Pf for info-gnus-english@gnu.org; Wed, 22 Aug 2012 09:06:50 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:47171) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4Ady-0003h9-Id for info-gnus-english@gnu.org; Wed, 22 Aug 2012 09:06:46 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1T4Adx-000136-VI for info-gnus-english@gnu.org; Wed, 22 Aug 2012 15:06:45 +0200 Original-Received: from cde31bf51.dhcp.as2116.net ([81.191.49.222]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Aug 2012 15:06:45 +0200 Original-Received: from unhammer by cde31bf51.dhcp.as2116.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Aug 2012 15:06:45 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 61 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cde31bf51.dhcp.as2116.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) Cancel-Lock: sha1:bdnIcx8rQaFuX5TwSnYf009Oxp8= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:15736 Archived-At: --===============3826985038611541698== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi,=20 someone on IRC asked about how to make a function that delays sending of email, so as to have a chance to edit/cancel within 2 minutes or so. I came up with (defun message-wait-send-and-exit (&optional arg) "Bury the buffer and wait a bit, then send message like `message-send-and-exit'." (interactive "P") (let ((timeout "2 minutes") (buf (current-buffer))) (message "Sending %s in %s" buf timeout) (bury-buffer) (run-at-time timeout nil (lambda (arg buf) (when (buffer-live-p buf) (with-current-buffer buf (let ((inhibit-quit nil)) ; avoid hang if e.g. server is slow/do= wn ; though this makes C-g dangerous (message-send-and-exit arg))))) arg buf))) =20=20 but I know it's fraught with problems (missing headers cause interactive questions to pop up out of nowhere, a C-g at the wrong moment will cancel sending). Has anyone attempted something like this before? I guess to avoid the problem of interactive questions you'd have to write your own version of `message-send' and do the `run-at-time' there. Perhaps `with-timeout' could be used along with inhibit-quit to avoid stray C-g's while still not hanging on server trouble? (Or is this a much bigger project than that?) =2D-=20 Kevin Brubeck Unhammer GPG: 0x766AC60C --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAEBAgAGBQJQNNlTAAoJEHQmBt52asYMVH8H/1b3+HGI1Fu/kMF7wWDuPBH1 Qis7/75YPzzzqfE/cb7YE/KIKjo7afI5RDJx2L5w8B2a8XEqlxK5yetEkJJSh83w XOxMbN845sDrM1GEEpi7hFrvlXDymtE81moUDoBzuUm2cJg9ymenv0XmsvsJq4zj uzUOFWRkrr9OrXs6SIzqHxhbYbSSoKllJ27U67bCpsFy2qoVNX9iZYvfitCgIR8C PPMf59+gz9W3kmm0Ss3Zgo/IsrbaWS5N9XONTPrdr6IDxuTiJ2bKSEXDgb70aiq0 TvHI0SXHghG3YK5r9u/XirY5S6W9tEMG4Zn1o5WVN4ZlxV+jWRu7zuj1Pwr/3iY= =gwoh -----END PGP SIGNATURE----- --=-=-=-- --===============3826985038611541698== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ info-gnus-english mailing list info-gnus-english@gnu.org https://lists.gnu.org/mailman/listinfo/info-gnus-english --===============3826985038611541698==--