From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Leo Liu Newsgroups: gmane.emacs.bugs Subject: bug#24585: 25.1; avoid hack in ggtags.el to run compilation-auto-jump timer Date: Sun, 09 Oct 2016 02:10:00 +0800 Message-ID: References: <83twcrks7q.fsf@gnu.org> <83int5jpde.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1475950297 1270 195.159.176.226 (8 Oct 2016 18:11:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 8 Oct 2016 18:11:37 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (macOS 10.12) Cc: 24585@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 08 20:11:33 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsw5b-00062d-8Z for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Oct 2016 20:11:15 +0200 Original-Received: from localhost ([::1]:41987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsw5Z-0000qs-Sq for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Oct 2016 14:11:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsw5S-0000qh-7L for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2016 14:11:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsw5N-0002RV-Vf for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2016 14:11:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42764) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsw5N-0002RJ-SP for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2016 14:11:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bsw5N-00013o-Ij for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2016 14:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Liu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Oct 2016 18:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24585 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24585-submit@debbugs.gnu.org id=B24585.14759502134017 (code B ref 24585); Sat, 08 Oct 2016 18:11:01 +0000 Original-Received: (at 24585) by debbugs.gnu.org; 8 Oct 2016 18:10:13 +0000 Original-Received: from localhost ([127.0.0.1]:48954 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsw4b-00012j-LA for submit@debbugs.gnu.org; Sat, 08 Oct 2016 14:10:13 -0400 Original-Received: from mail-pf0-f172.google.com ([209.85.192.172]:33079) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsw4Z-00012U-O8 for 24585@debbugs.gnu.org; Sat, 08 Oct 2016 14:10:12 -0400 Original-Received: by mail-pf0-f172.google.com with SMTP id 190so36902605pfv.0 for <24585@debbugs.gnu.org>; Sat, 08 Oct 2016 11:10:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:face:date:in-reply-to:message-id :user-agent:mime-version; bh=aO+XQRBVj0zI/lPmlHp38zJuCGReBIPJ8BVQvia5hIY=; b=KOvuS4tyXt3C62vSdUpp2oPXtxgU04MmupeahrhJFLKK0wCUjuFVFB1RtOz0SrYt3U f7nSm3EX+zxNXhcpvWPShOy0REeHjUT8PHkqkBbbXrEZ9KvNR45DxDwWKR6UofoYAQ6y Jk35cva2F2uSRY0vZTt2OVI79IbjGdoD11C6zkwwsbHB53sx/gaApnvBNP0PtfMykcY6 zIDz4d4DKcOxcWUgy33xpS3KL+kDhCg4aDeVn+3ZjuKpOTL/ew3KqQBGXJ3YDc/ztzCC DKz6ujEfMTKvn4YUi0swSojd+7UrTaK6ymTlSWc8GcsKX/5bpuS96hoIQewzJKH1a5sY fHdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:face:date :in-reply-to:message-id:user-agent:mime-version; bh=aO+XQRBVj0zI/lPmlHp38zJuCGReBIPJ8BVQvia5hIY=; b=g0ghxdFMaUJPkGm3szeFF7Das5UuQce6Lch+lJ55GB7l0R9JEuZfkM+wZCxCmLsRM0 sg6XyBPf7jVB0tWFgAmPzRnBnIbTaJTB3Yr8EMTBRVS9vSJqh9NuD2HUEPvJKkZ+EIq9 ECk5gQs/cOnrcC/Y4Y/DUEEqxLSHEyPdgRHjrv9FmU8EWT2NkuNduiL8M3DJMsBkIYeO pMxNmw/H87OFFz317jsPOnKuMlx6QOl0knksh+rJQWEodqhpqb15VfdkJR25mS/ksO8A pt4OgfLRRr+m1VPKQcc81dMh9qgttC2BXaSo5BHF903W6kzUmUR9Dn3xbXFdg6p6rQgQ 3Mcg== X-Gm-Message-State: AA6/9RlAc2M38HcJ+G+jwED6/JhNrUGbPjVBSFzZH41DkqgBF4Cuxhvh2ARZY1V9QKB1aw== X-Received: by 10.98.222.3 with SMTP id h3mr39056978pfg.168.1475950205745; Sat, 08 Oct 2016 11:10:05 -0700 (PDT) Original-Received: from zeuss-MacBook-Pro.local ([139.59.241.182]) by smtp.gmail.com with ESMTPSA id m83sm22787827pfg.48.2016.10.08.11.10.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 08 Oct 2016 11:10:04 -0700 (PDT) Face: iVBORw0KGgoAAAANSUhEUgAAACkAAAApAQAAAACAGz1bAAABKElEQVQYlWNg3NIt5FDPUPt7 4+X79Qyucz5/ugik+L2PBgKpyphaIK921q23QDnG0NBQoMr/vaWl9f8ZLL78uPv5PwN7RETfzXoG jhmFz27XM0RXmpuY/WfY+fv0Mc56BvFybfXA/wwL5t/wF61n2PU59axXPcOVzbmSW/8zrNt1benC /ww70hqUU/4zKCtrT9jwn8FhwynbufUMendE2aLqGRpdX9al1zM8eh17lKeeQcTMrdD5P8P3j/YT Q/8zXHSb7p1Qz/C4OM2JuZ7hgtI7K6AjqsMnf8j4z8C6xG1tw3+GqpqvsVn/GTzmpD9j/8/wP/oZ S/l/Bka+QO/g/wy15ueeFQL9N1O8mPU/g+umV3t1gdT0/1bTgHLqYVeXAlWKpMWt+w8Az82C9nHf X0cAAAAASUVORK5CYII= In-Reply-To: (Stefan Monnier's message of "Fri, 07 Oct 2016 14:10:53 -0400") 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" Xref: news.gmane.org gmane.emacs.bugs:124234 Archived-At: On 2016-10-07 14:10 -0400, Stefan Monnier wrote: > Hmm... calling compilation--ensure-parse *should* help. > More specifically, if you call compilation--ensure-parse up to point-max > from compilation-finish-functions, I can't think of any reason why > compilation-error-properties should be called afterwards. If you can > get a backtrace of when that happens, it would help. > > E.g. set a buffer-local var from compilation-finish-functions after > calling compilation--ensure-parse, and then add an assert in > compilation-error-properties to check that that var is not set yes. To the best of my knowledge that seems to work with change like this to compile.el: diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index f2e397a4..3a4f4b8b 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1052,13 +1052,18 @@ POS and RES.") l2 (setcdr l1 (cons (list ,key) l2))))))) -(defun compilation-auto-jump (buffer pos) - (with-current-buffer buffer - (goto-char pos) - (let ((win (get-buffer-window buffer 0))) - (if win (set-window-point win pos))) - (if compilation-auto-jump-to-first-error - (compile-goto-error)))) +(defvar-local compilation-pending-auto-jump nil) + +(defun compilation-auto-jump (buffer) + (when (buffer-live-p buffer) + (with-current-buffer buffer + (when compilation-pending-auto-jump + (goto-char compilation-pending-auto-jump) + (let ((win (get-buffer-window buffer 0))) + (if win (set-window-point win compilation-pending-auto-jump))) + (setq compilation-pending-auto-jump nil) + (if compilation-auto-jump-to-first-error + (compile-goto-error)))))) ;; This function is the central driver, called when font-locking to gather ;; all information needed to later jump to corresponding source code. @@ -1126,8 +1131,8 @@ POS and RES.") (when (and compilation-auto-jump-to-next (>= type compilation-skip-threshold)) (kill-local-variable 'compilation-auto-jump-to-next) - (run-with-timer 0 nil 'compilation-auto-jump - (current-buffer) (match-beginning 0))) + (setq compilation-pending-auto-jump (match-beginning 0)) + (run-with-timer 0 nil 'compilation-auto-jump (current-buffer))) (compilation-internal-error-properties file line end-line col end-col type fmt)))