From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
Received: from mp1 ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms0.migadu.com with LMTPS
	id aHtoNgemqmAgDAEAgWs5BA
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sun, 23 May 2021 20:59:19 +0200
Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp1 with LMTPS
	id aMP3MQemqmCAOwAAbx9fmQ
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sun, 23 May 2021 18:59:19 +0000
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id 429F51014E
	for <larch@yhetil.org>; Sun, 23 May 2021 20:59:18 +0200 (CEST)
Received: from localhost ([::1]:45296 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	id 1lktJk-0004eE-WD
	for larch@yhetil.org; Sun, 23 May 2021 14:59:17 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:36084)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <gusbrs.2016@gmail.com>)
 id 1lktJP-0004e5-MD
 for emacs-orgmode@gnu.org; Sun, 23 May 2021 14:58:55 -0400
Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]:34438)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <gusbrs.2016@gmail.com>)
 id 1lktJO-000156-79
 for emacs-orgmode@gnu.org; Sun, 23 May 2021 14:58:55 -0400
Received: by mail-oi1-x22a.google.com with SMTP id u11so25110327oiv.1
 for <emacs-orgmode@gnu.org>; Sun, 23 May 2021 11:58:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:references:user-agent:from:to:cc:subject:in-reply-to
 :message-id:date:mime-version;
 bh=HDITVbs8HpagPKq9geHC8E2ZGXudRECGzgKElyaeT5w=;
 b=M4ObqAnJsumdPrjve82OvFI2GtNG1ohDM0HsZsv3v3XT7tzJSolQrMuxIZwBlOatpL
 aI1Uh6sqe1k403fR1TAv7euUrN7JXe/9sXcflPXgsKe9pombvaYKrrQGrkn0SGXvKJCJ
 +KGHNdHHX3mWRaESuMReb8ExOqF7CQrYf6ajZB0HMDhuKCzlaSJSAKNkPu8iILko21Qc
 uxitd+xmAR46BEAuVpzTAYFRikyG/nLA7/vKcW9EOQrWZzYtoeHR0IG0A8jLxJ1Ncdbv
 qgqwHw2TOely95Q5G+ge+os/5BEpStwFqayMddXS1pfbwrkHgT5X7ZDK/xHbgkpmplM8
 MSdQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject
 :in-reply-to:message-id:date:mime-version;
 bh=HDITVbs8HpagPKq9geHC8E2ZGXudRECGzgKElyaeT5w=;
 b=b9qaz389vD06ZMV9tKG86HhtOKdGajMjrhgXYmxMvi5Y7eUXTzIEcHYSNq9NewbqQC
 euJCXslERdglPhQhfBbGxrpo4Z4yNwiXZxBF3rsafpUr9ZDDB+z6iOeT5T/fAAHJoh6+
 UJTfD58umcr6lzdmhmSY0YONyRmsfmELKd0HJcUo2PzxwGf+CyPj4vVS8ess04OqzqkB
 p9ZNPQW01+YoKNSoDMDqFLw87ly1CUwgs5DRJAFnQGrAE/eVF/ikdds0T6qj2kwXyQL3
 8D3AmZgvElVls/EW1bozd+MO25ZbAoaOzH1E6TbDjbc+eMlh3rjWgbN4S2hruv8QfWLQ
 uYdQ==
X-Gm-Message-State: AOAM530MZeRnwJGW7fgb5XxFWXKzwyOpicWR6kFiyA6nzFnPbGGfeMAt
 UdtW0nxI40j6NBnHfHZIP6zNOnvwRq8=
X-Google-Smtp-Source: ABdhPJzwg4x7CzurbyGKnK1tWmLoicJ4k18W0ESEZLug/yxf+t6hl+jERsKnjDjnhgjsab/AE2VjpA==
X-Received: by 2002:a05:6808:128b:: with SMTP id
 a11mr8516964oiw.88.1621796332015; 
 Sun, 23 May 2021 11:58:52 -0700 (PDT)
Received: from gusbrs-laptop ([181.214.227.57])
 by smtp.gmail.com with ESMTPSA id v19sm2644534otq.35.2021.05.23.11.58.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 23 May 2021 11:58:51 -0700 (PDT)
References: <CAOn=hbcSeGYonTBKzV7kcns66iVWQUzmrThT+rLLj18GwHw8Ew@mail.gmail.com>
 <CAOn=hbe4q7Ym2ApNH5zKd1E3MBNHHY8yr-33mi0xqQEWdnJ+_A@mail.gmail.com>
User-agent: mu4e 1.4.15; emacs 27.2
From: Gustavo Barros <gusbrs.2016@gmail.com>
To: Bhavin Gandhi <bhavin7392@gmail.com>
Subject: Re: Bug: Double trailing slash for default candidate in
 org-refile-get-target [9.4 (9.4-7-g3eccc5-elpaplus @
 /home/gustavo/.emacs.d/elpa/org-plus-contrib-20200921/)]
In-reply-to: <CAOn=hbe4q7Ym2ApNH5zKd1E3MBNHHY8yr-33mi0xqQEWdnJ+_A@mail.gmail.com>
Message-ID: <87sg2ds2e0.fsf@gmail.com>
Date: Sun, 23 May 2021 15:58:47 -0300
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
Received-SPF: pass client-ip=2607:f8b0:4864:20::22a;
 envelope-from=gusbrs.2016@gmail.com; helo=mail-oi1-x22a.google.com
X-Spam_score_int: -17
X-Spam_score: -1.8
X-Spam_bar: -
X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, 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-BeenThere: emacs-orgmode@gnu.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Cc: emacs-orgmode@gnu.org
Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
Sender: "Emacs-orgmode" <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
X-Migadu-Flow: FLOW_IN
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1621796359;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:cc:mime-version:mime-version:
	 content-type:content-type:in-reply-to:in-reply-to:
	 references:references:list-id:list-help:list-unsubscribe:
	 list-subscribe:list-post:dkim-signature;
	bh=HDITVbs8HpagPKq9geHC8E2ZGXudRECGzgKElyaeT5w=;
	b=klicU2FvpKbU8y1K13IT5ssOU7wEJJ/Fs68SEZNi0mxLWSVHd3PkUF+o/MgM+LCtS7S4WP
	6cyiWj4sJO+2S5CNBeWmSOM4teIH94K0Sf7KsJgC2kxMqdAhQkU2MHLg4pzlM0ldP5el5w
	jm1jo8kCBM48FP66sh7qQSe9xCmVPNOEKnunr6YsEtRc8D9lLtPRFN3IrT3eCSvOFt3sGx
	2ZjyOmRAJjeWlztev6/UbuZZRkrd4xHho/D6LDQ8fGbDOeK9QAHTCn6936hWBhrugptJjQ
	Clo/X2yIRLu8A6I6M3uKKQeaGcoUDn7n1CR+S535k0E7u0z4Yc6+Ht9J73Oa2Q==
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621796359; a=rsa-sha256; cv=none;
	b=Kmd1e7dImYo7eJwGgmqtcywZFQLLt4wg79llJWKUdXe5uQbvu0EJmk1aNtngxaWx2jcaf5
	Ji7yamYnkJwxDqdQM/2tQr4F6ph90SrRzPNLf8J5YsI9ga0qt6geaFvZiqwep4RmchLkkY
	ieqF7J/qkqbrgRoqnnDKc/duw1uBfHQBYYL+9nYD3o1oIM6ZUN012cNlf33rRu5NyFehsK
	/dPK7ipj7acR94DuZ89B3ILDlDMvtd89TPiOhDrhFinEf3v1VFDp1aJowVBpWbwgMh0v+o
	1UAytsJWuKzmwmYa8JCjdJaXDGl/rVG0gaHhcZqBJBQ6mq+KNePH0fjAzKge6Q==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=M4ObqAnJ;
	dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none);
	spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org
X-Migadu-Spam-Score: -1.34
Authentication-Results: aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=M4ObqAnJ;
	dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none);
	spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org
X-Migadu-Queue-Id: 429F51014E
X-Spam-Score: -1.34
X-Migadu-Scanner: scn0.migadu.com
X-TUID: moSXzVq1BdtH

Hi Bhavin,

On Sun, 23 May 2021 at 15:05, Bhavin Gandhi <bhavin7392@gmail.com> 
wrote:

> Finally after spending a couple of hours, I was able to understand the 
> code
> of org-refile-get-location \o/. The detailed bug report helped me to
> understand the issue. I'm attaching a patch here which should fix the
> problem, it has other details as well. I have tested a few basic 
> scenarios
> as mentioned in the report.

Thank you very much for working on this patch.  I couldn't offer it 
myself (out of my legal bounds) and had gone as far as I was allowed to 
here, so I'm happy you took it from there.

The patch looks good to me, and corresponds to my analysis of the 
problem and suggested fix.  I have only one minor nitpick: you could go 
with a simple `let' there, instead of a `let*', since we only have one 
let-bound variable there anyway.

About:

> [...] it has other details as well.

As far as I could see, we are very much aligned on the problem and fix. 
But perhaps I'm missing something, could you elaborate on that?

Thanks again.

Best,
Gustavo.