;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:39:23 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/emacs-lisp/trace.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`trace.el' was compiled for Emacs 19.29 or later"))

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


(byte-code "\300\301!\210\302\303\304\305\306\307\310\311&\207" [require advice custom-declare-group trace nil "Tracing facility for Emacs Lisp functions" :prefix "trace-" :group lisp] 8)
#@50 *Trace output will by default go to that buffer.
(custom-declare-variable 'trace-buffer '"*trace-output*" '(#$ . -812) :type 'string :group 'trace)
(byte-code "\301B\304\301!\204\f \305\302B\304\302!\204 \306\303B\304\303!\204* \307\310\311\312\313\"\"\301\207" [current-load-list trace-level trace-advice-name trace-separator boundp 0 trace-function\  format "%s\n" make-string 70 61] 5)
(defalias 'trace-entry-message #[(function level argument-bindings) "\303\304\305\306\307S\310\"\311#\312V\203 \311\202 \313	\305\314\n\311#&\207" [level function argument-bindings format "%s%s%d -> %s: %s\n" mapconcat char-to-string make-string 124 " " 1 "" #[(binding) "\301\302\303\"!\304\305\302\306\"!Q\207" [binding symbol-name ad-arg-binding-field name "=" prin1-to-string value] 6]] 10])
(defalias 'trace-exit-message #[(function level value) "\303\304\305\306\307S\310\"\311#\312V\203 \311\202 \313	\314\n!&\207" [level function value format "%s%s%d <- %s: %s\n" mapconcat char-to-string make-string 124 " " 1 "" prin1-to-string] 8])
(defalias 'trace-make-advice #[(function buffer background) "\304\305\306	\2036 \307\310\305\311\312\313\314\nDDD\315\316\317\320\321\322\323D\324BBD\257\325\315\326\327\321\330\323D\331BBDF\257F\202\\ \307\310\305\311\332\313\314\nDDD\333\334\335\321\322\323D\336BBD\325\337\340\321\330\323D\341BBD\257\nF$\207" [trace-advice-name background buffer function ad-make-advice nil t advice lambda let (trace-level (1+ trace-level)) trace-buffer get-buffer-create save-excursion (set-buffer trace-buffer) (goto-char (point-max)) (if (= trace-level 1) (insert trace-separator)) insert trace-entry-message quote (trace-level ad-arg-bindings) ad-do-it (set-buffer trace-buffer) (goto-char (point-max)) trace-exit-message (trace-level ad-return-value) (trace-level (1+ trace-level)) (pop-to-buffer trace-buffer) (goto-char (point-max)) (if (= trace-level 1) (insert trace-separator)) (trace-level ad-arg-bindings) (pop-to-buffer trace-buffer) (goto-char (point-max)) (trace-level ad-return-value)] 20])
(defalias 'trace-function-internal #[(function buffer background) "\304\305	\206	 \n#\306\307$\210\310\311\"\207" [function buffer trace-buffer background ad-add-advice trace-make-advice around last ad-activate nil] 6])
(defalias 'trace-is-traced #[(function) "\302	\303N\236A\236\207" [trace-advice-name function around ad-advice-info] 4])
#@487 Traces FUNCTION with trace output going to BUFFER.
For every call of FUNCTION Lisp-style trace messages that display argument
and return values will be inserted into BUFFER. This function generates the
trace advice for FUNCTION and activates it together with any other advice
there might be!! The trace BUFFER will popup whenever FUNCTION is called.
Do not use this to trace functions that switch buffers or do any other
display oriented stuff, use `trace-function-background' instead.
(defalias 'trace-function #[(function &optional buffer) "\302	\303#\207" [function buffer trace-function-internal nil] 4 (#$ . 3223) (list (intern (completing-read "Trace function: " obarray 'fboundp t)) (read-buffer "Output to buffer: " trace-buffer))])
#@401 Traces FUNCTION with trace output going quietly to BUFFER.
For every call of FUNCTION Lisp-style trace messages that display argument
and return values will be inserted into BUFFER. This function generates the
trace advice for FUNCTION and activates it together with any other advice
there might be!! Trace output will quietly go to BUFFER without changing
the window or buffer configuration at all.
(defalias 'trace-function-background #[(function &optional buffer) "\302	\303#\207" [function buffer trace-function-internal t] 4 (#$ . 3972) (list (intern (completing-read "Trace function in background: " obarray 'fboundp t)) (read-buffer "Output to buffer: " trace-buffer))])
#@243 Untraces FUNCTION and possibly activates all remaining advice.
Activation is performed with `ad-update', hence remaining advice will get
activated only if the advice of FUNCTION is currently active. If FUNCTION
was not traced this is a noop.
(defalias 'untrace-function #[(function) "\302!\205 \303\304	#\210\305!\207" [function trace-advice-name trace-is-traced ad-remove-advice around ad-update] 4 (#$ . 4658) (list (ad-read-advised-function "Untrace function: " 'trace-is-traced))])
#@42 Untraces all currently traced functions.
(defalias 'untrace-all #[nil "\303\211\203 \n@\304	@!\305	!\210\nA\211\204 *\303\207" [ad-advised-functions function ad-dO-vAr nil intern untrace-function] 3 (#$ . 5154) nil])
(provide 'trace)
