bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#15567: Point jumps around madly in XML file when undoing while auto-


From: Barry OReilly
Subject: bug#15567: Point jumps around madly in XML file when undoing while auto-revert-mode updates buffer
Date: Thu, 10 Oct 2013 10:14:08 -0400

There may be two bugs here:

   1: That the rng-validate-while-idle timer calls input-pending-p
   when point is on an excursion, regardless of what the inner timer
   is. ie another instance of bug 15045.

   2: That there are more than one rng-validate-while-idle timers.

In order to more directly verify bug 2, I ran with this:

diff --git a/lisp/nxml/rng-valid.el b/lisp/nxml/rng-valid.el
index fb8bd03..9fb5a7b 100644
--- a/lisp/nxml/rng-valid.el
+++ b/lisp/nxml/rng-valid.el
@@ -137,6 +137,8 @@ A quick validation validates at most one chunk."
 
 ;; Global variables
 
+(defvar rng-validate-timers '())
+
 (defvar rng-validate-timer nil)
 (make-variable-buffer-local 'rng-validate-timer)
 ;; ensure that we can cancel the timer even after a kill-all-local-variables
@@ -389,6 +391,7 @@ The schema is set like `rng-auto-set-schema'."
       (cancel-timer rng-validate-quick-timer))
     (kill-local-variable 'rng-validate-quick-timer)))
 
+(require 'cl-lib)
 (defun rng-activate-timers ()
   (unless rng-validate-timer
     (let ((inhibit-quit t))
@@ -401,7 +404,8 @@ The schema is set like `rng-auto-set-schema'."
            (run-with-idle-timer rng-validate-quick-delay
                                 t
                                 'rng-validate-quick-while-idle
-                                (current-buffer))))))
+                                (current-buffer)))
+      (cl-pushnew rng-validate-timer rng-validate-timers))))
 
 (defun rng-validate-clear ()
   (rng-validate-mode 1 t))
@@ -433,6 +437,7 @@ The schema is set like `rng-auto-set-schema'."
 ;; validation process down.
 
 (defun rng-validate-while-idle (buffer)
+  (my-msg "DEBUG: size of rng-validate-timers: %s" (length rng-validate-timers))
   (when (buffer-live-p buffer)         ; bug#13999
     (with-current-buffer buffer
       (if rng-validate-mode

I also have message statements in mode hooks. Here's the output when I
reproduced the issue:

2013-10-10T10:00:11.404643 Inside my-text-mode-hook for buffer REDACTED_UnitTests_valgrind.xml
2013-10-10T10:00:11.404814 Inside my-nxml-mode-hook for buffer REDACTED_UnitTests_valgrind.xml
Mark set [2 times]
2013-10-10T10:00:15.717636 DEBUG: size of rng-validate-timers: 1
Mark set [3 times]
Using vacuous schema
2013-10-10T10:00:37.920625 DEBUG: size of rng-validate-timers: 2
2013-10-10T10:00:38.227798 Inside my-text-mode-hook for buffer REDACTED_UnitTests_valgrind.xml
2013-10-10T10:00:38.227983 Inside my-nxml-mode-hook for buffer REDACTED_UnitTests_valgrind.xml
user-error: No further undo information
2013-10-10T10:00:43.442746 DEBUG: size of rng-validate-timers: 2
Reverting buffer `REDACTED_UnitTests_valgrind.xml'.
2013-10-10T10:01:01.231729 DEBUG: size of rng-validate-timers: 3
Reverting buffer `REDACTED_UnitTests_valgrind.xml'.
2013-10-10T10:01:11.217973 DEBUG: size of rng-validate-timers: 4
Reverting buffer `REDACTED_UnitTests_valgrind.xml'.
Mark set
2013-10-10T10:01:20.598804 DEBUG: size of rng-validate-timers: 5
2013-10-10T10:01:20.602859 DEBUG: size of rng-validate-timers: 5


reply via email to

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