aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2008-12-03 16:17:46 +0000
committerJuanma Barranquero2008-12-03 16:17:46 +0000
commite4fe4569a9f4fb296dbcc154ea2b0a502f98b2b2 (patch)
tree0f391227441398a733e28508b6f2253809b09828
parent805f2638aaeeddc752c6f78f71b23350161bf2b2 (diff)
downloademacs-e4fe4569a9f4fb296dbcc154ea2b0a502f98b2b2.tar.gz
emacs-e4fe4569a9f4fb296dbcc154ea2b0a502f98b2b2.zip
* international/mule-diag.el (unicodedata-file, unicode-data): Remove.
They already exist in descr-text.el as `describe-char-unicodedata-file' and `describe-char-unicode-data'. (print-list): Simplify. (read-charset): Reflow docstring. (list-coding-systems): Doc fix.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/international/mule-diag.el199
2 files changed, 13 insertions, 195 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 57cb3703c0e..707b4bc3616 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12008-12-03 Juanma Barranquero <lekktu@gmail.com>
2
3 * international/mule-diag.el (unicodedata-file, unicode-data): Remove.
4 They already exist in descr-text.el as `describe-char-unicodedata-file'
5 and `describe-char-unicode-data'.
6 (print-list): Simplify.
7 (read-charset): Reflow docstring.
8 (list-coding-systems): Doc fix.
9
12008-12-03 Glenn Morris <rgm@gnu.org> 102008-12-03 Glenn Morris <rgm@gnu.org>
2 11
3 * vc.el (vc-diff-switches): Doc fix. 12 * vc.el (vc-diff-switches): Doc fix.
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el
index b104cefa3ac..f47602c0915 100644
--- a/lisp/international/mule-diag.el
+++ b/lisp/international/mule-diag.el
@@ -38,12 +38,7 @@
38 38
39(defun print-list (&rest args) 39(defun print-list (&rest args)
40 "Print all arguments with single space separator in one line." 40 "Print all arguments with single space separator in one line."
41 (while (cdr args) 41 (princ (mapconcat #'identity args " "))
42 (when (car args)
43 (princ (car args))
44 (princ " "))
45 (setq args (cdr args)))
46 (princ (car args))
47 (princ "\n")) 42 (princ "\n"))
48 43
49;;; CHARSET 44;;; CHARSET
@@ -223,8 +218,8 @@ It must be an Emacs character set listed in the variable `charset-list'.
223Optional arguments are DEFAULT-VALUE and INITIAL-INPUT. 218Optional arguments are DEFAULT-VALUE and INITIAL-INPUT.
224DEFAULT-VALUE, if non-nil, is the default value. 219DEFAULT-VALUE, if non-nil, is the default value.
225INITIAL-INPUT, if non-nil, is a string inserted in the minibuffer initially. 220INITIAL-INPUT, if non-nil, is a string inserted in the minibuffer initially.
226See the documentation of the function `completing-read' for the 221See the documentation of the function `completing-read' for the detailed
227detailed meanings of these arguments." 222meanings of these arguments."
228 (let* ((table (mapcar (lambda (x) (list (symbol-name x))) charset-list)) 223 (let* ((table (mapcar (lambda (x) (list (symbol-name x))) charset-list))
229 (charset (completing-read prompt table 224 (charset (completing-read prompt table
230 nil t initial-input 'charset-history 225 nil t initial-input 'charset-history
@@ -756,7 +751,7 @@ Priority order for recognizing coding systems when reading files:\n")
756 "Display a list of all coding systems. 751 "Display a list of all coding systems.
757This shows the mnemonic letter, name, and description of each coding system. 752This shows the mnemonic letter, name, and description of each coding system.
758 753
759With prefix arg, the output format gets more cryptic, 754With prefix ARG, the output format gets more cryptic,
760but still contains full information about each coding system." 755but still contains full information about each coding system."
761 (interactive "P") 756 (interactive "P")
762 (with-output-to-temp-buffer "*Help*" 757 (with-output-to-temp-buffer "*Help*"
@@ -1113,192 +1108,6 @@ system which uses fontsets)."
1113 (print-help-return-message)))) 1108 (print-help-return-message))))
1114 1109
1115;;;###autoload 1110;;;###autoload
1116(defcustom unicodedata-file nil
1117 "Location of UnicodeData file.
1118This is the UnicodeData.txt file from the Unicode consortium, used for
1119diagnostics. If it is non-nil `describe-char-after' will print data
1120looked up from it."
1121 :group 'mule
1122 :type '(choice (const :tag "None" nil)
1123 file))
1124
1125;; We could convert the unidata file into a Lispy form once-for-all
1126;; and distribute it for loading on demand. It might be made more
1127;; space-efficient by splitting strings word-wise and replacing them
1128;; with lists of symbols interned in a private obarray, e.g.
1129;; "LATIN SMALL LETTER A" => '(LATIN SMALL LETTER A).
1130
1131;;;###autoload
1132(defun unicode-data (char)
1133 "Return a list of Unicode data for unicode CHAR.
1134Each element is a list of a property description and the property value.
1135The list is null if CHAR isn't found in `unicodedata-file'."
1136 (when unicodedata-file
1137 (unless (file-exists-p unicodedata-file)
1138 (error "`unicodedata-file' %s not found" unicodedata-file))
1139 (save-excursion
1140 (set-buffer (find-file-noselect unicodedata-file t t))
1141 (goto-char (point-min))
1142 (let ((hex (format "%04X" char))
1143 found first last)
1144 (if (re-search-forward (concat "^" hex) nil t)
1145 (setq found t)
1146 ;; It's not listed explicitly. Look for ranges, e.g. CJK
1147 ;; ideographs, and check whether it's in one of them.
1148 (while (and (re-search-forward "^\\([^;]+\\);[^;]+First>;" nil t)
1149 (>= char (setq first
1150 (string-to-number (match-string 1) 16)))
1151 (progn
1152 (forward-line 1)
1153 (looking-at "^\\([^;]+\\);[^;]+Last>;")
1154 (> char
1155 (setq last
1156 (string-to-number (match-string 1) 16))))))
1157 (if (and (>= char first)
1158 (<= char last))
1159 (setq found t)))
1160 (if found
1161 (let ((fields (mapcar (lambda (elt)
1162 (if (> (length elt) 0)
1163 elt))
1164 (cdr (split-string
1165 (buffer-substring
1166 (line-beginning-position)
1167 (line-end-position))
1168 ";")))))
1169 ;; The length depends on whether the last field was empty.
1170 (unless (or (= 13 (length fields))
1171 (= 14 (length fields)))
1172 (error "Invalid contents in %s" unicodedata-file))
1173 ;; The field names and values lists are slightly
1174 ;; modified from Mule-UCS unidata.el.
1175 (list
1176 (list "Name" (let ((name (nth 0 fields)))
1177 ;; Check for <..., First>, <..., Last>
1178 (if (string-match "\\`\\(<[^,]+\\)," name)
1179 (concat (match-string 1 name) ">")
1180 name)))
1181 (list "Category"
1182 (cdr (assoc
1183 (nth 1 fields)
1184 '(("Lu" . "uppercase letter")
1185 ("Ll" . "lowercase letter")
1186 ("Lt" . "titlecase letter")
1187 ("Mn" . "non-spacing mark")
1188 ("Mc" . "spacing-combining mark")
1189 ("Me" . "enclosing mark")
1190 ("Nd" . "decimal digit")
1191 ("Nl" . "letter number")
1192 ("No" . "other number")
1193 ("Zs" . "space separator")
1194 ("Zl" . "line separator")
1195 ("Zp" . "paragraph separator")
1196 ("Cc" . "other control")
1197 ("Cf" . "other format")
1198 ("Cs" . "surrogate")
1199 ("Co" . "private use")
1200 ("Cn" . "not assigned")
1201 ("Lm" . "modifier letter")
1202 ("Lo" . "other letter")
1203 ("Pc" . "connector punctuation")
1204 ("Pd" . "dash punctuation")
1205 ("Ps" . "open punctuation")
1206 ("Pe" . "close punctuation")
1207 ("Pi" . "initial-quotation punctuation")
1208 ("Pf" . "final-quotation punctuation")
1209 ("Po" . "other punctuation")
1210 ("Sm" . "math symbol")
1211 ("Sc" . "currency symbol")
1212 ("Sk" . "modifier symbol")
1213 ("So" . "other symbol")))))
1214 (list "Combining class"
1215 (cdr (assoc
1216 (string-to-number (nth 2 fields))
1217 '((0 . "Spacing")
1218 (1 . "Overlays and interior")
1219 (7 . "Nuktas")
1220 (8 . "Hiragana/Katakana voicing marks")
1221 (9 . "Viramas")
1222 (10 . "Start of fixed position classes")
1223 (199 . "End of fixed position classes")
1224 (200 . "Below left attached")
1225 (202 . "Below attached")
1226 (204 . "Below right attached")
1227 (208 . "Left attached (reordrant around \
1228single base character)")
1229 (210 . "Right attached")
1230 (212 . "Above left attached")
1231 (214 . "Above attached")
1232 (216 . "Above right attached")
1233 (218 . "Below left")
1234 (220 . "Below")
1235 (222 . "Below right")
1236 (224 . "Left (reordrant around single base \
1237character)")
1238 (226 . "Right")
1239 (228 . "Above left")
1240 (230 . "Above")
1241 (232 . "Above right")
1242 (233 . "Double below")
1243 (234 . "Double above")
1244 (240 . "Below (iota subscript)")))))
1245 (list "Bidi category"
1246 (cdr (assoc
1247 (nth 3 fields)
1248 '(("L" . "Left-to-Right")
1249 ("LRE" . "Left-to-Right Embedding")
1250 ("LRO" . "Left-to-Right Override")
1251 ("R" . "Right-to-Left")
1252 ("AL" . "Right-to-Left Arabic")
1253 ("RLE" . "Right-to-Left Embedding")
1254 ("RLO" . "Right-to-Left Override")
1255 ("PDF" . "Pop Directional Format")
1256 ("EN" . "European Number")
1257 ("ES" . "European Number Separator")
1258 ("ET" . "European Number Terminator")
1259 ("AN" . "Arabic Number")
1260 ("CS" . "Common Number Separator")
1261 ("NSM" . "Non-Spacing Mark")
1262 ("BN" . "Boundary Neutral")
1263 ("B" . "Paragraph Separator")
1264 ("S" . "Segment Separator")
1265 ("WS" . "Whitespace")
1266 ("ON" . "Other Neutrals")))))
1267 (list "Decomposition"
1268 (if (nth 4 fields)
1269 (let* ((parts (split-string (nth 4 fields)))
1270 (info (car parts)))
1271 (if (string-match "\\`<\\(.+\\)>\\'" info)
1272 (setq info (match-string 1 info))
1273 (setq info nil))
1274 (if info (setq parts (cdr parts)))
1275 (setq parts (mapconcat
1276 (lambda (arg)
1277 (string (string-to-number arg 16)))
1278 parts " "))
1279 (concat info parts))))
1280 (list "Decimal digit value"
1281 (nth 5 fields))
1282 (list "Digit value"
1283 (nth 6 fields))
1284 (list "Numeric value"
1285 (nth 7 fields))
1286 (list "Mirrored"
1287 (if (equal "Y" (nth 8 fields))
1288 "yes"))
1289 (list "Old name" (nth 9 fields))
1290 (list "ISO 10646 comment" (nth 10 fields))
1291 (list "Uppercase" (and (nth 11 fields)
1292 (string (string-to-number
1293 (nth 11 fields) 16))))
1294 (list "Lowercase" (and (nth 12 fields)
1295 (string (string-to-number
1296 (nth 12 fields) 16))))
1297 (list "Titlecase" (and (nth 13 fields)
1298 (string (string-to-number
1299 (nth 13 fields) 16)))))))))))
1300
1301;;;###autoload
1302(defun font-show-log (&optional limit) 1111(defun font-show-log (&optional limit)
1303 "Show log of font listing and opening. 1112 "Show log of font listing and opening.
1304Prefix arg LIMIT says how many fonts to show for each listing. 1113Prefix arg LIMIT says how many fonts to show for each listing.