From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Engster Newsgroups: gmane.emacs.bugs Subject: bug#22287: 25.1.50; Sudden jumping point in buffer Date: Wed, 06 Jan 2016 22:52:18 +0100 Message-ID: <87lh82ml4d.fsf@engster.org> References: <20160101111008.GA14391@scotty.home> <87y4c6nbte.fsf@engster.org> <20160103130742.GA11570@scotty.home> <87twmumzqm.fsf@engster.org> <20160103205104.GB11570@scotty.home> <83egdx8j3p.fsf@gnu.org> <20160105150121.GA10231@scotty.home> <838u4456vp.fsf@gnu.org> <20160105195129.GB10231@scotty.home> <834mer4wg7.fsf@gnu.org> <20160106141354.GA28490@scotty.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1452117204 20429 80.91.229.3 (6 Jan 2016 21:53:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Jan 2016 21:53:24 +0000 (UTC) Cc: 22287@debbugs.gnu.org To: "Stefan-W. Hahn" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 06 22:53:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aGw0z-0003U0-H8 for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Jan 2016 22:53:09 +0100 Original-Received: from localhost ([::1]:56204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGw0y-00033H-Nh for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Jan 2016 16:53:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGw0v-000339-I5 for bug-gnu-emacs@gnu.org; Wed, 06 Jan 2016 16:53:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGw0s-0001De-BP for bug-gnu-emacs@gnu.org; Wed, 06 Jan 2016 16:53:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGw0s-0001Da-7d for bug-gnu-emacs@gnu.org; Wed, 06 Jan 2016 16:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aGw0r-0003Dv-Ti for bug-gnu-emacs@gnu.org; Wed, 06 Jan 2016 16:53:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: David Engster Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Jan 2016 21:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22287 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22287-submit@debbugs.gnu.org id=B22287.145211714812345 (code B ref 22287); Wed, 06 Jan 2016 21:53:01 +0000 Original-Received: (at 22287) by debbugs.gnu.org; 6 Jan 2016 21:52:28 +0000 Original-Received: from localhost ([127.0.0.1]:40661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aGw0K-0003D3-7k for submit@debbugs.gnu.org; Wed, 06 Jan 2016 16:52:28 -0500 Original-Received: from randomsample.de ([5.45.97.173]:41957) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aGw0I-0003Ct-Bp for 22287@debbugs.gnu.org; Wed, 06 Jan 2016 16:52:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=I784X362yQd884i3BWoH7zm3Y4h6hcRPh/QE9JlSmjE=; b=YUHd61oealt/ZBmjoFN73lsS0TKvpqm5+QB/GePAZmLwJTMCyLRzC4q76tjSjIuYpEzbVtyP1hSvvBsotWmueSQScMnAsDZSpYPsXZK7jtNV/wDqp/WzvXH1c8DawvQv; Original-Received: from ip4d1494ed.dynamic.kabel-deutschland.de ([77.20.148.237] helo=isaac) by randomsample.de with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1aGw0G-0004kv-Ea; Wed, 06 Jan 2016 22:52:24 +0100 In-Reply-To: <20160106141354.GA28490@scotty.home> (Stefan-W. Hahn's message of "Wed, 6 Jan 2016 15:13:54 +0100") User-Agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111309 Archived-At: 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