Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8690907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:00:26+00:00 2026-06-13T00:00:26+00:00

I found this nifty little function for Org-mode: ;;; Move to next heading with

  • 0

I found this nifty little function for Org-mode:

;;; Move to next heading with dedicated buffer preview
(defun ded/org-show-next-heading-tidily ()
  "Show next entry, keeping other entries closed."
  (if (save-excursion (end-of-line) (outline-invisible-p))
      (progn (org-show-entry) (show-children))
    (outline-next-heading)
    (unless (and (bolp) (org-on-heading-p))
      (org-up-heading-safe)
      (hide-subtree)
      (error "Boundary reached"))
    (org-overview)
    (org-reveal t)
    (org-show-entry)
    (show-children)))

It moves from headline to headline, and shows its direct content and children.
I liked the idea, but would rather it would show in a dedicated buffer, using (org-tree-to-indirect-buffer).

I tried to do it like so:

(defun ded/org-show-next-heading-test ()
  "Show next entry, keeping other entries closed."
  (if (save-excursion (end-of-line) (outline-invisible-p))
      (progn (org-show-entry) (org-tree-to-indirect-buffer))
    (outline-next-heading)
    (unless (and (bolp) (org-on-heading-p))
      (org-up-heading-safe)
      (hide-subtree)
      (error "Boundary reached"))
    (org-overview)
    (org-reveal t)
    (org-tree-to-indirect-buffer)
    (show-children)))

But then I have to double press the key – once it shows the entry in a dedicated buffer and secondly it still shows the entry.
I tried to remove the progn function, but then it didn’t work entirely.

I’m not a lisp programmer, and I tried to play with it for an hour or so but to no avail, so I would love someone with some experience to help me sort this thing 🙂

Much obliged.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:00:27+00:00Added an answer on June 13, 2026 at 12:00 am

    I ended up making my own, simple functions to navigate more easily:

    (defun forward-and-preview ()
        "Go to same level next heading and show preview in dedicated buffer"
        (hide-subtree)
        (org-speed-move-safe (quote outline-next-visible-heading))
        (show-children)
        (org-tree-to-indirect-buffer)
        )
    (defun back-and-preview ()
        "Go to same level previous heading and show preview in dedicated buffer"
        (hide-subtree)
        (org-speed-move-safe (quote outline-previous-visible-heading))
        (show-children)
        (org-tree-to-indirect-buffer)
        )
    (defun up-back-and-preview ()
        "Go to previous level heading and show preview in dedicated buffer"
        (org-speed-move-safe (quote outline-up-heading))
        (org-tree-to-indirect-buffer)
        (hide-subtree)
        )
    (defun up-forward-and-preview ()
        "Go to previous level next heading and show preview in dedicated buffer"
        (org-speed-move-safe (quote outline-up-heading))
        (hide-subtree)
        (org-speed-move-safe (quote outline-next-visible-heading))
        (org-tree-to-indirect-buffer)
        )
    (defun inside-and-preview ()
        "Go to next level heading and show preview in dedicated buffer"
        (org-speed-move-safe (quote outline-next-visible-heading))
        (show-children)
        (org-tree-to-indirect-buffer)
        )
    (add-to-list 'org-speed-commands-user '("l" inside-and-preview))
    (add-to-list 'org-speed-commands-user '("j" forward-and-preview))
    (add-to-list 'org-speed-commands-user '("k" back-and-preview))
    (add-to-list 'org-speed-commands-user '("J" up-forward-and-preview))
    (add-to-list 'org-speed-commands-user '("K" up-back-and-preview))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just found out about this nifty little feature. I have a couple questions.
found this little code snippet that seems to do what i want, but im
I found this code on the internetz, it checks the current page url; function
I built this nifty little weather/clock app as a way of learning to work
I found a nifty RegEx function that I'm using (see below). The function outputs
I have this nifty little script that does a nice job of manipulating some
I found this nifty plugin that lets me create dashboard widgets from external files.
Found this script: function stopRKey(evt) { var evt = (evt) ? evt : ((event)
I found this nifty code snippet on several sites, allowing me to analyze the
I found this nifty way to check if a page really exists: $headers=@get_headers($imageurl); if(strpos($headers[0],'200')===false){

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.