aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2015-02-10 02:38:09 +0200
committerJuri Linkov2015-02-10 02:38:09 +0200
commit87fc99fee17ef1df4c22db15ec783a7735d3fc6b (patch)
tree7ee4cce5e6dfde09a7088fe5a2b6b068cb066ae2
parenta7b1c2f88f06bbeda16117c0aa1caffac1b4ebe1 (diff)
downloademacs-87fc99fee17ef1df4c22db15ec783a7735d3fc6b.tar.gz
emacs-87fc99fee17ef1df4c22db15ec783a7735d3fc6b.zip
Better support for the case of typing RET on the prompt in comint.
* lisp/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. Fixes: debbugs:19710
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/comint.el8
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 @@
12015-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
12015-02-08 Eli Zaretskii <eliz@gnu.org> 112015-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