emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Strange hiccups when running in server
@ 2009-07-06 16:42 Martin Pohlack
  2009-07-07  8:29 ` Martin Pohlack
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Pohlack @ 2009-07-06 16:42 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2294 bytes --]

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

[-- Attachment #2: leaf-trace-bad.txt --]
[-- Type: text/plain, Size: 2322 bytes --]

  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\b\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\b\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\b\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\b\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()

[-- Attachment #3: leaf-trace-good.txt --]
[-- Type: text/plain, Size: 2166 bytes --]

  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\b\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\b\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\b\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\b\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)

[-- Attachment #4: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-07-29 12:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-06 16:42 Strange hiccups when running in server Martin Pohlack
2009-07-07  8:29 ` Martin Pohlack
2009-07-29 12:34   ` Strange hiccups when running in server (also: Folding stops working) Martin Pohlack

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).