From 5afad3918bc8816b74e8efcff9cc441785446aa6 Mon Sep 17 00:00:00 2001 From: Daniel Lenski Date: Sat, 14 Nov 2020 17:07:49 +0100 Subject: [PATCH] Fix `speedbar-directory-buttons' when using Tramp * lisp/speedbar.el (speedbar-directory-buttons): Make speedbar work with directories accessed via Tramp (bug#44622). Copyright-paperwork-exempt: yes --- lisp/speedbar.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 991c8a33d46..3619b23d9e6 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -1874,9 +1874,9 @@ matches the user directory ~, then it is replaced with a ~. 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)) + (junk (string-prefix-p "~/" dd)) (displayme (if junk - (concat "~/" (substring dd (match-end 0))) + (concat "~/" (substring dd 2 nil)) dd)) (p (point))) (if (string-match "^~[/\\]?\\'" displayme) (setq displayme tilde)) -- 2.39.2