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 wI8gHD75uV/tHgAA0tVLHw (envelope-from ) for ; Sun, 22 Nov 2020 05:38:06 +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 OF49GD75uV9mfwAA1q6Kng (envelope-from ) for ; Sun, 22 Nov 2020 05:38:06 +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 F36C79402DD for ; Sun, 22 Nov 2020 05:38:05 +0000 (UTC) Received: from localhost ([::1]:52668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kgi4a-0006jm-Ll for larch@yhetil.org; Sun, 22 Nov 2020 00:38:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgi4C-0006iy-1n for emacs-orgmode@gnu.org; Sun, 22 Nov 2020 00:37:40 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:39439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kgi4A-0003Gg-HT for emacs-orgmode@gnu.org; Sun, 22 Nov 2020 00:37:39 -0500 Received: by mail-pl1-x634.google.com with SMTP id k5so710148plt.6 for ; Sat, 21 Nov 2020 21:37:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=c9fhd6zqELgwdvhjXJLZVUHYST7MjL6oX8ErRjJ+mnk=; b=c7q/GSkMUPvmtE3OHy+BS1ODOr5OqwFuCTY3JpS8fwkWIwnjC5uEbyIM5Vfj47Elt6 4jkd+aVtIcivPi8BHVjADbPnwOkQ6vMiPDkTaMNNVR6Mpxi7J8Qt3IxgQ1BZ/qXt/6T9 6WYwP72tcCdC0iaC52nxtUGJRAOGWezCySNzMKlLanUM6xcig/FZjnpH27DVESWvuCFm nkHeTbx0Hxgve5RhGow0ecIVmtROO6w7rywd3Ea1yODF/Htj/oHmZfm1dFWZnDCqkFWn CSRApZ6nFe/MBdfMdWLrcD73iSLf9qax3dX/YlG5ihdFeiSYe/4aMpDL1T5+jDhd7ESY 50yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=c9fhd6zqELgwdvhjXJLZVUHYST7MjL6oX8ErRjJ+mnk=; b=XrloyJco0LCcek5B4wXrkh/UuQLKuoqYmvjKPrca2Y4JZsufqC6ogU3lW6SYlyEC2M IwoIDqjlbcHdfqvaK1ezVidwTiQ9fl/G7h8Dcaf9A0oNg8+HvbcMWAbmkaszUSO/waes DuGxISW/EhHW53+1X1QTz/J3BwMibIGpHci3NdvmKHLW8GA4gzuO2z3kv3cEUyw9L6Ti xMeXj6DwSWbrkPjnYwjapdsQiuu+faowsS7X9YNUwr7GNQMZHaMyR44AgFsTfjh7HA/t jaOKM974gBviN43WjnOr9AbJSsgixt63TSP/yaaNq2p3MKbao2A9oAVUv0xiTEpE+TK0 YqcA== X-Gm-Message-State: AOAM531HCJYH0i0pUns/zNpejS42dxUmR3o2sOVxNTFv0fnfaq674sFi k5kv7fLp1ZHcbCp97E88C1Spobj3fPY= X-Google-Smtp-Source: ABdhPJyTuLteC4kkpbu+rDx4T0EVPCdJzzhEjjVdI4T1Z76xrIou8n6KXnLyYYoZvqMBRReWvewGYA== X-Received: by 2002:a17:902:b28a:b029:d5:f36b:44af with SMTP id u10-20020a170902b28ab02900d5f36b44afmr18661612plr.51.1606023455800; Sat, 21 Nov 2020 21:37:35 -0800 (PST) Received: from localhost ([104.151.51.115]) by smtp.gmail.com with ESMTPSA id q2sm7002398pgp.77.2020.11.21.21.37.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Nov 2020 21:37:34 -0800 (PST) From: Ihor Radchenko To: Alan Schmitt , emacs-orgmode Subject: Re: storing a link to a task from an agenda view In-Reply-To: <87h7pjgipj.fsf@m4x.org> References: <87h7pjgipj.fsf@m4x.org> Date: Sun, 22 Nov 2020 13:36:28 +0800 Message-ID: <87d006eyw3.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=yantar92@gmail.com; helo=mail-pl1-x634.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=c7q/GSkM; dmarc=pass (policy=none) header.from=gmail.com; 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-Spam-Score: -1.21 X-TUID: r2cGZqZQ5oKC > 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. (org-store-link nil) -> (org-store-link nil 'interactive) Or you can just save the return value of (org-store-link nil) Best, Ihor Alan Schmitt writes: > Hello, > > I'm trying to store a link to a task while the cursor is on it in the > agenda view. I=C2=A0tried ~org-store-link~ on it, but it tells me there i= s 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 () > (interactive) > (let* ((marker (or (org-get-at-bol 'org-marker) > (org-agenda-error))) > (buffer (marker-buffer marker)) > (pos (marker-position marker))) > (with-current-buffer buffer > (save-excursion > (goto-char pos) > (org-store-link nil) > )))) > #+end_src > > 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. > > Thanks, > > Alan