From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#15045: Point jumps inappropriately around time of Semantic lexing Date: Thu, 17 Oct 2013 14:18:56 -0400 Message-ID: References: <8738qksz6l.fsf@engster.org> <837gfvua2r.fsf@gnu.org> <87y58bs9x4.fsf@engster.org> <83zjsrs3k2.fsf@gnu.org> <87pptmsv4z.fsf@engster.org> <83siyira0w.fsf@gnu.org> <87vc3drhuv.fsf@engster.org> <83haexrgjn.fsf@gnu.org> <83ppr7pr6c.fsf@gnu.org> <83li1upkfx.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1382034020 5636 80.91.229.3 (17 Oct 2013 18:20:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Oct 2013 18:20:20 +0000 (UTC) Cc: 15045@debbugs.gnu.org, David Engster , Eric Ludlam To: Barry OReilly Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 17 20:20:23 2013 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 1VWsBJ-0002NK-Km for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Oct 2013 20:20:21 +0200 Original-Received: from localhost ([::1]:53757 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWsBJ-00019J-3M for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Oct 2013 14:20:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWsB8-00019C-SE for bug-gnu-emacs@gnu.org; Thu, 17 Oct 2013 14:20:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWsB1-0004nv-HP for bug-gnu-emacs@gnu.org; Thu, 17 Oct 2013 14:20:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWsB1-0004mm-Dg for bug-gnu-emacs@gnu.org; Thu, 17 Oct 2013 14:20:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VWsB0-0005WC-Jn for bug-gnu-emacs@gnu.org; Thu, 17 Oct 2013 14:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Oct 2013 18:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15045 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15045-submit@debbugs.gnu.org id=B15045.138203394621140 (code B ref 15045); Thu, 17 Oct 2013 18:20:02 +0000 Original-Received: (at 15045) by debbugs.gnu.org; 17 Oct 2013 18:19:06 +0000 Original-Received: from localhost ([127.0.0.1]:55784 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VWsA5-0005Us-4x for submit@debbugs.gnu.org; Thu, 17 Oct 2013 14:19:05 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:4382) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VWsA3-0005UO-Ae for 15045@debbugs.gnu.org; Thu, 17 Oct 2013 14:19:03 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFMCo0c/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kLodwBsEtkQoDpHqBXoMT X-IPAS-Result: Av4EABK/CFFMCo0c/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kLodwBsEtkQoDpHqBXoMT X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="35746751" Original-Received: from 76-10-141-28.dsl.teksavvy.com (HELO pastel.home) ([76.10.141.28]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 17 Oct 2013 14:18:57 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id F2F3E630FD; Thu, 17 Oct 2013 14:18:56 -0400 (EDT) In-Reply-To: (Barry OReilly's message of "Thu, 17 Oct 2013 11:03:11 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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:79344 Archived-At: > Here's the solution you requested. Let me know that it's good to > install. Looks fine. See comments below. > + Change how input-pending-p checks for timers to run. Its default > + changes from checking to not checking. Its new check-timers param > + allows for prior behavior. Good. "Don't run timers in input-pending-p" would have sufficed. > +** `(input-pending-p)' no longer runs other timers which are ready to > +run. The new optional CHECK-TIMERS param allows for the prior behavior. Please use 2 spaces after a full-stop (see sentence-end-double-space). > + return (get_input_pending ((EQ (check_timers, Qnil) EQ (check_timers, Qnil) => NILP (check_timers) > +;;; timer-tests.el --- tests for timers -*- coding: utf-8; > lexical-binding:t -*- The "coding:utf-8" is redundant nowadays. > +(require 'ert) IIUC this `require' is also redundant. > +(ert-deftest timer-tests-sit-for () > + (let ((timer-ran nil) > + (timeout (time-add (current-time) > + '(0 10 0 0))) > + ;; Want sit-for behavior when interactive > + (noninteractive nil)) > + (run-at-time '(0 1 0 0) > + nil > + (lambda () > + (setq timer-ran t))) > + (while (not timer-ran) > + (should (time-less-p (current-time) > + timeout)) > + (sit-for 0 t)))) I think there's a race-condition, here: - let's say we're at time < timeout. - we run sit-for, which does not run the timer since we're still timeout. - we check (should (time-less-p (current-time) timeout)) - we complain unjustly. I.e. we should test, after running sit-for, that the "current time before running sit-for" was < timeout. Stefan