aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2002-05-25 17:09:47 +0000
committerDave Love2002-05-25 17:09:47 +0000
commitfeff73a48b9272047974f4a9fd8ca58be5321abe (patch)
tree5d8fe854c8760240998e83d8c5f32964c206e09b
parent68ab7382da461669bc0a8ba922b4c23651d6a797 (diff)
downloademacs-feff73a48b9272047974f4a9fd8ca58be5321abe.tar.gz
emacs-feff73a48b9272047974f4a9fd8ca58be5321abe.zip
(print-coding-system): (Incomplete)
updates. (describe-character-set): List more properties. (print-fontset): Fix case of vector font-spec. (describe-current-coding-system): Fix iso-7, iso-7-else.
-rw-r--r--lisp/international/mule-diag.el119
1 files changed, 72 insertions, 47 deletions
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el
index 35659934c0b..75e9d49d329 100644
--- a/lisp/international/mule-diag.el
+++ b/lisp/international/mule-diag.el
@@ -301,7 +301,6 @@ detailed meanings of these arguments."
301 (setq min (aref range 0) 301 (setq min (aref range 0)
302 max (aref range 1)) 302 max (aref range 1))
303 (if (= dim 1) 303 (if (= dim 1)
304 ;; Fixme: get iso 1-dim codes right
305 (list-block-of-chars charset 0 min max) 304 (list-block-of-chars charset 0 min max)
306 (setq min2 (aref range 2) 305 (setq min2 (aref range 2)
307 max2 (aref range 3)) 306 max2 (aref range 3))
@@ -320,42 +319,58 @@ detailed meanings of these arguments."
320 (help-setup-xref (list #'describe-character-set charset) (interactive-p)) 319 (help-setup-xref (list #'describe-character-set charset) (interactive-p))
321 (with-output-to-temp-buffer (help-buffer) 320 (with-output-to-temp-buffer (help-buffer)
322 (with-current-buffer standard-output 321 (with-current-buffer standard-output
323 (insert "Character set: " (symbol-name charset) ?\n) 322 (insert "Character set: " (symbol-name charset))
324 (insert (charset-description charset) "\n\n") 323 (let ((name (get-charset-property charset :name)))
325 (if (plist-get (charset-plist charset) :ascii-compatible-p) 324 (if (not (eq name charset))
326 (insert "ASCII compatible.\n")) 325 (insert " (alias of " (symbol-name name) ?\))))
326 (insert "\n\n" (charset-description charset) "\n\n")
327 (insert "Number of contained characters: " 327 (insert "Number of contained characters: "
328 (if (= (charset-dimension charset) 1) 328 (if (= (charset-dimension charset) 1)
329 (format "%d\n" (charset-chars charset)) 329 (format "%d\n" (charset-chars charset))
330 (format "%dx%d\n" (charset-chars charset) 330 (format "%dx%d\n" (charset-chars charset)
331 (charset-chars charset)))) 331 (charset-chars charset))))
332 (insert "Final char of ISO2022 designation sequence: ") 332 (let ((char (charset-iso-final-char charset)))
333 (if (> (charset-iso-final-char charset) 0) 333 (when (> char 0)
334 (insert (format "`%c'\n" (charset-iso-final-char charset))) 334 (insert "Final char of ISO2022 designation sequence: ")
335 (insert "not assigned\n")) 335 (insert (format "`%c'\n" char))))
336 (insert (format "Width (how many columns on screen): %d\n" 336 (insert (format "Width (how many columns on screen): %d\n"
337 (aref char-width-table (make-char charset)))) 337 (aref char-width-table (make-char charset))))
338 (let ((map (plist-get (charset-plist charset) :map))) 338 (let (aliases)
339 (if (stringp map) 339 (dolist (c charset-list)
340 (insert "Loaded from map file " map ?\n))) 340 (if (and (not (eq c charset))
341 (let ((invalid (plist-get (charset-plist charset) :invalid-code))) 341 (eq charset (get-charset-property c :name)))
342 (if invalid 342 (push c aliases)))
343 (insert (format "Invalid character: %c (code %d)\n" 343 (if aliases
344 invalid invalid)))) 344 (insert "Aliases: " (mapconcat #'symbol-name aliases ", ") ?\n)))
345 (let ((id (plist-get (charset-plist charset) :emacs-mule-id))) 345
346 (if id 346 (dolist (elt `((:ascii-compatible-p "ASCII compatible." nil)
347 (insert "Id in emacs-mule coding system: " 347 (:map "Map file: " identity)
348 (number-to-string id) ?\n))) 348 (:unify-map "Unification map file: " identity)
349;; Fixme: junk this? 349 (:invalid-code
350;; (let ((coding (plist-get (aref info 14) 'preferred-coding-system))) 350 nil
351;; (when coding 351 ,(lambda (c)
352;; (insert (format "Preferred coding system: %s\n" coding)) 352 (format "Invalid character: %c (code %d)" c c)))
353;; (search-backward (symbol-name coding)) 353 (:emacs-mule-id "Id in emacs-mule coding system: "
354;; (help-xref-button 0 'help-coding-system coding))) 354 number-to-string)
355 355 (:parents "Parents: "
356 ;; Fixme: parents, code-space, iso-revision-number, 356 (lambda (parents)
357 ;; supplementary-p, code-offset, unify-map? 357 (mapconcat ,(lambda (elt)
358 ))) 358 (format "%s" elt))
359 parents
360 ", ")))
361 (:code-space "Code space: " ,(lambda (c)
362 (format "%s" c)))
363 (:code-offset "Code offset: " number-to-string)
364 (:iso-revision-number "ISO revision number: "
365 number-to-string)
366 (:supplementary-p
367 "Used only as a parent of some other charset." nil)))
368 (let ((val (get-charset-property charset (car elt))))
369 (when val
370 (if (cadr elt) (insert (cadr elt)))
371 (if (nth 2 elt)
372 (insert (funcall (nth 2 elt) val)))
373 (insert ?\n)))))))
359 374
360;;;###autoload 375;;;###autoload
361(defun describe-char-after (&optional pos) 376(defun describe-char-after (&optional pos)
@@ -432,6 +447,7 @@ which font is being used for displaying the character."
432 (if encoded 447 (if encoded
433 (list (encoded-string-description encoded coding) 448 (list (encoded-string-description encoded coding)
434 (format "(encoded by coding system %S)" coding)) 449 (format "(encoded by coding system %S)" coding))
450 ;; Fixme: this is wrong e.g. for chars in HELLO
435 (list "not encodable by coding system" 451 (list "not encodable by coding system"
436 (symbol-name coding))))) 452 (symbol-name coding)))))
437 ,@(if (or (memq 'mule-utf-8 453 ,@(if (or (memq 'mule-utf-8
@@ -762,8 +778,9 @@ Priority order for recognizing coding systems when reading files:\n")
762 (lambda (x) 778 (lambda (x)
763 (if (and (not (eq x coding-system)) 779 (if (and (not (eq x coding-system))
764 (coding-system-get x 'no-initial-designation) 780 (coding-system-get x 'no-initial-designation)
765 (let ((flags (coding-system-flags x))) 781 (let ((flags (coding-system-get :flags)))
766 (not (or (aref flags 10) (aref flags 11))))) 782 (not (or (memq 'use-roman flags)
783 (memq 'use-oldjis flags)))))
767 (setq codings (cons x codings))))) 784 (setq codings (cons x codings)))))
768 (get (car categories) 'coding-systems)) 785 (get (car categories) 'coding-systems))
769 (if codings 786 (if codings
@@ -810,7 +827,7 @@ Priority order for recognizing coding systems when reading files:\n")
810 "Print detailed information on CODING-SYSTEM." 827 "Print detailed information on CODING-SYSTEM."
811 (let ((type (coding-system-type coding-system)) 828 (let ((type (coding-system-type coding-system))
812 (eol-type (coding-system-eol-type coding-system)) 829 (eol-type (coding-system-eol-type coding-system))
813 (flags (coding-system-flags coding-system)) 830 (flags (coding-system-get coding-system :flags))
814 (aliases (coding-system-get coding-system 'alias-coding-systems))) 831 (aliases (coding-system-get coding-system 'alias-coding-systems)))
815 (if (not (eq (car aliases) coding-system)) 832 (if (not (eq (car aliases) coding-system))
816 (princ (format "%s (alias of %s)\n" coding-system (car aliases))) 833 (princ (format "%s (alias of %s)\n" coding-system (car aliases)))
@@ -824,7 +841,7 @@ Priority order for recognizing coding systems when reading files:\n")
824 type 841 type
825 (coding-system-mnemonic coding-system) 842 (coding-system-mnemonic coding-system)
826 (if (integerp eol-type) eol-type 3))) 843 (if (integerp eol-type) eol-type 3)))
827 (cond ((eq type 2) ; ISO-2022 844 (cond ((eq type 'iso2022)
828 (let ((idx 0) 845 (let ((idx 0)
829 charset) 846 charset)
830 (while (< idx 4) 847 (while (< idx 4)
@@ -851,7 +868,7 @@ Priority order for recognizing coding systems when reading files:\n")
851 (princ ",") 868 (princ ",")
852 (setq idx (1+ idx))) 869 (setq idx (1+ idx)))
853 (princ (if (aref flags idx) 1 0)))) 870 (princ (if (aref flags idx) 1 0))))
854 ((eq type 4) ; CCL 871 ((eq type 'ccl)
855 (let (i len) 872 (let (i len)
856 (if (symbolp (car flags)) 873 (if (symbolp (car flags))
857 (princ (format " %s" (car flags))) 874 (princ (format " %s" (car flags)))
@@ -1014,18 +1031,26 @@ the current buffer."
1014 (if (= (charset-chars charset) 94) 126 127)))) 1031 (if (= (charset-chars charset) 94) 126 127))))
1015 (insert to)))) 1032 (insert to))))
1016 (indent-to 24) 1033 (indent-to 24)
1017 (if (stringp font-spec) 1034 (cond ((stringp font-spec)
1018 (insert font-spec) 1035 (insert font-spec))
1019 (if (car font-spec) 1036 ((vectorp font-spec)
1020 (if (string-match "-" (car font-spec)) 1037 (insert "*-" (or (aref font-spec 0) ?*) ; family
1021 (insert "-" (car font-spec) "-*-") 1038 ?- (or (aref font-spec 1) ?*) ; weight
1022 (insert "-*-" (car font-spec) "-*-")) 1039 ?- (or (aref font-spec 2) ?*) ; slant
1023 (insert "-*-")) 1040 "-*-" (or (aref font-spec 3) ?*) ; width
1024 (if (cdr font-spec) 1041 "-*-" (or (aref font-spec 4) ?*) ; adstyle
1025 (if (string-match "-" (cdr font-spec)) 1042 "-*-*-*-*-*-*-" (aref font-spec 5))) ; registry
1026 (insert (cdr font-spec)) 1043 (t
1027 (insert (cdr font-spec) "-*")) 1044 (if (car font-spec)
1028 (insert "*"))) 1045 (if (string-match "-" (car font-spec))
1046 (insert "-" (car font-spec) "-*-")
1047 (insert "-*-" (car font-spec) "-*-"))
1048 (insert "-*-"))
1049 (if (cdr font-spec)
1050 (if (string-match "-" (cdr font-spec))
1051 (insert (cdr font-spec))
1052 (insert (cdr font-spec) "-*"))
1053 (insert "*"))))
1029 (insert "\n") 1054 (insert "\n")
1030 (when print-fonts 1055 (when print-fonts
1031 (while opened 1056 (while opened