From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sean McAfee Newsgroups: gmane.emacs.help Subject: Re: wait/sleep in a keyboard macro? Date: Mon, 30 Aug 2010 12:06:36 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1291869070 8889 80.91.229.12 (9 Dec 2010 04:31:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 04:31:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 05:31:06 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQY9p-0003FM-SQ for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 05:31:06 +0100 Original-Received: from localhost ([127.0.0.1]:40277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQY9p-0003Rf-4J for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 23:31:05 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!news2.glorb.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Mon, 30 Aug 2010 14:06:36 -0500 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (darwin) Cancel-Lock: sha1:F8FRotJDrA6crjtoQ15Kz+idn7U= Original-Lines: 25 Original-X-Trace: sv3-8v5awpyY11YIS4jrn6FEQ9i+CkRAupkm1km5PON1oag8wBgxDcme2R48cAZqK1mTSRuMN56B6v+n1Wp!7S0rfsPlOgQfi9eWVrqrqzX3/7EEAJW9EGi3m94dHP72upZhS42Lz4BGuA4= Original-X-Complaints-To: www.supernews.com/docs/abuse.html X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Original-Xref: usenet.stanford.edu gnu.emacs.help:181027 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:76648 Archived-At: kent williams writes: > (fset 'hardcorps > [?\M-x ?t ?e ?l ?n ?e ?t ?\C-m ?c ?h ?a ?t ?. ?f ?4 ?. ?c ?a ? ?6 > ?6 ?2 ?3 ?\C-m ?* ?* ?* ?* ?\C-m ?* ?* ?* ?* ?* ?* ?* ?* ?* ?* > ?\C-m]) > > in other words: alt-X 'telnet chat.f4.ca 6623' '' > '' return > > It appears (to me) that what happens is that the macro runs too fast, > such that when it tries to add the login name to the buffer, the > buffer isn't yet connected to the server, or it isn't ready for input. > Or something! How about advising the telnet function to wait a bit after it runs if a keyboard macro is executing? (defadvice telnet (after pause-during-keyboard-macro activate) (when executing-kbd-macro (sleep-for 1))) Season the sleep-for delay to taste. Not very sophisticated, but it gets the job done.