emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Martin Pohlack <mp26@os.inf.tu-dresden.de>
To: emacs-orgmode@gnu.org
Subject: Strange hiccups when running in server
Date: Mon, 06 Jul 2009 18:42:33 +0200	[thread overview]
Message-ID: <4A522979.2090805@os.inf.tu-dresden.de> (raw)

[-- 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

             reply	other threads:[~2009-07-06 16:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-06 16:42 Martin Pohlack [this message]
2009-07-07  8:29 ` Martin Pohlack
2009-07-29 12:34   ` Strange hiccups when running in server (also: Folding stops working) Martin Pohlack

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A522979.2090805@os.inf.tu-dresden.de \
    --to=mp26@os.inf.tu-dresden.de \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: Strange hiccups when running in server' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this 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).