From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qEShIfhTsF6oUQAA0tVLHw (envelope-from ) for ; Mon, 04 May 2020 17:42:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id QMKYMgJUsF6NNAAA1q6Kng (envelope-from ) for ; Mon, 04 May 2020 17:42:26 +0000 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:470:142::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 E717F94452C for ; Mon, 4 May 2020 17:42:23 +0000 (UTC) Received: from localhost ([::1]:34752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVf6l-0006fb-Dn for larch@yhetil.org; Mon, 04 May 2020 13:42:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVf64-0006OY-U4 for emacs-orgmode@gnu.org; Mon, 04 May 2020 13:41:40 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:35716) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jVf63-0006U2-Qy for emacs-orgmode@gnu.org; Mon, 04 May 2020 13:41:40 -0400 Received: by mail-wr1-x42e.google.com with SMTP id x18so129998wrq.2 for ; Mon, 04 May 2020 10:41:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=+hJZ4couBnzZ8n3rw5pxLMlwOmLraZ9jJ/9n5s/bHPg=; b=O3XMSr3MkqONvR6+uKNkFM0ogyEd4Mdnug0+6LncpU1GNPGKyat7OeuFfmIQNGBVEi A6BFoeohXwrgCZ8ThhmJrsX/GpU5VxrnPnSkDUe1eSYtT9pIIxvrOErr5m0rfkeG/KBZ 5mJcXLjK0o2EHpJfFzm/ZZtVJM0lcngPGSgNukCejZ0HAqYX09AiNR87pswLT2vrKW43 q3idNFYEb9XEiDtaBcDWNl8k8asR7guK1EUXYNdD2WjsvJmwtZqNXPM4lfHrbIx1F88G +E/Y6RDydlvpe059NGYPR+ZOCtda96i0fzBVHBvWF7mXVhqnaGDfxpg8RvytnuIQ2XdQ lDRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=+hJZ4couBnzZ8n3rw5pxLMlwOmLraZ9jJ/9n5s/bHPg=; b=GdRIqdVjDdmfAxfoSf5eMPSIT3zivXhrZZ3EoivrfOec0+PfF7wWNz6oKUjsRx0ZHf ZCagDBOYT7CbAaZjlBTjLO5PsHJT8o0Ou85AWwHwPk6ICbUP1SyBzQSbXA7mdyWXlkLM hgxEkOKUY5OM9J47wftw3trweSLCDi4j+SlHpLEh96ZT8OKcT3b+9tnYJxMEd+J8XBlF lM/FSrfcJjBeiTE1udCTgOZVBsw+7XXLwoQdIWHzx/XEqdpccZY0rRmpIz+ojihsphu8 KY3JmFwqgkuQ+GQe56t79lTIpNKyBZm6/WOSXHuCKF/BcdXwOnsDi7hQEChpvH8KE+A7 SU7A== X-Gm-Message-State: AGi0PuZQLqlLnrbaIkDmIpU9KIj6vd7ISeNxrNPc2w+6EALzC50oY0DW Zm5A8D9roBcK1pH6oZxzYj9UgHir6F0= X-Google-Smtp-Source: APiQypJr/MwSy+OaCoAtxeigKnYJfXnETWxCUBuSFRNP0FUGosbQSdd1FxdMJmmwfRWlhAyoTIXETw== X-Received: by 2002:a5d:49c7:: with SMTP id t7mr455039wrs.22.1588614097513; Mon, 04 May 2020 10:41:37 -0700 (PDT) Received: from debian ([2a01:e0a:21e:7710:94dd:94eb:c85f:2c7f]) by smtp.gmail.com with ESMTPSA id e5sm19459635wru.92.2020.05.04.10.41.36 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 May 2020 10:41:36 -0700 (PDT) From: Joseph Vidal-Rosset To: Ihor Radchenko Subject: Re: Inserting org-mode heading links the org-refile way References: <871ro0nv4u.fsf@localhost> <87r1w0rz6s.fsf@gmail.com> <87y2q8mawy.fsf@localhost> Date: Mon, 04 May 2020 19:41:36 +0200 In-Reply-To: <87y2q8mawy.fsf@localhost> (Ihor Radchenko's message of "Mon, 04 May 2020 15:11:57 +0800") Message-ID: <874ksv61in.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=joseph.vidal.rosset@gmail.com; helo=mail-wr1-x42e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001 autolearn=_AUTOLEARN 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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org, Daryl Manning Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 X-Spam-Score: 0.09 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=O3XMSr3M; 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 2001:470:142::17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scan-Result: default: False [0.09 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.49498252381344]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2001:470:142::/48:c]; R_DKIM_REJECT(1.00)[gmail.com:s=20161025]; DWL_DNSWL_BLOCKED(0.00)[2001:470:142::17:from]; FREEMAIL_FROM(0.00)[gmail.com]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.13), country: US(-0.00), ip: 2001:470:142::17(-0.49)]; DKIM_TRACE(0.00)[gmail.com:-]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:2001:470:142::/48, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; FROM_NEQ_ENVFROM(0.00)[josephvidalrosset@gmail.com,emacs-orgmode-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TAGGED_RCPT(0.00)[orgmode]; PREVIOUSLY_DELIVERED(0.00)[emacs-orgmode@gnu.org]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; DNSWL_BLOCKED(0.00)[2001:470:142::17:from]; FORGED_SENDER_MAILLIST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : SPF not aligned (relaxed),none] X-TUID: e8YiG4ssQwjs Le lun. 05/04/20 mai 2020 =C3=A0 03:11:57 , Ihor Radchen= ko a envoy=C3=A9 ce message: > Can you try the following simplified code? Hello, I confirm that the simplified code below does not break the code of my setup and that org-links for gnus work. Thanks !=20 > (defun org-id-prompt-id () > "Prompt for the id during completion of id: link." > (let ((org-refile-history nil) > (org-refile-cache nil) > (org-refile-target-verify-function nil)) > (let ((prompt-ans (org-refile-get-location "Select org entry"))) > (prog1 > (or (org-id-get (seq-find #'markerp > prompt-ans) > 'create) > (user-error "Cannot find ID of the entry: %s" prompt-ans)) > (setq org-id-history org-refile-history) > (setq org-id-cache org-refile-cache))))) > > (defun org-id-link-complete (&optional arg) > "Completion function for id: link." > (let* ((id (org-id-prompt-id))) > (format "id:%s" id))) > > (org-link-set-parameters "id" > :complete #'org-id-link-complete) > > P.S. You can use %^t instead of %(org-insert-time-stamp ...). > > From org-capture-templates docstring: >> %^t Like %t, but prompt for date. Similarly %^T, %^u, %^U. >> You may define a prompt like: %^{Please specify birthday}t. >> The default date is that of %t, see above. > > Best, > Ihor