;; for events without parameters.
(interactive (list last-input-event))
(let ((pos (point)))
- (if event (mouse-set-point event))
+ (if event (posn-set-point (event-end event)))
(if (not (eq (get-char-property (point) 'field) 'input))
;; No input at POS, fall back to the global definition.
(let* ((keys (this-command-keys))
;; problems when `comint-prompt-read-only' is non-nil.
(let ((inhibit-read-only t))
(delete-region comint-last-input-end
- (+ comint-last-input-end echo-len))))))
+ (+ comint-last-input-end echo-len))
+ (when comint-prompt-read-only
+ (save-excursion
+ (goto-char comint-last-input-end)
+ (comint-update-fence)))))))
;; This used to call comint-output-filter-functions,
;; but that scrolled the buffer in undesirable ways.
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.
(set-window-start (selected-window) (point))
(comint-skip-prompt))
(t
- (goto-char (field-beginning pos))
+ (let* ((beg (field-beginning pos))
+ (pt (if (= (point-min) beg)
+ (point-min)
+ (1+ beg))))
+ (goto-char pt))
(set-window-start (selected-window) (point))))))
:type '(repeat (string :tag "Suffix"))
:group 'comint-completion)
+;;;###autoload
(defvar comint-file-name-prefix ""
"Prefix prepended to absolute file names taken from process input.
This is used by Comint's and shell's completion functions, and by shell's
this value.")
(defvar comint-redirect-subvert-readonly nil
- "Non-nil means comint-redirect can insert into otherwise-readonly buffers.
-The readonly status is toggled around insertion.
+ "Non-nil means `comint-redirect' can insert into read-only buffers.
+This works by binding `inhibit-read-only' around the insertion.
This is useful, for instance, for insertion into Help mode buffers.
You probably want to set it locally to the output buffer.")