bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#44608: [PATCH] speedbar bugfix: only replace '~/' when it appears at


From: Andreas Schwab
Subject: bug#44608: [PATCH] speedbar bugfix: only replace '~/' when it appears at the beginning of the path
Date: Fri, 13 Nov 2020 11:08:18 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

On Nov 12 2020, Daniel Lenski wrote:

> This makes Speedbar work correctly with remote directories accessed through 
> TRAMP. This bug has apparently been known for a long time: 
> https://cedet-devel.narkive.com/eIs7LoWB/speedbar-and-tramp#post2
>
> Signed-off-by: Daniel Lenski <dlenski@gmail.com>
> ---
>  lisp/speedbar.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/speedbar.el b/lisp/speedbar.el
> index 991c8a3..3542936 100644
> --- a/lisp/speedbar.el
> +++ b/lisp/speedbar.el
> @@ -1874,7 +1874,7 @@ 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-match (concat "^" (regexp-quote tilde)) dd))

That should use string-prefix-p.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."





reply via email to

[Prev in Thread] Current Thread [Next in Thread]