;ELC ;;; compiled by liberte@churchy.gnu.ai.mit.edu on Sat Apr 9 18:29:31 1994 ;;; from file /gd/gnu/emacs/19.0/lisp/cust-print.el ;;; emacs version 19.22.93. ;;; bytecomp version FSF 2.10 ;;; 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 "`/gd/gnu/emacs/19.0/lisp/cust-print.el' was compiled for Emacs 19")) (byte-code "!!M" [require backquote fboundp defalias fset] 2) (defvar print-level nil "\ *Controls how many levels deep a nested data object will print. If nil, printing proceeds recursively and may lead to max-lisp-eval-depth being exceeded or an error may occur: `Apparently circular structure being printed.' Also see `print-length' and `print-circle'. If non-nil, components at levels equal to or greater than `print-level' are printed simply as `#'. The object to be printed is at level 0, and if the object is a list or vector, its top-level components are at level 1.") (defvar print-circle nil "\ *Controls the printing of recursive structures. If nil, printing proceeds recursively and may lead to `max-lisp-eval-depth' being exceeded or an error may occur: \"Apparently circular structure being printed.\" Also see `print-length' and `print-level'. If non-nil, shared substructures anywhere in the structure are printed with `#N=' before the first occurrence (in the order of the print representation) and `#N#' in place of each subsequent occurrence, where N is a positive decimal integer. There is no way to read this representation in standard Emacs, but if you need to do so, try the cl-read.el package.") (defvar custom-print-vectors nil "\ *Non-nil if printing of vectors should obey print-level and print-length. For Emacs 18, setting print-level, or adding custom print list or vector handling will make this happen anyway. Emacs 19 obeys print-level, but not for vectors.") (defconst custom-printers nil "\ An alist for custom printing of any type. Pairs are of the form (PREDICATE . PRINTER). If PREDICATE is true for an object, then PRINTER is called with the object. PRINTER should print to `standard-output' using cust-print-original-princ if the standard printer is sufficient, or cust-print-prin for complex things. The PRINTER should return the object being printed. Don't modify this variable directly. Use `add-custom-printer' and `delete-custom-printer'") (defalias 'add-custom-printer #[(pred printer) " B \"B " [pred printer delq custom-printers cust-print-update-custom-printers] 4 "\ Add a pair of PREDICATE and PRINTER to `custom-printers'. Any pair that has the same PREDICATE is first removed."]) (defalias 'delete-custom-printer #[(pred) " \n\n\" " [delq pred custom-printers cust-print-update-custom-printers] 3 "\ Delete the custom printer associated with PREDICATE."]) (byte-code "\"\"\"\"!\"" [defalias cust-print-use-custom-printer (lambda (object)) cust-print-update-custom-printers #[nil "\"\"BE\"" [defalias cust-print-use-custom-printer lambda (object) cond append mapcar #[(pair) "@BABD" [pair (object) (object)] 3] custom-printers ((t nil))] 9] cust-print-set-function-cell #[(symbol-pair) " @ A@K\"" [defalias symbol-pair] 3] cust-print-original-princ (lambda (object &optional stream)) fboundp cust-print-original-prin1 mapcar ((cust-print-original-prin1 prin1) (cust-print-original-princ princ) (cust-print-original-print print) (cust-print-original-prin1-to-string prin1-to-string) (cust-print-original-format format) (cust-print-original-message message) (cust-print-original-error error))] 3) (defalias 'custom-print-install #[nil "\"Ç" [mapcar cust-print-set-function-cell ((prin1 custom-prin1) (princ custom-princ) (print custom-print) (prin1-to-string custom-prin1-to-string) (format custom-format) (message custom-message) (error custom-error)) t] 3 "\ Replace print functions with general, customizable, Lisp versions. The emacs subroutines are saved away, and you can reinstall them by running `custom-print-uninstall'." nil]) (defalias 'custom-print-uninstall #[nil "\"Ç" [mapcar cust-print-set-function-cell ((prin1 cust-print-original-prin1) (princ cust-print-original-princ) (print cust-print-original-print) (prin1-to-string cust-print-original-prin1-to-string) (format cust-print-original-format) (message cust-print-original-message) (error cust-print-original-error)) t] 3 "\ Reset print functions to their emacs subroutines." nil]) (defalias (quote custom-print-funcs-installed-p) (quote custom-print-installed-p)) (defalias 'custom-print-installed-p #[nil "KK=" [custom-prin1 prin1] 2 "\ Return t if custom-print is currently installed, nil otherwise."]) (byte-code "##\"" [put with-custom-print-funcs edebug-form-spec (body) with-custom-print (body) defalias] 4) (defalias 'with-custom-print '(macro . #[(&rest body) " BBBB" [unwind-protect progn (custom-print-install) body ((custom-print-uninstall))] 4 "\ Temporarily install the custom print package while executing BODY."])) (defalias 'custom-prin1 #[(object &optional stream) " \n#" [cust-print-top-level object stream cust-print-original-prin1] 4 "\ Output the printed representation of OBJECT, any Lisp object. Quoting characters are printed when needed to make output that `read' can handle, whenever this is possible. Output stream is STREAM, or value of `standard-output' (which see). This is the custom-print replacement for the standard `prin1'. It uses the appropriate printer depending on the values of `print-level' and `print-circle' (which see)."]) (defalias 'custom-princ #[(object &optional stream) " \n#" [cust-print-top-level object stream cust-print-original-princ] 4 "\ Output the printed representation of OBJECT, any Lisp object. No quoting characters are used; no delimiters are printed around the contents of strings. Output stream is STREAM, or value of `standard-output' (which see). This is the custom-print replacement for the standard `princ'."]) (defalias 'custom-prin1-to-string #[(object) "!\nq ) \n\"\nq *" [get-buffer-create " *custom-print-temp*" buf erase-buffer custom-prin1 object buffer-string] 3 "\ Return a string containing the printed representation of OBJECT, any Lisp object. Quoting characters are used when needed to make output that `read' can handle, whenever this is possible. This is the custom-print replacement for the standard `prin1-to-string'."]) (defalias 'custom-print #[(object &optional stream) "\n\"\f\n\"\n\"" [cust-print-original-princ "\n" stream custom-prin1 object] 3 "\ Output the printed representation of OBJECT, with newlines around it. Quoting characters are printed when needed to make output that `read' can handle, whenever this is possible. Output stream is STREAM, or value of `standard-output' (which see). This is the custom-print replacement for the standard `print'."]) (defalias 'custom-format #[(fmt &rest args) "\n \"#" [apply cust-print-original-format fmt mapcar #[(arg) "<!9!" [arg vectorp custom-prin1-to-string] 2] args] 6 "\ Format a string out of a control-string and arguments. The first argument is a control string. It, and subsequent arguments substituted into it, become the value, which is a string. It may contain %s or %d or %c to substitute successive following arguments. %s means print an argument as a string, %d means print as number in decimal, %c means print a number as a single character. The argument used by %s must be a string or a symbol; the argument used by %d, %b, %o, %x or %c must be a number. This is the custom-print replacement for the standard `format'. It calls the emacs `format' after first making strings for list, vector, or symbol args. The format specification for such args should be `%s' in any case, so a string argument will also work. The string is generated with `custom-prin1-to-string', which quotes quotable characters."]) (defalias 'custom-message #[(fmt &rest args) "\n \"#" [apply cust-print-original-message fmt mapcar #[(arg) "<!9!" [arg vectorp custom-prin1-to-string] 2] args] 6 "\ Print a one-line message at the bottom of the screen. The first argument is a control string. It may contain %s or %d or %c to print successive following arguments. %s means print an argument as a string, %d means print as number in decimal, %c means print a number as a single character. The argument used by %s must be a string or a symbol; the argument used by %d or %c must be a number. This is the custom-print replacement for the standard `message'. See `custom-format' for the details."]) (defalias 'custom-error #[(fmt &rest args) "\f #C\"" [signal error apply custom-format fmt args] 6 "\ Signal an error, making error message by passing all args to `format'. This is the custom-print replacement for the standard `error'. See `custom-format' for the details."]) (byte-code "\"\"\"\"\"\"\"\"\"\"!" [defalias cust-print-original-printer (lambda (object)) cust-print-low-level-prin (lambda (object)) cust-print-prin (lambda (object)) cust-print-top-level #[(object stream emacs-printer) " \n\f\f!  \" :: :> :>Ђ?\"L҂M\"\f!\f+" [stream standard-output print-circle cust-print-preprocess-circle-tree object print-level -1 cust-print-current-level circle-table defalias cust-print-original-printer emacs-printer cust-print-low-level-prin custom-printers custom-print-vectors print-length cust-print-print-object cust-print-prin cust-print-print-circular] 3] cust-print-print-object #[(object) "!!:!!#!!" [object cust-print-original-printer cust-print-use-custom-printer cust-print-list vectorp cust-print-vector] 2] cust-print-print-circular #[(object) " 8\nAV! !!4\n [! [!!!);!)" [object circle-table tag id 0 cust-print-original-princ "#" "=" cust-print-low-level-prin] 3] cust-print-list #[(list) "U !S! @!A.!SxUx<[\n[@!Ag!!S3!3U!!*" [cust-print-current-level 0 cust-print-original-princ "#" "(" print-length length cust-print-prin list " " circle-table ". " nil "..." ")"] 3] cust-print-vector #[(vector) "U !VS\fG!$ ^ WE\fH!T\fGW$!$\fGWQ!!+\f" [cust-print-current-level 0 cust-print-original-princ "#" vector len i "[" print-length cust-print-prin " " "..." "]"] 4] cust-print-preprocess-circle-tree #[(object) "C ! A A>A@A3 SA:AA)* A)" [nil circle-table cust-print-walk-circle-tree object -1 id rest tag] 3] cust-print-walk-circle-tree #[(object) "  9 !!=?$ A0 ǡ>\n> CAB F{ :U @! A{ !{ G \f \fWz  H! T d**" [nil tag read-equivalent-p object intern-soft symbol-name circle-table t cust-print-walk-circle-tree vectorp 0 j i] 5] provide cust-print] 3)