From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#33618: 27.0.50; ada-mode breaks M-x grep Date: Wed, 05 Dec 2018 09:26:45 -0500 Message-ID: References: <83wooo8ogl.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1544019909 23052 195.159.176.226 (5 Dec 2018 14:25:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 5 Dec 2018 14:25:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: stephen_leake@member.fsf.org, 33618@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 05 15:25:05 2018 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 1gUY6q-0005qV-K4 for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Dec 2018 15:25:04 +0100 Original-Received: from localhost ([::1]:34875 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUY8x-0006U7-2s for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Dec 2018 09:27:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUY8q-0006Tr-9l for bug-gnu-emacs@gnu.org; Wed, 05 Dec 2018 09:27:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUY8k-00008z-LM for bug-gnu-emacs@gnu.org; Wed, 05 Dec 2018 09:27:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57252) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gUY8k-00008v-HN for bug-gnu-emacs@gnu.org; Wed, 05 Dec 2018 09:27:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gUY8k-00041M-Cc for bug-gnu-emacs@gnu.org; Wed, 05 Dec 2018 09:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Dec 2018 14:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33618 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33618-submit@debbugs.gnu.org id=B33618.154402000915435 (code B ref 33618); Wed, 05 Dec 2018 14:27:02 +0000 Original-Received: (at 33618) by debbugs.gnu.org; 5 Dec 2018 14:26:49 +0000 Original-Received: from localhost ([127.0.0.1]:33277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gUY8X-00040t-Bo for submit@debbugs.gnu.org; Wed, 05 Dec 2018 09:26:49 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:40337) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gUY8U-00040k-Pu for 33618@debbugs.gnu.org; Wed, 05 Dec 2018 09:26:48 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id wB5EQjaJ013725; Wed, 5 Dec 2018 09:26:45 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 06F316AA38; Wed, 5 Dec 2018 09:26:45 -0500 (EST) In-Reply-To: <83wooo8ogl.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 05 Dec 2018 08:41:46 +0200") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6433=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6433> : inlines <6977> : streams <1806250> : uri <2760508> 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:153110 Archived-At: >> > Opening a file in ada-mode using the new ada-mode from GNU ELPA globally >> > sets compilation-search-path (for me, it got set to `("~/tmp")` >> > probably because the Ada file was in ~/tmp), which in >> > turn breaks M-x grep in the sense that clicking on a match doesn't jump >> > to the file but prompts you to find the file (unless you happened to >> > grep from one of the directories mentioned in the >> > compilation-search-path, of course). >> >> I use the patch below currently to work around this problem. >> Should I install it into `master` (with a few more comments and >> probably etc/NEWS or even manual updates)? > > If the problem is in ada-mode in ELPA, it should be fixed there, IMO. > Why do we need to change our code to cater to problems in packages, > even if those packages are on ELPA? It sounds wrong to me, FWIW. Because I think the problem in ada-mode is linked to a design problem with that variable: it is defined to be a global variable, and compile.el looks it up from inside the compilation buffer, so there's no convenient way for a major mode like ada-mode to tell compile.el which search-path to use for which file/project: all they can do is change the global value. The patch I use changes compile.el so the var is looked up from the buffer from which the compilation is launched (e.g. an ada-mode buffer) and then stashed into the compilation buffer (for later use). Note that the hunk below (which is part of the patch I sent) is sufficient to unbreak grep, but other tools that (like grep) build on `compilation-start` would still be affected. Stefan --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -834,7 +834,8 @@ grep-mode (set (make-local-variable 'compilation-disable-input) t) (set (make-local-variable 'compilation-error-screen-columns) grep-error-screen-columns) - (add-hook 'compilation-filter-hook 'grep-filter nil t)) + (setq-local compilation-search-path '(nil)) + (add-hook 'compilation-filter-hook #'grep-filter nil t)) (defun grep--save-buffers () (when grep-save-buffers