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: Fri, 07 Oct 2016 02:31:39 +0800 Message-ID: References: <83twcrks7q.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1475778749 15833 195.159.176.226 (6 Oct 2016 18:32:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 6 Oct 2016 18:32:29 +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 Thu Oct 06 20:32:25 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 1bsDSn-0002K3-Gx for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Oct 2016 20:32:13 +0200 Original-Received: from localhost ([::1]:58815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsDSm-0004ra-4W for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Oct 2016 14:32:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsDSg-0004mc-Ia for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2016 14:32:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsDSc-0002sC-GU for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2016 14:32:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsDSc-0002s8-Cd for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2016 14:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bsDSc-0008Oa-3S for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2016 14:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Liu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Oct 2016 18:32:02 +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.147577871232254 (code B ref 24585); Thu, 06 Oct 2016 18:32:02 +0000 Original-Received: (at 24585) by debbugs.gnu.org; 6 Oct 2016 18:31:52 +0000 Original-Received: from localhost ([127.0.0.1]:46853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsDSS-0008OA-9W for submit@debbugs.gnu.org; Thu, 06 Oct 2016 14:31:52 -0400 Original-Received: from mail-pf0-f193.google.com ([209.85.192.193]:34365) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsDSR-0008Ny-GJ for 24585@debbugs.gnu.org; Thu, 06 Oct 2016 14:31:51 -0400 Original-Received: by mail-pf0-f193.google.com with SMTP id 190so1513726pfv.1 for <24585@debbugs.gnu.org>; Thu, 06 Oct 2016 11:31:51 -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=zeFRf/g5VUKHnNHFp4Rd53RxSZVPVmEXbzIidnlX7gs=; b=QFEBJZOhU2Ksh8rvlPqgtwkt7JBfqnxwVDPZjlKaZNIQr87KHspd3IkQhOrSUbXqSw GNvP3ghcp3X2vYyGtirsH1f+AyDTDPWtIcxOgftzBO6WP2PPNkVcuXXaOWj75UY1VYXE Scxp3S1b9GaxkvnE40oXjsKc4jwo0W+XTUAODqMDrEjPdyt/XAyTAMMYkCLJEFiIKP27 Xxl+uxCtCJZmlABKbFlv4gl09bZL6xuAPQYQ8USLQLvBc9x8J9eYy4mhwL7zLXydfuYH hF+neKS0naCncybjXhG8LxRMlJNauxkvhPBVBpLdSMjhpvq6TfSJGuRYkpnlGICXzOPA a6aw== 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=zeFRf/g5VUKHnNHFp4Rd53RxSZVPVmEXbzIidnlX7gs=; b=kKcKHGgnLU03SkoqrOWMh8gZ8oHHzkZ2z6Y4ClFVVI2WY++jxysPwHK2bHV9pVhb53 p+OqYidXXvQeseL2270Gq1lwsjmYlCSASYuf4PgWIWLz8E7Upqvz4dAYcim21PBNpjaA F/uF1CI8tSOyXeok4Yz/yUvorxERonqDoK772jqgLxIYTPBgJbyW2GGzMbpz3OCJvQ1Q epj37UqiKVFwC2QCT/ZvsqjUaFZ7HYAyZ1aIFIjWGPhN1Qb+uJ29XYGvsKQ673w0u4c/ J2bWGhPx8QR/JszC6HO/Z9hLvRzioYdrHtxggegA/am1spJR64vwRRRXUQABw7e+UHbK 6m7g== X-Gm-Message-State: AA6/9Rl1UzQydo1AtyVeFaMlHPrEBDct14lh9ZhX7luTUO3Yvb7Zyh7aI81XZLs/0sUhLw== X-Received: by 10.98.194.133 with SMTP id w5mr21554680pfk.4.1475778705658; Thu, 06 Oct 2016 11:31:45 -0700 (PDT) Original-Received: from zeuss-MacBook-Pro.local ([139.59.241.182]) by smtp.gmail.com with ESMTPSA id af17sm24575595pac.14.2016.10.06.11.31.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Oct 2016 11:31:45 -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 "Thu, 06 Oct 2016 14:10:40 -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:124126 Archived-At: On 2016-10-06 14:10 -0400, Stefan Monnier wrote: > I thought that's what I had proposed, so yes, I think that's > a good solution. By exposing the position I can change ggtags not to depend on the order of auto-jump and clean up. The patch could look like this. Any objection to installing it in emacs-25? diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index f2e397a4..a7804fd7 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1052,13 +1052,16 @@ POS and RES.") l2 (setcdr l1 (cons (list ,key) l2))))))) +(defvar-local compilation-auto-jump-pos nil) + (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)))) + (when (buffer-live-p buffer) + (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))))) ;; This function is the central driver, called when font-locking to gather ;; all information needed to later jump to corresponding source code. @@ -1126,8 +1129,9 @@ POS and RES.") (when (and compilation-auto-jump-to-next (>= type compilation-skip-threshold)) (kill-local-variable 'compilation-auto-jump-to-next) + (setq compilation-auto-jump-pos (match-beginning 0)) (run-with-timer 0 nil 'compilation-auto-jump - (current-buffer) (match-beginning 0))) + (current-buffer) compilation-auto-jump-pos)) (compilation-internal-error-properties file line end-line col end-col type fmt)))