]> git.eshelyaron.com Git - emacs.git/commitdiff
Search exec-path for fortune strfile program
authorBenjamin Ragheb <ben@benzado.com>
Tue, 9 Jul 2019 22:31:10 +0000 (00:31 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 9 Jul 2019 22:33:17 +0000 (00:33 +0200)
* lisp/play/fortune.el (fortune-compile): Search exec-path for
strfile program (bug#33984).

Copyright-paperwork-exempt: yes

lisp/play/fortune.el

index 3c057f4149773a83309961b149c1c453471bdfbd..7226ea07030df1f7c660e08886b6eb97802cd676 100644 (file)
@@ -244,12 +244,14 @@ the value of `fortune-file'.  This currently cannot handle directories."
   (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)))))