unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Sudden jumping point in buffer. Probably a bug?
@ 2015-11-18 18:35 Stefan-W. Hahn
  2015-11-18 18:38 ` Stefan-W. Hahn
  2015-11-18 18:49 ` Eli Zaretskii
  0 siblings, 2 replies; 14+ messages in thread
From: Stefan-W. Hahn @ 2015-11-18 18:35 UTC (permalink / raw)
  To: emacs-devel

Hello,

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.

First I thought I have touched the touchpad of my laptop. But this also
happened without touchpad on normal keyboard.

I also thought first it just happens on windows. But I saw it a few times on
linux too.

I'm not sure but perhaps it also happens not just in C++ but also in
Org-mode.

My guess that it has something to do with fontifying (semantic?). With this
I have gone through the commits of emacs and saw that at May 4 2015 there
was a change with save-excursion and a new function save-mark-and excursion;
but I haven't seen a bug in implementation at first sight.

Alas I don't know the version of my (older) emacs which haven't had this problem.
(Because of this I now compile the git commit signature into the flags like:

./configure --with-x ...  CFLAGS="-g3 -O3" GIT_VERSION="$(git describe)"

With this I have tha signature available in system-configuration-options.)

I even don't have a clue how to produce this. So for the moment I'm doing
ghost bug hunting... :-(

Anybody else having this problem?
Any hint how to dig into the problem? (view-lossage does not show any
unusual)


With kind regards,
Stefan


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



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

* Re: Sudden jumping point in buffer. Probably a bug?
  2015-11-18 18:35 Sudden jumping point in buffer. Probably a bug? Stefan-W. Hahn
@ 2015-11-18 18:38 ` Stefan-W. Hahn
  2015-11-18 18:49 ` Eli Zaretskii
  1 sibling, 0 replies; 14+ messages in thread
From: Stefan-W. Hahn @ 2015-11-18 18:38 UTC (permalink / raw)
  To: emacs-devel

Mail von Stefan-W. Hahn, Wed, 18 Nov 2015 at 19:35:55 +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.

Sorry, forgot to mention current versio I'm using is:

commit 1d378c0b9b105ffe6710411ef01b6a9b8cc2a21d
Author: Glenn Morris <rgm@gnu.org>
Date:   Sun Oct 18 06:23:59 2015 -0400

    ; Auto-commit of ChangeLog files.

Stefan

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



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

* Re: Sudden jumping point in buffer. Probably a bug?
  2015-11-18 18:35 Sudden jumping point in buffer. Probably a bug? Stefan-W. Hahn
  2015-11-18 18:38 ` Stefan-W. Hahn
@ 2015-11-18 18:49 ` Eli Zaretskii
  2015-11-18 18:57   ` Dmitry Gutov
  2015-11-18 19:31   ` Stefan-W. Hahn
  1 sibling, 2 replies; 14+ messages in thread
From: Eli Zaretskii @ 2015-11-18 18:49 UTC (permalink / raw)
  To: Stefan-W. Hahn; +Cc: emacs-devel

> Date: Wed, 18 Nov 2015 19:35:55 +0100
> From: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
> 
> 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
post-command-hook set up by some of your customizations and optional
features you load.



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

* Re: Sudden jumping point in buffer. Probably a bug?
  2015-11-18 18:49 ` Eli Zaretskii
@ 2015-11-18 18:57   ` Dmitry Gutov
  2015-11-18 19:01     ` Dmitry Gutov
                       ` (2 more replies)
  2015-11-18 19:31   ` Stefan-W. Hahn
  1 sibling, 3 replies; 14+ messages in thread
From: Dmitry Gutov @ 2015-11-18 18:57 UTC (permalink / raw)
  To: Eli Zaretskii, Stefan-W. Hahn; +Cc: emacs-devel

On 11/18/2015 08:49 PM, Eli Zaretskii wrote:

>> 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
> post-command-hook set up by some of your customizations and optional
> features you load.

I think it's already been mentioned here: 
http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01655.html



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

* Re: Sudden jumping point in buffer. Probably a bug?
  2015-11-18 18:57   ` Dmitry Gutov
@ 2015-11-18 19:01     ` Dmitry Gutov
  2015-11-19 10:18     ` Phillip Lord
  2015-11-24 19:07     ` Stefan-W. Hahn
  2 siblings, 0 replies; 14+ messages in thread
From: Dmitry Gutov @ 2015-11-18 19:01 UTC (permalink / raw)
  To: Eli Zaretskii, Stefan-W. Hahn; +Cc: emacs-devel

On 11/18/2015 08:57 PM, Dmitry Gutov wrote:

> I think it's already been mentioned here:
> http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01655.html

Or not. Sorry. The present thread's OP mentions jumping which happens 
without user interaction.



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

* Re: Sudden jumping point in buffer. Probably a bug?
  2015-11-18 18:49 ` Eli Zaretskii
  2015-11-18 18:57   ` Dmitry Gutov
@ 2015-11-18 19:31   ` Stefan-W. Hahn
  1 sibling, 0 replies; 14+ messages in thread
From: Stefan-W. Hahn @ 2015-11-18 19:31 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Mail von Eli Zaretskii, Wed, 18 Nov 2015 at 20:49:34 +0200:

> > Date: Wed, 18 Nov 2015 19:35:55 +0100
> > From: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
> > 
> > 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
> post-command-hook set up by some of your customizations and optional
> features you load.

Not yet, but I will try to do some tests at next weekend. (At
company I'm lost without my customizations. :-))


Stefan

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



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

* Re: Sudden jumping point in buffer. Probably a bug?
  2015-11-18 18:57   ` Dmitry Gutov
  2015-11-18 19:01     ` Dmitry Gutov
@ 2015-11-19 10:18     ` Phillip Lord
  2015-11-24 19:07     ` Stefan-W. Hahn
  2 siblings, 0 replies; 14+ messages in thread
From: Phillip Lord @ 2015-11-19 10:18 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Eli Zaretskii, Stefan-W. Hahn, emacs-devel

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 11/18/2015 08:49 PM, Eli Zaretskii wrote:
>
>>> 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
>> post-command-hook set up by some of your customizations and optional
>> features you load.
>
> I think it's already been mentioned here:
> http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01655.html


I don't know if this issue is related or not. It's not caused by my
patch.

I have also noticed some fairly random jumping of point. I make
extensive use of post-command-hooks, so I assumed it was my code that
caused the breakage but if other people are having the same problem,
maybe not.

Phil



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

* Re: Sudden jumping point in buffer. Probably a bug?
  2015-11-18 18:57   ` Dmitry Gutov
  2015-11-18 19:01     ` Dmitry Gutov
  2015-11-19 10:18     ` Phillip Lord
@ 2015-11-24 19:07     ` Stefan-W. Hahn
  2015-12-31 13:04       ` Stefan-W. Hahn
  2 siblings, 1 reply; 14+ messages in thread
From: Stefan-W. Hahn @ 2015-11-24 19:07 UTC (permalink / raw)
  To: Dmitry Gutov, Eli Zaretskii; +Cc: emacs-devel

Mail von Dmitry Gutov, Wed, 18 Nov 2015 at 20:57:04 +0200:
> On 11/18/2015 08:49 PM, Eli Zaretskii wrote:

Hello,

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

> >post-command-hook set up by some of your customizations and optional
> >features you load.

In a C++ buffer post-command-hook has:

(global-font-lock-mode-check-buffers global-company-mode-check-buffers
global-hi-lock-mode-check-buffers winner-save-old-configurations
eldoc-schedule-timer mode-local-post-major-mode-change)

timer-list has:
Its value is ([nil 22100 46194 814488 3 quick-transfer-check-dired
      ("/home/hs/transfer/" 3)
      nil 945000]
 [nil 22100 46196 580496 nil undo-auto--boundary-timer nil nil 660000]
 [nil 22100 46207 130220 300 savehist-autosave nil nil 194000]
 [nil 22100 46240 0 60 display-time-event-handler nil nil 0])

(quick-transfer-check-dired self written to check a directory for new
content. This my colleague isn't running, s.b.)

timer-idle-list has:
([t 0 0 50000 t jit-lock-deferred-fontify nil idle 0]
 [t 0 0 100000 t mouse-avoidance-fancy nil idle 0]
 [t 0 0 125000 t show-paren-function nil idle 0]
 [nil 0 0 500000 nil
      #[0 "\b\204\x0f\0	\205\x11\0\n\303>?\205\x11\0\304 \207"
          [eldoc-mode global-eldoc-mode eldoc-documentation-function
                      (nil ignore)
                      eldoc-print-current-symbol-info]
          2]
      nil idle 0]
 [nil 0 0 500000 t which-func-update nil idle 0]
 [nil 0 0 500000 t jit-lock-context-fontify nil idle 0]
 [nil 0 0 500000 0.5 blink-cursor-start nil idle 0]
 [nil 0 1 0 t semantic-idle-scheduler-function nil idle 0]
 [nil 0 5 0 t jit-lock-stealth-fontify nil idle 0]
 [nil 0 10 560 nil jit-lock-stealth-fontify
      (t)
      idle 723000]
 [nil 0 60 0 t semantic-idle-scheduler-work-function nil idle 0])


> I think it's already been mentioned here:
> http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01655.html

Tried this patch. But I think I have seen it one time with this patch.

A Colleague mentioned that if he scrolls a (C++ containing) buffer to bottom
with pressing C-n (<down>) continously he saw the cursor jumping to
beginning of the buffer. But this also is not reproducible.

My guess it has to do with fontifying, perhaps jit-lock or semantic.


With kind regards,
Stefan

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



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

* Re: Sudden jumping point in buffer. Probably a bug?
  2015-11-24 19:07     ` Stefan-W. Hahn
@ 2015-12-31 13:04       ` Stefan-W. Hahn
  2015-12-31 13:18         ` Stefan-W. Hahn
  2016-01-01 20:02         ` Stefan-W. Hahn
  0 siblings, 2 replies; 14+ messages in thread
From: Stefan-W. Hahn @ 2015-12-31 13:04 UTC (permalink / raw)
  To: Dmitry Gutov, Eli Zaretskii; +Cc: emacs-devel

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

Hello,

> > >>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 <monnier@iro.umontreal.ca>
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
behaviour.

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)
                       (accept-process-output)))))
      (throw semantic-current-input-throw-symbol ,from)))

With kind regards,
Stefan

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



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

* Re: Sudden jumping point in buffer. Probably a bug?
  2015-12-31 13:04       ` Stefan-W. Hahn
@ 2015-12-31 13:18         ` Stefan-W. Hahn
  2016-01-02  9:14           ` Stefan-W. Hahn
  2016-01-01 20:02         ` Stefan-W. Hahn
  1 sibling, 1 reply; 14+ messages in thread
From: Stefan-W. Hahn @ 2015-12-31 13:18 UTC (permalink / raw)
  To: Dmitry Gutov, Eli Zaretskii; +Cc: emacs-devel

Mail von Stefan-W. Hahn, Thu, 31 Dec 2015 at 14:04:18 +0100:
> Mail von Stefan-W. Hahn, Tue, 24 Nov 2015 at 20:07:22 +0100:

Hello,

> 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)
>                        (accept-process-output)))))
>       (throw semantic-current-input-throw-symbol ,from)))

happened again with this patch.

With kind regards,
Stefan

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



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

* Re: Sudden jumping point in buffer. Probably a bug?
  2015-12-31 13:04       ` Stefan-W. Hahn
  2015-12-31 13:18         ` Stefan-W. Hahn
@ 2016-01-01 20:02         ` Stefan-W. Hahn
  2016-01-01 20:32           ` Eli Zaretskii
  2016-01-01 22:27           ` David Engster
  1 sibling, 2 replies; 14+ messages in thread
From: Stefan-W. Hahn @ 2016-01-01 20:02 UTC (permalink / raw)
  To: Dmitry Gutov, Eli Zaretskii; +Cc: emacs-devel

Mail von Stefan-W. Hahn, Thu, 31 Dec 2015 at 14:04:18 +0100:
> Mail von Stefan-W. Hahn, Tue, 24 Nov 2015 at 20:07:22 +0100:

Hello,

I filed a bug with further investigations, but got no response, the Bug
Tracker Server seems to be down.

I found a workaround which seems to work, but the reason is not clear:

diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el
index e4ac56c..3dd9bcd 100644
--- a/lisp/cedet/semantic/db.el
+++ b/lisp/cedet/semantic/db.el
@@ -724,12 +724,13 @@ semanticdb-save-all-db-idle
 Exit the save between databases if there is user input."
   (semantic-safe "Auto-DB Save: %S"
     ;; FIXME: Use `while-no-input'?
-    (semantic-exit-on-input 'semanticdb-idle-save
-      (mapc (lambda (db)
-             (semantic-throw-on-input 'semanticdb-idle-save)
-             (semanticdb-save-db db t))
-           semanticdb-database-list))
-    ))
+    (save-excursion
+      (semantic-exit-on-input 'semanticdb-idle-save
+        (mapc (lambda (db)
+                (semantic-throw-on-input 'semanticdb-idle-save)
+                (semanticdb-save-db db t))
+              semanticdb-database-list))
+      )))
 
 ;;; Directory Project support
 ;;


With kind regards,
Stefan

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



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

* Re: Sudden jumping point in buffer. Probably a bug?
  2016-01-01 20:02         ` Stefan-W. Hahn
@ 2016-01-01 20:32           ` Eli Zaretskii
  2016-01-01 22:27           ` David Engster
  1 sibling, 0 replies; 14+ messages in thread
From: Eli Zaretskii @ 2016-01-01 20:32 UTC (permalink / raw)
  To: Stefan-W. Hahn; +Cc: emacs-devel, dgutov

> Date: Fri, 1 Jan 2016 21:02:39 +0100
> From: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
> Cc: emacs-devel@gnu.org
> 
> Mail von Stefan-W. Hahn, Thu, 31 Dec 2015 at 14:04:18 +0100:
> > Mail von Stefan-W. Hahn, Tue, 24 Nov 2015 at 20:07:22 +0100:
> 
> Hello,
> 
> I filed a bug with further investigations, but got no response, the Bug
> Tracker Server seems to be down.

It's down, yes.  Please wait until it comes up again, and re-file the
bug if it doesn't appear in the DB.



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

* Re: Sudden jumping point in buffer. Probably a bug?
  2016-01-01 20:02         ` Stefan-W. Hahn
  2016-01-01 20:32           ` Eli Zaretskii
@ 2016-01-01 22:27           ` David Engster
  1 sibling, 0 replies; 14+ messages in thread
From: David Engster @ 2016-01-01 22:27 UTC (permalink / raw)
  To: Stefan-W. Hahn; +Cc: Eli Zaretskii, emacs-devel, Dmitry Gutov

Stefan-W. Hahn writes:
> Mail von Stefan-W. Hahn, Thu, 31 Dec 2015 at 14:04:18 +0100:
>> Mail von Stefan-W. Hahn, Tue, 24 Nov 2015 at 20:07:22 +0100:
>
> Hello,
>
> I filed a bug with further investigations, but got no response, the Bug
> Tracker Server seems to be down.
>
> I found a workaround which seems to work, but the reason is not clear:

As already noted in this thread, this seems to be #15045. The
`semantic-throw-on-input' macro calls `input-pending-p', which is also
running timers, and one of your timers seems to trigger redisplay. But
let's postpone further discussion until the bugtracker is back online.

-David



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

* Re: Sudden jumping point in buffer. Probably a bug?
  2015-12-31 13:18         ` Stefan-W. Hahn
@ 2016-01-02  9:14           ` Stefan-W. Hahn
  0 siblings, 0 replies; 14+ messages in thread
From: Stefan-W. Hahn @ 2016-01-02  9:14 UTC (permalink / raw)
  To: emacs-devel

Mail von Stefan-W. Hahn, Thu, 31 Dec 2015 at 14:18:41 +0100:

See filed bug#22287


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



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

end of thread, other threads:[~2016-01-02  9:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-18 18:35 Sudden jumping point in buffer. Probably a bug? Stefan-W. Hahn
2015-11-18 18:38 ` Stefan-W. Hahn
2015-11-18 18:49 ` Eli Zaretskii
2015-11-18 18:57   ` Dmitry Gutov
2015-11-18 19:01     ` Dmitry Gutov
2015-11-19 10:18     ` Phillip Lord
2015-11-24 19:07     ` Stefan-W. Hahn
2015-12-31 13:04       ` Stefan-W. Hahn
2015-12-31 13:18         ` Stefan-W. Hahn
2016-01-02  9:14           ` Stefan-W. Hahn
2016-01-01 20:02         ` Stefan-W. Hahn
2016-01-01 20:32           ` Eli Zaretskii
2016-01-01 22:27           ` David Engster
2015-11-18 19:31   ` Stefan-W. Hahn

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).