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: Tue, 04 Dec 2018 19:02:35 -0500 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1543968843 31928 195.159.176.226 (5 Dec 2018 00:14:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 5 Dec 2018 00:14:03 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Stephen Leake To: 33618@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 05 01:13:59 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 1gUKpC-00089w-0D for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Dec 2018 01:13:58 +0100 Original-Received: from localhost ([::1]:59464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUKrI-0005oR-LQ for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Dec 2018 19:16:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUKqW-0005I6-OR for bug-gnu-emacs@gnu.org; Tue, 04 Dec 2018 19:15:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUKej-0001Ri-Tv for bug-gnu-emacs@gnu.org; Tue, 04 Dec 2018 19:03:13 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56881) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gUKee-0001PI-E2 for bug-gnu-emacs@gnu.org; Tue, 04 Dec 2018 19:03:06 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gUKec-0001a0-7F for bug-gnu-emacs@gnu.org; Tue, 04 Dec 2018 19:03: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 00:03: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.15439681596038 (code B ref 33618); Wed, 05 Dec 2018 00:03:02 +0000 Original-Received: (at 33618) by debbugs.gnu.org; 5 Dec 2018 00:02:39 +0000 Original-Received: from localhost ([127.0.0.1]:32906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gUKeF-0001ZK-FK for submit@debbugs.gnu.org; Tue, 04 Dec 2018 19:02:39 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:36953) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gUKeD-0001ZA-3y for 33618@debbugs.gnu.org; Tue, 04 Dec 2018 19:02:37 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id wB502ZqW006200; Tue, 4 Dec 2018 19:02:35 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 4AFD56A9FF; Tue, 4 Dec 2018 19:02:35 -0500 (EST) In-Reply-To: (Stefan Monnier's message of "Tue, 04 Dec 2018 18:46:55 -0500") 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, RV6432=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6432> : inlines <6976> : streams <1806193> : uri <2760213> 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:153091 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)? Stefan diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el index 359c187d85..d31e614f14 100644 --- a/lisp/progmodes/ada-xref.el +++ b/lisp/progmodes/ada-xref.el @@ -943,7 +943,7 @@ ada-select-prj-file ;; FIXME: use ada-get-absolute-dir, mapconcat here (setenv "ADA_PROJECT_PATH" ada_project_path))) - (setq compilation-search-path (ada-xref-get-src-dir-field)) + (setq-local compilation-search-path (ada-xref-get-src-dir-field)) (setq ada-search-directories-internal ;; FIXME: why do we need directory-file-name here? @@ -1208,9 +1208,8 @@ ada-compile-application (ada-require-project-file) (let ((cmd (ada-xref-get-project-field 'make_cmd)) (process-environment (ada-set-environment)) - (compilation-scroll-output t)) - - (setq compilation-search-path (ada-xref-get-src-dir-field)) + (compilation-scroll-output t) + (compilation-search-path (ada-xref-get-src-dir-field))) ;; If no project file was found, ask the user (unless cmd diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index c7c510f7a3..f5627e10ce 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1614,7 +1614,7 @@ recompile (setq command (compilation-read-command (or (car compilation-arguments) command))) (if compilation-arguments (setcar compilation-arguments command))) - (apply 'compilation-start (or compilation-arguments (list command))))) + (apply #'compilation-start (or compilation-arguments (list command))))) (defcustom compilation-scroll-output nil "Non-nil to scroll the *compilation* buffer window as output appears. @@ -1682,6 +1682,7 @@ compilation-start (replace-regexp-in-string "-mode\\'" "" (symbol-name mode)))) (thisdir default-directory) (thisenv compilation-environment) + (this-search-path compilation-search-path) outwin outbuf) (with-current-buffer (setq outbuf @@ -1749,6 +1750,8 @@ compilation-start ;; NB: must be done after (funcall mode) as that resets local variables (set (make-local-variable 'compilation-directory) thisdir) (set (make-local-variable 'compilation-environment) thisenv) + (unless (local-variable-p 'compilation-search-path) + (setq-local compilation-search-path this-search-path)) (if highlight-regexp (set (make-local-variable 'compilation-highlight-regexp) highlight-regexp)) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 331eeec01b..16b54081ae 100644 --- 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