+2015-02-10 Juri Linkov <juri@linkov.net>
+
+ Better support for the case of typing RET on the prompt in comint.
+
+ * comint.el (comint-get-old-input-default): Go to the field end
+ when comint-use-prompt-regexp is nil.
+ (comint-line-beginning-position): Check if point is already
+ on the prompt before searching for the prompt when
+ comint-use-prompt-regexp is non-nil. (Bug#19710)
+
2015-02-08 Eli Zaretskii <eliz@gnu.org>
* frame.el (frame-notice-user-settings): Refresh the value of
(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.
(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