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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Daniel Lenski <dlenski@HIDDEN>; merged with #44622; dated Fri, 13 Nov 2020 00:49:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Removed tag(s) fixed and patch. Request was from Andreas Schwab <schwab@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
bug No longer marked as fixed in versions 28.1 and reopened. Request was from Debbugs Internal Request <help-debbugs@HIDDEN> to internal_control <at> debbugs.gnu.org. Full text available.
Forcibly Merged 44608 44622. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 44608 <at> debbugs.gnu.org:


Received: (at 44608) by debbugs.gnu.org; 13 Nov 2020 10:08:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 13 05:08:25 2020
Received: from localhost ([127.0.0.1]:46667 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kdW0H-0008He-Ff
	for submit <at> debbugs.gnu.org; Fri, 13 Nov 2020 05:08:25 -0500
Received: from mail-out.m-online.net ([212.18.0.9]:38909)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <whitebox@HIDDEN>) id 1kdW0E-0008HU-A9
 for 44608 <at> debbugs.gnu.org; Fri, 13 Nov 2020 05:08:23 -0500
Received: from frontend01.mail.m-online.net (unknown [192.168.8.182])
 by mail-out.m-online.net (Postfix) with ESMTP id 4CXZ11055xz1qsk3;
 Fri, 13 Nov 2020 11:08:20 +0100 (CET)
Received: from localhost (dynscan1.mnet-online.de [192.168.6.70])
 by mail.m-online.net (Postfix) with ESMTP id 4CXZ105Yfzz1tF6y;
 Fri, 13 Nov 2020 11:08:20 +0100 (CET)
X-Virus-Scanned: amavisd-new at mnet-online.de
Received: from mail.mnet-online.de ([192.168.8.182])
 by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,
 port 10024)
 with ESMTP id FwlQ4ZEXHcOg; Fri, 13 Nov 2020 11:08:19 +0100 (CET)
X-Auth-Info: knopwKbfNiLBP2E8ve3JpWS3R14pt/41v2XhCfnxj5vyIqmv9aTveK7x9Sjcg9za
Received: from igel.home (ppp-46-244-182-209.dynamic.mnet-online.de
 [46.244.182.209])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mail.mnet-online.de (Postfix) with ESMTPSA;
 Fri, 13 Nov 2020 11:08:19 +0100 (CET)
Received: by igel.home (Postfix, from userid 1000)
 id 02C842C3357; Fri, 13 Nov 2020 11:08:18 +0100 (CET)
From: Andreas Schwab <schwab@HIDDEN>
To: Daniel Lenski <dlenski@HIDDEN>
Subject: Re: bug#44608: [PATCH] speedbar bugfix: only replace '~/' when it
 appears at the beginning of the path
References: <20201113004609.1227253-1-dlenski@HIDDEN>
X-Yow: My TOYOTA is built like a ... BAGEL with CREAM CHEESE!!
Date: Fri, 13 Nov 2020 11:08:18 +0100
In-Reply-To: <20201113004609.1227253-1-dlenski@HIDDEN> (Daniel Lenski's
 message of "Thu, 12 Nov 2020 16:46:09 -0800")
Message-ID: <87y2j5tvql.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.4 (/)
X-Debbugs-Envelope-To: 44608
Cc: 44608 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.4 (-)

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@HIDDEN>
> ---
>  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@HIDDEN
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44608; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 13 Nov 2020 00:48:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 12 19:48:49 2020
Received: from localhost ([127.0.0.1]:46155 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kdNGj-00078v-9S
	for submit <at> debbugs.gnu.org; Thu, 12 Nov 2020 19:48:49 -0500
Received: from lists.gnu.org ([209.51.188.17]:53142)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dlenski@HIDDEN>) id 1kdNEJ-00075T-2D
 for submit <at> debbugs.gnu.org; Thu, 12 Nov 2020 19:46:19 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:40236)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <dlenski@HIDDEN>) id 1kdNEI-00035J-PY
 for bug-gnu-emacs@HIDDEN; Thu, 12 Nov 2020 19:46:18 -0500
Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:43883)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <dlenski@HIDDEN>) id 1kdNEH-0008PM-7I
 for bug-gnu-emacs@HIDDEN; Thu, 12 Nov 2020 19:46:18 -0500
