Hi all, I often edit org-mode files in my emacs server. After some time, org-mode behaves strangely and can only be brought back to normal by rebooting the emacs server. The symptom is that tree folding does not work anymore. Everything is expanded (also when loading new org files) and hitting tab, C-tab etc. on items results in no action but the message “FOLDED” in the minibuffer. I tried to debug this but didn't get too far. I'm using the following wrapper for (debug …) in order to capture all the leaf-nodes of the backtraces when single stepping with ‘d’: ---------------------------------------------------------------------- (defun debug-with-leaf-trace (&rest debugger-args) "Wrapper for debug which generates a backtrace for each step and captures the current leave node in the backtrace into a continous trace in another buffer." (interactive) (with-output-to-temp-buffer "_backtraces" (backtrace)) (save-excursion (set-buffer "_backtraces") (setq err1 (goto-line 4)) (setq start (point)) (setq err2 (beginning-of-line 2)) (setq end (point)) (if (and (eq err1 0) (eq err2 nil)) ; this does not really append sometimes but inserts somewhere ; in the middle ? (append-to-buffer "_backtraces2" start end) (debug-print "XXX\n")) (debug debugger-args))) ---------------------------------------------------------------------- I traced org-cycle with above's debug wrapper active on the following file: --debug_tab.org------------------------------------------------------- * a b ---------------------------------------------------------------------- By evaling this: (debug-on-entry 'org-cycle) (setq debugger 'debug-with-leaf-trace) then M-x show-all in the debug_tab.org buffer to trace the closing of a tree part. I single stepped through the first part but the diverse hooks took forever to step through, so I hit ‘c’ several times later on in the trace. After a first glance, the traces do not show a significant difference in the first part. I'm quiet sure, that debugging somehow interferes with the later part. Anyway, please find the traces attached. I'm not sure if this is a sensible approach to debugging this problem. How would you go about this? Cheers, Martin Pohlack