From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#67930: 29.1; emacs 29.1 follows symlinks when a grep result is selected Date: Wed, 20 Dec 2023 20:46:33 +0200 Message-ID: <83edfghfue.fsf@gnu.org> References: <80q7cl9dlo4.fsf@eurocontrol.int> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2540"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67930@debbugs.gnu.org To: Jurgen De Backer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 20 19:48:17 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rG1c9-0000Rz-3W for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Dec 2023 19:48:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rG1bt-0007Dj-4d; Wed, 20 Dec 2023 13:48:01 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rG1br-0007DE-Bf for bug-gnu-emacs@gnu.org; Wed, 20 Dec 2023 13:47:59 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rG1br-0005yo-3a for bug-gnu-emacs@gnu.org; Wed, 20 Dec 2023 13:47:59 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rG1bu-0005ai-2Q for bug-gnu-emacs@gnu.org; Wed, 20 Dec 2023 13:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Dec 2023 18:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67930 X-GNU-PR-Package: emacs Original-Received: via spool by 67930-submit@debbugs.gnu.org id=B67930.170309802221304 (code B ref 67930); Wed, 20 Dec 2023 18:48:02 +0000 Original-Received: (at 67930) by debbugs.gnu.org; 20 Dec 2023 18:47:02 +0000 Original-Received: from localhost ([127.0.0.1]:41791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rG1av-0005XN-UE for submit@debbugs.gnu.org; Wed, 20 Dec 2023 13:47:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rG1at-0005X3-Uw for 67930@debbugs.gnu.org; Wed, 20 Dec 2023 13:47:00 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rG1aj-0005X2-Cx; Wed, 20 Dec 2023 13:46:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=d2+AQ58G8aOu72ZewL7X8hslwvWHZlPNi9rzeXyxV8s=; b=XZqP/UHRQ0ti lMyevIr8+CKZSYNhuBz95aD/EIo5mTKKAuSpRKZ2wc9uPsxr7vYu1MQvlrzSylq0mrK/sgM+bhf7P OMMbWesRBSd7RTSo9yRdEpXzd4l6IRMoXm6rdg85jEugc5qOgXeH0jt6N58c1/XVjgMxNH+NmDlus drVqk4One5xYIzL9H3j/nBXC9ZLLhuWerpdw9EhXp83xlsqoKu0oov2DJs24Dp17nh21P1wq4f8Yg vWSgFMKKySXgWG6aIQokxRWNRt0xKCxCN0xkcCUREO3zf07Tk+jg7fEOwBDl8aZH+ZcBzgHPaXkc0 D4Z1LWQZty9eHiKXHhMM5Q==; In-Reply-To: <80q7cl9dlo4.fsf@eurocontrol.int> (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276584 Archived-At: > Date: Wed, 20 Dec 2023 13:54:19 +0000 > From: Jurgen De Backer via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Since emacs 29.1 (possibly already in 28.x), symlinks are resolved > whenever a file is selected in a grep result in the *grep* buffer. > For our project, we preferred the old behaviour to remain in the symlink's > directory. > Also, when symlinks are resolved and a new grep is done, we may end up > grepping in another directory than we started from. > > Attached is a patch o revert the behaviour, and to add a custom > variable compilation-follow-symlinks to disable/enable this behaviour. > > It may be useful to allow the user to select either behaviour. Thanks, but I don't think this is a matter of user preferences. We replaced expand-file-name there by file-truename because in some cases the former doesn't work: it expands to a file that doesn't exist. See bug#8035, where such cases are presented. We cannot ask the user to set or reset this option each time they need to work with these or those file names. So I don't think the fix you propose is the right one. I think we need to use expand-file-name where it works, and file-truename where expand-file-name doesn't work. Or maybe just try expand-file-name first, and if that produces a file name that fails file-exists-p, try file-truename. Would you like to propose and test a patch along these lines?