[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Inserting org-mode heading links the org-refile way
From: |
Joseph Vidal-Rosset |
Subject: |
Re: Inserting org-mode heading links the org-refile way |
Date: |
Mon, 04 May 2020 19:41:36 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Le lun. 05/04/20 mai 2020 à 03:11:57 , Ihor Radchenko
<address@hidden> a envoyé 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 !
> (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