From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id oP8NDGCAIGMlHwAAbAwnHQ (envelope-from ) for ; Tue, 13 Sep 2022 15:06:40 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id iNoFC2CAIGOdEAEAG6o9tA (envelope-from ) for ; Tue, 13 Sep 2022 15:06:40 +0200 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 B0AA732645 for ; Tue, 13 Sep 2022 15:06:39 +0200 (CEST) Received: from localhost ([::1]:53422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oY5cc-0000uF-6j for larch@yhetil.org; Tue, 13 Sep 2022 09:06:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY5ad-0008AQ-HX for emacs-orgmode@gnu.org; Tue, 13 Sep 2022 09:04:35 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:52896) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oY5aV-0000jN-Gh; Tue, 13 Sep 2022 09:04:34 -0400 Received: by mail-pj1-x1032.google.com with SMTP id go6so7054112pjb.2; Tue, 13 Sep 2022 06:04:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date; bh=1jgGQAL9Pal2EFMzJ7aiqxKxXB3/oPGRTgYwhRUY6Hw=; b=FgbMC4349YEbB/Rm3Y/OWHRRaVWfWYZnimsJUkgBdrhE4WEJFvPbplwaZzFNMqh1YH GXtk3eAwXShbYvE/brhfC7VoM0Qe1mxR6Gjt96zp3DKKpOpNEAvPfj8u4P7gK/XpgKaN fylaAjT9z3AwMnlIGQQNuygeEkQ6Rt/x10KUYa0wDgboH+MuKEEn6zpqWzDwxhPF2s7G 4iaHZV5WhalAzpGslosOpOrjfSPA4c57T/uQaXgZ975uMrezqKlCKAsLn5ko+wfcxLy2 Toh3CCBy1eRrg4x8l6923Z8/ti+AC7J3s/H15r38SW/h6el49r0jAbMTQVuLYdpUTlwU DK4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=1jgGQAL9Pal2EFMzJ7aiqxKxXB3/oPGRTgYwhRUY6Hw=; b=ykPfi5B1dwQEAdEdw1YSKVWNnuH9FL89eI86/cuRXazrNUh/qLbgJnKC9Du03OXBnL s6c2gscdL1YnRy3cVsFRfIlpoVzEnmhM12U0KJDWd33IJh1ELSCUvIqWddavoVxSMxH6 Qq5M2+Bq3rlpHfpbO4ChN39pUfZ6U19dF6fXUtWkg9MJLCoVtOCYpeXLCxJsClstQqi8 Aze6icaiE6Yn5zeRWSzJSi5Ytn82RE5J3UYJz7llzddCQDwahpGHGy+P72nuvxpjRLL/ KirAvJax8KcWJKxpRSeRvirNMBRjgWW3JALNwZw5du3MW1eNdURlXRp0OtE8+qEkhhf5 lg3w== X-Gm-Message-State: ACgBeo1rsXcl8/7/3RIRWU80mQM501IEIR6b924FndnFz3IX//PMR3pJ z8sUAgAL4zrhqPWOZYlu4MI= X-Google-Smtp-Source: AA6agR6GXWSKliI8tckhCmfoZEPtsvV2GU1LZaCJluRaj4AsMbJ4mxC/3ko967b83sh0S9FJwPnRiw== X-Received: by 2002:a17:90b:17cc:b0:202:bccc:f552 with SMTP id me12-20020a17090b17cc00b00202bcccf552mr3997976pjb.154.1663074263622; Tue, 13 Sep 2022 06:04:23 -0700 (PDT) Received: from localhost ([2409:8a70:2bc:c850:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id n1-20020a170902dc8100b0017508d2665dsm8358112pld.34.2022.09.13.06.04.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Sep 2022 06:04:22 -0700 (PDT) From: Ihor Radchenko To: Max Nikulin Cc: Bastien , Fr Ml , emacs-orgmode@gnu.org Subject: Re: Bug: org-store-link uses CUSTOM_ID instead of target point [9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/)] In-Reply-To: References: <87im3wqbk6.fsf@gnu.org> Date: Tue, 13 Sep 2022 21:05:14 +0800 Message-ID: <87edwfctmd.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1032.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, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1663074400; 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=1jgGQAL9Pal2EFMzJ7aiqxKxXB3/oPGRTgYwhRUY6Hw=; b=IJmvFTHlz/xZFoatjFIN5qyN41QEzfyOKy7SE6P+yUa/q9VS6vgaA9vYnBWWEflFmveqhu A1u1F06FMVsC7XRaafXZd0osGXcHbm4CVuNVDTYd1rRNUczV6ZWRj6885P1dmb2bv18nxC TKYoJiP1JWjB3uSAq3yImNJ0bwvml1QJCb01MxcZWppQOZpRCevpOSZBUIXA3Mdvvd8U7t wZOe1/PGHubh+wnpXKHho3UFqnLxSm8IG/dqi+9ai7KSeDMpBfYOI7p6SF8h8BNdQJCZq7 w4PkrshqMpwkOVYWqYG/pPk5nnCskfoGdZ/xEctb8bWGwBViKogN6JIFjvX97A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663074400; a=rsa-sha256; cv=none; b=oeN8VGZpQ3MM7YrhP3ka7LYEyv+gah1myUdHkw2VzXLFq1pDxZOeTAmWddqnJI6WTF5Alx JoQS7oIlXLfIlUUVPfqTGv6Y9q0acStgcOR8VJNj9LOcRxJbCc8HjV9b/O01DARvDRvxS0 vINiOrIZLaDXBPwe+HD9+1x4UFx6uK7ceOcxZImXubT7RXsxGVQ5mb6oAo+YtQWq8B4LrV 4gRZcxeBvyFnYstKkB46KnYCJaIBzuPWSYe8w9p/f+oHRmsrAwydlMvJJf+E74DnK7u0xQ gG9qYoOMp0hmk7by1aYFlvcdXv2tcjLrjaxIbCbe8/aLkG6hZJHuVsU+tu3KCg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FgbMC434; 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" X-Migadu-Spam-Score: -3.31 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FgbMC434; 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" X-Migadu-Queue-Id: B0AA732645 X-Spam-Score: -3.31 X-Migadu-Scanner: scn1.migadu.com X-TUID: fsOlXOfvdf7j Max Nikulin writes: >> Fixed in maint, thanks a lot for reporting this and Ihor for >> confirming the bug. > > Bastien, unfortunately your fix caused duplication of stored links like > "file:~/org/file.org::#custom_id" when point is outside of <>. > Earlier #CUSTOM_ID link was stored in addition to > "file:~/org/file.org::*Heading" search link. My suggestion is to revert > your patch and to just reset custom-id variable when <> link is > stored. Another effect or your patch, that I consider unintentional, is > storing > [[file:~/org/file.org::#custom_id][file:~/org/file.org::#custom_id]] > instead of [[file:~/org/file.org::#custom_id][Heading]]. I prefer > "original" behavior. > > Third patch is intended to avoid links inserted as > [[target][file:~/org/file.org::target]] in the case of same file. I > suppose, just [[target]] is better. Current variant looks unbalanced and > misleading. Of course, you are free to skip last patch. Thanks for reminding about this unresolved patch! Applied all three patches onto main. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=543a23a57d2947cd01c906d134ae9c5c8d0907c4 https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f7b8510283537bda4eba3b54fce5eafc7cec9993 https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=c3d6672cfdbff8c9dd4c2ec70886ad3f62153d07 -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92