emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nathan Neff <nathan.neff@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Help with "macro"
Date: Sat, 12 Oct 2019 15:04:56 -0400	[thread overview]
Message-ID: <CAC=HedBdh_Jz2zSfT_6ZsjnKAMW-db0+tv_qkdP=q4q=Mx17Cg@mail.gmail.com> (raw)
In-Reply-To: <CAC=HedBW4Qs7nNdmzhv1HY-bo2mn0Rd2s6y8N08cKNDB1MiLyg@mail.gmail.com>

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

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 <nathan.neff@gmail.com> 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 <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: 2643 bytes --]

  reply	other threads:[~2019-10-12 19:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-12 16:18 Help with "macro" Nathan Neff
2019-10-12 19:04 ` Nathan Neff [this message]
2019-10-12 20:16 ` Adam Porter

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  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='CAC=HedBdh_Jz2zSfT_6ZsjnKAMW-db0+tv_qkdP=q4q=Mx17Cg@mail.gmail.com' \
    --to=nathan.neff@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

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