aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/descr-text.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 42d7c7e60d5..d509cb5d5b6 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -341,10 +341,11 @@ This function is semi-obsolete. Use `get-char-code-property'."
341 (format "%s:%s (#x%02X)" type name code) 341 (format "%s:%s (#x%02X)" type name code)
342 (format "%s:%s (#x%04X%04X)" 342 (format "%s:%s (#x%04X%04X)"
343 type name (car code) (cdr code)))))) 343 type name (car code) (cdr code))))))
344 (let* ((coding (terminal-coding-system)) 344 (let* ((charset (get-text-property pos 'charset))
345 (encoded (encode-coding-char char coding))) 345 (coding (terminal-coding-system))
346 (encoded (encode-coding-char char coding charset)))
346 (if encoded 347 (if encoded
347 (encoded-string-description encoded coding))))) 348 (encoded-string-description encoded coding charset)))))
348 349
349 350
350;; Return a string of CH with composition for padding on both sides. 351;; Return a string of CH with composition for padding on both sides.
@@ -363,7 +364,7 @@ as well as widgets, buttons, overlays, and text properties."
363 (if (>= pos (point-max)) 364 (if (>= pos (point-max))
364 (error "No character follows specified position")) 365 (error "No character follows specified position"))
365 (let* ((char (char-after pos)) 366 (let* ((char (char-after pos))
366 (charset (char-charset char)) 367 (charset (or (get-text-property pos 'charset) (char-charset char)))
367 (composition (find-composition pos nil nil t)) 368 (composition (find-composition pos nil nil t))
368 (component-chars nil) 369 (component-chars nil)
369 (display-table (or (window-display-table) 370 (display-table (or (window-display-table)
@@ -388,7 +389,9 @@ as well as widgets, buttons, overlays, and text properties."
388 (kill-buffer tmp-buf)))) 389 (kill-buffer tmp-buf))))
389 item-list max-width code) 390 item-list max-width code)
390 391
391 (setq code (encode-char char charset)) 392 (or (setq code (encode-char char charset))
393 (setq charset (char-charset char)
394 code (encode-char char charset)))
392 (setq item-list 395 (setq item-list
393 `(("character" 396 `(("character"
394 ,(format "%s (%d, #o%o, #x%x)" 397 ,(format "%s (%d, #o%o, #x%x)"
@@ -450,7 +453,7 @@ as well as widgets, buttons, overlays, and text properties."
450 (string-as-unibyte (char-to-string char)) nil)) 453 (string-as-unibyte (char-to-string char)) nil))
451 ("file code" 454 ("file code"
452 ,@(let* ((coding buffer-file-coding-system) 455 ,@(let* ((coding buffer-file-coding-system)
453 (encoded (encode-coding-char char coding))) 456 (encoded (encode-coding-char char coding charset)))
454 (if encoded 457 (if encoded
455 (list (encoded-string-description encoded coding) 458 (list (encoded-string-description encoded coding)
456 (format "(encoded by coding system %S)" coding)) 459 (format "(encoded by coding system %S)" coding))