changeset 64819:fe9134f14297

(send-invisible): Identify buffer, if not selected.
author Richard M. Stallman <rms@gnu.org>
date Tue, 09 Aug 2005 11:25:35 +0000
parents bc16d0987bb1
children 3b8ee785ce35
files lisp/comint.el
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/comint.el	Tue Aug 09 11:24:48 2005 +0000
+++ b/lisp/comint.el	Tue Aug 09 11:25:35 2005 +0000
@@ -1935,15 +1935,21 @@
 Security bug: your string can still be temporarily recovered with
 \\[view-lossage]; `clear-this-command-keys' can fix that."
   (interactive "P")			; Defeat snooping via C-x ESC ESC
-  (let ((proc (get-buffer-process (current-buffer))))
+  (let ((proc (get-buffer-process (current-buffer)))
+	(prefix
+	 (if (eq (window-buffer (selected-window)) (current-buffer))
+	     ""
+	   (format "(In buffer %s) "
+		   (current-buffer)))))
     (if proc
-	(let ((str (read-passwd (or prompt "Non-echoed text: "))))
+	(let ((str (read-passwd (concat prefix
+					(or prompt "Non-echoed text: ")))))
 	  (if (stringp str)
 	      (progn
 		(comint-snapshot-last-prompt)
 		(funcall comint-input-sender proc str))
 	    (message "Warning: text will be echoed")))
-      (error "Current buffer has no process"))))
+      (error "Buffer %s has no process" (current-buffer)))))
 
 (defun comint-watch-for-password-prompt (string)
   "Prompt in the minibuffer for password and send without echoing.