Subject: Re: bug#33984: 26.1; fortune-compile does not search exec-path for strfile program

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 10 Jul 2019 00:32:28 +0200

"Benjamin Ragheb" <[email-masked]> writes:

> I have attached a patch which corrects this problem by using
> executable-find before calling shell-command. If strfile cannot be
> found, it signals an error.

Makes sense.

> I tried to keep the patch as small as possible, and resisted the
> temptation to replace the call to shell-command with
> call-process. Doing so would have broken compatibility with the
> fortune-quiet-strfile-options variable, which people may have
> customized.

Yeah, that would be better, but would be incompatible as you say.

> -			(concat fortune-file fortune-database-extension)))))
> +			(concat fortune-file fortune-database-extension))))
> +         (strfile (or (executable-find fortune-strfile)
> +                      (error "Can't find strfile program %s" fortune-strfile)))
>    (cond ((file-exists-p fortune-file)
>           (cond ((file-newer-than-file-p fortune-file fortune-dat)
>                  (message "Compiling new fortune database %s" fortune-dat)
>                  (shell-command
> -                 (concat fortune-strfile fortune-strfile-options
> +                 (concat strfile fortune-strfile-options

I've now applied this patch to the Emacs trunk.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no