]> git.eshelyaron.com Git - emacs.git/commitdiff
(select-safe-coding-system): Be sure
authorKenichi Handa <handa@m17n.org>
Sat, 27 Feb 1999 04:28:31 +0000 (04:28 +0000)
committerKenichi Handa <handa@m17n.org>
Sat, 27 Feb 1999 04:28:31 +0000 (04:28 +0000)
to show a buffer being decoded.

lisp/international/mule-cmds.el

index 5362e5815868839db187a0f6b05594a1fe24db0c..1cc43e8b640f5329490de78d1b673f57340d91d3 100644 (file)
@@ -482,7 +482,7 @@ and TO is ignored."
                             (and default-coding-system
                                  (coding-system-get default-coding-system
                                                     'safe-charsets))))
-           overlays)
+           show-position overlays)
        (save-excursion
          ;; Highlight characters that default-coding-system can't encode.
          (when (integerp from)
@@ -492,8 +492,8 @@ and TO is ignored."
                          (re-search-forward "[^\000-\177]" to t))
                (setq found (assq (char-charset (preceding-char))
                                  non-safe-chars))))
-           (beginning-of-line)
-           (set-window-start (selected-window) (point))
+           (forward-line -1)
+           (setq show-position (point))
            (save-excursion
              (while (and (< (length overlays) 256)
                          (re-search-forward "[^\000-\177]" to t))
@@ -507,7 +507,11 @@ and TO is ignored."
          ;; At last, ask a user to select a proper coding system.  
          (unwind-protect
              (save-window-excursion
-               ;; At first, show a helpful message.
+               (when show-position
+                 ;; At first, be sure to show the current buffer.
+                 (set-window-buffer (selected-window) (current-buffer))
+                 (set-window-start (selected-window) show-position))
+               ;; Then, show a helpful message.
                (with-output-to-temp-buffer "*Warning*"
                  (save-excursion
                    (set-buffer standard-output)