Function: print-coding-system-briefly

print-coding-system-briefly is a byte-compiled function defined in mule-diag.el.gz.

Signature

(print-coding-system-briefly CODING-SYSTEM &optional DOC-STRING)

Documentation

Print symbol name and mnemonic letter of CODING-SYSTEM with princ.

If DOC-STRING is non-nil, print also the docstring of CODING-SYSTEM. If DOC-STRING is tightly, don't print an empty line before the docstring, and print only the first line of the docstring.

Source Code

;; Defined in /usr/src/emacs/lisp/international/mule-diag.el.gz
(defun print-coding-system-briefly (coding-system &optional doc-string)
  "Print symbol name and mnemonic letter of CODING-SYSTEM with `princ'.
If DOC-STRING is non-nil, print also the docstring of CODING-SYSTEM.
If DOC-STRING is `tightly', don't print an empty line before the
docstring, and print only the first line of the docstring."
  (if (not coding-system)
      (princ "nil\n")
    (princ (format "%c -- %s"
		   (coding-system-mnemonic coding-system)
		   coding-system))
    (let ((aliases (coding-system-aliases coding-system)))
      (cond ((eq coding-system (car aliases))
	     (if (cdr aliases)
		 (princ (format " %S" (cons 'alias: (cdr aliases))))))
	    ((memq coding-system aliases)
	     (princ (format " (alias of %s)" (car aliases))))
	    (t
	     (let ((eol-type (coding-system-eol-type coding-system))
		   (base-eol-type (coding-system-eol-type (car aliases))))
	       (if (and (integerp eol-type)
			(vectorp base-eol-type)
			(not (eq coding-system (aref base-eol-type eol-type))))
		   (princ (format " (alias of %s)"
				  (aref base-eol-type eol-type))))))))
    (princ "\n")
    (or (eq doc-string 'tightly)
	(princ "\n"))
    (if doc-string
	(let ((doc (or (coding-system-doc-string coding-system) "")))
	  (when (eq doc-string 'tightly)
	    (if (string-match "\n" doc)
		(setq doc (substring doc 0 (match-beginning 0))))
	    (setq doc (concat "  " doc)))
	  (princ (format "%s\n" (substitute-command-keys doc)))))))