From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id SE+UC97hc2bIPQEAqHPOHw:P1 (envelope-from ) for ; Thu, 20 Jun 2024 08:01:34 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id SE+UC97hc2bIPQEAqHPOHw (envelope-from ) for ; Thu, 20 Jun 2024 10:01:34 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ICtfpxb5; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1718870494; a=rsa-sha256; cv=none; b=eLGVf0RXIHsKRSu2HtAbakMK7Z+2eK9gf0XIDXz0jbVhfv2g7fmdCZWGlxBZD0M6xm01qR 8ZU5L/jppjSt4XTi6FiHtVy0Y7k3H/DVRXf7VIuyeNfvHP5elUEEJ5gN99e3bAjk7tJF2K m2lHr2ZVUuUb6PmeHJRG7jUFugqxeA2gxvhG4INDqch7bWeCTjcz7ZpJETaYhB3a6ZwLXN 0ccP158hXNceDVztTSYKAafU8Ae9scXdkq7VyawmLW8gAFKo5v1BiuKNMm5yM8xOnxytso Pg/VlZ3MCRj2VANYL9bobJqI1Gj7JVk0420fUDXs4Q9i1f1ABemsE+nFAfLfqQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=ICtfpxb5; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1718870494; 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=xkHQ4TxzEF1LAaM0B9axcWauti46COHQrr2dLbabCGc=; b=W5GZ6nCL1QnKjq5BYZCMKCDFt3aJnukKZIx+jFNmcXIA+ZS6ujCwRxyQCrk9GQtqrd3+fr PvEmniRcO8gdwWIJy1UiXQ1Tef84TBj5gSUPortIJgvJO8njtnwlqK+DhaGBfEj5D2wIQ5 vK9yDNLnmeCOD3lIzo2jaFhYrOkituAOr3UQpwUnstPTtQF4Am40cdrNeuSkt3jFVUKjhw ly/NfMyAkps+npmLOJSqZieL5Zrsh0ZTgVil/ENKf1+WTOGd7xccXwOmxSxTfrHwEZek5F zYnuQraZ0ijhkXxW/Ycpt5EPNeU00h/ucfVYEbMOGSEjU4oY1V78rRJ+XnZapQ== 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 ED89537478 for ; Thu, 20 Jun 2024 10:01:33 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKCis-0004yo-63; Thu, 20 Jun 2024 04:00:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKCiq-0004yQ-NE for emacs-orgmode@gnu.org; Thu, 20 Jun 2024 04:00:44 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sKCip-0000T3-2z for emacs-orgmode@gnu.org; Thu, 20 Jun 2024 04:00:44 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-361b376236fso469195f8f.3 for ; Thu, 20 Jun 2024 01:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718870439; x=1719475239; darn=gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=xkHQ4TxzEF1LAaM0B9axcWauti46COHQrr2dLbabCGc=; b=ICtfpxb5Uu69RSgJM/jXieZSVpcZTnFiX1FA93KgaI7Kg142d1GQpIWYdKlHqrdSnX wRuQ3i9V5U6nW66BxKk1UQlycjD/3/U6pwLLsLXPjYX0VIC1ElBkWbmme1pQIGcQsWI4 7QFP+eDEHv3qgLHhmLxLz6+Qdkkvx0gv1w28Johx2Y9znQalSnHYJzGorwPJ34cEIurv xP7jJCTO3nftg1V8iHggcbNA+4MoAhgYbsJC6LSDG4qfHC8epyTqdjTJoUPC8tvb+XeI wMym8JTfOBZHdYg0dYxLfAZyjtf+mn688Tap6h4sKKYn5TnYkD5Nd6Snf2PaPFfOm8am FUKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718870439; x=1719475239; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xkHQ4TxzEF1LAaM0B9axcWauti46COHQrr2dLbabCGc=; b=h4kqXfvqL/mhXD5MdfLpXJn970Qqxl9gERAar0mScqPE4qb8RAhlWb69oiSGFsJ8fg qHFoECy80eENjXdtv4hLaMlVzfoMnue/Ss1lLdgGZpIl6LTpWfpUcqK06pB5qggbdWC6 sYe7fwQU4dv97rVFiYzcAZ49eokMlvBXEfpO4CAIFDMTmbN1pl+CNodTXBMcbukGprPS DW3bh5pYeMYpnGcpLVQcFo2kztux7adEaH5x5qbgKLQtg272bwn5nh7CN0X0OnBgfLYb AI+OqU3Q1c4+BrnXp7g4+NiBCdzPLJ5cso6XHRjPeDJo1zex7GjC9CG1c7ae9U889YU5 j+Wg== X-Gm-Message-State: AOJu0Yyi34age/EYhrjoJzmFstnbjifWU808LmidQNAyHcvQB86vMmpC ZyYPagZTccDPsjV14b1Zd1oCsmoKIcxA9BYjAwZVYAJlnrymy/p/VLMaUg== X-Google-Smtp-Source: AGHT+IEmmCpkLauIQWCcZl5lhip2pTDsg9Qko9Utcjr+smMcbqoFIb68WzPcyFJpaBFvUd5Y9rcr8A== X-Received: by 2002:a5d:452d:0:b0:355:230:e2d3 with SMTP id ffacd0b85a97d-363177a3d04mr3513299f8f.20.1718870438478; Thu, 20 Jun 2024 01:00:38 -0700 (PDT) Received: from localhost (sgyl-45-b2-v4wan-166941-cust3717.vm6.cable.virginm.net. [82.37.190.134]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3647bf3092csm1564866f8f.97.2024.06.20.01.00.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 01:00:37 -0700 (PDT) From: Al Haji-Ali To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] org-refile-get-location a symlinked file [9.7-pre (release_9.6.29-1443-gb4d17c)] In-Reply-To: <87v8259fh7.fsf@localhost> References: <87sexba3aa.fsf@localhost> <87le32s93z.fsf@localhost> <87v8259fh7.fsf@localhost> Date: Thu, 20 Jun 2024 09:00:12 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=abdo.haji.ali@gmail.com; helo=mail-wr1-x432.google.com 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.70 X-Migadu-Scanner: mx12.migadu.com X-Spam-Score: -9.70 X-Migadu-Queue-Id: ED89537478 X-TUID: WaIhEiJwPvRK --=-=-= Content-Type: text/plain On 19/06/2024, Ihor Radchenko wrote: > Al Haji-Ali writes: > >> On 18/06/2024, Ihor Radchenko wrote: >>> Hmm. Thanks, but the patch does not apply on my side. >>> May you instead create a patch as a separate file, add the commit >>> message, and attach that patch file in the email reply? >> >> See attached. > > Thanks. Although this is a different kind of patch. And it is doing too > much - we do not want to expand all the names via `file-truename' > because you may have a situation like > > /path/to/file1.org > /path/to/symlinks/name-is-completely-different.org > > Then, using `file-truename' may be confusing for people who expect the > symlink name to be displayed. I am not sure what would be the correct approach. Perhaps the true-name expansion should be conditioned on the value of `find-file-visit-truename`. > I am thus attaching an alternative patch. > May you please test if it fixes the problem on your side? I think it's missing calling `file-truename` call on `filename`, see attached patch. Best regards, -- Al --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=org-refile-targets.patch >From 9b44f737a44945723a9cf35dfa92e19d27a1135b Mon Sep 17 00:00:00 2001 From: Al Haji-Ali Date: Tue, 18 Jun 2024 19:27:56 +0100 Subject: [PATCH] org-refile-get-location: Fix outline path to a symlink of current buffer * lisp/org-refile.el (org-refile-get-location): When current buffer file is a symlink to refile location, do not append the file name to the outline path, just as we do when current buffer is the same as refile location file. --- lisp/org-refile.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org-refile.el b/lisp/org-refile.el index 20b5fbd02..c8e64903c 100644 --- a/lisp/org-refile.el +++ b/lisp/org-refile.el @@ -666,12 +666,12 @@ this function appends the default value from #'completing-read)) (extra (if org-refile-use-outline-path "/" "")) (cbnex (concat (buffer-name) extra)) - (filename (and cfn (expand-file-name cfn))) + (filename (and cfn (file-truename cfn))) (tbl (mapcar (lambda (x) (if (and (not (member org-refile-use-outline-path '(file full-file-path title))) - (not (equal filename (nth 1 x)))) + (not (equal filename (file-truename (nth 1 x))))) (cons (concat (car x) extra " (" (file-name-nondirectory (nth 1 x)) ")") (cdr x)) --=-=-=--