Org-mode mailing list
 help / color / mirror / Atom feed
From: Alan Schmitt <>
To: "emacs-orgmode" <>
Subject: storing a link to a task from an agenda view
Date: Sat, 21 Nov 2020 10:30:48 +0100
Message-ID: <> (raw)

[-- Attachment #1: Type: text/plain, Size: 1015 bytes --]


I'm trying to store a link to a task while the cursor is on it in the
agenda view. I tried ~org-store-link~ on it, but it tells me there is no
method to do so. So I looked at some of the org-agenda code to find a
way to get to the underlying task, and I tried this:

#+begin_src emacs-lisp
(defun as/mk-agenda-link ()
  (let* ((marker (or (org-get-at-bol 'org-marker)
         (buffer (marker-buffer marker))
         (pos (marker-position marker)))
    (with-current-buffer buffer
        (goto-char pos)
        (org-store-link nil)

but it does not store anything. (I have to put the ~nil~ at the
~org-store-link~ code otherwise I have an error, and looking at some of
the ~org-capture~ code, I saw it there.)

Do you have suggestions on how to store such a link from an agenda view?
It can either end up in ~org-stored-links~ or captured in a variable.



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 528 bytes --]

             reply	other threads:[~2020-11-21  9:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-21  9:30 Alan Schmitt [this message]
2020-11-22  5:36 ` Ihor Radchenko
2020-11-22 11:07   ` Alan Schmitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ \
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:

AGPL code for this site: git clone