;;; mule-diag.el --- show diagnosis of multilingual environment (Mule)
-;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
-;; Licensed to the Free Software Foundation.
-;; Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003
+;; Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997, 1999, 2000, 2001, 2002, 2003
+;; National Institute of Advanced Industrial Science and Technology (AIST)
+;; Registration Number H14PRO021
;; Keywords: multilingual, charset, coding system, fontset, diagnosis, i18n
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Commentary:
'help-echo "mouse-2, RET: show table of characters for this character set")
;;;###autoload
-(defvar non-iso-charset-alist nil
+(defvar non-iso-charset-alist
+ `((mac-roman
+ (ascii latin-iso8859-1 mule-unicode-2500-33ff
+ mule-unicode-0100-24ff mule-unicode-e000-ffff)
+ mac-roman-decoder
+ ((0 255)))
+ (viscii
+ (ascii vietnamese-viscii-lower vietnamese-viscii-upper)
+ viet-viscii-nonascii-translation-table
+ ((0 255)))
+ (vietnamese-tcvn
+ (ascii vietnamese-viscii-lower vietnamese-viscii-upper)
+ viet-tcvn-nonascii-translation-table
+ ((0 255)))
+ (koi8-r
+ (ascii cyrillic-iso8859-5)
+ cyrillic-koi8-r-nonascii-translation-table
+ ((32 255)))
+ (alternativnyj
+ (ascii cyrillic-iso8859-5)
+ cyrillic-alternativnyj-nonascii-translation-table
+ ((32 255)))
+ (koi8-u
+ (ascii cyrillic-iso8859-5 mule-unicode-0100-24ff)
+ cyrillic-koi8-u-nonascii-translation-table
+ ((32 255)))
+ (big5
+ (ascii chinese-big5-1 chinese-big5-2)
+ decode-big5-char
+ ((32 127)
+ ((?\xA1 ?\xFE) . (?\x40 ?\x7E ?\xA1 ?\xFE))))
+ (sjis
+ (ascii katakana-jisx0201 japanese-jisx0208)
+ decode-sjis-char
+ ((32 127 ?\xA1 ?\xDF)
+ ((?\x81 ?\x9F ?\xE0 ?\xEF) . (?\x40 ?\x7E ?\x80 ?\xFC)))))
"Alist of charset names vs the corresponding information.
This is mis-named for historical reasons. The charsets are actually
non-built-in ones. They correspond to Emacs coding systems, not Emacs
The second form is used for 2-byte codes. The car part is the ranges
of the first byte, and the cdr part is the ranges of the second byte.")
-;; Set it like this in case code-pages &c has been loaded previously,
-;; in which case defvar would be useless.
-(setq non-iso-charset-alist
- (append
- non-iso-charset-alist
- `((mac-roman
- (ascii latin-iso8859-1 mule-unicode-2500-33ff
- mule-unicode-0100-24ff mule-unicode-e000-ffff)
- mac-roman-decoder
- ((0 255)))
- (viscii
- (ascii vietnamese-viscii-lower vietnamese-viscii-upper)
- viet-viscii-nonascii-translation-table
- ((0 255)))
- (vietnamese-tcvn
- (ascii vietnamese-viscii-lower vietnamese-viscii-upper)
- viet-tcvn-nonascii-translation-table
- ((0 255)))
- (koi8-r
- (ascii cyrillic-iso8859-5)
- cyrillic-koi8-r-nonascii-translation-table
- ((32 255)))
- (alternativnyj
- (ascii cyrillic-iso8859-5)
- cyrillic-alternativnyj-nonascii-translation-table
- ((32 255)))
- (koi8-u
- (ascii cyrillic-iso8859-5 mule-unicode-0100-24ff)
- cyrillic-koi8-u-nonascii-translation-table
- ((32 255)))
- (big5
- (ascii chinese-big5-1 chinese-big5-2)
- decode-big5-char
- ((32 127)
- ((?\xA1 ?\xFE) . (?\x40 ?\x7E ?\xA1 ?\xFE))))
- (sjis
- (ascii katakana-jisx0201 japanese-jisx0208)
- decode-sjis-char
- ((32 127 ?\xA1 ?\xDF)
- ((?\x81 ?\x9F ?\xE0 ?\xEF) . (?\x40 ?\x7E ?\x80 ?\xFC)))))))
-
;;;###autoload
(defun list-character-sets (arg)
"Display a list of all character sets.
;;;###autoload
(defun describe-coding-system (coding-system)
"Display information about CODING-SYSTEM."
- (interactive "zDescribe coding system (default, current choices): ")
+ (interactive "zDescribe coding system (default current choices): ")
(if (null coding-system)
(describe-current-coding-system)
(help-setup-xref (list #'describe-coding-system coding-system)
(let ((vars (coding-system-get coding-system 'dependency)))
(when vars
(princ "See also the documentation of these customizable variables
-which alter the behaviour of this coding system.\n")
+which alter the behavior of this coding system.\n")
(dolist (v vars)
(princ " `")
(princ v)
(setq codings (cons x codings))))
(get (car categories) 'coding-systems))
(if codings
- (let ((max-col (frame-width))
+ (let ((max-col (window-width))
pos)
(princ (format "\
The following are decoded correctly but recognized as %s:\n "
(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))))
+ (print-coding-system coding-system)))
+ (let ((first t))
+ (dolist (elt coding-system-alist)
+ (unless (memq (intern (car elt)) coding-system-list)
+ (when first
+ (princ "\
+####################################################
+# The following coding systems are not yet loaded. #
+####################################################
+")
+ (setq first nil))
+ (princ-list (car elt))))))
;;;###autoload
(defun list-coding-categories ()
;;;###autoload
(defun describe-font (fontname)
- "Display information about fonts which partially match FONTNAME."
- (interactive "sFontname (default, current choice for ASCII chars): ")
+ "Display information about a font whose name is FONTNAME.
+The font must be already used by Emacs."
+ (interactive "sFont name (default current choice for ASCII chars): ")
(or (and window-system (fboundp 'fontset-list))
- (error "No fontsets being used"))
- (when (or (not fontname) (= (length fontname) 0))
- (setq fontname (cdr (assq 'font (frame-parameters))))
- (if (query-fontset fontname)
- (setq fontname
- (nth 1 (assq 'ascii (aref (fontset-info fontname) 2))))))
- (let ((font-info (font-info fontname)))
+ (error "No fonts being used"))
+ (let (fontset font-info)
+ (when (or (not fontname) (= (length fontname) 0))
+ (setq fontname (frame-parameter nil 'font))
+ ;; Check if FONTNAME is a fontset.
+ (if (query-fontset fontname)
+ (setq fontset fontname
+ fontname (nth 1 (assq 'ascii
+ (aref (fontset-info fontname) 2))))))
+ (setq font-info (font-info fontname))
(if (null font-info)
- (message "No matching font")
+ (if fontset
+ ;; The font should be surely used. So, there's some
+ ;; problem about getting information about it. It is
+ ;; better to print the fontname to show which font has
+ ;; this problem.
+ (message "No information about \"%s\"" fontname)
+ (message "No matching font being used"))
(with-output-to-temp-buffer "*Help*"
(describe-font-internal font-info 'verbose)))))
(mapcar 'cdr fontset-alias-alist)))
(completion-ignore-case t))
(list (completing-read
- "Fontset (default, used by the current frame): "
+ "Fontset (default used by the current frame): "
fontset-list nil t)))))
(if (= (length fontset) 0)
(setq fontset (frame-parameter nil 'font)))
(goto-char (point-min))
(while (re-search-forward
"^ \\([^ ]+\\) (`.*' in mode line)$" nil t)
- (help-xref-button 1 #'help-input-method
- (match-string 1)
- "mouse-2: describe this method"))))))
+ (help-xref-button 1 'help-input-method (match-string 1)))))))
(defun list-input-methods-1 ()
(if (not input-method-alist)