emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r108444: * net/tramp.el (tramp-check-


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108444: * net/tramp.el (tramp-check-for-regexp): Search from buffer end,
Date: Fri, 01 Jun 2012 15:23:26 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108444
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Fri 2012-06-01 15:23:26 +0200
message:
  * net/tramp.el (tramp-check-for-regexp): Search from buffer end,
  in order to avoid "Stack overflow in regexp matcher".
modified:
  lisp/ChangeLog
  lisp/net/tramp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-05-31 20:06:04 +0000
+++ b/lisp/ChangeLog    2012-06-01 13:23:26 +0000
@@ -1,3 +1,8 @@
+2012-06-01  Michael Albinus  <address@hidden>
+
+       * net/tramp.el (tramp-check-for-regexp): Search from buffer end,
+       in order to avoid "Stack overflow in regexp matcher".
+
 2012-05-31  Glenn Morris  <address@hidden>
 
        * image.el: For clarity, call imagemagick-register-types at

=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2012-04-22 13:58:00 +0000
+++ b/lisp/net/tramp.el 2012-06-01 13:23:26 +0000
@@ -3315,8 +3315,14 @@
                     '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 @@
 ;; * Run emerge on two remote files.  Bug is described here:
 ;;   <http://www.mail-archive.com/address@hidden/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
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]