1 ;;; mule-diag.el --- Show diagnosis of multilingual environment (MULE)
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
6 ;; Keywords: multilingual, charset, coding system, fontset, diagnosis
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
25 ;;; General utility function
27 ;; Print all arguments with single space separator in one line.
28 (defun print-list (&rest args)
33 (setq args (cdr args)))
37 ;; Re-order the elements of charset-list.
38 (defun sort-charset-list ()
41 (function (lambda (x y) (< (charset-id x) (charset-id y)))))))
46 (defun list-character-sets (&optional arg)
47 "Display a list of all character sets.
49 The ID column contains a charset identification number for internal use.
50 The B column contains a number of bytes occupied in a buffer.
51 The W column contains a number of columns occupied in a screen.
53 With prefix arg, the output format gets more cryptic
54 but contains full information about each character sets."
57 (with-output-to-temp-buffer "*Help*"
59 (set-buffer standard-output)
60 (let ((l charset-list)
64 (insert "ID Name B W Description\n")
65 (insert "-- ---- - - -----------\n")
67 (setq charset (car l) l (cdr l))
68 (insert (format "%03d %s" (charset-id charset) charset))
70 (insert (format "%d %d %s\n"
71 (charset-bytes charset)
72 (charset-width charset)
73 (charset-description charset)))))
75 #########################
77 ## Each line corresponds to one charset.
78 ## The following attributes are listed in this order
79 ## separated by a colon `:' in one line.
81 ## CHARSET-SYMBOL-NAME,
84 ## BYTES (of multibyte form: 1, 2, 3, or 4),
85 ## WIDTH (occupied column numbers: 1 or 2),
86 ## DIRECTION (0:left-to-right, 1:right-to-left),
87 ## ISO-FINAL-CHAR (character code of ISO-2022's final character)
88 ## ISO-GRAPHIC-PLANE (ISO-2022's graphic plane, 0:GL, 1:GR)
89 ## DESCRIPTION (describing string of the charset)
92 (setq charset (car l) l (cdr l))
93 (princ (format "%03d:%s:%d:%d:%d:%d:%d:%d:%d:%s\n"
96 (charset-dimension charset)
97 (charset-chars charset)
98 (charset-bytes charset)
99 (charset-width charset)
100 (charset-direction charset)
101 (charset-iso-final-char charset)
102 (charset-iso-graphic-plane charset)
103 (charset-description charset))))))
105 (setq truncate-lines t))))
109 ;; Print information of designation of each graphic register in FLAGS
110 ;; in human readable format. See the documentation of
111 ;; `make-coding-system' for the meaning of FLAGS.
112 (defun print-designation (flags)
113 (let ((graphic-register 0)
115 (while (< graphic-register 4)
116 (setq charset (aref flags graphic-register))
120 (cond ((null charset)
123 "no initial designation, and used by any charsets")
126 charset (charset-description charset)))
128 (if (charsetp (car charset))
129 (format "%s:%s, and also used by the followings:"
131 (charset-description (car charset)))
132 "no initial designation, and used by the followings:"))
134 "invalid designation information"))))
135 (when (listp charset)
136 (setq charset (cdr charset))
138 (cond ((eq (car charset) t)
139 (princ "\tany other charsets\n"))
140 ((charsetp (car charset))
141 (princ (format "\t%s:%s\n"
143 (charset-description (car charset)))))
145 "invalid designation information"))
146 (setq charset (cdr charset))))
147 (setq graphic-register (1+ graphic-register)))))
150 (defun describe-coding-system (coding-system)
151 "Display information of CODING-SYSTEM."
152 (interactive "zDescribe coding system (default, current choices): ")
153 (if (null coding-system)
154 (describe-current-coding-system)
155 (with-output-to-temp-buffer "*Help*"
156 (print-coding-system-briefly coding-system 'doc-string)
157 (let ((coding-spec (coding-system-spec coding-system)))
159 (let ((type (coding-system-type coding-system))
160 (flags (coding-system-flags coding-system)))
163 (princ " (do no conversion)"))
165 (princ " (do automatic conversion)"))
167 (princ " (Emacs internal multibyte form)"))
169 (princ " (Shift-JIS, MS-KANJI)"))
171 (princ " (variant of ISO-2022)\n")
172 (princ "Initial designations:\n")
173 (print-designation flags)
174 (princ "Other Form: \n ")
175 (princ (if (aref flags 4) "short-form" "long-form"))
176 (if (aref flags 5) (princ ", ASCII@EOL"))
177 (if (aref flags 6) (princ ", ASCII@CNTL"))
178 (princ (if (aref flags 7) ", 7-bit" ", 8-bit"))
179 (if (aref flags 8) (princ ", use-locking-shift"))
180 (if (aref flags 9) (princ ", use-single-shift"))
181 (if (aref flags 10) (princ ", use-roman"))
182 (if (aref flags 10) (princ ", use-old-jis"))
183 (if (aref flags 11) (princ ", no-ISO6429"))
188 (princ " (do conversion by CCL program)"))
189 (t (princ "invalid coding-system."))))
190 (princ "\nEOL type:\n ")
191 (let ((eol-type (coding-system-eol-type coding-system)))
192 (cond ((vectorp eol-type)
193 (princ "Automatic selection from:\n\t")
196 ((or (null eol-type) (eq eol-type 0)) (princ "LF\n"))
197 ((eq eol-type 1) (princ "CRLF\n"))
198 ((eq eol-type 2) (princ "CR\n"))
199 (t (princ "invalid\n")))))
201 (set-buffer standard-output)
205 (defun describe-current-coding-system-briefly ()
206 "Display coding systems currently used in a brief format in echo area.
208 The format is \"F[..],K[..],T[..],P>[..],P<[..], default F[..],P<[..],P<[..]\",
209 where mnemonics of the following coding systems come in this order
210 at the place of `..':
211 buffer-file-coding-system (of the current buffer)
212 eol-type of buffer-file-coding-system (of the current buffer)
213 (keyboard-coding-system)
214 eol-type of (keyboard-coding-system)
215 (terminal-coding-system)
216 eol-type of (terminal-coding-system)
217 process-coding-system for read (of the current buffer, if any)
218 eol-type of process-coding-system for read (of the current buffer, if any)
219 process-coding-system for write (of the current buffer, if any)
220 eol-type of process-coding-system for write (of the current buffer, if any)
221 default-buffer-file-coding-system
222 eol-type of default-buffer-file-coding-system
223 default-process-coding-system for read
224 eol-type of default-process-coding-system for read
225 default-process-coding-system for write
226 eol-type of default-process-coding-system"
228 (let* ((proc (get-buffer-process (current-buffer)))
229 (process-coding-systems (if proc (process-coding-system proc))))
231 "F[%c%c],K[%c%c],T[%c%c],P>[%c%c],P<[%c%c], default F[%c%c],P>[%c%c],P<[%c%c]"
232 (coding-system-mnemonic buffer-file-coding-system)
233 (coding-system-eol-type-mnemonic buffer-file-coding-system)
234 (coding-system-mnemonic (keyboard-coding-system))
235 (coding-system-eol-type-mnemonic (keyboard-coding-system))
236 (coding-system-mnemonic (terminal-coding-system))
237 (coding-system-eol-type-mnemonic (terminal-coding-system))
238 (coding-system-mnemonic (car process-coding-systems))
239 (coding-system-eol-type-mnemonic (car process-coding-systems))
240 (coding-system-mnemonic (cdr process-coding-systems))
241 (coding-system-eol-type-mnemonic (cdr process-coding-systems))
242 (coding-system-mnemonic default-buffer-file-coding-system)
243 (coding-system-eol-type-mnemonic default-buffer-file-coding-system)
244 (coding-system-mnemonic (car default-process-coding-system))
245 (coding-system-eol-type-mnemonic (car default-process-coding-system))
246 (coding-system-mnemonic (cdr default-process-coding-system))
247 (coding-system-eol-type-mnemonic (cdr default-process-coding-system))
250 ;; Print symbol name and mnemonic letter of CODING-SYSTEM by `princ'.
251 (defun print-coding-system-briefly (coding-system &optional doc-string)
252 (if (not coding-system)
254 (princ (format "%c -- %s"
255 (coding-system-mnemonic coding-system)
257 (let ((parent (coding-system-parent coding-system)))
259 (princ (format " (alias of %s)" parent))))
260 (let ((aliases (get coding-system 'alias-coding-systems)))
262 (princ (format " %S" (cons 'alias: aliases)))))
265 (setq doc-string (coding-system-doc-string coding-system)))
266 (princ (format " %s\n" doc-string)))))
269 (defun describe-current-coding-system ()
270 "Display coding systems currently used in a detailed format."
272 (with-output-to-temp-buffer "*Help*"
273 (let* ((proc (get-buffer-process (current-buffer)))
274 (process-coding-systems (if proc (process-coding-system proc))))
275 (princ "Current buffer file: buffer-file-coding-system\n ")
276 (if (local-variable-p 'buffer-file-coding-system)
277 (print-coding-system-briefly buffer-file-coding-system)
278 (princ "Not set locally, use the following default.\n"))
279 (princ "Default buffer file: default-buffer-file-coding-system\n ")
280 (print-coding-system-briefly default-buffer-file-coding-system)
281 (princ "Keyboard: (keyboard-coding-system)\n ")
282 (print-coding-system-briefly (keyboard-coding-system))
283 (princ "Terminal: (display-coding-system)\n ")
284 (print-coding-system-briefly (terminal-coding-system))
285 (princ "Current buffer process: (process-coding-system)\n")
286 (if (not process-coding-systems)
287 (princ " No process.\n")
288 (princ " decoding: ")
289 (print-coding-system-briefly (car process-coding-systems))
290 (princ " encoding: ")
291 (print-coding-system-briefly (cdr process-coding-systems)))
292 (princ "Default process: default-process-coding-system\n")
293 (princ " decoding: ")
294 (print-coding-system-briefly (car default-process-coding-system))
295 (princ " encoding: ")
296 (print-coding-system-briefly (cdr default-process-coding-system)))
299 (set-buffer standard-output)
301 (princ "\nPriority order of coding systems:\n")
302 (let ((l coding-category-list)
306 (setq coding (symbol-value (car l)))
307 (princ (format " %d. %s" i coding))
308 (when (setq aliases (get coding 'alias-coding-systems))
310 (princ (cons 'alias: aliases)))
312 (setq l (cdr l) i (1+ i))))
313 (princ "\n Other coding systems cannot be distinguished automatically
314 from these, and therefore cannot be recognized automatically
315 with the present coding system priorities.\n\n")
317 (let ((categories '(coding-category-iso-7 coding-category-iso-else))
318 coding-system codings)
320 (setq coding-system (symbol-value (car categories)))
324 (if (and (not (eq x coding-system))
325 (get x 'no-initial-designation)
326 (let ((flags (coding-system-flags x)))
327 (not (or (aref flags 10) (aref flags 11)))))
328 (setq codings (cons x codings)))))
329 (get (car categories) 'coding-systems))
331 (let ((max-col (frame-width))
333 (princ (format " The followings are decoded correctly but recognized as %s:\n " coding-system))
336 (insert (format " %s" (car codings)))
337 (when (> (current-column) max-col)
340 (goto-char (point-max)))
341 (setq codings (cdr codings)))
343 (setq categories (cdr categories))))
345 (princ "Look up tables for finding a coding system on I/O operations:\n")
347 (princ " OPERATION\tTARGET PATTERN\t\tCODING SYSTEM(s)\n")
348 (princ " ---------\t--------------\t\t----------------\n")
349 (let ((func (lambda (operation alist)
353 (princ "\tnothing specified\n")
356 (prin1 (car (car alist)))
358 (princ (cdr (car alist)))
360 (setq alist (cdr alist)))))))
361 (funcall func "File I/O" file-coding-system-alist)
362 (funcall func "Process I/O" process-coding-system-alist)
363 (funcall func "Network I/O" network-coding-system-alist))
366 ;; Print detailed information on CODING-SYSTEM.
367 (defun print-coding-system (coding-system &optional aliases)
368 (let ((type (coding-system-type coding-system))
369 (eol-type (coding-system-eol-type coding-system))
370 (flags (coding-system-flags coding-system))
371 (base (coding-system-base coding-system)))
372 (if (not (eq base coding-system))
373 (princ (format "%s (alias of %s)\n" coding-system base))
374 (princ coding-system)
377 (princ (car aliases))
378 (setq aliases (cdr aliases)))
379 (princ (format ":%s:%c:%d:"
381 (coding-system-mnemonic coding-system)
382 (if (integerp eol-type) eol-type 3)))
383 (cond ((eq type 2) ; ISO-2022
387 (setq charset (aref flags idx))
388 (cond ((null charset)
396 (princ (car charset))
397 (setq charset (cdr charset))
400 (princ (car charset))
401 (setq charset (cdr charset)))
406 (princ (if (aref flags idx) 1 0))
409 (princ (if (aref flags idx) 1 0))))
412 (setq i 0 len (length (car flags)))
414 (princ (format " %x" (aref (car flags) i)))
417 (setq i 0 len (length (cdr flags)))
419 (princ (format " %x" (aref (cdr flags) i)))
423 (princ (coding-system-doc-string coding-system))
427 (defun list-coding-systems (&optional arg)
428 "Display a list of all coding systems.
429 It prints mnemonic letter, name, and description of each coding systems.
431 With prefix arg, the output format gets more cryptic,
432 but contains full information about each coding systems."
434 (with-output-to-temp-buffer "*Help*"
437 ###############################################
438 # List of coding systems in the following format:
439 # MNEMONIC-LETTER -- CODING-SYSTEM-NAME
443 #########################
444 ## LIST OF CODING SYSTEMS
445 ## Each line corresponds to one coding system
446 ## Format of a line is:
447 ## NAME[,ALIAS...]:TYPE:MNEMONIC:EOL:FLAGS:POST-READ-CONVERSION
448 ## :PRE-WRITE-CONVERSION:DOC-STRING,
450 ## NAME = coding system name
451 ## ALIAS = alias of the coding system
452 ## TYPE = nil (no conversion), t (undecided or automatic detection),
453 ## 0 (EMACS-MULE), 1 (SJIS), 2 (ISO2022), 3 (BIG5), or 4 (CCL)
454 ## EOL = 0 (LF), 1 (CRLF), 2 (CR), or 3 (Automatic detection)
457 ## comma (`,') separated data of the followings:
458 ## G0, G1, G2, G3, SHORT-FORM, ASCII-EOL, ASCII-CNTL, SEVEN,
459 ## LOCKING-SHIFT, SINGLE-SHIFT, USE-ROMAN, USE-OLDJIS, NO-ISO6429
460 ## else if TYPE = 4 then
461 ## comma (`,') separated CCL programs for read and write
464 ## POST-READ-CONVERSION, PRE-WRITE-CONVERSION = function name to be called
467 (let ((bases (coding-system-list 'base-only))
470 (setq coding-system (car bases))
472 (print-coding-system-briefly coding-system 'doc-string)
473 (print-coding-system coding-system))
474 (setq bases (cdr bases))))))
477 (defun list-coding-categories ()
478 "Display a list of all coding categories."
479 (with-output-to-temp-buffer "*Help*"
481 ############################
482 ## LIST OF CODING CATEGORIES (ordered by priority)
483 ## CATEGORY:CODING-SYSTEM
486 (let ((l coding-category-list))
488 (princ (format "%s:%s\n" (car l) (symbol-value (car l))))
493 ;; Print information of a font in FONTINFO.
494 (defun describe-font-internal (font-info &optional verbose)
495 (print-list "name (opened by):" (aref font-info 0))
496 (print-list " full name:" (aref font-info 1))
497 (let ((charset (aref font-info 2)))
498 (print-list " charset:"
499 (format "%s (%s)" charset (charset-description charset))))
500 (print-list " size:" (format "%d" (aref font-info 3)))
501 (print-list " height:" (format "%d" (aref font-info 4)))
502 (print-list " baseline-offset:" (format "%d" (aref font-info 5)))
503 (print-list "relative-compose:" (format "%d" (aref font-info 6))))
506 (defun describe-font (fontname)
507 "Display information about fonts which partially match FONTNAME."
508 (interactive "sFontname (default, current choise for ASCII chars): ")
510 (error "No window system being used"))
511 (when (or (not fontname) (= (length fontname) 0))
512 (setq fontname (cdr (assq 'font (frame-parameters))))
513 (if (query-fontset fontname)
515 (nth 2 (assq 'ascii (aref (fontset-info fontname) 2))))))
516 (let ((font-info (font-info fontname)))
518 (message "No matching font")
519 (with-output-to-temp-buffer "*Help*"
520 (describe-font-internal font-info 'verbose)))))
522 ;; Print information of FONTSET. If optional arg PRINT-FONTS is
523 ;; non-nil, print also names of all fonts in FONTSET. This function
524 ;; actually INSERT such information in the current buffer.
525 (defun print-fontset (fontset &optional print-fonts)
526 (let* ((fontset-info (fontset-info fontset))
527 (size (aref fontset-info 0))
528 (height (aref fontset-info 1))
529 (fonts (and print-fonts (aref fontset-info 2)))
530 (xlfd-fields (x-decompose-font-name fontset))
531 (weight (aref xlfd-fields xlfd-regexp-weight-subnum))
532 (slant (aref xlfd-fields xlfd-regexp-slant-subnum))
534 (if (string-match "^bold$\\|^demibold$" weight)
535 (setq style (concat weight " "))
536 (setq style "medium "))
537 (cond ((string-match "^i$" slant)
538 (setq style (concat style "italic")))
539 ((string-match "^o$" slant)
540 (setq style (concat style "slant")))
541 ((string-match "^ri$" slant)
542 (setq style (concat style "reverse italic")))
543 ((string-match "^ro$" slant)
544 (setq style (concat style "reverse slant"))))
548 (insert (if (> size 0) (format "%2dx%d" size height) " -"))
552 (insert " O Charset / Fontname\n"
553 " - ------------------\n")
555 (let ((l charset-list)
556 charset font-info opened fontname)
558 (setq charset (car l) l (cdr l))
559 (setq font-info (assq charset fonts))
561 (setq opened ?? fontname "not specified")
562 (if (nth 2 font-info)
563 (if (stringp (nth 2 font-info))
564 (setq opened ?o fontname (nth 2 font-info))
565 (setq opened ?- fontname (nth 1 font-info)))
566 (setq opened ?x fontname (nth 1 font-info))))
567 (insert (format " %c %s\n %s\n"
568 opened charset fontname)))))))
571 (defun describe-fontset (fontset)
572 "Display information of FONTSET.
574 It prints name, size, and style of FONTSET, and lists up fonts
575 contained in FONTSET.
577 The column WDxHT contains width and height (pixels) of each fontset
578 \(i.e. those of ASCII font in the fontset). The letter `-' in this
579 column means that the corresponding fontset is not yet used in any
582 The O column of each font contains one of the following letters.
583 o -- font already opened
584 - -- font not yet opened
585 x -- font can't be opened
586 ? -- no font specified
588 The Charset column of each font contains a name of character set
589 displayed by the font."
591 (if (not window-system)
592 (error "No window system being used")
593 (let ((fontset-list (mapcar '(lambda (x) (list x)) (fontset-list)))
594 (completion-ignore-case t))
595 (list (completing-read
596 "Fontset (default, used by the current frame): "
597 fontset-list nil t)))))
598 (if (= (length fontset) 0)
599 (setq fontset (cdr (assq 'font (frame-parameters)))))
600 (if (not (query-fontset fontset))
601 (error "Current frame is using font, not fontset"))
602 (let ((fontset-info (fontset-info fontset)))
603 (with-output-to-temp-buffer "*Help*"
605 (set-buffer standard-output)
606 (insert "Fontset-Name\t\t\t\t\t\t WDxHT Style\n")
607 (insert "------------\t\t\t\t\t\t ----- -----\n")
608 (print-fontset fontset t)))))
611 (defun list-fontsets (arg)
612 "Display a list of all fontsets.
614 It prints name, size, and style of each fontset.
615 With prefix arg, it also lists up fonts contained in each fontset.
616 See the function `describe-fontset' for the format of the list."
618 (with-output-to-temp-buffer "*Help*"
620 (set-buffer standard-output)
621 (insert "Fontset-Name\t\t\t\t\t\t WDxHT Style\n")
622 (insert "------------\t\t\t\t\t\t ----- -----\n")
623 (let ((fontsets (fontset-list)))
625 (print-fontset (car fontsets) arg)
626 (setq fontsets (cdr fontsets)))))))
629 (defun list-input-methods ()
630 "Print information of all input methods."
632 (with-output-to-temp-buffer "*Help*"
633 (princ "LANGUAGE\n NAME (`TITLE' in mode line)\n")
634 (princ " SHORT-DESCRIPTION\n------------------------------\n")
635 (setq input-method-alist
636 (sort input-method-alist
637 (function (lambda (x y) (string< (nth 1 x) (nth 1 y))))))
638 (let ((l input-method-alist)
641 (setq elt (car l) l (cdr l))
642 (when (not (equal language (nth 1 elt)))
643 (setq language (nth 1 elt))
646 (princ (format " %s (`%s' in mode line)\n %s\n"
647 (car elt) (nth 3 elt)
648 (let ((title (nth 4 elt)))
649 (string-match ".*" title)
650 (match-string 0 title))))))))
654 ;; Insert a header of a section with SECTION-NUMBER and TITLE.
655 (defun insert-section (section-number title)
656 (insert "########################################\n"
657 "# Section " (format "%d" section-number) ". " title "\n"
658 "########################################\n\n"))
662 "Display diagnosis of the multilingual environment (MULE).
664 It prints various information related to the current multilingual
665 environment, including lists of input methods, coding systems,
666 character sets, and fontsets (if Emacs running under some window
669 (with-output-to-temp-buffer "*Mule-Diagnosis*"
671 (set-buffer standard-output)
672 (insert "\t###############################\n"
673 "\t### Diagnosis of your Emacs ###\n"
674 "\t###############################\n\n"
675 "CONTENTS: Section 1. General Information\n"
676 " Section 2. Display\n"
677 " Section 3. Input methods\n"
678 " Section 4. Coding systems\n"
679 " Section 5. Character sets\n")
681 (insert " Section 6. Fontsets\n"))
684 (insert-section 1 "General Information")
685 (insert "Version of this emacs:\n " (emacs-version) "\n"
686 "Primary language:\n " primary-language "\n\n")
688 (insert-section 2 "Display")
690 (insert "Window-system: "
691 (symbol-name window-system)
692 (format "%s" window-system-version))
693 (insert "Terminal: " (getenv "TERM")))
696 (if (eq window-system 'x)
697 (let ((font (cdr (assq 'font (frame-parameters)))))
698 (insert "The selected frame is using the "
699 (if (query-fontset font) "fontset" "font")
701 (insert "Coding system of the terminal: "
702 (symbol-name (terminal-coding-system))))
705 (insert-section 3 "Input methods")
706 (save-excursion (list-input-methods))
707 (insert-buffer-substring "*Help*")
709 (if default-input-method
710 (insert "Default input method: %s\n" default-input-method)
711 (insert "No default input method is specified.\n"))
713 (insert-section 4 "Coding systems")
714 (save-excursion (list-coding-systems t))
715 (insert-buffer-substring "*Help*")
716 (list-coding-categories)
717 (insert-buffer-substring "*Help*")
720 (insert-section 5 "Character sets")
721 (list-character-sets t)
722 (insert-buffer-substring "*Help*")
726 (insert-section 6 "Fontsets")
728 (insert-buffer-substring "*Help*"))
735 (defun dump-charsets ()
736 "Dump information of all charsets into the file \"CHARSETS\".
737 The file is saved in the directory `data-directory'."
738 (let ((file (expand-file-name "CHARSETS" data-directory))
740 (or (file-writable-p file)
741 (error "Can't write to file %s" file))
742 (setq buf (find-file-noselect file))
743 (save-window-excursion
746 (setq buffer-read-only nil)
748 (list-character-sets t)
749 (insert-buffer-substring "*Help*")
750 (let (make-backup-files
751 coding-system-for-write)
758 (defun dump-codings ()
759 "Dump information of all coding systems into the file \"CODINGS\".
760 The file is saved in the directory `data-directory'."
761 (let ((file (expand-file-name "CODINGS" data-directory))
763 (or (file-writable-p file)
764 (error "Can't write to file %s" file))
765 (setq buf (find-file-noselect file))
766 (save-window-excursion
769 (setq buffer-read-only nil)
771 (list-coding-systems t)
772 (insert-buffer-substring "*Help*")
773 (list-coding-categories)
774 (insert-buffer-substring "*Help*")
775 (let (make-backup-files
776 coding-system-for-write)
782 ;;; mule-diag.el ends here