emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Help with "macro"
@ 2019-10-12 16:18 Nathan Neff
  2019-10-12 19:04 ` Nathan Neff
  2019-10-12 20:16 ` Adam Porter
  0 siblings, 2 replies; 3+ messages in thread
From: Nathan Neff @ 2019-10-12 16:18 UTC (permalink / raw)
  To: emacs-orgmode

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

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 <heading name>" or perhaps "agenda for <property "PROP" of
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

[-- Attachment #2: Type: text/html, Size: 2041 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-12 20:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-12 16:18 Help with "macro" Nathan Neff
2019-10-12 19:04 ` Nathan Neff
2019-10-12 20:16 ` Adam Porter

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).