Received: by mail-pf1-x441.google.com with SMTP id z3so6121958pfb.10
 for <bug-gnu-emacs@HIDDEN>; Thu, 12 Nov 2020 16:46:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:date:message-id;
 bh=0udIFlkQZQSSSRi06UXlAWt+sJDlXWDDpTqBYxNbS24=;
 b=UD6gxELgT1h3ey7AnnrZrTQUH62XQ1/luV8+Y6lfiLQyP8txTabGaFmAsUuYNP8Y6g
 s0ujYFiKbBt+GgNdcPveYTGrW+9gPgDGkY1Zy+wwQZDgCgjkp7zatUJpmaBkjdUURUJt
 ncRkcuGh+KyXmHJ/+eVxUoNtLSgd3MchGZHOdUApdkePcKIEtYXNS45XkhwPALwAGR1V
 xeAOzrwB2e5RX8yt1h6JL0dYokwHkF7w83nJHapHF0vWnRkx0PY5DzV6hP2GHicP34od
 67yUdVSpqpwtcyEsPrMR6mUetUAGtC0FNmKVwZhRhTEqVXIkCz0z/WtqsilLZxhNilUw
 UNIA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id;
 bh=0udIFlkQZQSSSRi06UXlAWt+sJDlXWDDpTqBYxNbS24=;
 b=sByq4HKTtban7aK5GpT7QE8BPxE9hQg6u03wyzIckOcmXyCuFi8re2BbL6irl/w/aI
 d6z9nQ7/Aq2FgBDxPtSaoFFf8WLoqu//VcqWfH/cq8ii+01Q/oRFdnqTOp1vYzfr6bZ9
 FduNZslMQdAMCtM/j1oxRfXG9NyyJmNuYOnJcNvN2ObJEwzSGAldLetsKyk7MtQVJ//g
 ziPgvngtZXiAsTyCZS4QOAcplUck8vid7/aDB4V4SsjVy7upHLnuvNgN9o5KJZnWqwK0
 ks6b8zBI2VdUlS+5NXvyBXBVktD6G/ZRznLYHLRVL1wjeoboz4t+N4P4X9k7dCK9v6sN
 Y1nQ==
X-Gm-Message-State: AOAM531nb5PMtSWVAAThET4SRdEhA7BmwbHPfic9VSOrLQhbhqMW0VNl
 7HQlhsP+q1mWzkk8ftIdCjKhH5CafhPupw==
X-Google-Smtp-Source: ABdhPJx8dXF+EorJOcRs0etNTV1wpyVGC68QO9HEE2xlqyntH4JVzsEZ8Gp/Ztd4YWLU98M2wcck6Q==
X-Received: by 2002:a63:5143:: with SMTP id r3mr1667014pgl.439.1605228375107; 
 Thu, 12 Nov 2020 16:46:15 -0800 (PST)
Received: from u0b6eedb2c9435b.ant.amazon.com ([73.96.105.50])
 by smtp.gmail.com with ESMTPSA id n68sm7662248pfn.161.2020.11.12.16.46.14
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 12 Nov 2020 16:46:14 -0800 (PST)
From: Daniel Lenski <dlenski@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] speedbar bugfix: only replace '~/' when it appears at the
 beginning of the path
Date: Thu, 12 Nov 2020 16:46:09 -0800
Message-Id: <20201113004609.1227253-1-dlenski@HIDDEN>
X-Mailer: git-send-email 2.17.1
Received-SPF: pass client-ip=2607:f8b0:4864:20::441;
 envelope-from=dlenski@HIDDEN; helo=mail-pf1-x441.google.com
X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache.
 That's all we know.
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.4 (/)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Thu, 12 Nov 2020 19:48:48 -0500
Cc: Daniel Lenski <dlenski@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

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@HIDDEN>
---
 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





Acknowledgement sent to Daniel Lenski <dlenski@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#44608; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 14 Nov 2020 17:00:02 UTC

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