all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Robustness problem in tramp.el
@ 2010-05-25 12:12 christian.lynbech
  2010-05-25 12:26 ` christian.lynbech
  2010-05-25 13:38 ` Michael Albinus
  0 siblings, 2 replies; 5+ messages in thread
From: christian.lynbech @ 2010-05-25 12:12 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 907 bytes --]

I have stumbled across a slight problem in `tramp-handle-insert-directory' in
tramp.el.

When operating against a system where `ls' support "--dired", there is
some code to iterate across the line of data tagged with
//DIRED//. However, after seeing the tag (with `looking-at') it uses
among other things `forward-word' to reposition itself which will fail
if the user has modified the default syntax table in certain ways (which
was what I was doing and then was surprised to see tramp fail).

One could perhaps argue that there are some deeply rooted assumptions
about `/' not being a word constituent character but apart from the fact
that I do not believe I have seen it documented anywhere that one cannot
change the default syntax allocations, it is rather silly to have such a
dependency in tramp when it is so easy to have a more robust solution.

I have attached a diff with a proposal for a fix.


[-- Attachment #2: diff --]
[-- Type: application/octet-stream, Size: 732 bytes --]

--- tramp.el.orig	2010-05-25 12:45:04.000000000 +0200
+++ tramp.el.new	2010-05-25 12:46:20.000000000 +0200
@@ -4150,13 +4150,12 @@
 	(forward-line -2)
 	(when (looking-at "//SUBDIRED//")
 	  (forward-line -1))
-	(when (looking-at "//DIRED//")
-	  (let ((end (tramp-compat-line-end-position))
-		(linebeg (point)))
+	(when (looking-at "//DIRED// +")
+	  (let* ((databeg (match-end 0))
+		 (end (tramp-compat-line-end-position))
+		 (linebeg (point)))
 	    ;; Now read the numeric positions of file names.
-	    (goto-char linebeg)
-	    (forward-word 1)
-	    (forward-char 3)
+	    (goto-char databeg)
 	    (while (< (point) end)
 	      (let ((start (+ beg (read (current-buffer))))
 		    (end (+ beg (read (current-buffer)))))

[-- Attachment #3: Type: text/plain, Size: 371 bytes --]



------------------------+-----------------------------------------------------
Christian Lynbech       | christian #\@ defun #\. dk
------------------------+-----------------------------------------------------
Hit the philistines three times over the head with the Elisp reference manual.
                                        - petonic@hal.com (Michael A. Petonic)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Robustness problem in tramp.el
  2010-05-25 12:12 Robustness problem in tramp.el christian.lynbech
@ 2010-05-25 12:26 ` christian.lynbech
  2010-05-25 13:38 ` Michael Albinus
  1 sibling, 0 replies; 5+ messages in thread
From: christian.lynbech @ 2010-05-25 12:26 UTC (permalink / raw)
  To: emacs-devel@gnu.org

I forgot to add that this report relates to the latest snapshot of
emacs23. The one I am running was built a few weeks ago but as far as I
can see in the repository, the problem remains.


------------------------+-----------------------------------------------------
Christian Lynbech       | christian #\@ defun #\. dk
------------------------+-----------------------------------------------------
Hit the philistines three times over the head with the Elisp reference manual.
                                        - petonic@hal.com (Michael A. Petonic)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Robustness problem in tramp.el
  2010-05-25 12:12 Robustness problem in tramp.el christian.lynbech
  2010-05-25 12:26 ` christian.lynbech
@ 2010-05-25 13:38 ` Michael Albinus
  2010-05-25 15:58   ` Chong Yidong
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Albinus @ 2010-05-25 13:38 UTC (permalink / raw)
  To: christian.lynbech; +Cc: emacs-devel

<christian.lynbech@tieto.com> writes:

> I have attached a diff with a proposal for a fix.

Thanks for the report, your patch looks good. I've committed it,
slightly modified, to the trunk.

Best regards, Michael (who works also for Tieto :-)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Robustness problem in tramp.el
  2010-05-25 13:38 ` Michael Albinus
@ 2010-05-25 15:58   ` Chong Yidong
  2010-05-25 19:08     ` Michael Albinus
  0 siblings, 1 reply; 5+ messages in thread
From: Chong Yidong @ 2010-05-25 15:58 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-devel, christian.lynbech

Michael Albinus <michael.albinus@gmx.de> writes:

> <christian.lynbech@tieto.com> writes:
>
>> I have attached a diff with a proposal for a fix.
>
> Thanks for the report, your patch looks good. I've committed it,
> slightly modified, to the trunk.

If this patch is safe enough for the branch, I think it should go in
there too.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Robustness problem in tramp.el
  2010-05-25 15:58   ` Chong Yidong
@ 2010-05-25 19:08     ` Michael Albinus
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Albinus @ 2010-05-25 19:08 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel, christian.lynbech

Chong Yidong <cyd@stupidchicken.com> writes:

> If this patch is safe enough for the branch, I think it should go in
> there too.

I was thinking about as well. There are several fixes in the trunk,
worth to be applied to the branch. But there are also new features.

Maybe I shall start with a new Tramp 2.2 series (for the trunk), and I
shall continue with Tramp 2.1 as bug fix release for Emacs 23. The same
story as with Tramp 2.0/2.1 for Emacs 22/23.

I will check it, when  times are a little bit less busy.

Best regards, Michael.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-25 19:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-25 12:12 Robustness problem in tramp.el christian.lynbech
2010-05-25 12:26 ` christian.lynbech
2010-05-25 13:38 ` Michael Albinus
2010-05-25 15:58   ` Chong Yidong
2010-05-25 19:08     ` 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.