From unknown Sat Sep 06 03:34:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33984: 26.1; fortune-compile does not search exec-path for strfile program Resent-From: "Benjamin Ragheb" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Jan 2019 03:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33984 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 33984@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154665725020335 (code B ref -1); Sat, 05 Jan 2019 03:01:01 +0000 Received: (at submit) by debbugs.gnu.org; 5 Jan 2019 03:00:50 +0000 Received: from localhost ([127.0.0.1]:47162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfcCg-0005Hv-BR for submit@debbugs.gnu.org; Fri, 04 Jan 2019 22:00:50 -0500 Received: from eggsout.gnu.org ([209.51.188.92]:40737) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfc6g-000584-Bj for submit@debbugs.gnu.org; Fri, 04 Jan 2019 21:54:38 -0500 Received: from [209.51.188.17] (port=39399 helo=lists.gnu.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gfc6f-0003fg-Nx for submit@debbugs.gnu.org; Fri, 04 Jan 2019 21:54:37 -0500 Received: from eggsout.gnu.org ([209.51.188.92]:54520 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfc6e-00061h-KB for bug-gnu-emacs@gnu.org; Fri, 04 Jan 2019 21:54:37 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50, MIME_HEADER_CTYPE_ONLY,RCVD_IN_DNSWL_LOW autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfc6a-0003dA-8W for bug-gnu-emacs@gnu.org; Fri, 04 Jan 2019 21:54:36 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:40101) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gfc6Z-0003c1-Vz for bug-gnu-emacs@gnu.org; Fri, 04 Jan 2019 21:54:32 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6BC9323152 for ; Fri, 4 Jan 2019 21:54:29 -0500 (EST) Received: from imap22 ([10.202.2.72]) by compute1.internal (MEProxy); Fri, 04 Jan 2019 21:54:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=benzado.com; h= message-id:date:from:to:subject:content-type; s=mesmtp; bh=UZCHr pEIxpY2cFvgbq6+Zf9RfDXrJsaAGNzixHcGlWY=; b=U9DxuqpI5zFacxSaVu9D+ zUe12pT08zUCimxc5n7SRZiztwnRBavePR0dU+tvH6v2LwWUHWCgMrcgsRiNzv9l 6c0cnMPyofUtkY58UCPxxk/xA14NQ3dfxK4podWqx2t1v6rJRG2Q61+tcikWVZ5k B4cI1Utz4lh3L5y9PyF32k= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id:subject :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=UZCHrpEIxpY2cFvgbq6+Zf9RfDXrJsaAGNzixHcGlWY=; b=RYfQB3iV IWm8XEC2lvoOnARCWltBXOLMP2GwG848MU4eCvvzsZGefLLmg5fCY/zAIRETN4qZ 3Fv36IjA+vO/aCs7stXn4mV9HbXOg2Im7YHUuYI0CewvyBPmaeWZGcrVMPhlk+3V HGQMLwWntHXsVm5/myNHu4r+j8B9dvL/CDk1Mr9Q7sZB6ubXcVPd87ZNGJoN1ICW mzGr6BXx1in+7yniA8bkS6q/PIeR3xl8v2MqqUcrgf6OHpx9xvh8mhntdXO5oW4j TSoOk0RRDi8hgdOwwy75gEsH1Dj7nm8b9krGAg8/iCEhCCe8GN6/qRn+eOxRXd2E 4seS4ziVgldnXQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrvddvgdehgeculddtuddrgedtkedrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgfkfffhvffutgesmhdtreerre ertdenucfhrhhomhepfdeuvghnjhgrmhhinhcutfgrghhhvggsfdcuoegsvghnsegsvghn iigrughordgtohhmqeenucfrrghrrghmpehmrghilhhfrhhomhepsggvnhessggvnhiirg guohdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id E4AB8E64B; Fri, 4 Jan 2019 21:54:28 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.5-739-g7452a1e-fmstable-20190103v1 X-Me-Personality: 62235657 Message-Id: Date: Fri, 04 Jan 2019 21:54:28 -0500 From: "Benjamin Ragheb" Content-Type: multipart/mixed; boundary=4cc081f71e8b483f9f98b6088de6b3fb X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 2.6 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 [...] Content analysis details: (2.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 2.0 MIME_HEADER_CTYPE_ONLY 'Content-Type' found without required MIME headers X-Mailman-Approved-At: Fri, 04 Jan 2019 22:00:49 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.6 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 [...] Content analysis details: (1.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 2.0 MIME_HEADER_CTYPE_ONLY 'Content-Type' found without required MIME headers -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --4cc081f71e8b483f9f98b6088de6b3fb Content-Type: text/plain 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. --4cc081f71e8b483f9f98b6088de6b3fb Content-Disposition: attachment;filename="fortune.el.patch" Content-Type: application/octet-stream; name="fortune.el.patch" Content-Transfer-Encoding: 7BIT --- fortune.el.master 2019-01-04 20:37:38.000000000 -0500 +++ fortune.el.strfile-fix 2019-01-04 21:12:09.000000000 -0500 @@ -244,12 +244,14 @@ (let* ((fortune-file (expand-file-name (substitute-in-file-name file))) (fortune-dat (expand-file-name (substitute-in-file-name - (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 " " fortune-file fortune-quiet-strfile-options))))) (t (error "Can't compile fortune file %s" fortune-file))))) --4cc081f71e8b483f9f98b6088de6b3fb-- From unknown Sat Sep 06 03:34:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33984: 26.1; fortune-compile does not search exec-path for strfile program Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Jul 2019 22:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33984 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Benjamin Ragheb" Cc: 33984@debbugs.gnu.org Received: via spool by 33984-submit@debbugs.gnu.org id=B33984.156271155627411 (code B ref 33984); Tue, 09 Jul 2019 22:33:01 +0000 Received: (at 33984) by debbugs.gnu.org; 9 Jul 2019 22:32:36 +0000 Received: from localhost ([127.0.0.1]:34461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkyf5-00077u-Se for submit@debbugs.gnu.org; Tue, 09 Jul 2019 18:32:36 -0400 Received: from quimby.gnus.org ([80.91.231.51]:54856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkyf3-00075r-KP for 33984@debbugs.gnu.org; Tue, 09 Jul 2019 18:32:34 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hkyey-0001ZD-J9; Wed, 10 Jul 2019 00:32:30 +0200 From: Lars Ingebrigtsen References: Date: Wed, 10 Jul 2019 00:32:28 +0200 In-Reply-To: (Benjamin Ragheb's message of "Fri, 04 Jan 2019 21:54:28 -0500") Message-ID: <87v9waq1oj.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: "Benjamin Ragheb" 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. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) "Benjamin Ragheb" 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 09 18:32:40 2019 Received: (at control) by debbugs.gnu.org; 9 Jul 2019 22:32:40 +0000 Received: from localhost ([127.0.0.1]:34464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkyfA-0007C5-8c for submit@debbugs.gnu.org; Tue, 09 Jul 2019 18:32:40 -0400 Received: from quimby.gnus.org ([80.91.231.51]:54870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkyf8-00078t-2R for control@debbugs.gnu.org; Tue, 09 Jul 2019 18:32:38 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hkyf5-0001ZK-Hv for control@debbugs.gnu.org; Wed, 10 Jul 2019 00:32:37 +0200 Date: Wed, 10 Jul 2019 00:32:35 +0200 Message-Id: <87tvbuq1oc.fsf@mouse.gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #33984 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 33984 fixed close 33984 27.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 33984 fixed close 33984 27.1 quit