comparison lisp/international/mule-cmds.el @ 24417:8a8615132482

(select-safe-coding-system): Be sure to show a buffer being decoded.
author Kenichi Handa <handa@m17n.org>
date Sat, 27 Feb 1999 04:28:31 +0000
parents eb23f0e62cd5
children 45b77df0b5ac
comparison
equal deleted inserted replaced
24416:3d446442b6a0 24417:8a8615132482
480 (let ((non-safe-chars (find-multibyte-characters 480 (let ((non-safe-chars (find-multibyte-characters
481 from to 3 481 from to 3
482 (and default-coding-system 482 (and default-coding-system
483 (coding-system-get default-coding-system 483 (coding-system-get default-coding-system
484 'safe-charsets)))) 484 'safe-charsets))))
485 overlays) 485 show-position overlays)
486 (save-excursion 486 (save-excursion
487 ;; Highlight characters that default-coding-system can't encode. 487 ;; Highlight characters that default-coding-system can't encode.
488 (when (integerp from) 488 (when (integerp from)
489 (goto-char from) 489 (goto-char from)
490 (let ((found nil)) 490 (let ((found nil))
491 (while (and (not found) 491 (while (and (not found)
492 (re-search-forward "[^\000-\177]" to t)) 492 (re-search-forward "[^\000-\177]" to t))
493 (setq found (assq (char-charset (preceding-char)) 493 (setq found (assq (char-charset (preceding-char))
494 non-safe-chars)))) 494 non-safe-chars))))
495 (beginning-of-line) 495 (forward-line -1)
496 (set-window-start (selected-window) (point)) 496 (setq show-position (point))
497 (save-excursion 497 (save-excursion
498 (while (and (< (length overlays) 256) 498 (while (and (< (length overlays) 256)
499 (re-search-forward "[^\000-\177]" to t)) 499 (re-search-forward "[^\000-\177]" to t))
500 (let* ((char (preceding-char)) 500 (let* ((char (preceding-char))
501 (charset (char-charset char))) 501 (charset (char-charset char)))
505 (overlay-put (car overlays) 'face 'highlight)))))) 505 (overlay-put (car overlays) 'face 'highlight))))))
506 506
507 ;; At last, ask a user to select a proper coding system. 507 ;; At last, ask a user to select a proper coding system.
508 (unwind-protect 508 (unwind-protect
509 (save-window-excursion 509 (save-window-excursion
510 ;; At first, show a helpful message. 510 (when show-position
511 ;; At first, be sure to show the current buffer.
512 (set-window-buffer (selected-window) (current-buffer))
513 (set-window-start (selected-window) show-position))
514 ;; Then, show a helpful message.
511 (with-output-to-temp-buffer "*Warning*" 515 (with-output-to-temp-buffer "*Warning*"
512 (save-excursion 516 (save-excursion
513 (set-buffer standard-output) 517 (set-buffer standard-output)
514 (insert "The target text contains the following non ASCII character(s):\n") 518 (insert "The target text contains the following non ASCII character(s):\n")
515 (let ((len (length non-safe-chars)) 519 (let ((len (length non-safe-chars))