all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Engster <deng@randomsample.de>
To: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
Cc: 22287@debbugs.gnu.org
Subject: bug#22287: 25.1.50; Sudden jumping point in buffer
Date: Wed, 06 Jan 2016 22:52:18 +0100	[thread overview]
Message-ID: <87lh82ml4d.fsf@engster.org> (raw)
In-Reply-To: <20160106141354.GA28490@scotty.home> (Stefan-W. Hahn's message of "Wed, 6 Jan 2016 15:13:54 +0100")

Stefan-W. Hahn writes:
> If I see it right, then semantic-c-lexer will be called under save-excursion
> from semantic-idle-core-handler whenn called via timer-event-handler:
>
> ,----
> | "semantic-idle-core-handler" (0xffffcb50)
> | "semantic-idle-scheduler-function" (0xffffce08)
> | "apply" (0xffffce00)
> | "timer-event-handler" (0xffffcfc8)
> `----
>
> but when called from semanticdb-save-all-db-idle (I think) it will be called
> from semanticdb-save-db and
>
> ,----
> |     (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))
> `----
>
> therefore from within semantic-exit-on-input, which is a catch. And with my
> other observations I saw the catch exiting with moved point.
>
> This seems to explains, why a save-excursion around this works for me.
>
> I also tried a save-excursion around semantic-c-lexer and this seems to work
> too.
>
> So after all this: my opinion is that semantic-c-lexer is the problem.

That is some impressive sleuthing you did there. Thanks a lot!

The problem is that the `object-write' method for the semanticdb-table
class calls `semantic-fetch-tags'. I was completely unaware of
that. When the table is not up-to-date, it will re-parse the buffer and
call the lexer.

So yes, this has to be wrapped in a save-excursion. But more
importantly, I think we should not put semanticdb-save-all-db-idle in
the auto-save-hook. As a function meant for idle-time, it really has no
business there. My best guess is that Eric originally thought that the
auto-save-hook is only called during idle time. I'll look a bit more
into what this entails, and I'll apply a fix in the coming days.

Thanks again,
David





  reply	other threads:[~2016-01-06 21:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-01 11:10 bug#22287: 25.1.50; Sudden jumping point in buffer Stefan-W. Hahn
2016-01-03 11:26 ` David Engster
2016-01-03 13:07   ` Stefan-W. Hahn
2016-01-03 15:47     ` David Engster
2016-01-03 20:51       ` Stefan-W. Hahn
2016-01-04 15:22         ` Eli Zaretskii
2016-01-05 15:01           ` Stefan-W. Hahn
2016-01-05 16:27             ` Eli Zaretskii
2016-01-05 19:51               ` Stefan-W. Hahn
2016-01-05 20:12                 ` Eli Zaretskii
2016-01-05 21:08                   ` Stefan-W. Hahn
2016-01-06 14:13                   ` Stefan-W. Hahn
2016-01-06 21:52                     ` David Engster [this message]
2016-02-21 16:29                       ` David Engster
2016-01-04 15:22       ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=87lh82ml4d.fsf@engster.org \
    --to=deng@randomsample.de \
    --cc=22287@debbugs.gnu.org \
    --cc=stefan.hahn@s-hahn.de \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.