[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tramp (2.2.3-24.1); 'Stack overflow in regexp matcher' when attempti
From: |
Michael Albinus |
Subject: |
Re: tramp (2.2.3-24.1); 'Stack overflow in regexp matcher' when attempting remote dired on folder containing many files |
Date: |
Fri, 01 Jun 2012 15:16:38 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) |
Tom Roche <address@hidden> writes:
Hi Tom,
> address@hidden:~ $ find /project/this/that/emis/model_ready -maxdepth 1 | wc
> -l
> 2637
Wow!
> Stack overflow in regexp matcher
>
> Please let me know if I should debug further, e.g., (setq tramp-verbose 9) ->
> init.el, M-x tramp-cleanup-all-connections.
I could reproduce it (creating a temp directory with 5000 dummy
files). The following patch solves the problem for me:
--8<---------------cut here---------------start------------->8---
detlef:~> (cd src/emacs/lisp/net/ ; bzr diff --diff-options -c tramp.el)
=== modified file 'lisp/net/tramp.el'
*** lisp/net/tramp.el 2012-04-22 13:58:00 +0000
--- lisp/net/tramp.el 2012-06-01 13:02:09 +0000
***************
*** 3315,3322 ****
'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))))
(defun tramp-wait-for-regexp (proc timeout regexp)
"Wait for a REGEXP to appear from process PROC within TIMEOUT seconds.
--- 3315,3328 ----
'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.
! ;; 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.
--8<---------------cut here---------------end--------------->8---
Thanks for the report, and best regards, Michael.
- Re: tramp (2.2.3-24.1); 'Stack overflow in regexp matcher' when attempting remote dired on folder containing many files,
Michael Albinus <=