Discussion:
Speedbar and Tramp
(too old to reply)
Gary O'Sullivan
2008-02-14 14:33:31 UTC
Permalink
Hi,

I have the following navigation problem when using speedbar with remote tramp
directories. I'm using emacs22, and latest CVS versions of cedet,tramp and ecb.

- C-x C-f /ssh:LinuxTestDev:~/projects/security/semaproj/Makefile
- M-x speedbar
Speedbar displays ~/projects/security/semaproj/ at top of window with contents.
Clicking on semaproj button gives blank content.
*Messages* buffer displays:
speedbar-file-lists: Opening directory: no such file or directory,
/home/garyos/projects/security/semaproj/

There is a similar problem with ECB directory window.

I'm an elisp beginner but I think I've tracked the problem to
speedbar-directory-buttons
in speedbar.el (CVS:1.257). When I make the following change to avoid replacing
with '~/' it seems to fix both speedbar and ecb for me:

--- speedbar.el.orig 2008-02-14 13:17:33.000000000 +0000
+++ speedbar.el 2008-02-14 13:18:07.000000000 +0000
@@ -1876,9 +1876,7 @@
(let* ((tilde (expand-file-name "~/"))
(dd (expand-file-name directory))
(junk (string-match (regexp-quote tilde) dd))
- (displayme (if junk
- (concat "~/" (substring dd (match-end 0)))
- dd))
+ (displayme dd)
(p (point)))
(if (string-match "^~[/\\]?\\'" displayme) (setq displayme tilde))
(insert displayme)


Regards,
Gary O'Sullivan
Eric M. Ludlam
2008-02-18 14:16:53 UTC
Permalink
Hi Gary,

As opposed to disabling the ~ handling, would a patch like this fix
your tramp problem?

Thanks
Eric

---------

*** speedbar.el 09 Feb 2008 21:17:45 -0500 1.257
--- speedbar.el 18 Feb 2008 09:15:12 -0500
***************
*** 1875,1881 ****
INDEX is not used, but is required by the caller."
(let* ((tilde (expand-file-name "~/"))
(dd (expand-file-name directory))
! (junk (string-match (regexp-quote tilde) dd))
(displayme (if junk
(concat "~/" (substring dd (match-end 0)))
dd))
--- 1875,1881 ----
INDEX is not used, but is required by the caller."
(let* ((tilde (expand-file-name "~/"))
(dd (expand-file-name directory))
! (junk (string-match (concat "^" (regexp-quote tilde)) dd))
(displayme (if junk
(concat "~/" (substring dd (match-end 0)))
dd))
Post by Gary O'Sullivan
Hi,
I have the following navigation problem when using speedbar with remote tramp
directories. I'm using emacs22, and latest CVS versions of cedet,tramp and ecb.
- C-x C-f /ssh:LinuxTestDev:~/projects/security/semaproj/Makefile
- M-x speedbar
Speedbar displays ~/projects/security/semaproj/ at top of window with contents.
Clicking on semaproj button gives blank content.
speedbar-file-lists: Opening directory: no such file or directory,
/home/garyos/projects/security/semaproj/
There is a similar problem with ECB directory window.
I'm an elisp beginner but I think I've tracked the problem to
speedbar-directory-buttons
in speedbar.el (CVS:1.257). When I make the following change to avoid replacing
--- speedbar.el.orig 2008-02-14 13:17:33.000000000 +0000
+++ speedbar.el 2008-02-14 13:18:07.000000000 +0000
@@ -1876,9 +1876,7 @@
(let* ((tilde (expand-file-name "~/"))
(dd (expand-file-name directory))
(junk (string-match (regexp-quote tilde) dd))
- (displayme (if junk
- (concat "~/" (substring dd (match-end 0)))
- dd))
+ (displayme dd)
(p (point)))
(if (string-match "^~[/\\]?\\'" displayme) (setq displayme tilde))
(insert displayme)
Regards,
Gary O'Sullivan
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Cedet-devel mailing list
https://lists.sourceforge.net/lists/listinfo/cedet-devel
Gary O'Sullivan
2008-02-18 15:47:45 UTC
Permalink
Hi Eric,

That's the better solution. I tested it with local and remote dirs and
it works fine.

Many thanks,
Gary
Post by Eric M. Ludlam
Hi Gary,
As opposed to disabling the ~ handling, would a patch like this fix
your tramp problem?
Thanks
Eric
---------
*** speedbar.el 09 Feb 2008 21:17:45 -0500 1.257
--- speedbar.el 18 Feb 2008 09:15:12 -0500
***************
*** 1875,1881 ****
INDEX is not used, but is required by the caller."
(let* ((tilde (expand-file-name "~/"))
(dd (expand-file-name directory))
! (junk (string-match (regexp-quote tilde) dd))
(displayme (if junk
(concat "~/" (substring dd (match-end 0)))
dd))
--- 1875,1881 ----
INDEX is not used, but is required by the caller."
(let* ((tilde (expand-file-name "~/"))
(dd (expand-file-name directory))
! (junk (string-match (concat "^" (regexp-quote tilde)) dd))
(displayme (if junk
(concat "~/" (substring dd (match-end 0)))
dd))
Eric M. Ludlam
2008-02-18 16:20:52 UTC
Permalink
Great. I've checked in the change.

Eric
Post by Gary O'Sullivan
Hi Eric,
That's the better solution. I tested it with local and remote dirs and
it works fine.
Many thanks,
Gary
Post by Eric M. Ludlam
Hi Gary,
As opposed to disabling the ~ handling, would a patch like this fix
your tramp problem?
Thanks
Eric
---------
*** speedbar.el 09 Feb 2008 21:17:45 -0500 1.257
--- speedbar.el 18 Feb 2008 09:15:12 -0500
***************
*** 1875,1881 ****
INDEX is not used, but is required by the caller."
(let* ((tilde (expand-file-name "~/"))
(dd (expand-file-name directory))
! (junk (string-match (regexp-quote tilde) dd))
(displayme (if junk
(concat "~/" (substring dd (match-end 0)))
dd))
--- 1875,1881 ----
INDEX is not used, but is required by the caller."
(let* ((tilde (expand-file-name "~/"))
(dd (expand-file-name directory))
! (junk (string-match (concat "^" (regexp-quote tilde)) dd))
(displayme (if junk
(concat "~/" (substring dd (match-end 0)))
dd))
--
Eric Ludlam: ***@siege-engine.com
Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net
Loading...