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

* Re: Strange hiccups when running in server
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Pohlack @ 2009-07-07  8:29 UTC (permalink / raw)
  To: emacs-orgmode

Sorry for the noise.

A local package globally modified outline-heading-end-regexp which broke
folding via outline-mode.

Cheers,
Martin

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

* Re: Strange hiccups when running in server (also: Folding stops working)
  2009-07-07  8:29 ` Martin Pohlack
@ 2009-07-29 12:34   ` Martin Pohlack
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Pohlack @ 2009-07-29 12:34 UTC (permalink / raw)
  To: emacs-orgmode

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

Martin Pohlack wrote:
> Sorry for the noise.
> 
> A local package globally modified outline-heading-end-regexp which broke
> folding via outline-mode.

It wasn't a local package after all: simple-wiki.el is to blame here.

It globally modifies "outline-regexp" and "outline-heading-end-regexp".

For those using simple-wiki.el, please find a patch attached (already
reported upstream).

Cheers,
Martin

PS.: This is probably the same problem as described in an earlier thread
called "Folding stops working".

[-- Attachment #2: buf_local.diff --]
[-- Type: text/x-patch, Size: 511 bytes --]

--- simple-wiki.el.orig	2009-07-29 10:53:26.706233000 +0200
+++ simple-wiki.el	2009-07-07 10:08:02.981394000 +0200
@@ -815,6 +817,8 @@
           (set (make-local-variable (car pair)) (cdr pair))))
 
       (unless (equal simple-wiki-outline-patterns 'none)
+        (make-local-variable 'outline-regexp)
+        (make-local-variable 'outline-heading-end-regexp)
         (setq outline-regexp (car simple-wiki-outline-patterns))
         (setq outline-heading-end-regexp (cdr simple-wiki-outline-patterns)))
 

[-- Attachment #3: 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).