diff options
| author | Kenichi Handa | 2009-03-13 05:08:19 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2009-03-13 05:08:19 +0000 |
| commit | d102151dabddcce2860f82b5291ab106c27d534f (patch) | |
| tree | bde2a47e3d197090af14de35b0345fe31d9f47c9 | |
| parent | 2d2db320ff86719ac7742f94d957b62123897561 (diff) | |
| download | emacs-d102151dabddcce2860f82b5291ab106c27d534f.tar.gz emacs-d102151dabddcce2860f82b5291ab106c27d534f.zip | |
(print-fontset): Handling of the
argument FONTSET changed for consistency. Reorder the printed
information to match with the font searching strategy.
(describe-fontset): Use face-attribute to get the fontset of the
selected frame.
(mule-diag): Likewise. Print both font and fontset of the frame.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/international/mule-diag.el | 51 |
2 files changed, 49 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bf137f658c6..595b7fc953f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2009-03-13 Kenichi Handa <handa@m17n.org> | ||
| 2 | |||
| 3 | * international/mule-diag.el (print-fontset): Handling of the | ||
| 4 | argument FONTSET changed for consistency. Reorder the printed | ||
| 5 | information to match with the font searching strategy. | ||
| 6 | (describe-fontset): Use face-attribute to get the fontset of the | ||
| 7 | selected frame. | ||
| 8 | (mule-diag): Likewise. Print both font and fontset of the frame. | ||
| 9 | |||
| 1 | 2009-03-13 Chong Yidong <cyd@stupidchicken.com> | 10 | 2009-03-13 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 11 | ||
| 3 | * term.el (term-send-raw-string): Deactivate mark. | 12 | * term.el (term-send-raw-string): Deactivate mark. |
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el index 50b8022cc72..bc8ffbb7824 100644 --- a/lisp/international/mule-diag.el +++ b/lisp/international/mule-diag.el | |||
| @@ -907,23 +907,52 @@ The font must be already used by Emacs." | |||
| 907 | 907 | ||
| 908 | (defun print-fontset (fontset &optional print-opened) | 908 | (defun print-fontset (fontset &optional print-opened) |
| 909 | "Print information about FONTSET. | 909 | "Print information about FONTSET. |
| 910 | If FONTSET is nil, print information about the default fontset. | 910 | FONTSET nil means the fontset of the selected frame, t means the |
| 911 | default fontset. | ||
| 911 | If optional arg PRINT-OPENED is non-nil, also print names of all opened | 912 | If optional arg PRINT-OPENED is non-nil, also print names of all opened |
| 912 | fonts for FONTSET. This function actually inserts the information in | 913 | fonts for FONTSET. This function actually inserts the information in |
| 913 | the current buffer." | 914 | the current buffer." |
| 914 | (or fontset | 915 | (if (eq fontset t) |
| 915 | (setq fontset (query-fontset "fontset-default"))) | 916 | (setq fontset (query-fontset "fontset-default")) |
| 917 | (if (eq fontset nil) | ||
| 918 | (setq fontset (face-attribute 'default :fontset)))) | ||
| 916 | (beginning-of-line) | 919 | (beginning-of-line) |
| 920 | (narrow-to-region (point) (point)) | ||
| 917 | (insert "Fontset: " fontset "\n") | 921 | (insert "Fontset: " fontset "\n") |
| 918 | (insert (propertize "CHAR RANGE" 'face 'underline) | 922 | (insert (propertize "CHAR RANGE" 'face 'underline) |
| 919 | " (" (propertize "CODE RANGE" 'face 'underline) ")\n") | 923 | " (" (propertize "CODE RANGE" 'face 'underline) ")\n") |
| 920 | (insert " " (propertize "FONT NAME" 'face 'underline) | 924 | (insert " " (propertize "FONT NAME" 'face 'underline) |
| 921 | " (" (propertize "REQUESTED" 'face 'underline) | 925 | " (" (propertize "REQUESTED" 'face 'underline) |
| 922 | " and [" (propertize "OPENED" 'face 'underline) "])") | 926 | " and [" (propertize "OPENED" 'face 'underline) "])") |
| 923 | (let ((info (fontset-info fontset))) | 927 | (let* ((info (fontset-info fontset)) |
| 928 | (default-info (char-table-extra-slot info 0)) | ||
| 929 | start1 end1 start2 end2) | ||
| 924 | (describe-vector info 'print-fontset-element) | 930 | (describe-vector info 'print-fontset-element) |
| 925 | (insert "\n ---<fallback to the default fontset>---") | 931 | (when (char-table-range info nil) |
| 926 | (describe-vector (char-table-extra-slot info 0) 'print-fontset-element))) | 932 | ;; The default of FONTSET is described. |
| 933 | (setq start1 (re-search-backward "^default")) | ||
| 934 | (delete-region (point) (line-end-position)) | ||
| 935 | (insert "\n ---<fallback to the default of the specified fontset>---") | ||
| 936 | (put-text-property (line-beginning-position) (point) 'face 'highlight) | ||
| 937 | (goto-char (point-max)) | ||
| 938 | (setq end1 (setq start2 (point)))) | ||
| 939 | (when default-info | ||
| 940 | (insert "\n ---<fallback to the default fontset>---") | ||
| 941 | (put-text-property (line-beginning-position) (point) 'face 'highlight) | ||
| 942 | (describe-vector default-info 'print-fontset-element) | ||
| 943 | (when (char-table-range default-info nil) | ||
| 944 | ;; The default of the default fontset is described. | ||
| 945 | (setq end2 (re-search-backward "^default")) | ||
| 946 | (delete-region (point) (line-end-position)) | ||
| 947 | (insert "\n ---<fallback to the default of the default fontset>---") | ||
| 948 | (put-text-property (line-beginning-position) (point) 'face 'highlight))) | ||
| 949 | (if (and start1 end2) | ||
| 950 | ;; Reoder the printed information to match with the font | ||
| 951 | ;; searching strategy; i.e. FONTSET, the default fontset, | ||
| 952 | ;; default of FONTSET, default of the default fontset. | ||
| 953 | (transpose-regions start1 end1 start2 end2)) | ||
| 954 | (goto-char (point-max))) | ||
| 955 | (widen)) | ||
| 927 | 956 | ||
| 928 | (defvar fontset-alias-alist) | 957 | (defvar fontset-alias-alist) |
| 929 | (declare-function fontset-list "fontset.c" ()) | 958 | (declare-function fontset-list "fontset.c" ()) |
| @@ -943,8 +972,8 @@ This shows which font is used for which character(s)." | |||
| 943 | "Fontset (default used by the current frame): " | 972 | "Fontset (default used by the current frame): " |
| 944 | fontset-list nil t))))) | 973 | fontset-list nil t))))) |
| 945 | (if (= (length fontset) 0) | 974 | (if (= (length fontset) 0) |
| 946 | (setq fontset (frame-parameter nil 'font))) | 975 | (setq fontset (face-attribute 'default :fontset)) |
| 947 | (setq fontset (query-fontset fontset)) | 976 | (setq fontset (query-fontset fontset))) |
| 948 | (help-setup-xref (list #'describe-fontset fontset) (interactive-p)) | 977 | (help-setup-xref (list #'describe-fontset fontset) (interactive-p)) |
| 949 | (with-output-to-temp-buffer (help-buffer) | 978 | (with-output-to-temp-buffer (help-buffer) |
| 950 | (with-current-buffer standard-output | 979 | (with-current-buffer standard-output |
| @@ -1064,9 +1093,9 @@ system which uses fontsets)." | |||
| 1064 | 1093 | ||
| 1065 | (if window-system | 1094 | (if window-system |
| 1066 | (let ((font (cdr (assq 'font (frame-parameters))))) | 1095 | (let ((font (cdr (assq 'font (frame-parameters))))) |
| 1067 | (insert "The selected frame is using the " | 1096 | (insert "The font and fontset of the selected frame are:\n" |
| 1068 | (if (query-fontset font) "fontset" "font") | 1097 | " font: " font "\n" |
| 1069 | ":\n\t" font)) | 1098 | " fontset: " (face-attribute 'default :fontset) "\n")) |
| 1070 | (insert "Coding system of the terminal: " | 1099 | (insert "Coding system of the terminal: " |
| 1071 | (symbol-name (terminal-coding-system)))) | 1100 | (symbol-name (terminal-coding-system)))) |
| 1072 | (insert "\n\n") | 1101 | (insert "\n\n") |