[Top][All Lists]

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

Re: Sudden jumping point in buffer. Probably a bug?

From: Stefan-W. Hahn
Subject: Re: Sudden jumping point in buffer. Probably a bug?
Date: Thu, 31 Dec 2015 14:04:18 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Mail von Stefan-W. Hahn, Tue, 24 Nov 2015 at 20:07:22 +0100:


> > >>I'm using emacs as 64 bit compiled on windows 7/64 and linux 64 bit. Since
> > >>quite a while I have the problem that, while typing, the cursor (point) is
> > >>sometimes suddenly jumping to another position in buffer.
> > >
> > >Does this happen in "emacs -Q"?  If not, look for a deviant timer or a
> I tried this and it doesn't happen. But this does not say anthing because it
> is not reproducible anyway.

after trying to catch the problem with debugging outputs at several
positions I think I have found the cause:

I wrapped post-command-hook first, but these hook functions seem
innocent. But I observed in *Message* an "auto save" message every time the
cursor was jumping. So I wrapped auto-save-hook which is set to
'(semanticdb-save-all-db-idle tramp-set-auto-save-file-modes) in my case.

With this I found that the cursor was jumping inside
semanticdb-save-all-db-idle. While investigating I found that the same
problem was already described in Bug#15045.

If this is again the place where the problem happens, then it is obvious why
it is not reproducible so easy.

Together with

commit 599ca626d760215b090012c69c749d391cfd6fbe
Author: Stefan Monnier <address@hidden>
Date:   Wed Mar 25 09:47:12 2015 -0400

    `save-excursion' does not save&restore the mark any more

it seems to have another side effects after the change of save-excursion

To test it I will try following change in semantic-throw-on-input:

diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el
index d8ba6f2..cf1327f 100644
--- a/lisp/cedet/semantic/fw.el
+++ b/lisp/cedet/semantic/fw.el
@@ -392,7 +392,7 @@ semantic-throw-on-input
                     ;; Timers might run during accept-process-output.
                     ;; If they redisplay, point must be where the user
                     ;; expects. (Bug#15045)
-                    (save-excursion
+                    (save-mark-and-excursion
                       (goto-char semantic--on-input-start-marker)
      (throw semantic-current-input-throw-symbol ,from)))

With kind regards,

Stefan-W. Hahn                          It is easy to make things.
                                        It is hard to make things simple.

reply via email to

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