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#50852: [PATCH] Fix search of the look program. Date: Tue, 28 Sep 2021 09:07:26 +0300 Message-ID: <8335ppkzc1.fsf@gnu.org> References: <87wnn17t85.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20262"; mail-complaints-to="usenet@ciao.gmane.io" Cc: andremegafone@gmail.com, 50852@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 28 08:08:13 2021 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 1mV6Hk-000562-TT for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Sep 2021 08:08:12 +0200 Original-Received: from localhost ([::1]:40542 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mV6Hj-0003XV-Pz for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Sep 2021 02:08:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mV6Hb-0003V2-5W for bug-gnu-emacs@gnu.org; Tue, 28 Sep 2021 02:08:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60217) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mV6Ha-000180-G7 for bug-gnu-emacs@gnu.org; Tue, 28 Sep 2021 02:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mV6Ha-0007yf-0o for bug-gnu-emacs@gnu.org; Tue, 28 Sep 2021 02:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Sep 2021 06:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50852 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch moreinfo Original-Received: via spool by 50852-submit@debbugs.gnu.org id=B50852.163280925030616 (code B ref 50852); Tue, 28 Sep 2021 06:08:01 +0000 Original-Received: (at 50852) by debbugs.gnu.org; 28 Sep 2021 06:07:30 +0000 Original-Received: from localhost ([127.0.0.1]:43530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mV6H3-0007xi-Vy for submit@debbugs.gnu.org; Tue, 28 Sep 2021 02:07:30 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57296) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mV6H2-0007xV-Ta for 50852@debbugs.gnu.org; Tue, 28 Sep 2021 02:07:29 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57616) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mV6Gx-0000cF-J2; Tue, 28 Sep 2021 02:07:23 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2362 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mV6Gx-0007j1-6L; Tue, 28 Sep 2021 02:07:23 -0400 In-Reply-To: (message from Stefan Kangas on Mon, 27 Sep 2021 16:56:14 -0700) 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" Xref: news.gmane.io gmane.emacs.bugs:215739 Archived-At: > From: Stefan Kangas > Date: Mon, 27 Sep 2021 16:56:14 -0700 > Cc: 50852@debbugs.gnu.org > > André A. Gomes writes: > > > Here's a more robust way to handle the existence of the look program by > > ispell. GNU Guix users will be happy. > > LGTM. I do wonder if this shouldn't be done in many more places... Careful: that will subtly change the behavior. For starters, executable-find looks in exec-path, which includes Emacs-specific directories. It also has its own ideas about which files are executable and whether to try some extensions. And finally, executable-find could return nil, whereas the original value was never nil, which could cause some code to signal an error, and requires the user to redefine the value when a program was originally absent, but is then installed without restarting Emacs. I'm not saying these differences are for the worse, but they need to be carefully considered when making such "innocent" changes, as they could introduce subtle bugs and misfeatures, at least potentially. In this case, why not simply have the value as "look" with no leading directories? If the program is installed, it will be found when it's invoked, and if it isn't installed, the user gets an error message at that time.