changeset 50496:ad2c77c56a81

(print-coding-system-briefly): If DOC-STRING is `tightly', print the doc-string tightly. (list-coding-systems-1): Call print-coding-system-briefly with the arg DOC-STRING `tightly'.
author Kenichi Handa <handa@m17n.org>
date Wed, 09 Apr 2003 00:27:58 +0000
parents cf8b9e443180
children 937e53fc2d5c
files lisp/international/mule-diag.el
diffstat 1 files changed, 19 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/mule-diag.el	Tue Apr 08 20:09:23 2003 +0000
+++ b/lisp/international/mule-diag.el	Wed Apr 09 00:27:58 2003 +0000
@@ -760,6 +760,10 @@
      )))
 
 ;; 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.
+
 (defun print-coding-system-briefly (coding-system &optional doc-string)
   (if (not coding-system)
       (princ "nil\n")
@@ -780,10 +784,16 @@
 			(not (eq coding-system (aref base-eol-type eol-type))))
 		   (princ (format " (alias of %s)"
 				  (aref base-eol-type eol-type))))))))
-    (princ "\n\n")
-    (if (and doc-string
-	     (setq doc-string (coding-system-doc-string coding-system)))
-	(princ (format "%s\n" doc-string)))))
+    (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" doc))))))
 
 ;;;###autoload
 (defun describe-current-coding-system ()
@@ -976,7 +986,7 @@
 ###############################################
 # List of coding systems in the following format:
 # MNEMONIC-LETTER -- CODING-SYSTEM-NAME
-#	DOC-STRING
+#   DOC-STRING
 ")
     (princ "\
 #########################
@@ -1003,14 +1013,10 @@
 ##  POST-READ-CONVERSION, PRE-WRITE-CONVERSION = function name to be called
 ##
 "))
-  (let ((bases (coding-system-list 'base-only))
-	coding-system)
-    (while bases
-      (setq coding-system (car bases))
-      (if (null arg)
-	  (print-coding-system-briefly coding-system 'doc-string)
-	(print-coding-system coding-system))
-      (setq bases (cdr bases)))))
+  (dolist (coding-system (sort-coding-systems (coding-system-list 'base-only)))
+    (if (null arg)
+	(print-coding-system-briefly coding-system 'tightly)
+      (print-coding-system coding-system))))
 
 ;;;###autoload
 (defun list-coding-categories ()