help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: wait/sleep in a keyboard macro?


From: Kevin Rodgers
Subject: Re: wait/sleep in a keyboard macro?
Date: Fri, 10 Sep 2010 00:10:05 -0600
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2

On 8/30/10 8:44 AM, kent williams wrote:
Prior to emacs 23, I had a simple keyboard macro I used to log in to a
chat server via telnet.  Yes, the password was plain text in the macro
body in my .emacs, but this was not a high-security thing.

But this dumb macro stopped working in emacs 23.  The reason being --
well the behavior differs now based on whether the buffer for the
telnet session already exists, but most commonly, I get an error
message "Marker does not point anywhere".

The macro itself is this:


(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>  '<login name>'
<return>  '<password>' 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!

I suppose it's possible to do this in a more sophisticated way in
lisp, but this hasn't risen to the level of importance for me that I'm
ready to puzzle out how to wait for prompts from a remote host before
adding text to the buffer.

Try M-: (sleep-for 1) RET

--
Kevin Rodgers
Denver, Colorado, USA




reply via email to

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