TransWikia.com

How to call `org-sparse-tree` from Lisp?

Emacs Asked by user2567544 on September 2, 2021

While viewing org-mode files I am used to typing , - / t to produce a sparse tree of todo items.

I am trying, unsuccessfully, to write some Lisp to achieve the same thing.

Here’s the sort of thing I’m playing with, added to my init file:

  (defun my-sparse-todo ()
    (interactive)
    (org-sparse-tree nil "t"))

  (define-key evil-normal-state-map [f10] 'my-sparse-todo)

If I run this by hitting f10, I am prompted to enter the sparse tree type character.

What am I doing wrong please?

One Answer

Try

 (defun my-sparse-todo ()
    (interactive)
    (call-interactively 'org-show-todo-tree))

This is what org-sparse-tree does after you have selected t from the menu.

Answered by NickD on September 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP