;ELC
;;; Compiled by LTX@Xue-LingTaos-MacBook-Pro.local on Wed Mar 16 23:12:52 2011
;;; from file /Users/LTX/Projects/Emacs/emacs/lisp/erc/erc-autoaway.el
;;; in Emacs version 24.0.50.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\302\303\304\305\306\301%\207" [require erc custom-declare-group erc-autoaway nil "Set yourself automatically away after some idletime and set\nyourself back when you type something." :group] 6)
#@90 The Emacs idletimer.
This is only used when `erc-autoaway-idle-method' is set to 'emacs.
(defvar erc-autoaway-idletimer nil (#$ . 770))
#@40 The last time the user sent something.
(defvar erc-autoaway-last-sent-time (erc-current-time) (#$ . 912))
#@83 Indicates whether this module was responsible for setting the
user's away status.
(defvar erc-autoaway-caused-away nil (#$ . 1024))
#@153 Reestablish the Emacs idletimer.
If `erc-autoaway-idle-method' is 'emacs, you must call this
function each time you change `erc-autoaway-idle-seconds'.
(defalias 'erc-autoaway-reestablish-idletimer #[nil "\203\302!\210\303	\304\305	$\211\207" [erc-autoaway-idletimer erc-autoaway-idle-seconds erc-cancel-timer run-with-idle-timer t erc-autoaway-set-away] 5 (#$ . 1163) nil])
#@89 Return some ERC server buffer if its connection is alive.
If none is found, return nil.
(defalias 'erc-autoaway-some-server-buffer #[nil "\300\301!@\207" [erc-buffer-list erc-open-server-buffer-p] 2 (#$ . 1549)])
#@146 Add autoaway reset function to `post-command-hook' if at least one
ERC process is alive.

This is used when `erc-autoaway-idle-method' is 'user.
(defalias 'erc-autoaway-insinuate-maybe #[(&optional server &rest ignored) "\204	\301 \205
\302\303\304\"\207" [server erc-autoaway-some-server-buffer add-hook post-command-hook erc-autoaway-reset-idle-user] 3 (#$ . 1769)])
#@145 Remove the autoaway reset function from `post-command-hook' if
no ERC process is alive.

This is used when `erc-autoaway-idle-method' is 'user.
(defalias 'erc-autoaway-remove-maybe #[(&rest ignored) "\300 ?\205\n\301\302\303\"\207" [erc-autoaway-some-server-buffer remove-hook post-command-hook erc-autoaway-reset-idle-user] 3 (#$ . 2148)])
#@272 Non-nil if Erc-Autoaway mode is enabled.
See the command `erc-autoaway-mode' for a description of this minor mode.
Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization')
or call the function `erc-autoaway-mode'.
(custom-declare-variable 'erc-autoaway-mode 'nil '(#$ . 2497) :set 'custom-set-minor-mode :initialize 'custom-initialize-default :group 'erc-autoaway :type 'boolean)
#@885 Toggle ERC autoaway mode.
With arg, turn ERC autoaway mode on if and only if arg is positive.
In ERC autoaway mode, you can be set away automatically.
If `erc-auto-set-away' is set, then you will be set away after
the number of seconds specified in `erc-autoaway-idle-seconds'.

There are several kinds of being idle:

User idle time measures how long you have not been sending any
commands to Emacs.  This is the default.

Emacs idle time measures how long Emacs has been idle.  This is
currently not useful, since Emacs is non-idle when it handles
ping-pong with IRC servers.  See `erc-autoaway-idle-method'
for more information.

IRC idle time measures how long since you last sent something (see
`erc-autoaway-last-sent-time').

If `erc-auto-discard-away' is set, then typing anything, will
set you no longer away.

Related variables: `erc-public-away-p' and `erc-away-nickname'.
(defalias 'erc-autoaway-mode #[(&optional arg) "\303 	\304=\203\n?\202\305	!\306V\211\203\307 \210\202!\310 \210\311\312\n\203+\313\202,\314\"\210\315\316!\203Q\317\302!\210\303 \203D\303 \232\203Q\320\321\n\203N\322\202O\323\"\210)\324 \210\n\207" [#1=#:last-message arg erc-autoaway-mode current-message toggle prefix-numeric-value 0 erc-autoaway-enable erc-autoaway-disable run-hooks erc-autoaway-mode-hook erc-autoaway-mode-on-hook erc-autoaway-mode-off-hook called-interactively-p any customize-mark-as-set message "Erc-Autoaway mode %sabled" "en" "dis" force-mode-line-update] 4 (#$ . 2941) (list (or current-prefix-arg 'toggle))])
(byte-code "\301\302\303\304\300!\205\n\303\211%\207" [erc-autoaway-mode-map add-minor-mode erc-autoaway-mode nil boundp] 6)
#@27 Enable ERC autoaway mode.
(defalias 'erc-autoaway-enable #[nil "\303\304\305\"\210\306\307\302!\205P\310\311\312\"\210\313 \n\314=\203(\310\315\316\"\210\310\317\316\"\210\202G\n\320=\203>\310\321\322\"\210\310\323\324\"\210\322 \210\202G\n\325=\203G\326 \210\310\327\330\"\210\310\331\312\"\207" [erc-autoaway-mode erc-autoaway-last-sent-time erc-autoaway-idle-method add-to-list erc-modules autoaway t boundp add-hook erc-connect-pre-hook erc-autoaway-reset-indicators erc-current-time irc erc-send-completed-hook erc-autoaway-reset-idle-irc erc-server-001-functions user erc-after-connect erc-autoaway-insinuate-maybe erc-disconnected-hook erc-autoaway-remove-maybe emacs erc-autoaway-reestablish-idletimer erc-timer-hook erc-autoaway-possibly-set-away erc-server-305-functions] 3 (#$ . 4613) nil])
#@28 Disable ERC autoaway mode.
(defalias 'erc-autoaway-disable #[nil "\304\305\"\306\307\302!\205R\310\311\312\"\210\n\313=\203%\310\314\315\"\210\310\316\315\"\210\202I\n\317=\203=\310\320\321\"\210\310\322\323\"\210\310\324\325\"\210\202I\n\326=\203I\327!\210\306\310\330\331\"\210\310\332\312\"\207" [erc-modules erc-autoaway-mode erc-autoaway-idle-method erc-autoaway-idletimer delq autoaway nil boundp remove-hook erc-connect-pre-hook erc-autoaway-reset-indicators irc erc-send-completed-hook erc-autoaway-reset-idle-irc erc-server-001-functions user post-command-hook erc-autoaway-reset-idle-user erc-after-connect erc-autoaway-insinuate-maybe erc-disconnected-hook erc-autoaway-remove-maybe emacs erc-cancel-timer erc-timer-hook erc-autoaway-possibly-set-away erc-server-305-functions] 3 (#$ . 5429) nil])
(byte-code "\300\301\302\303#\210\300\304\302\303#\210\300\305\302\303#\207" [put erc-autoaway-mode definition-name autoaway erc-autoaway-enable erc-autoaway-disable] 4)
#@366 *The method used to determine how long you have been idle.
If 'user, the time of the last command sent to Emacs is used.
If 'emacs, the idle time in Emacs is used.
If 'irc, the time of the last IRC command is used.

The time itself is specified by `erc-autoaway-idle-seconds'.

See `erc-autoaway-mode' for more information on the various
definitions of being idle.
(custom-declare-variable 'erc-autoaway-idle-method ''user '(#$ . -6426) :group 'erc-autoaway :type '(choice (const :tag "User idle time" user) (const :tag "Emacs idle time" emacs) (const :tag "Last IRC action" irc)) :set #[(sym val) "\203\303 \210	\nL\210\304 \207	\nL\207" [erc-autoaway-mode sym val erc-autoaway-disable erc-autoaway-enable] 2])
#@295 *If non-nil, set away after `erc-autoaway-idle-seconds' seconds of idling.
ERC autoaway mode can set you away when you idle, and set you no
longer away when you type something.  This variable controls whether
you will be set away when you idle.  See `erc-auto-discard-away' for
the other half.
(custom-declare-variable 'erc-auto-set-away 't '(#$ . -7148) :group 'erc-autoaway :type 'boolean)
#@359 *If non-nil, sending anything when away automatically discards away state.
ERC autoaway mode can set you away when you idle, and set you no
longer away when you type something.  This variable controls whether
you will be set no longer away when you type something.  See
`erc-auto-set-away' for the other half.
See also `erc-autoaway-no-auto-discard-regexp'.
(custom-declare-variable 'erc-auto-discard-away 't '(#$ . -7547) :group 'erc-autoaway :type 'boolean)
#@99 *Input that matches this will not automatically discard away status.
See `erc-auto-discard-away'.
(custom-declare-variable 'erc-autoaway-no-auto-discard-regexp '"^/g?away.*$" '(#$ . -8013) :group 'erc-autoaway :type 'regexp)
#@206 *Number of seconds after which ERC will set you automatically away.
If you are changing this variable using lisp instead of customizing it,
you have to run `erc-autoaway-reestablish-idletimer' afterwards.
(custom-declare-variable 'erc-autoaway-idle-seconds '1800 '(#$ . -8245) :group 'erc-autoaway :set #[(sym val) "\303	\"\210\n\304=\205
\305 \207" [sym val erc-autoaway-idle-method set-default emacs erc-autoaway-reestablish-idletimer] 3] :type 'number)
#@138 *Message ERC will use when setting you automatically away.
It is used as a `format' string with the argument of the idletime
in seconds.
(custom-declare-variable 'erc-autoaway-message '"I'm gone (autoaway after %i seconds of idletime)" '(#$ . -8710) :group 'erc-autoaway :type 'string)
#@123 Reset the stored user idle time.
This is one global variable since a user talking on one net can
talk on another net too.
(defalias 'erc-autoaway-reset-idle-user #[(&rest stuff) "\203\302\303!\210\304 \211\207" [erc-auto-discard-away erc-autoaway-last-sent-time erc-autoaway-set-back erc-autoaway-remove-maybe erc-current-time] 2 (#$ . 9003)])
#@122 Reset the stored IRC idle time.
This is one global variable since a user talking on one net can
talk on another net too.
(defalias 'erc-autoaway-reset-idle-irc #[(line &rest stuff) "\203	;\203\304\n	\"\204\305 \210\306 \211\207" [erc-auto-discard-away line erc-autoaway-no-auto-discard-regexp erc-autoaway-last-sent-time string-match erc-autoaway-set-back erc-current-time] 3 (#$ . 9358)])
#@106 Discard the away state globally.

NONE-ALIVE-FUNC is the function to call if no ERC processes are alive.
(defalias 'erc-autoaway-set-back #[(&optional none-alive-func) "\304 	\203\305!\203rq\210\n)\203\306\307!\202\"\205\" )\207" [server-buffer erc-autoaway-caused-away erc-away none-alive-func erc-autoaway-some-server-buffer buffer-live-p erc-cmd-GAWAY ""] 2 (#$ . 9763)])
#@114 Return some ERC server buffer if its connection is alive and the
user is not away.
If none is found, return nil.
(defalias 'erc-autoaway-some-open-server-buffer #[nil "\300\301!@\207" [erc-buffer-list #[nil "\301 \205?\207" [erc-away erc-open-server-buffer-p] 1]] 2 (#$ . 10158)])
#@104 Set autoaway when `erc-auto-set-away' is true and the idletime is
exceeds `erc-autoaway-idle-seconds'.
(defalias 'erc-autoaway-possibly-set-away #[(current-time) "\205-	\205-\n?\205-\306 \205-\307\f\"\211Y\205,\310\311\312\311\313\314
\"$\210\315
\316\")\207" [erc-server-connected erc-auto-set-away erc-autoaway-caused-away erc-autoaway-last-sent-time current-time idle-time erc-autoaway-some-open-server-buffer erc-time-diff erc-display-message nil notice format "Setting automatically away after %i seconds of idle-time" erc-autoaway-set-away t erc-autoaway-idle-seconds] 8 (#$ . 10449)])
#@128 Set the away state globally.

If NOTEST is specified, do not check to see whether there is an
activer server buffer available.
(defalias 'erc-autoaway-set-away #[(idle-time &optional notest) "\204	\304 \205\305\306\307\n\"!\207" [notest erc-autoaway-caused-away erc-autoaway-message idle-time erc-autoaway-some-open-server-buffer t erc-cmd-GAWAY format] 4 (#$ . 11058)])
#@51 Reset indicators used by the erc-autoaway module.
(defalias 'erc-autoaway-reset-indicators #[(&rest stuff) "\302 \303\211\207" [erc-autoaway-last-sent-time erc-autoaway-caused-away erc-current-time nil] 2 (#$ . 11441)])
(provide 'erc-autoaway)
