From: Daniel Lenski Date: Sat, 14 Nov 2020 16:07:49 +0000 (+0100) Subject: Fix `speedbar-directory-buttons' when using Tramp X-Git-Tag: emacs-28.0.90~5149 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5afad3918bc8816b74e8efcff9cc441785446aa6;p=emacs.git 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 --- 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))