summaryrefslogtreecommitdiff
path: root/lisp/simple.el
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>1999-02-12 08:06:39 +0000
committerKenichi Handa <handa@m17n.org>1999-02-12 08:06:39 +0000
commit1f70b06ddc08d6a211b5a208007daa63268eda63 (patch)
tree9eaf74e1dc1607817da4547dc7e0cc7c3eb18fe5 /lisp/simple.el
parent57a6f7575144f55008b4cb88dbdb1a8378ddf158 (diff)
downloademacs-1f70b06ddc08d6a211b5a208007daa63268eda63.tar.gz
(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/simple.el')
-rw-r--r--lisp/simple.el57
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."
pos total percent beg end col hscroll)
(message "point=%d of %d(%d%%) column %d %s"
pos total percent col hscroll))
- (let* ((coding-system buffer-file-coding-system)
- (encoding
- (encode-coding-string (char-to-string char) coding-system t))
- (encoding-string-hex
- (mapconcat (lambda (ch) (format "0x%x" ch)) encoding " "))
- (encoding-msg
- (if (and coding-system
- (not (and (= (length encoding) 1)
- (= (aref encoding 0) char))))
- (format "(0%o, %d, 0x%x, ext %s)"
- char char char
- encoding-string-hex)
- (format "(0%o, %d, 0x%x)"
- char char char))))
+ (let ((charset (char-charset char))
+ (coding-system buffer-file-coding-system)
+ slot external encoding-msg)
+ ;; To decided an external character code, we use
+ ;; charset-origin-alist property of buffer-file-coding-system.
+ ;; But, if buffer-file-coding-system is nil of undecided, use
+ ;; that property of default-buffer-file-coding-system. If
+ ;; that property value is nil, we don't show external
+ ;; character code.
+ (if (or (not coding-system)
+ (eq (coding-system-type coding-system) t))
+ (setq coding-system default-buffer-file-coding-system))
+ (if (and coding-system
+ (setq slot
+ (coding-system-get coding-system 'charset-origin-alist))
+ (setq slot (assq charset slot)))
+ (setq external (list (nth 1 slot) (funcall (nth 2 slot) char))))
+ (setq encoding-msg
+ (if external
+ (format "(0%o, %d, 0x%x, ext 0x%x)"
+ char char char (nth 1 external))
+ (format "(0%o, %d, 0x%x)" char char char)))
(if detail
- (let* ((internal (split-char char))
- (charset (char-charset char))
- (slot (assq charset charset-origin-alist))
- external)
- (if slot
- (setq external (list (nth 1 slot) (funcall (nth 2 slot) char)))
- (if (eq charset 'composition)
- (setq internal '("composite-character"))
+ ;; We show the detailed information of CHAR.
+ (let (internal)
+ (if (eq charset 'composition)
+ ;; For a composite character, we show the components
+ ;; only.
+ (setq internal (concat "(composition of \""
+ (decompose-composite-char char)
+ "\")")
+ external nil)
+ (setq internal (split-char char))
+ (unless external
(setq external (cons (charset-short-name charset)
(copy-sequence (cdr internal))))
(if (= (charset-iso-graphic-plane charset) 1)
@@ -552,7 +563,7 @@ Each language environment may show different external character components."
(if (< char 256)
(single-key-description char)
(char-to-string char))
- encoding-msg (or internal "") (or external "")))
+ encoding-msg internal (or external "")))
(if (or (/= beg 1) (/= end (1+ total)))
(message "Char: %s %s point=%d of %d(%d%%) <%d - %d> column %d %s"
(if (< char 256)