diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-03-03 14:35:41 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-03-03 14:35:41 -0800 |
commit | 2c82deee7fbb951a90ed3246350fbf9390af038a (patch) | |
tree | 465aaf0fdaefea778317ab1ed5c48400f223b596 /lisp/comint.el | |
parent | 6eab3936c71951e304f13b69ad2e835ddaf9f2f4 (diff) | |
parent | c0ba5908b117170995df36e839a087af7c5f79db (diff) | |
download | emacs-2c82deee7fbb951a90ed3246350fbf9390af038a.tar.gz emacs-2c82deee7fbb951a90ed3246350fbf9390af038a.tar.bz2 emacs-2c82deee7fbb951a90ed3246350fbf9390af038a.zip |
Merge from origin/emacs-24
c0ba590 Fix vertical-motion and posn-at-point when word-wrap is
a323b93 Better multi-line input support in comint.el
008a04a todo-mode.el: Restore point on setting item done (Bug#19727)
9615c0d doc/misc/erc.texi: fix typo
c648717 Update ERC docs and update MAINTANERS to include myself
d825f66 Fix filling circle/ellipse in Artist Mode (Bug#19763)
Conflicts:
admin/ChangeLog
doc/misc/ChangeLog
doc/misc/erc.texi
lisp/ChangeLog
src/ChangeLog
Diffstat (limited to 'lisp/comint.el')
-rw-r--r-- | lisp/comint.el | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index 2c4168474ab..b14ab5bdf9f 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1476,7 +1476,7 @@ Intended to be added to `isearch-mode-hook' in `comint-mode'." (or ;; 1. First try searching in the initial comint text (funcall search-fun string - (if isearch-forward bound (field-beginning)) + (if isearch-forward bound (comint-line-beginning-position)) noerror) ;; 2. If the above search fails, start putting next/prev history ;; elements in the comint successively, and search the string @@ -1492,7 +1492,7 @@ Intended to be added to `isearch-mode-hook' in `comint-mode'." (when (null comint-input-ring-index) (error "End of history; no next item")) (comint-next-input 1) - (goto-char (field-beginning))) + (goto-char (comint-line-beginning-position))) (t ;; Signal an error here explicitly, because ;; `comint-previous-input' doesn't signal an error. @@ -1510,7 +1510,7 @@ Intended to be added to `isearch-mode-hook' in `comint-mode'." (unless isearch-forward ;; For backward search, don't search ;; in the comint prompt - (field-beginning)) + (comint-line-beginning-position)) noerror))) ;; Return point of the new search result (point)) @@ -1534,16 +1534,16 @@ the function `isearch-message'." (if (overlayp comint-history-isearch-message-overlay) (move-overlay comint-history-isearch-message-overlay (save-excursion - (goto-char (field-beginning)) + (goto-char (comint-line-beginning-position)) (forward-line 0) (point)) - (field-beginning)) + (comint-line-beginning-position)) (setq comint-history-isearch-message-overlay (make-overlay (save-excursion - (goto-char (field-beginning)) + (goto-char (comint-line-beginning-position)) (forward-line 0) (point)) - (field-beginning))) + (comint-line-beginning-position))) (overlay-put comint-history-isearch-message-overlay 'evaporate t)) (overlay-put comint-history-isearch-message-overlay 'display (isearch-message-prefix ellipsis isearch-nonincremental)) @@ -1564,7 +1564,7 @@ or to the last history element for a backward search." (comint-goto-input (1- (ring-length comint-input-ring))) (comint-goto-input nil)) (setq isearch-success t) - (goto-char (if isearch-forward (field-beginning) (point-max)))) + (goto-char (if isearch-forward (comint-line-beginning-position) (point-max)))) (defun comint-history-isearch-push-state () "Save a function restoring the state of input history search. @@ -1788,7 +1788,10 @@ Similarly for Soar, Scheme, etc." (widen) (let* ((pmark (process-mark proc)) (intxt (if (>= (point) (marker-position pmark)) - (progn (if comint-eol-on-send (goto-char (field-end))) + (progn (if comint-eol-on-send + (if comint-use-prompt-regexp + (end-of-line) + (goto-char (field-end)))) (buffer-substring pmark (point))) (let ((copy (funcall comint-get-old-input))) (goto-char pmark) @@ -2267,6 +2270,7 @@ 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) (comint-skip-prompt) (point)) @@ -2277,7 +2281,7 @@ a buffer local variable." ;; if there are two fields on a line, then the first one is the ;; prompt, and the second one is an input field, and is front-sticky ;; (as input fields should be). - (constrain-to-field (line-beginning-position) (line-end-position)))) + (constrain-to-field (field-beginning) (line-end-position)))) (defun comint-bol (&optional arg) "Go to the beginning of line, then skip past the prompt, if any. |