GNU bug report logs - #44622
[PATCH v2] 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 18:55:01 UTC

Severity: normal

Tags: moreinfo

Merged with 44608

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 44622 in the body.
You can then email your comments to 44622 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#44622; Package emacs. (Fri, 13 Nov 2020 18:55:01 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 18:55:01 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: Andreas Schwab <schwab <at> linux-m68k.org>, Daniel Lenski <dlenski <at> gmail.com>
Subject: [PATCH v2] speedbar bugfix: only replace '~/' when it appears at the
 beginning of the path
Date: Fri, 13 Nov 2020 10:51:38 -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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index 991c8a33d4..3619b23d9e 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.17.1





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44622; Package emacs. (Sat, 14 Nov 2020 16:09:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Daniel Lenski <dlenski <at> gmail.com>
Cc: Andreas Schwab <schwab <at> linux-m68k.org>, 44622 <at> debbugs.gnu.org
Subject: Re: bug#44622: [PATCH v2] speedbar bugfix: only replace '~/' when
 it appears at the beginning of the path
Date: Sat, 14 Nov 2020 17:08:03 +0100
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.

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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 14 Nov 2020 16:09:03 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 44622 <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. (Sat, 14 Nov 2020 16:09:03 GMT) Full text and rfc822 format available.

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:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44622; Package emacs. (Sat, 14 Nov 2020 16:32:02 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Daniel Lenski <dlenski <at> gmail.com>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: [PATCH v2] speedbar bugfix: only replace '~/' when it appears
 at the beginning of the path
Date: Sat, 14 Nov 2020 17:31:40 +0100
On Nov 13 2020, Daniel Lenski wrote:

> diff --git a/lisp/speedbar.el b/lisp/speedbar.el
> index 991c8a33d4..3619b23d9e 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))

That should match tilde, not "~/" (which will never match).

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."




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) patch and fixed. 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#44622; Package emacs. (Sat, 31 Jul 2021 12:57:02 GMT) Full text and rfc822 format available.

Message #24 received at 44622 <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#44622; Package emacs. (Sun, 29 Aug 2021 20:18:02 GMT) Full text and rfc822 format available.

Message #29 received at 44622 <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 183 days ago.

Previous Next


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