GNU bug report logs - #44608
[PATCH] speedbar bugfix: only replace '~/' when it appears at the beginning of the path

Previous Next

Package: emacs;

Reported by: Daniel Lenski <dlenski <at> gmail.com>

Date: Fri, 13 Nov 2020 00:49:01 UTC

Severity: normal

Tags: moreinfo

Merged with 44622

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 44608 in the body.
You can then email your comments to 44608 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#44608; Package emacs. (Fri, 13 Nov 2020 00:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daniel Lenski <dlenski <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 13 Nov 2020 00:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Daniel Lenski <dlenski <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: Daniel Lenski <dlenski <at> gmail.com>
Subject: [PATCH] speedbar bugfix: only replace '~/' when it appears at the
 beginning of the path
Date: Thu, 12 Nov 2020 16:46:09 -0800
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 <at> 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))
 	 (displayme (if junk
 			(concat "~/" (substring dd (match-end 0)))
 		      dd))
-- 
2.17.1





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44608; Package emacs. (Fri, 13 Nov 2020 10:09:01 GMT) Full text and rfc822 format available.

Message #8 received at 44608 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Daniel Lenski <dlenski <at> gmail.com>
Cc: 44608 <at> debbugs.gnu.org
Subject: Re: 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
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 <at> 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 <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Forcibly Merged 44608 44622. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 14 Nov 2020 16:29:01 GMT) Full text and rfc822 format available.

bug No longer marked as fixed in versions 28.1 and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 14 Nov 2020 16:52:02 GMT) Full text and rfc822 format available.

Removed tag(s) fixed and patch. Request was from Andreas Schwab <schwab <at> linux-m68k.org> to control <at> debbugs.gnu.org. (Sat, 14 Nov 2020 16:52:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44608; Package emacs. (Sat, 31 Jul 2021 12:57:01 GMT) Full text and rfc822 format available.

Message #17 received at 44608 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Daniel Lenski <dlenski <at> gmail.com>
Cc: 44608 <at> debbugs.gnu.org, Andreas Schwab <schwab <at> linux-m68k.org>,
 44622 <at> debbugs.gnu.org
Subject: Re: bug#44608: [PATCH] speedbar bugfix: only replace '~/' when it
 appears at the beginning of the path
Date: Sat, 31 Jul 2021 14:56:08 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Daniel Lenski <dlenski <at> gmail.com> writes:
>
>> 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
>
> Thanks; applied to Emacs 28.

And now I've reverted it, because it doesn't really look like it could
possibly be correct.

The URL is dead -- do you have a test case that demonstrates the
original problem?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 31 Jul 2021 12:57:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44608; Package emacs. (Sun, 29 Aug 2021 20:18:02 GMT) Full text and rfc822 format available.

Message #22 received at 44608 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Daniel Lenski <dlenski <at> gmail.com>
Cc: 44608 <at> debbugs.gnu.org, Andreas Schwab <schwab <at> linux-m68k.org>,
 44622 <at> debbugs.gnu.org
Subject: Re: bug#44608: [PATCH] speedbar bugfix: only replace '~/' when it
 appears at the beginning of the path
Date: Sun, 29 Aug 2021 22:17:13 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> And now I've reverted it, because it doesn't really look like it could
> possibly be correct.
>
> The URL is dead -- do you have a test case that demonstrates the
> original problem?

More information was requested, but no response was given within a
month, so I'm closing this bug report.  If the problem still exists,
please respond to this email and we'll reopen the bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 44608 <at> debbugs.gnu.org and Daniel Lenski <dlenski <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 29 Aug 2021 20:18:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 27 Sep 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 205 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.