emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alan Schmitt <alan.schmitt@polytechnique.org>
To: "emacs-orgmode" <emacs-orgmode@gnu.org>
Subject: storing a link to a task from an agenda view
Date: Sat, 21 Nov 2020 10:30:48 +0100	[thread overview]
Message-ID: <87h7pjgipj.fsf@m4x.org> (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 ` storing a link to a task from an agenda view 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: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=87h7pjgipj.fsf@m4x.org \
    --to=alan.schmitt@polytechnique.org \
    --cc=emacs-orgmode@gnu.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).