erc-discuss
[Top][All Lists]
Advanced

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

[Erc-discuss] Re: Make erc-autoaway-use-emacs-idle work like type-break


From: Mark Plaksin
Subject: [Erc-discuss] Re: Make erc-autoaway-use-emacs-idle work like type-break mode?
Date: Sun, 28 May 2006 21:03:13 -0400
User-agent: Gnus/5.110005 (No Gnus v0.5) Emacs/22.0.51 (gnu/linux)

Michael Olson <address@hidden> writes:

> Mark Plaksin <address@hidden> writes:
>
>> The documentation for erc-autoaway-use-emacs-idle says:
>>
>>   Note that using Emacs idletime is currently broken for most
>>   versions, since process activity (as happens all the time on IRC)
>>   makes Emacs non-idle.  Emacs idle-time and user idle-time are just
>>   not the same.
>>
>> type-break mode knows when you've been typing and when you haven't.
>> What about making ERC's use-emacs-idle option work like type-break
>> mode?  Maybe some part of type-break itself can be used.  type-break
>> uses run-at-time plus some other functions to figure out how long
>> you've been typing (or idle).
>
> This seems like a good idea.  I figure we could remove the idle timer
> functionality (since it appears to be broken) and make it an option to
> use the time of the last keystroke as a basis for autoaway detection.
> To get the time of the last keystroke, we'd just have to add the
> following function to `post-command-hook'.
>
> (defun erc-autoaway-get-last-keystroke
>   (setq erc-autoaway-last-keystroke (current-time)))

How about this patch?  It's a little clunky doing the setup (see FIXME) but
works nicely for me.  Besides setting away when you don't type anything, it
unsets away after you start typing.  That's what I want but maybe I'm
strange :)

Attachment: erc-autoaway.diff
Description: Text document


reply via email to

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