From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Neff Subject: Help with "macro" Date: Sat, 12 Oct 2019 12:18:03 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000004258a20594b8fbdf" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:57850) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJK5x-0003aK-AZ for emacs-orgmode@gnu.org; Sat, 12 Oct 2019 12:18:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJK5w-00053A-3J for emacs-orgmode@gnu.org; Sat, 12 Oct 2019 12:18:17 -0400 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]:35073) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iJK5v-000528-SV for emacs-orgmode@gnu.org; Sat, 12 Oct 2019 12:18:16 -0400 Received: by mail-io1-xd35.google.com with SMTP id q10so28038677iop.2 for ; Sat, 12 Oct 2019 09:18:15 -0700 (PDT) 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 --0000000000004258a20594b8fbdf Content-Type: text/plain; charset="UTF-8" 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
I'm trying to implem= ent a function to display the TODO items of the currently highlighted
i= tem in the agenda and have a few questions:

Goal:<= /div>

1) From the agenda, place the cursor on a heading.= =C2=A0
2) Press a key and instantly narrow the agenda to the hea= ding which the cursor is on. =C2=A0=C2=A0
3) Display org-todo-lis= t for the "narrowed" item in a new buffer, with the name "ag= enda for <heading name>" or perhaps "agenda for <propert= y "PROP" of the narrowed item"
4) Keep the existin= g original agenda view (using sticky or some other tactic).

<= /div>
Here's what I have so far:
(defun njn-sho= w-tasks-for-project()
=C2=A0 =C2=A0(interactive)
=C2=A0= =C2=A0;; (setq preval org-agenda-sticky)
=C2=A0 =C2=A0;; (messag= e "preval is: ")
=C2=A0 =C2=A0(call-interactively '= org-agenda-set-restriction-lock-from-agenda)
=C2=A0 =C2=A0;; (org= -toggle-sticky-agenda 't)
=C2=A0 =C2=A0(setq org-agenda-buffe= r-name "JarJarBarBar")
=C2=A0 =C2=A0(call-interactively= 'org-todo-list)
=C2=A0 =C2=A0;; (org-toggle-sticky-agenda pr= eval)
)

This works, but my o= riginal agenda view is updated to be restricted.=C2=A0
=C2=A0I= 9;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 th= e heading which my cursor
is on in the agenda, or perhaps a prope= rty of the heading which my cursor is
on in the agenda.

As you can see, I tried to set a "preval" variabl= e to the current stickiness of the agenda
and then reset the valu= e after calling org-todo-list, but this has not worked out for me so far.

Any ideas?

Thanks,
--Nate
--0000000000004258a20594b8fbdf--