Subject: bug#50852: [PATCH] Fix search of the look program.

From: André A. Gomes <[email-masked]>
Date: Mon, 27 Sep 2021 21:45:30 +0300

Hi Emacs,

Here's a more robust way to handle the existence of the look program by
ispell.  GNU Guix users will be happy.

There's another aspect worth discussing.  The look program doesn't have
the -r flag (as of today), but ispell handles this case (look at
ispell-look-options).  It seems that look was published around 1979.
Perhaps it's time to deprecate this flag?

Thank you.

--
André A. Gomes
"Free Thought, Free World"
>From 5a42784837845fa718bd80fd878c88c09d331a5b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20A=2E=20Gomes?= <[email-masked]>
Date: Mon, 27 Sep 2021 21:27:26 +0300
Subject: [PATCH] Fix search of the look program.

Not all distributions follow the FHS standard.  For instance, in GNU
Guix the look program lives at /run/current-system/profile/bin/.

* lisp/textmodes/ispell.el: Fix logic concerning the existence of the
look program.
---
 lisp/textmodes/ispell.el | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index b650ab3871..65da617e07 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -250,16 +250,12 @@ Always stores Fcc copy of message when nil."
 Should probably be \"-Ei\"."
   :type 'string)
 
-(defcustom ispell-look-command
-  (cond ((file-exists-p "/bin/look") "/bin/look")
-	((file-exists-p "/usr/local/bin/look") "/usr/local/bin/look")
-	((file-exists-p "/usr/bin/look") "/usr/bin/look")
-	(t "look"))
+(defcustom ispell-look-command (executable-find "look")
   "Name of the look command for search processes.
 This must be an absolute file name."
   :type 'file)
 
-(defcustom ispell-look-p (file-exists-p ispell-look-command)
+(defcustom ispell-look-p ispell-look-command
   "Non-nil means use `look' rather than `grep'.
 Default is based on whether `look' seems to be available."
   :type 'boolean)
-- 
2.33.0