From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id M5wEJah8fGUJewAAkFu2QA (envelope-from ) for ; Fri, 15 Dec 2023 17:19:52 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 2OQaHqh8fGVjHQAAqHPOHw (envelope-from ) for ; Fri, 15 Dec 2023 17:19:52 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=ricklupton.name header.s=fm1 header.b="i ZmJ2uA"; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=J+7+Nffi; 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"; dmarc=pass (policy=none) header.from=ricklupton.name ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1702657192; 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=A9xD+BEFW94cY75apkVdCv2SsD0XaEpSCAlbgAaFLwM=; b=Oi2seEdkpz6X88o/HozJX9Mf7zbb7mwg+E+cTa3rVADILhF3xWuB19GqgN0q2qHpAwtEV2 bLweiH29ULCTS9BGLlvnUmaJ8msmwSps3YVkoZMPHB/VD3NaqPp0PZZRWjaanBJJF9Fj2A 5JGxFTZVsKKxiPHiJq8ctVDUkeEQz1BfkUpKL3DO7smH6wZEZfXk83R+02BIYy8rT0Xycv yJx1yNc9L9ULNtLpIGXdn1SCfJSxbvpgiTVSguykR9pc8p2hO8eAp29pkfuddxrPIGyHRR M3coJd5Hz19DTmwoNpIinXSLL8+mmahEo0lEiup85ssuI3t8P1tyBQXa4A/LDQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=ricklupton.name header.s=fm1 header.b="i ZmJ2uA"; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=J+7+Nffi; 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"; dmarc=pass (policy=none) header.from=ricklupton.name ARC-Seal: i=1; s=key1; d=yhetil.org; t=1702657192; a=rsa-sha256; cv=none; b=aECiyj/pYRJ0Xve6IyfSG/YwSwZokSzp0EnxRCh+Q/vImbF2f7V1ZXMDu5c7qMlHsdIrvH 81kz1CzAIvIjVp4wF53yv4XOcrJDQ+m4FCoH/Mpx0j2wPjntoB7s1c92zp3cjanPp+58yM 5KD+OmsHzX7Ga3O/iZ4+TiqBEzrVLV45upqzQpCa2/WWs+EhDTxWKJIoMP4HU2Fbp1WzEo 5FQ3Gp1zRKrZtG3HRNOPHxi9YKAVjJZIEFQ7KSp0rvncPU3OMwsh5pQRNjmkthx5UR5MiQ QHxcZEq9dUKAIoBe14zrpFzlE2FDX0ElZ3rIg9kw+gtB+CbzvJonT4G+ExXLoA== 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 53F6E2093F for ; Fri, 15 Dec 2023 17:19:51 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rEAtp-0002jb-QJ; Fri, 15 Dec 2023 11:18:53 -0500 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 1rEAtn-0002jD-IX for emacs-orgmode@gnu.org; Fri, 15 Dec 2023 11:18:51 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rEAtl-0001jn-CX for emacs-orgmode@gnu.org; Fri, 15 Dec 2023 11:18:51 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 923355C0291; Fri, 15 Dec 2023 11:18:48 -0500 (EST) Received: from imap50 ([10.202.2.100]) by compute2.internal (MEProxy); Fri, 15 Dec 2023 11:18:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ricklupton.name; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1702657128; x= 1702743528; bh=A9xD+BEFW94cY75apkVdCv2SsD0XaEpSCAlbgAaFLwM=; b=i ZmJ2uAw3HbvBsTJa7TpovJboe1rwTvxuTKZ1xErcSQjo23ZWD+q7nm7WLcL0SrH+ jZfOSImfGCtEg3u2F80BmCK40if70LW3S8AHeAd8zwxTDzvy9HjRdNDGwTbHjSvR fDMOc+CxBpBM6zUhfaonfP2Or6F5htGjuvBHJ/2T6Q7/e6G+aPpNpGI9CCJWuHF1 4Tae9sdGQ4eZrIG9o8B6gP/L58PSEkVCwn1EiJi1Qqj29p1qofOcqDsjRAf2xjER mclOT28aVl8HDBsFiDSZvHVfytUnI+GLw4wElNrEV89ZJ/Haq0aw3TctG23IFfE5 DTOe7NNjOroWuxCmtVtIw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1702657128; x=1702743528; bh=A9xD+BEFW94cY75apkVdCv2SsD0X aEpSCAlbgAaFLwM=; b=J+7+Nffisi3VQ+VreW4yatJiGODOkoEjT6jI/xNGsb8Q o8zhyZyGYJkALUWCTFLrijfu3x/cdqaGeEZtrswVMcX7qNyFysC6SoXEZOv4AWB7 EI/OEzU8OurH2HnyKGUtQ3ozBMq5uVmxW8/YXR0OBVn8j+LV6mro9N8fjAW3OMfF p2y6bMv0tJZ2cBFLjVYBoXbYZxvJus7pP+g2OwLhAHJi42GSHvPSomWnjybKWUCp Pt+7xXftS1pQT5irmHf0nXpYIg8zPRh81rTDeM6exl1zykMzlJuN/fJoDJsbziJd VJkVfvU1E0NTwm7VCy0LTzZaWf7nbtF+WPEqmDGycA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvddtvddgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvvefutgesth dtredtreertdenucfhrhhomhepfdftihgtkhcunfhuphhtohhnfdcuoehmrghilhesrhhi tghklhhuphhtohhnrdhnrghmvgeqnecuggftrfgrthhtvghrnheptddtgefgtdelhfffud dthfefkeeuteefgeefhfefkeehgfekhefgkeegieetieejnecuffhomhgrihhnpehgnhhu rdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epmhgrihhlsehrihgtkhhluhhpthhonhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i0143436f:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 592481700096; Fri, 15 Dec 2023 11:18:48 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1283-g327e3ec917-fm-20231207.002-g327e3ec9 MIME-Version: 1.0 Message-Id: <3c5737c8-f489-4144-a27f-c0e0527c79c0@app.fastmail.com> In-Reply-To: <87zfybzkul.fsf@localhost> References: <118435e8-0b20-46fd-af6a-88de8e19fac6@app.fastmail.com> <87edkwsafe.fsf@localhost> <87cywh2ad6.fsf@localhost> <87jzpmqiy0.fsf@localhost> <2cdfefbf-e9e3-4aeb-a410-1ff3a9d6168e@app.fastmail.com> <87zfybzkul.fsf@localhost> Date: Fri, 15 Dec 2023 16:16:36 +0000 From: "Rick Lupton" To: "Ihor Radchenko" Cc: "Y. E." Subject: Re: [PATCH] org-id: allow using parent's existing id in links to headlines Content-Type: text/plain Received-SPF: pass client-ip=66.111.4.28; envelope-from=mail@ricklupton.name; helo=out4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -9.79 X-Spam-Score: -9.79 X-Migadu-Queue-Id: 53F6E2093F X-Migadu-Scanner: mx10.migadu.com X-TUID: PaXO4DdWkVgq On Fri, 15 Dec 2023, at 12:55 PM, Ihor Radchenko wrote: > No, it is generally not safe. For a different reason. > > Let me illustrate with an example: > > ... > > Conclusion: It is unsafe to use `current-prefix-arg' value. We need to > pass this information some other way. > > The way I proposed is actually not any special for ID links. What I > meant it to let-bind `org-link-context-for-files' around the whole call > to `org-store-link-functions', so that the custom :store functions will > get access to the adjusted value of `org-link-context-for-files'. > Does this explanation make more sense? Thanks for the example and explanation. Yes that does make sense, mostly. I assume this would look like this in org-store-link: (let ((org-link-context-for-files (org-xor org-link-context-for-files (equal arg '(4)))) (...call store link functions...)) The meaning of `org-link-context-for-files' is then shifting from being "should file: links include search strings (and how much should be included when the region is active)" from "should any link that supports search strings include them (and how much should be included when the region is active)". Is it necessary to rename it to reflect this? (e.g. to `org-link-use-context' or similar). It's also then less clear what the role of `org-id-link-use-context' is and how it interacts with `org-link-context-for-files'. I had included `org-id-link-use-context' to give a way to opt out of the new behaviour (i.e. using the update discussed above, a search string is added if (and org-link-context-for-files org-id-link-use-context) ). But perhaps this is also unnecessarily complicated, and `org-id-link-use-context' could be removed again completely? > I will update the docstring of > `org-link-search' to explicitly specify that it is searching within the > accessible portion of the buffer and update the callers to account for > this. > https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=89164e605 > https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5c543cd9d > https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=cb71bde7c > https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=63ef7b924 > > But does your code do narrowing? I did not notice it. Not in the patch I sent, I added it later after you pointed this out. I'll send an updated patch next. Thanks, Rick