* [PATCH] tramp: Avoid "Args out of range" error
@ 2013-02-01 16:05 Andrew W. Nosenko
2013-02-01 19:11 ` Michael Albinus
0 siblings, 1 reply; 5+ messages in thread
From: Andrew W. Nosenko @ 2013-02-01 16:05 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 248 bytes --]
Attached patch for tramp.el avoids the "Args out of range" error inside
tramp-check-for-regexp.
Such error occurs, for example, when try to compile through tramp with
FreeBSD-9.1 as remote host.
--
Andrew W. Nosenko <andrew.w.nosenko@gmail.com>
[-- Attachment #2: 0001-tramp-Avoid-Args-out-of-range-error.patch --]
[-- Type: application/octet-stream, Size: 1259 bytes --]
From 150aaaba5ae485af1cce1d751dd95eb0cdf46b6c Mon Sep 17 00:00:00 2001
From: "Andrew W. Nosenko" <andrew.w.nosenko@gmail.com>
Date: Thu, 31 Jan 2013 14:36:43 +0200
Subject: [PATCH] tramp: Avoid "Args out of range" error
Such error occurs, for example, when try to compile through tramp with
FreeBSD-9.1 as remote host.
* lisp/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.
---
lisp/net/tramp.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 4f31e95..2f18db7 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3413,7 +3413,8 @@ 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) (1+ 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
--
1.8.1.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] tramp: Avoid "Args out of range" error
2013-02-01 16:05 [PATCH] tramp: Avoid "Args out of range" error Andrew W. Nosenko
@ 2013-02-01 19:11 ` Michael Albinus
2013-02-01 19:47 ` Andrew W. Nosenko
2013-02-01 20:36 ` Stefan Monnier
0 siblings, 2 replies; 5+ messages in thread
From: Michael Albinus @ 2013-02-01 19:11 UTC (permalink / raw)
To: Andrew W. Nosenko; +Cc: emacs-devel
"Andrew W. Nosenko" <andrew.w.nosenko@gmail.com> writes:
Hi Andrew,
> Attached patch for tramp.el avoids the "Args out of range" error inside
> tramp-check-for-regexp.
>
> Such error occurs, for example, when try to compile through tramp with
> FreeBSD-9.1 as remote host.
Thanks for the patch, it makes sense. But I believe it is incorrect, it
should be
(tramp-compat-funcall
'buffer-substring-no-properties
(point-min)
(min (+ (point-min) tramp-echo-mark-marker-length) (point-max))))))
I would like to install it in the emacs-24 branch, are there objections?
Glenn? Stefan?
> Andrew W. Nosenko <andrew.w.nosenko@gmail.com>
Best regards, Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tramp: Avoid "Args out of range" error
2013-02-01 19:11 ` Michael Albinus
@ 2013-02-01 19:47 ` Andrew W. Nosenko
2013-02-01 20:36 ` Stefan Monnier
1 sibling, 0 replies; 5+ messages in thread
From: Andrew W. Nosenko @ 2013-02-01 19:47 UTC (permalink / raw)
To: Michael Albinus; +Cc: emacs-devel
On Fri, Feb 1, 2013 at 9:11 PM, Michael Albinus <michael.albinus@gmx.de> wrote:
> "Andrew W. Nosenko" <andrew.w.nosenko@gmail.com> writes:
>
> Hi Andrew,
>
>> Attached patch for tramp.el avoids the "Args out of range" error inside
>> tramp-check-for-regexp.
>>
>> Such error occurs, for example, when try to compile through tramp with
>> FreeBSD-9.1 as remote host.
>
> Thanks for the patch, it makes sense. But I believe it is incorrect, it
> should be
>
> (tramp-compat-funcall
> 'buffer-substring-no-properties
> (point-min)
> (min (+ (point-min) tramp-echo-mark-marker-length) (point-max))))))
>
Thanks for catch!
--
Andrew W. Nosenko <andrew.w.nosenko@gmail.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tramp: Avoid "Args out of range" error
2013-02-01 19:11 ` Michael Albinus
2013-02-01 19:47 ` Andrew W. Nosenko
@ 2013-02-01 20:36 ` Stefan Monnier
2013-02-01 21:12 ` Michael Albinus
1 sibling, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2013-02-01 20:36 UTC (permalink / raw)
To: Michael Albinus; +Cc: Andrew W. Nosenko, emacs-devel
> I would like to install it in the emacs-24 branch, are there objections?
IIUC this just replaces 1 with point-min, which seems safe here, so it
hink it's OK.
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tramp: Avoid "Args out of range" error
2013-02-01 20:36 ` Stefan Monnier
@ 2013-02-01 21:12 ` Michael Albinus
0 siblings, 0 replies; 5+ messages in thread
From: Michael Albinus @ 2013-02-01 21:12 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Andrew W. Nosenko, emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> I would like to install it in the emacs-24 branch, are there objections?
>
> IIUC this just replaces 1 with point-min, which seems safe here, so it
> hink it's OK.
Installed.
> Stefan
Best regards, Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-02-01 21:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-01 16:05 [PATCH] tramp: Avoid "Args out of range" error Andrew W. Nosenko
2013-02-01 19:11 ` Michael Albinus
2013-02-01 19:47 ` Andrew W. Nosenko
2013-02-01 20:36 ` Stefan Monnier
2013-02-01 21:12 ` Michael Albinus
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.