summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew W. Nosenko <andrew.w.nosenko@gmail.com>2013-02-01 22:10:08 +0100
committerMichael Albinus <michael.albinus@gmx.de>2013-02-01 22:10:08 +0100
commitf864e0ea838f8f5e1a27b2ac612d0072c1606507 (patch)
treec9d3aeb66d673612140ea2573edf0f36e7f9c5bc
parent25b4eb90f9ed665a2cb7c4a219ec7bb447d24fe6 (diff)
downloademacs-f864e0ea838f8f5e1a27b2ac612d0072c1606507.tar.gz
* net/tramp.el (tramp-check-for-regexp): Avoid "Args out of range"
error when buffer in question is narrowed so position 1 is out of visible part.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/net/tramp.el4
2 files changed, 9 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 88fdf7ac1ac..df19277bb3a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2013-02-01 Andrew W. Nosenko <andrew.w.nosenko@gmail.com> (tiny change)
+
+ * net/tramp.el (tramp-check-for-regexp): Avoid "Args out of range"
+ error when buffer in question is narrowed so position 1 is out of
+ visible part.
+
2013-01-31 Glenn Morris <rgm@gnu.org>
* textmodes/remember.el (remember-clipboard): Doc fix.
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index c29879691d7..6710c8a5211 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3359,7 +3359,9 @@ Erase echoed commands if exists."
0 (min tramp-echo-mark-marker-length (1- (point-max))))
(tramp-compat-funcall
'buffer-substring-no-properties
- 1 (min (1+ tramp-echo-mark-marker-length) (point-max))))))
+ (point-min)
+ (min (+ (point-min) tramp-echo-mark-marker-length)
+ (point-max))))))
;; No echo to be handled, now we can look for the regexp.
;; Sometimes, lines are much to long, and we run into a "Stack
;; overflow in regexp matcher". For example, //DIRED// lines of