summaryrefslogtreecommitdiff
path: root/lisp/comint.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-03-03 14:37:43 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2015-03-03 14:37:43 -0800
commite2ae1c5a40e2802fcd9f5ee26b4906be97c8b878 (patch)
treeb2d56b00e2ae8ba90167ede434561d4a3b1f273d /lisp/comint.el
parentd8462361f2d087d6f7c745305c61a266843ee19c (diff)
parent4b0b27d0018f040bda6a2ec885fa54c666d9c083 (diff)
downloademacs-e2ae1c5a40e2802fcd9f5ee26b4906be97c8b878.tar.gz
Merge from origin/emacs-24
4b0b27d Fix invocation of commands whose file name includes extension 87fc99f Better support for the case of typing RET on the prompt in comint. a7b1c2f Don't lose frame's background color when setting foreground 20c817d Fix handling of frame color parameters in TTY sessions eca7da1 Complete the remaining documentation updates for 24.5 Conflicts: doc/lispref/ChangeLog etc/NEWS lisp/ChangeLog nt/ChangeLog src/ChangeLog
Diffstat (limited to 'lisp/comint.el')
-rw-r--r--lisp/comint.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index b14ab5bdf9f..722a42d6af2 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -2222,7 +2222,10 @@ the current line with any initial string matching the regexp
(null (get-char-property (setq bof (field-beginning)) 'field)))
(field-string-no-properties bof)
(comint-bol)
- (buffer-substring-no-properties (point) (line-end-position)))))
+ (buffer-substring-no-properties (point)
+ (if comint-use-prompt-regexp
+ (line-end-position)
+ (field-end))))))
(defun comint-copy-old-input ()
"Insert after prompt old input at point as new input to be edited.
@@ -2270,8 +2273,9 @@ a buffer local variable."
(if comint-use-prompt-regexp
;; Use comint-prompt-regexp
(save-excursion
- (re-search-backward comint-prompt-regexp nil t)
(beginning-of-line)
+ (unless (looking-at comint-prompt-regexp)
+ (re-search-backward comint-prompt-regexp nil t))
(comint-skip-prompt)
(point))
;; Use input fields. Note that, unlike the behavior of