diff options
| author | Kenichi Handa | 1999-02-12 08:06:39 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1999-02-12 08:06:39 +0000 |
| commit | 1f70b06ddc08d6a211b5a208007daa63268eda63 (patch) | |
| tree | 9eaf74e1dc1607817da4547dc7e0cc7c3eb18fe5 /lisp | |
| parent | 57a6f7575144f55008b4cb88dbdb1a8378ddf158 (diff) | |
| download | emacs-1f70b06ddc08d6a211b5a208007daa63268eda63.tar.gz emacs-1f70b06ddc08d6a211b5a208007daa63268eda63.zip | |
(what-cursor-position): Don't use the variable
charset-origin-alist, but use charset-origin-alist property of
buffer-file-coding-system to decide external character set code.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/simple.el | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index d2d6e41d063..38bea602eb5 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -517,29 +517,40 @@ Each language environment may show different external character components." | |||
| 517 | pos total percent beg end col hscroll) | 517 | pos total percent beg end col hscroll) |
| 518 | (message "point=%d of %d(%d%%) column %d %s" | 518 | (message "point=%d of %d(%d%%) column %d %s" |
| 519 | pos total percent col hscroll)) | 519 | pos total percent col hscroll)) |
| 520 | (let* ((coding-system buffer-file-coding-system) | 520 | (let ((charset (char-charset char)) |
| 521 | (encoding | 521 | (coding-system buffer-file-coding-system) |
| 522 | (encode-coding-string (char-to-string char) coding-system t)) | 522 | slot external encoding-msg) |
| 523 | (encoding-string-hex | 523 | ;; To decided an external character code, we use |
| 524 | (mapconcat (lambda (ch) (format "0x%x" ch)) encoding " ")) | 524 | ;; charset-origin-alist property of buffer-file-coding-system. |
| 525 | (encoding-msg | 525 | ;; But, if buffer-file-coding-system is nil of undecided, use |
| 526 | (if (and coding-system | 526 | ;; that property of default-buffer-file-coding-system. If |
| 527 | (not (and (= (length encoding) 1) | 527 | ;; that property value is nil, we don't show external |
| 528 | (= (aref encoding 0) char)))) | 528 | ;; character code. |
| 529 | (format "(0%o, %d, 0x%x, ext %s)" | 529 | (if (or (not coding-system) |
| 530 | char char char | 530 | (eq (coding-system-type coding-system) t)) |
| 531 | encoding-string-hex) | 531 | (setq coding-system default-buffer-file-coding-system)) |
| 532 | (format "(0%o, %d, 0x%x)" | 532 | (if (and coding-system |
| 533 | char char char)))) | 533 | (setq slot |
| 534 | (coding-system-get coding-system 'charset-origin-alist)) | ||
| 535 | (setq slot (assq charset slot))) | ||
| 536 | (setq external (list (nth 1 slot) (funcall (nth 2 slot) char)))) | ||
| 537 | (setq encoding-msg | ||
| 538 | (if external | ||
| 539 | (format "(0%o, %d, 0x%x, ext 0x%x)" | ||
| 540 | char char char (nth 1 external)) | ||
| 541 | (format "(0%o, %d, 0x%x)" char char char))) | ||
| 534 | (if detail | 542 | (if detail |
| 535 | (let* ((internal (split-char char)) | 543 | ;; We show the detailed information of CHAR. |
| 536 | (charset (char-charset char)) | 544 | (let (internal) |
| 537 | (slot (assq charset charset-origin-alist)) | 545 | (if (eq charset 'composition) |
| 538 | external) | 546 | ;; For a composite character, we show the components |
| 539 | (if slot | 547 | ;; only. |
| 540 | (setq external (list (nth 1 slot) (funcall (nth 2 slot) char))) | 548 | (setq internal (concat "(composition of \"" |
| 541 | (if (eq charset 'composition) | 549 | (decompose-composite-char char) |
| 542 | (setq internal '("composite-character")) | 550 | "\")") |
| 551 | external nil) | ||
| 552 | (setq internal (split-char char)) | ||
| 553 | (unless external | ||
| 543 | (setq external (cons (charset-short-name charset) | 554 | (setq external (cons (charset-short-name charset) |
| 544 | (copy-sequence (cdr internal)))) | 555 | (copy-sequence (cdr internal)))) |
| 545 | (if (= (charset-iso-graphic-plane charset) 1) | 556 | (if (= (charset-iso-graphic-plane charset) 1) |
| @@ -552,7 +563,7 @@ Each language environment may show different external character components." | |||
| 552 | (if (< char 256) | 563 | (if (< char 256) |
| 553 | (single-key-description char) | 564 | (single-key-description char) |
| 554 | (char-to-string char)) | 565 | (char-to-string char)) |
| 555 | encoding-msg (or internal "") (or external ""))) | 566 | encoding-msg internal (or external ""))) |
| 556 | (if (or (/= beg 1) (/= end (1+ total))) | 567 | (if (or (/= beg 1) (/= end (1+ total))) |
| 557 | (message "Char: %s %s point=%d of %d(%d%%) <%d - %d> column %d %s" | 568 | (message "Char: %s %s point=%d of %d(%d%%) <%d - %d> column %d %s" |
| 558 | (if (< char 256) | 569 | (if (< char 256) |