From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iHXzNnoRhGHBxAAAgWs5BA (envelope-from ) for ; Thu, 04 Nov 2021 17:59:38 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id YHucMnoRhGFwYgAAB5/wlQ (envelope-from ) for ; Thu, 04 Nov 2021 16:59:38 +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 557B88B2D for ; Thu, 4 Nov 2021 17:59:38 +0100 (CET) Received: from localhost ([::1]:43498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mig5Q-0003Kt-UY for larch@yhetil.org; Thu, 04 Nov 2021 12:59:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mig4q-0003Jk-Sh for emacs-orgmode@gnu.org; Thu, 04 Nov 2021 12:59:00 -0400 Received: from ciao.gmane.io ([116.202.254.214]:58296) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mig4p-0000pb-6J for emacs-orgmode@gnu.org; Thu, 04 Nov 2021 12:59:00 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mig4l-000AbL-B5 for emacs-orgmode@gnu.org; Thu, 04 Nov 2021 17:58:55 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: org-store-link question Date: Thu, 4 Nov 2021 23:58:48 +0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 7 X-Spam_score: 0.7 X-Spam_bar: / X-Spam_report: (0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-2.093, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1636045178; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=WBtXdx4+RThGV+qIiFNx+X9xwDCdHKurRhzbaniW6E0=; b=kVzg48UM00K/+43pJjUYVidyt6r8nbLcmyLx8obMl5S2Smp/SpTzzMn0HHtqs5RPHHQYLT C7YoCn7Wi8bEmvJFRtQDgVmusSzM7RCN66ksBzFd8R9nKv2q74BQkiaISNF38eqo+QH99Q KYCATepQy+MHMRL1We2JRVAb4yv+tVTXSKgrzllH82B8rPi9yPdES1ZvxnsLnaxqkJHd/I GMQHKabg8VPq7bKPGmxR2FodpqxyNIcd7btjokF/7Ne3kIv7FMNAEyWhv1PlvPE1L58F1I dv9UnSgYTgGEyj3ZblUG70P7ulHr4vR7X98MAtgHrcQSD7Rx29CQtZRBFezD8g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636045178; a=rsa-sha256; cv=none; b=to3Ce6P99Dqan4AA25n0/WfUBVrl3Ohz+LsQfzZrW7Jqn3hoqYwuWX2P+ZbnZhnBMeXINe AvU5hmPfDWlObPCBc1WtjNadtGVT4UldZKNHHb1lJTZoKfIswidKSi2AIe+Ebh/Ed2RGIL VfAQz5IKwlcO3Nm0QUN+W6HU9EgXfCGW60QLRdkBpE4QdnccwxE2mTnsZGwtCu2h2x1u+Z Eh4sO4kXLL/RHwPMRYsB0TKSVnnd0u7eVbuLnuImGt3eUnYWQRb2SHvq1kHrtqo3D+Mhy/ WzKOSWps/W96u1evenETX+a2dpnyTc4laGdm3cqm2f37uaMoNlh7B3tVKHs81Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" 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: -0.32 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" 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: 557B88B2D X-Spam-Score: -0.32 X-Migadu-Scanner: scn0.migadu.com X-TUID: neO+iEZtdye7 On 04/11/2021 03:07, John Kitchin wrote: > In a basically vanilla emacs, if I have a target like <> with my > point on it, and I run org-store-link (via C-c l), and then somewhere > else do org-isnert-link (via C-c C-l) I get a link like > > [[file:~/s/f.org::test]] > > If I define a link now like this: > > #+BEGIN_SRC emacs-lisp > (org-link-set-parameters "jump" > :store (lambda () >  (org-link-store-props >   :type "jump" >   :link (format "jump:%s::%s" > (buffer-file-name) > (line-number-at-pos))))) > #+END_SRC > > and do that again, all I can insert with C-c C-l is something like: > > [[jump:~/s/f.org::9]] > > and the file link is not an option anymore. Should the file link still > be there? It seems `org-store-link' is designed to store a single link. You can make :store for "jump" links more selective by returning nil in some cases or to hit C-u C-u before `org-store-link' to bypass custom :store functions. P.S. There is a piece of code to store #CUSTOM_ID link in addition to search heading link, but the latter part is broken, so if #CUSTOM_ID is present, it is saved twice.