Function: custom-format

custom-format is a byte-compiled function defined in cust-print.el.gz.

Signature

(custom-format FMT &rest ARGS)

Documentation

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.

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/cust-print.el.gz
(defun custom-format (fmt &rest args)
  "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."
  (apply #'cust-print-original-format fmt
	 (mapcar (function (lambda (arg)
			     (if (or (listp arg) (vectorp arg) (symbolp arg))
				 (custom-prin1-to-string arg)
			       arg)))
		 args)))