aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2014-12-06 01:55:20 +0200
committerJuri Linkov2014-12-06 01:55:20 +0200
commitf6c3965074dbf5f355ecce739104fb89fb4d90f8 (patch)
tree4adc2e0ca9e8891d697194103e7b04ea4a5d1082
parent0ffa34951a2c45afa7857b7a970459d0189b4313 (diff)
downloademacs-f6c3965074dbf5f355ecce739104fb89fb4d90f8.tar.gz
emacs-f6c3965074dbf5f355ecce739104fb89fb4d90f8.zip
Better support for milti-line shell input.
* lisp/comint.el (comint-history-isearch-search) (comint-history-isearch-wrap): Use field-beginning instead of comint-line-beginning-position. (comint-send-input): Go to the end of the field instead of the end of the line to accept whole multi-line input. http://lists.gnu.org/archive/html/emacs-devel/2014-12/msg00305.html
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/comint.el10
2 files changed, 14 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5cc530c42b6..b3cb2fa3168 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,14 @@
12014-12-05 Juri Linkov <juri@linkov.net> 12014-12-05 Juri Linkov <juri@linkov.net>
2 2
3 * comint.el (comint-history-isearch-search)
4 (comint-history-isearch-wrap): Use field-beginning instead of
5 comint-line-beginning-position.
6 (comint-send-input): Go to the end of the field instead of the end
7 of the line to accept whole multi-line input.
8 http://lists.gnu.org/archive/html/emacs-devel/2014-12/msg00305.html
9
102014-12-05 Juri Linkov <juri@linkov.net>
11
3 * minibuffer.el (minibuffer-completion-help): Compare 12 * minibuffer.el (minibuffer-completion-help): Compare
4 selected-window with minibuffer-window to check whether 13 selected-window with minibuffer-window to check whether
5 completions should be displayed near the minibuffer. (Bug#17809) 14 completions should be displayed near the minibuffer. (Bug#17809)
diff --git a/lisp/comint.el b/lisp/comint.el
index da3782717c0..3085052087c 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1475,7 +1475,7 @@ Intended to be added to `isearch-mode-hook' in `comint-mode'."
1475 (or 1475 (or
1476 ;; 1. First try searching in the initial comint text 1476 ;; 1. First try searching in the initial comint text
1477 (funcall search-fun string 1477 (funcall search-fun string
1478 (if isearch-forward bound (comint-line-beginning-position)) 1478 (if isearch-forward bound (field-beginning))
1479 noerror) 1479 noerror)
1480 ;; 2. If the above search fails, start putting next/prev history 1480 ;; 2. If the above search fails, start putting next/prev history
1481 ;; elements in the comint successively, and search the string 1481 ;; elements in the comint successively, and search the string
@@ -1491,7 +1491,7 @@ Intended to be added to `isearch-mode-hook' in `comint-mode'."
1491 (when (null comint-input-ring-index) 1491 (when (null comint-input-ring-index)
1492 (error "End of history; no next item")) 1492 (error "End of history; no next item"))
1493 (comint-next-input 1) 1493 (comint-next-input 1)
1494 (goto-char (comint-line-beginning-position))) 1494 (goto-char (field-beginning)))
1495 (t 1495 (t
1496 ;; Signal an error here explicitly, because 1496 ;; Signal an error here explicitly, because
1497 ;; `comint-previous-input' doesn't signal an error. 1497 ;; `comint-previous-input' doesn't signal an error.
@@ -1509,7 +1509,7 @@ Intended to be added to `isearch-mode-hook' in `comint-mode'."
1509 (unless isearch-forward 1509 (unless isearch-forward
1510 ;; For backward search, don't search 1510 ;; For backward search, don't search
1511 ;; in the comint prompt 1511 ;; in the comint prompt
1512 (comint-line-beginning-position)) 1512 (field-beginning))
1513 noerror))) 1513 noerror)))
1514 ;; Return point of the new search result 1514 ;; Return point of the new search result
1515 (point)) 1515 (point))
@@ -1557,7 +1557,7 @@ or to the last history element for a backward search."
1557 (comint-goto-input (1- (ring-length comint-input-ring))) 1557 (comint-goto-input (1- (ring-length comint-input-ring)))
1558 (comint-goto-input nil)) 1558 (comint-goto-input nil))
1559 (setq isearch-success t) 1559 (setq isearch-success t)
1560 (goto-char (if isearch-forward (comint-line-beginning-position) (point-max)))) 1560 (goto-char (if isearch-forward (field-beginning) (point-max))))
1561 1561
1562(defun comint-history-isearch-push-state () 1562(defun comint-history-isearch-push-state ()
1563 "Save a function restoring the state of input history search. 1563 "Save a function restoring the state of input history search.
@@ -1781,7 +1781,7 @@ Similarly for Soar, Scheme, etc."
1781 (widen) 1781 (widen)
1782 (let* ((pmark (process-mark proc)) 1782 (let* ((pmark (process-mark proc))
1783 (intxt (if (>= (point) (marker-position pmark)) 1783 (intxt (if (>= (point) (marker-position pmark))
1784 (progn (if comint-eol-on-send (end-of-line)) 1784 (progn (if comint-eol-on-send (goto-char (field-end)))
1785 (buffer-substring pmark (point))) 1785 (buffer-substring pmark (point)))
1786 (let ((copy (funcall comint-get-old-input))) 1786 (let ((copy (funcall comint-get-old-input)))
1787 (goto-char pmark) 1787 (goto-char pmark)