From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Neff Subject: Re: Help with "macro" Date: Sat, 12 Oct 2019 15:04:56 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001ee9e20594bb506b" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:48095) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJMhS-0000OL-40 for emacs-orgmode@gnu.org; Sat, 12 Oct 2019 15:05:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJMhQ-00057m-P9 for emacs-orgmode@gnu.org; Sat, 12 Oct 2019 15:05:10 -0400 Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]:45887) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iJMhQ-00056P-KG for emacs-orgmode@gnu.org; Sat, 12 Oct 2019 15:05:08 -0400 Received: by mail-io1-xd36.google.com with SMTP id c25so28389895iot.12 for ; Sat, 12 Oct 2019 12:05:08 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode --0000000000001ee9e20594bb506b Content-Type: text/plain; charset="UTF-8" I'm getting there - I found (org-element-property :PROJ (org-element-at-point)) from a regular org-mode file - now I just need to jump there from the agenda. On Sat, Oct 12, 2019 at 12:18 PM Nathan Neff wrote: > I'm trying to implement a function to display the TODO items of the > currently highlighted > item in the agenda and have a few questions: > > Goal: > > 1) From the agenda, place the cursor on a heading. > 2) Press a key and instantly narrow the agenda to the heading which the > cursor is on. > 3) Display org-todo-list for the "narrowed" item in a new buffer, with the > name "agenda for " or perhaps "agenda for the narrowed item" > 4) Keep the existing original agenda view (using sticky or some other > tactic). > > Here's what I have so far: > (defun njn-show-tasks-for-project() > (interactive) > ;; (setq preval org-agenda-sticky) > ;; (message "preval is: ") > (call-interactively 'org-agenda-set-restriction-lock-from-agenda) > ;; (org-toggle-sticky-agenda 't) > (setq org-agenda-buffer-name "JarJarBarBar") > (call-interactively 'org-todo-list) > ;; (org-toggle-sticky-agenda preval) > ) > > This works, but my original agenda view is updated to be restricted. > I've been tinkering with the "sticky" view for the agenda. Also, I would > like to set the name of the new buffer to either the heading which my > cursor > is on in the agenda, or perhaps a property of the heading which my cursor > is > on in the agenda. > > As you can see, I tried to set a "preval" variable to the current > stickiness of the agenda > and then reset the value after calling org-todo-list, but this has not > worked out for me so far. > > Any ideas? > > Thanks, > --Nate > --0000000000001ee9e20594bb506b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm getting there - I found

(or= g-element-property :PROJ (org-element-at-point)) from a regular org-mode fi= le -
now I just need to jump there from the agenda.
On Sat, = Oct 12, 2019 at 12:18 PM Nathan Neff <nathan.neff@gmail.com> wrote:
I'm trying to implement a= function to display the TODO items of the currently highlighted
item i= n the agenda and have a few questions:

Goal:
=

1) From the agenda, place the cursor on a heading. =C2= =A0
2) Press a key and instantly narrow the agenda to the heading= which the cursor is on. =C2=A0=C2=A0
3) Display org-todo-list fo= r the "narrowed" item in a new buffer, with the name "agenda= for <heading name>" or perhaps "agenda for <property &q= uot;PROP" of the narrowed item"
4) Keep the existing or= iginal agenda view (using sticky or some other tactic).

Here's what I have so far:
(defun njn-show-ta= sks-for-project()
=C2=A0 =C2=A0(interactive)
=C2=A0 =C2= =A0;; (setq preval org-agenda-sticky)
=C2=A0 =C2=A0;; (message &q= uot;preval is: ")
=C2=A0 =C2=A0(call-interactively 'org-= agenda-set-restriction-lock-from-agenda)
=C2=A0 =C2=A0;; (org-tog= gle-sticky-agenda 't)
=C2=A0 =C2=A0(setq org-agenda-buffer-na= me "JarJarBarBar")
=C2=A0 =C2=A0(call-interactively = 9;org-todo-list)
=C2=A0 =C2=A0;; (org-toggle-sticky-agenda preval= )
)

This works, but my origi= nal agenda view is updated to be restricted.=C2=A0
=C2=A0I've= been tinkering with the "sticky" view for the agenda.=C2=A0 Also= , I would
like to set the name of the new buffer to either the he= ading which my cursor
is on in the agenda, or perhaps a property = of the heading which my cursor is
on in the agenda.
As you can see, I tried to set a "preval" variable to= the current stickiness of the agenda
and then reset the value af= ter calling org-todo-list, but this has not worked out for me so far.
=

Any ideas?

Thanks,
-= -Nate
--0000000000001ee9e20594bb506b--