unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Barry OReilly <gundaetiapo@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 15567@debbugs.gnu.org
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	[thread overview]
Message-ID: <CAFM41H0EoNLsGr7fPpOsk+c8Ke1dV70n8_o=5=N5LETOTwtOrQ@mail.gmail.com> (raw)
In-Reply-To: <jwvwqlmzl2d.fsf-monnier+emacsbugs@gnu.org>

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

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

[-- Attachment #2: Type: text/html, Size: 3388 bytes --]

  reply	other threads:[~2013-10-10 14:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-08 23:07 bug#15567: Point jumps around madly in XML file when undoing while auto-revert-mode updates buffer Barry OReilly
2013-10-09 12:29 ` Stefan Monnier
2013-10-10 14:14   ` Barry OReilly [this message]
2013-10-18 14:04     ` Barry OReilly
2021-08-20 15:28     ` Lars Ingebrigtsen
2021-09-17 16:01       ` Lars Ingebrigtsen

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.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CAFM41H0EoNLsGr7fPpOsk+c8Ke1dV70n8_o=5=N5LETOTwtOrQ@mail.gmail.com' \
    --to=gundaetiapo@gmail.com \
    --cc=15567@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).