aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus <[email protected]>2012-06-01 15:23:26 +0200
committerMichael Albinus <[email protected]>2012-06-01 15:23:26 +0200
commit046e38ce2b6f4ae94251f480184b1a36243dd62d (patch)
treee011c37ca1c4ed2bb34f8e637b61a6ebedc8b98a /lisp/net
parent4e8fa7d3083ff94935dbb97ca1f6b8c7f908b69f (diff)
* net/tramp.el (tramp-check-for-regexp): Search from buffer end,
in order to avoid "Stack overflow in regexp matcher".
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index beb97c6eb3..be5bfdb79d 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3315,8 +3315,14 @@ Erase echoed commands if exists."
'buffer-substring-no-properties
1 (min (1+ tramp-echo-mark-marker-length) (point-max))))))
;; No echo to be handled, now we can look for the regexp.
- (goto-char (point-min))
- (re-search-forward regexp nil t))))
+ ;; Sometimes, the buffer is much to huge, and we run into a
+ ;; "Stack overflow in regexp matcher". For example, directory
+ ;; listings with some thousand files. Therefore, we look from
+ ;; the end for the last line. We ignore also superlong lines,
+ ;; like created with "//DIRED//".
+ (goto-char (point-max))
+ (unless (> (- (point) (point-at-bol)) 128)
+ (re-search-backward regexp (point-at-bol) t)))))
(defun tramp-wait-for-regexp (proc timeout regexp)
"Wait for a REGEXP to appear from process PROC within TIMEOUT seconds.
@@ -3857,9 +3863,6 @@ Only works for Bourne-like shells."
;; * Run emerge on two remote files. Bug is described here:
;; <http://www.mail-archive.com/[email protected]/msg01041.html>.
;; (Bug#6850)
-;; * It would be very useful if it were possible to load or save a
-;; buffer using Tramp in a non-blocking way so that use of Emacs on
-;; other buffers could continue. (Bug#9617)
;;; tramp.el ends here