GNU bug report logs - #33984
26.1; fortune-compile does not search exec-path for strfile program

Previous Next

Package: emacs;

Reported by: "Benjamin Ragheb" <ben <at> benzado.com>

Date: Sat, 5 Jan 2019 03:01:01 UTC

Severity: minor

Tags: fixed

Found in version 26.1

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Benjamin Ragheb" <ben <at> benzado.com>
To: 33984 <at> debbugs.gnu.org
Subject: bug#33984: 26.1; fortune-compile does not search exec-path for strfile program
Date: Fri, 04 Jan 2019 21:54:28 -0500
[Message part 1 (text/plain, inline)]
I am using Emacs 26.1 on macOS 10.14.2 Mojave. macOS does not include the fortune or strfile programs, so I install them using MacPorts, which places them in /opt/local/bin. By default, that directory is not on the PATH, so I have the following line in init.el:

    (add-to-list 'exec-path "/opt/local/bin")

With this setup, running M-x fortune works as expected (because the fortune command uses call-process to invoke the fortune program).

However, M-x fortune-compile fails with this error:

    /bin/bash: strfile: command not found

I have determined this is because fortune-compile passes the value of the fortune-strfile variable directly to shell-command, which does not consult exec-path.

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.

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.
[fortune.el.patch (application/octet-stream, attachment)]

This bug report was last modified 6 years and 31 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.