Function: add-custom-printer
add-custom-printer is a byte-compiled function defined in
cust-print.el.gz.
Signature
(add-custom-printer PRED PRINTER)
Documentation
Add a pair of PREDICATE and PRINTER to custom-printers.
Any pair that has the same PREDICATE is first removed.
Source Code
;; Defined in /usr/src/emacs/lisp/obsolete/cust-print.el.gz
;; Should cust-print-original-princ and cust-print-prin be exported symbols?
;; Or should the standard printers functions be replaced by
;; CP ones in Emacs Lisp so that CP internal functions need not be called?
(defun add-custom-printer (pred printer)
"Add a pair of PREDICATE and PRINTER to `custom-printers'.
Any pair that has the same PREDICATE is first removed."
(setq custom-printers (cons (cons pred printer)
(delq (assq pred custom-printers)
custom-printers)))
;; Rather than updating here, we could wait until cust-print-top-level is called.
(cust-print-update-custom-printers))