diff options
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/comint.el | 8 |
2 files changed, 16 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 728b9833c9f..ea428b1de15 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2015-02-10 Juri Linkov <juri@linkov.net> | ||
| 2 | |||
| 3 | Better support for the case of typing RET on the prompt in comint. | ||
| 4 | |||
| 5 | * comint.el (comint-get-old-input-default): Go to the field end | ||
| 6 | when comint-use-prompt-regexp is nil. | ||
| 7 | (comint-line-beginning-position): Check if point is already | ||
| 8 | on the prompt before searching for the prompt when | ||
| 9 | comint-use-prompt-regexp is non-nil. (Bug#19710) | ||
| 10 | |||
| 1 | 2015-02-08 Eli Zaretskii <eliz@gnu.org> | 11 | 2015-02-08 Eli Zaretskii <eliz@gnu.org> |
| 2 | 12 | ||
| 3 | * frame.el (frame-notice-user-settings): Refresh the value of | 13 | * frame.el (frame-notice-user-settings): Refresh the value of |
diff --git a/lisp/comint.el b/lisp/comint.el index 419938ea684..c81551acd5f 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -2215,7 +2215,10 @@ the current line with any initial string matching the regexp | |||
| 2215 | (null (get-char-property (setq bof (field-beginning)) 'field))) | 2215 | (null (get-char-property (setq bof (field-beginning)) 'field))) |
| 2216 | (field-string-no-properties bof) | 2216 | (field-string-no-properties bof) |
| 2217 | (comint-bol) | 2217 | (comint-bol) |
| 2218 | (buffer-substring-no-properties (point) (line-end-position))))) | 2218 | (buffer-substring-no-properties (point) |
| 2219 | (if comint-use-prompt-regexp | ||
| 2220 | (line-end-position) | ||
| 2221 | (field-end)))))) | ||
| 2219 | 2222 | ||
| 2220 | (defun comint-copy-old-input () | 2223 | (defun comint-copy-old-input () |
| 2221 | "Insert after prompt old input at point as new input to be edited. | 2224 | "Insert after prompt old input at point as new input to be edited. |
| @@ -2263,8 +2266,9 @@ a buffer local variable." | |||
| 2263 | (if comint-use-prompt-regexp | 2266 | (if comint-use-prompt-regexp |
| 2264 | ;; Use comint-prompt-regexp | 2267 | ;; Use comint-prompt-regexp |
| 2265 | (save-excursion | 2268 | (save-excursion |
| 2266 | (re-search-backward comint-prompt-regexp nil t) | ||
| 2267 | (beginning-of-line) | 2269 | (beginning-of-line) |
| 2270 | (unless (looking-at comint-prompt-regexp) | ||
| 2271 | (re-search-backward comint-prompt-regexp nil t)) | ||
| 2268 | (comint-skip-prompt) | 2272 | (comint-skip-prompt) |
| 2269 | (point)) | 2273 | (point)) |
| 2270 | ;; Use input fields. Note that, unlike the behavior of | 2274 | ;; Use input fields. Note that, unlike the behavior of |