Skip to main content
13 events
when toggle format what by license comment
Sep 12, 2017 at 1:12 comment added Melioratus @myotis - Thanks! What resolved issue? Did you upgrade to org v.9.0.9?
Sep 12, 2017 at 0:03 vote accept myotis
Sep 12, 2017 at 0:03 comment added myotis Thaks a lot for your efforts! It works great :)
Sep 11, 2017 at 23:56 comment added Melioratus @myotis - I understand your frustration. I updated my answer to force the cursor back into *Occur* buffer after the hook is run. Now when I run the answer, I navigate up and down with C-n and C-p and press return key. This does the following: 1. Pops cursor from occur buffer to heading in org buffer to the desired heading; 2. Collapses all the headings in the org buffer; 3. Expands only the current heading; 4. Pops back to occur buffer. This works with mouse clicks; M-g M-n and M-g M-p and using the arrow keys plus return. I'm guessing that upgrading to org v.9.0.9 will fix issue.
Sep 11, 2017 at 23:42 history edited Melioratus CC BY-SA 3.0
Code fix
Sep 11, 2017 at 23:06 comment added myotis Removing :results none writes out 20 lines with emacs commands, many of which are org commands. Yes, the return key moves the cursor to the other window, without opening the headline there. And then there is no point in the code, because I could just as well open the headlines directly in the file without making any occur window. I want the file to be collapsed to headlines only, and moving down the occur file headline will open the corresponding heading in the text file. While the other hading are collapsed.
Sep 11, 2017 at 22:52 comment added Melioratus @myotis - Thanks for the update. Removing :results none should only print a small one row table under #+RESULTS: which I'm guessing it did not do. Was an error displayed? Using the return key will move cursor to other window but it should also expand the heading. Did the heading stay collapsed? Did previously expanded headings stay expanded? We might need to move our troubleshooting into chat instead of comments but not sure how to do that? Any suggestions?
Sep 11, 2017 at 21:30 comment added myotis a) the arrow key approach does not help. The return key moves point from a heading in the occur window, to the corresponding heading ing the file. b) the removing of :results none does not help either, it writes out a lot of stuff under a #+RESULTS: heading, but navigating the occur file with arrow keys/return key or C-n/C-p does not automatically open the header i the file, when the corresponding header in the occur buffer is navigatet to.
Sep 11, 2017 at 1:13 comment added Melioratus @myotis - My guess is you did everything perfectly! Try this: after executing first code block and opening occur, use arrow keys and return key to navigate in occur instead of C-n and C-p. If this works than our key bindings may be different. If it doesn't then please remove the :results none header from block so any execution errors will be displayed and execute the first code block again. Does this help?
Sep 10, 2017 at 23:08 comment added myotis Hi @Melioratus. Now I have tested your code and I am not able to make it work. I have turned your code on, turned on occur, and got a second window with the occur buffer. But when navigating the headlines in the new buffer, down (C-n) or up (C-p), nothing happens, no headlines are opened, none are collapsed. What have I done wrong? I am using Emacs 25.0.93.1 and Org mode version 9.0.1
Sep 9, 2017 at 0:06 comment added Melioratus @myotis my pleasure! Please let me know if you have any problems. I'm going to add the code to my init file because it's a nice feature when you have long org files.
Sep 8, 2017 at 22:31 comment added myotis Thanks for your work! I will test your code as soon as possible.
Sep 8, 2017 at 1:32 history answered Melioratus CC BY-SA 3.0