;ELC ;;; compiled by jwz@thalidomide on Mon Jan 3 17:54:35 1994 ;;; from file /th/jwz/emacs19/lisp/prim/itimer.el ;;; emacs version 19.9 Lucid (beta12). ;;; bytecomp version 2.22; 22-dec-93. ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "This file was compiled for Emacs 19.")) (defvar itimer-version "1.00" "\ Version number of the itimer package.") (defvar itimer-list nil "\ List of all active itimers.") (defvar itimer-edit-map nil "\ Keymap used when in Itimer Edit mode.") (byte-code " ##########!MMM" [itimer-edit-map make-sparse-keymap define-key "s" itimer-edit-set-field "d" itimer-edit-delete-itimer "q" itimer-edit-quit " " itimer-edit-next-field " " next-line "n" "p" previous-line "" itimer-edit-previous-field "x" start-itimer "?" itimer-edit-help boundp itimer-edit-start-marker nil itimer-decf (macro . #[(variable) " DE" [setq variable 1-] 4]) itimer-incf (macro . #[(variable) " DE" [setq variable 1+] 4]) itimer-signum (macro . #[(n) "\nE\nDFF" [if > n 0 1 zerop -1] 7])] 4) (fset 'check-itimer '(macro . #[(var) " D EEFE" [setq var if itimerp signal 'wrong-type-argument list 'itimerp] 10 "\ If VAR is not bound to an itimer, signal wrong-type-argument. This is a macro."])) (fset 'check-itimer-coerce-string '(macro . #[(var) " D D D DD EEDFE" [setq var cond itimerp stringp get-itimer t signal 'wrong-type-argument list 'string-or-itimer-p] 11 "\ If VAR is not bound to a string, look up the itimer that it names and bind VAR to it. Otherwise if VAR is not bound to an itimer, signal wrong-type-argument. This is a macro."])) (fset 'itimer-check-natnum '(macro . #[(var) " D EEFE" [setq var if natnump signal 'wrong-type-argument list 'natnump] 10 "\ If VAR is not bound to a non-negative number, signal wrong-type-argument. This is a macro."])) (fset 'itimer-check-string '(macro . #[(var) " D EEFE" [setq var if stringp signal 'wrong-type-argument list 'stringp] 10 "\ If VAR is not bound to a string, signal wrong-type-argument. This is a macro."])) (fset 'itimerp #[(obj) ":@;G=" [obj 5] 2 "\ Returns non-nil iff OBJ is an itimer."]) (fset 'itimer-name #[(itimer) " ! D\"@" [itimerp itimer signal wrong-type-argument] 5 "\ Returns the name of ITIMER."]) (fset 'itimer-value #[(itimer) " ! D\"A@" [itimerp itimer signal wrong-type-argument] 5 "\ Returns the number of seconds until ITIMER expires."]) (fset 'itimer-restart #[(itimer) " ! D\" 8" [itimerp itimer signal wrong-type-argument 2] 4 "\ Returns the value to which ITIMER will be set at restart. nil is returned if this itimer doesn't restart."]) (fset 'itimer-function #[(itimer) " ! D\" 8" [itimerp itimer signal wrong-type-argument 3] 4 "\ Returns the function of ITIMER. This function is called each time ITIMER expires."]) (fset 'itimer-id #[(itimer) " ! D\" 8" [itimerp itimer signal wrong-type-argument 4] 4 "\ Returns the timeout-id of ITIMER."]) (fset 'set-itimer-value #[(itimer value) " ! D\" ! D\" ! ! A ! )" [itimerp itimer signal wrong-type-argument natnump value t inhibit-quit itimer-id deactivate-itimer activate-itimer] 4 "\ Set the timeout value of ITIMER to be VALUE. Itimer will expire is this many seconds. Returns VALUE."]) (fset 'set-itimer-restart #[(itimer restart) " ! D\" ! D\" W C\" !\n ! AA  A !* " [itimerp itimer signal wrong-type-argument restart natnump 1 args-out-of-range itimer-id t inhibit-quit was-active deactivate-itimer activate-itimer] 5 "\ Set the restart value of ITIMER to be RESTART. If RESTART is nil, ITIMER will not restart when it expires. Returns RESTART."]) (fset 'set-itimer-function #[(itimer function) " ! D\"AAA " [itimerp itimer signal wrong-type-argument function] 5 "\ Set the function of ITIMER to be FUNCTION. FUNCTION will be called when itimer expires. Returns FUNCTION."]) (fset 'set-itimer-id #[(itimer id) " ! D\"AAAA " [itimerp itimer signal wrong-type-argument id] 5]) (fset 'get-itimer #[(name) ";D\" \"" [name signal wrong-type-argument stringp assoc itimer-list] 4 "\ Return itimer named NAME, or nil if there is none."]) (fset 'read-itimer #[(prompt &optional initial-input) "\n %!" [get-itimer completing-read prompt itimer-list nil confirm initial-input] 7 "\ Read the name of an itimer from the minibuffer and return the itimer associated with that name. The user is prompted with PROMPT. Optional second arg INITIAL-INPUT non-nil is inserted into the minibuffer as initial user input."]) (fset 'delete-itimer #[(itimer) " ! ; ! D\" ! \"" [itimerp itimer get-itimer signal wrong-type-argument string-or-itimer-p deactivate-itimer delq itimer-list] 4 "\ Deletes ITIMER. ITIMER may be an itimer or the name of one."]) (fset 'start-itimer #[(name function value &optional restart) ";D\" ! D\"!D\" ! RTl* ЯB@!)@" [name signal wrong-type-argument stringp natnump value restart 2 num oname get-itimer "<" ">" t inhibit-quit function nil itimer-list activate-itimer] 5 "\ Start an itimer. Args are NAME, FUNCTION, VALUE &optional RESTART. NAME is an identifier for the itimer. It must be a string. If an itimer already exists with this name, NAME will be modified slightly to until it is unique. FUNCTION should be a function (or symbol naming one) of no arguments. It will be called each time the itimer expires. The function can access itimer that invoked it through the variable `current-itimer'. VALUE is the number of seconds until this itimer expires. Optional fourth arg RESTART non-nil means that this itimer should be restarted automatically after its function is called. Normally an itimer is deleted at expiration after its function has returned. If non-nil RESTART should be a number indicating the value at which the itimer should be set at restart time. Returns the newly created itimer." (byte-code "\n\" #!!lj$p)  !lj$ o )F" [completing-read "Start itimer: " itimer-list read "Itimer function: " obarray fboundp nil value natnump read-from-minibuffer "Itimer value: " t restart "Itimer restart: "] 9)]) (fset 'list-itimers #[nil "!`\n!\nq \n ͱ`!@!! @!! @!! @!!AK b`Wb\n\n!," [get-buffer-create "*Itimer List*" buf opoint standard-output reverse itimer-list itimers itimer-edit-mode nil buffer-read-only erase-buffer "Name Value Restart Function\n" "---- ----- ------- --------" itimer-edit-start-marker newline 1 prin1 itimer-name tab-to-tab-stop itimer-value itimer-restart itimer-function t display-buffer] 4 "\ Pop up a buffer containing a list of all itimers. The major mode of the buffer is Itimer Edit mode. This major mode provides commands to manipulate itimers; see the documentation for `itimer-edit-mode' for more information." nil]) (fset 'edit-itimers #[nil " !! b ! !" [list-itimers select-window get-buffer-window "*Itimer List*" itimer-edit-start-marker itimer-list forward-sexp 2 backward-sexp message "type q to quit, ? for help"] 3 "\ Display a list of all itimers and select it for editing. The major mode of the buffer containing the listing is Itimer Edit mode. This major mode provides commands to manipulate itimers; see the documentation for `itimer-edit-mode' for more information." nil]) (fset 'itimer-edit-mode #[nil " !!!p!!!" [kill-all-local-variables make-local-variable tab-stop-list itimer-edit-mode major-mode "Itimer Edit" mode-name t truncate-lines (22 32 42) abbrev-mode 0 auto-fill-mode buffer-disable-undo use-local-map itimer-edit-map lisp-mode-syntax-table set-syntax-table] 2 "\ Major mode for manipulating itimers. Atrributes of running itimers are changed by moving the cursor to the desired field and typing `s' to set that field. The field will then be set to the value read from the minibuffer. Commands: TAB move forward a field DEL move backward a field s set a field d delete the selected itimer x start a new itimer ? help"]) (put 'itimer-edit-mode 'mode-class 'special) (fset 'itimer-edit-help #[nil "= !" [last-command itimer-edit-help describe-mode message "TAB, DEL select fields, (s)et field, (d)elete itimer (type ? for more help)"] 2 "\ Help function for Itimer Edit." nil]) (fset 'itimer-edit-quit #[nil "p!!p!! " [bury-buffer one-window-p t switch-to-buffer other-buffer delete-window] 3 "\ End Itimer Edit." nil]) (byte-code "MMMMMMMMMMMM" [itimer-edit-set-field #[nil "`X!Éyp!!) `  y `Y W!  T f =! =Ӫ =ժ =+= !É$q) = !É$p) = 9 ! : @>!$!`) !P! \" É%&!`w`\" p\"l -" [itimer-edit-start-marker error "" nil field-value field itimer 0 get-itimer read itimer-edit-beginning-of-field n opoint 4 forward-sexp 2 backward-sexp 1 "Cannot change itimer name." value 3 restart function "Set itimer value: " prompt natnump read-from-minibuffer t "Set itimer restart: " "Set itimer function: " fboundp (lambda macro) completing-read obarray intern "set-itimer-" symbol-name kill-ring buffer-read-only kill-sexp kill-region " " prin1 tab-to-tab-stop] 7 nil nil] itimer-edit-delete-itimer #[nil "`X!Ŋyp!)\"! " [itimer-edit-start-marker error "" delete-itimer read-itimer "Delete itimer: " 0 read list-itimers] 5 nil nil] itimer-edit-next-field #[(count) " Vê UªV U? mb n! SX Vê UªW U? n `Xdb T`" [itimer-edit-beginning-of-field count 0 1 -1 forward-sexp itimer-edit-start-marker backward-sexp 2] 3 nil "p"] itimer-edit-previous-field #[(count) " [!" [itimer-edit-next-field count] 2 nil "p"] itimer-edit-beginning-of-field #[nil " `) `)\n= `=Ī *" [forward-sexp backward-sexp back forw-back t] 3] itimer-process-filter #[(process string) "!" [error "itimer-process-filter is not used in Lucid Emacs"] 2] itimer-process-sentinel #[(process message) "!" [error "itimer-process-sentinel is not used in Lucid Emacs"] 2] itimer-process-start #[nil "!" [error "itimer-process-start is not used in Lucid Emacs"] 2] itimer-process-wakeup #[nil "!" [error "itimer-process-wakeup is not used in Lucid Emacs"] 2] activate-itimer #[(itimer) " ! !$\") " [t inhibit-quit set-itimer-id itimer add-timeout itimer-value itimer-callback itimer-restart] 8] deactivate-itimer #[(itimer) "\n! !\n\"*\n" [t itimer-id itimer id inhibit-quit disable-timeout set-itimer-id nil] 3] itimer-callback #[(current-itimer) " ! " [itimer-function current-itimer] 2]] 2) (defvar auto-save-timeout 30 "\ *Number of seconds idle time before auto-save. Zero or nil means disable auto-saving due to idleness. The actual amount of idle time between auto-saves is logarithmically related to the size of the current buffer. This variable is the number of seconds after which an auto-save will happen when the current buffer is 50k or less; the timeout will be 2 1/4 times this in a 200k buffer, 3 3/4 times this in a 1000k buffer, and 4 1/2 times this in a 2000k buffer. See also the variable `auto-save-interval', which controls auto-saving based on the number of characters typed.") (defvar auto-gc-threshold (/ gc-cons-threshold 3) "\ *GC when this many bytes have been consed since the last GC, and the user has been idle for `auto-save-timeout' seconds.") (fset 'auto-save-itimer #[nil "X = \"T  \n  V T   \"Z j W  _ϥ :\n@@U T\nA@AZ V V V -!!V!ϥUϥ\")ȇ" [auto-save-timeout 0 minibuffer-window selected-window ash buffer-size -8 current-time nil delay now delay-level buf-size 64 -2 4 last-input-time idle-time do-auto-save consing-since-gc auto-gc-threshold garbage-collect get-itimer "auto-save" self error "auto-save-itimer can't find itself" itimer-restart set-itimer-restart] 5 "\ For use as a itimer callback function. Auto-saves and garbage-collects based on the size of the current buffer and the value of `auto-save-timeout', `auto-gc-threshold', and the current keyboard idle-time."]) (byte-code "M\n\" !" [itimer-init-auto-gc #[nil "! ƥ]$)" [noninteractive get-itimer "auto-save" 2 auto-save-timeout 30 4 time start-itimer auto-save-itimer] 5] purify-flag add-hook after-init-hook noninteractive provide itimer] 3)