emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Strange hiccups when running in server


From: Martin Pohlack
Subject: [Orgmode] Strange hiccups when running in server
Date: Mon, 06 Jul 2009 18:42:33 +0200
User-agent: Thunderbird 2.0.0.22 (X11/20090608)

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
  implement-debug-on-entry()
* (org-load-modules-maybe)
* (when (or force (not org-modules-loaded)) (mapc (lambda ... ...) org-modules) 
(setq org-modules-loaded t))
* #[(cond &rest body) "\302\303        BE\207" [cond body if progn] 4 
2151788]((or force (not org-modules-loaded)) (mapc (lambda (ext) 
(condition-case nil ... ...)) org-modules) (setq org-modules-loaded t))
* #[(cond &rest body) "\302\303        BE\207" [cond body if progn] 4 
2151788]((or force (not org-modules-loaded)) (mapc (lambda (ext) 
(condition-case nil ... ...)) org-modules) (setq org-modules-loaded t))
* (when (or force (not org-modules-loaded)) (mapc (lambda ... ...) org-modules) 
(setq org-modules-loaded t))
* org-load-modules-maybe()
* (unless (run-hook-with-args-until-success (quote org-tab-first-hook)) (let* 
(... ... ... ... ... ...) (if ... ...) (cond ... ... ... ... ... ... ... ... 
... ... ... ... ... ... ...)))
* #[(cond &rest body) "\302\303        BBB\207" [cond body if nil] 4 
2151976]((run-hook-with-args-until-success (quote org-tab-first-hook)) (let* 
((limit-level ...) (nstars ...) (outline-regexp ...) (bob-special ...) 
(org-cycle-hook ...) (pos ...)) (if (or bob-special ...) (setq arg t)) (cond 
(... ... ...) (... ... ...) (... ...) (...) (... ...) (... ...) (... ...) (... 
...) (buffer-read-only ...) (...) (...) (...) (... ...) (... ...) (t ...))))
* #[(cond &rest body) "\302\303        BBB\207" [cond body if nil] 4 
2151976]((run-hook-with-args-until-success (quote org-tab-first-hook)) (let* 
((limit-level ...) (nstars ...) (outline-regexp ...) (bob-special ...) 
(org-cycle-hook ...) (pos ...)) (if (or bob-special ...) (setq arg t)) (cond 
(... ... ...) (... ... ...) (... ...) (...) (... ...) (... ...) (... ...) (... 
...) (buffer-read-only ...) (...) (...) (...) (... ...) (... ...) (t ...))))
* (unless (run-hook-with-args-until-success (quote org-tab-first-hook)) (let* 
(... ... ... ... ... ...) (if ... ...) (cond ... ... ... ... ... ... ... ... 
... ... ... ... ... ... ...)))
* run-hooks(activate-menubar-hook)
* (normal-top-level)
* message("Back to top level.")
* message("Back to top level.")
* normal-top-level()
* run-hooks(activate-menubar-hook)
* (normal-top-level)
* message("Back to top level.")
* message("Back to top level.")
* normal-top-level()
* run-hooks(activate-menubar-hook)
* (normal-top-level)
* normal-top-level()
  implement-debug-on-entry()
* (org-load-modules-maybe)
* (when (or force (not org-modules-loaded)) (mapc (lambda ... ...) org-modules) 
(setq org-modules-loaded t))
* #[(cond &rest body) "\302\303        BE\207" [cond body if progn] 4 
2151788]((or force (not org-modules-loaded)) (mapc (lambda (ext) 
(condition-case nil ... ...)) org-modules) (setq org-modules-loaded t))
* #[(cond &rest body) "\302\303        BE\207" [cond body if progn] 4 
2151788]((or force (not org-modules-loaded)) (mapc (lambda (ext) 
(condition-case nil ... ...)) org-modules) (setq org-modules-loaded t))
* (when (or force (not org-modules-loaded)) (mapc (lambda ... ...) org-modules) 
(setq org-modules-loaded t))
* org-load-modules-maybe()
* (unless (run-hook-with-args-until-success (quote org-tab-first-hook)) (let* 
(... ... ... ... ... ...) (if ... ...) (cond ... ... ... ... ... ... ... ... 
... ... ... ... ... ... ...)))
* #[(cond &rest body) "\302\303        BBB\207" [cond body if nil] 4 
2151976]((run-hook-with-args-until-success (quote org-tab-first-hook)) (let* 
((limit-level ...) (nstars ...) (outline-regexp ...) (bob-special ...) 
(org-cycle-hook ...) (pos ...)) (if (or bob-special ...) (setq arg t)) (cond 
(... ... ...) (... ... ...) (... ...) (...) (... ...) (... ...) (... ...) (... 
...) (buffer-read-only ...) (...) (...) (...) (... ...) (... ...) (t ...))))
* #[(cond &rest body) "\302\303        BBB\207" [cond body if nil] 4 
2151976]((run-hook-with-args-until-success (quote org-tab-first-hook)) (let* 
((limit-level ...) (nstars ...) (outline-regexp ...) (bob-special ...) 
(org-cycle-hook ...) (pos ...)) (if (or bob-special ...) (setq arg t)) (cond 
(... ... ...) (... ... ...) (... ...) (...) (... ...) (... ...) (... ...) (... 
...) (buffer-read-only ...) (...) (...) (...) (... ...) (... ...) (t ...))))
* (unless (run-hook-with-args-until-success (quote org-tab-first-hook)) (let* 
(... ... ... ... ... ...) (if ... ...) (cond ... ... ... ... ... ... ... ... 
... ... ... ... ... ... ...)))
* run-hooks(post-command-hook)
* run-hooks(post-command-hook)
* normal-top-level()
* message("Back to top level.")
* message("Back to top level.")
* (normal-top-level)
* run-hooks(activate-menubar-hook)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]