changeset 43182:faaa5a3adc82

(select-safe-coding-system): State the buffer's name in the message popped in the *Warning* buffer, and make sure the offending buffer is displayed.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 08 Feb 2002 11:59:42 +0000
parents 0f5eacbb65d9
children 0665cd668d8b
files lisp/international/mule-cmds.el
diffstat 1 files changed, 16 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/mule-cmds.el	Fri Feb 08 10:21:21 2002 +0000
+++ b/lisp/international/mule-cmds.el	Fri Feb 08 11:59:42 2002 +0000
@@ -599,6 +599,7 @@
 
   (let ((codings (find-coding-systems-region from to))
 	(coding-system nil)
+	(bufname (buffer-name))
 	(l default-coding-system))
     (if (eq (car codings) 'undecided)
 	;; Any coding system is ok.
@@ -625,6 +626,9 @@
 	      (setcar l mime-charset))
 	  (setq l (cdr l))))
 
+      ;; Make sure the offending buffer is displayed.
+      (or (stringp from)
+	  (pop-to-buffer bufname))
       ;; Then ask users to select one form CODINGS.
       (unwind-protect
 	  (save-window-excursion
@@ -632,15 +636,18 @@
 	      (save-excursion
 		(set-buffer standard-output)
 		(if (not default-coding-system)
-		    (insert "No default coding systems to try.")
-		  (insert "These default coding systems were tried")
-		  (if (stringp from)
-		      (insert " to encode \""
-			      (if (> (length from) 10)
-				  (substring from 0 10)
-				from)
-			      "...\""))
-		  (insert ":\n")
+		    (insert "No default coding systems to try for "
+			    (if (stringp from)
+				(format "string \"%s\"." from)
+			      (format "buffer `%s'." bufname)))
+		  (insert
+		   "These default coding systems were tried to encode"
+		   (if (stringp from)
+		       (concat " \"" (if (> (length from) 10)
+					 (concat (substring from 0 10) "...\"")
+				       (concat from "\"")))
+		     (format " text\nin the buffer `%s'" bufname))
+		   ":\n")
 		  (let ((pos (point))
 			(fill-prefix "  "))
 		    (mapcar (function (lambda (x)