Function: fortune-compile

fortune-compile is an autoloaded, interactive and byte-compiled function defined in fortune.el.gz.

Signature

(fortune-compile &optional FILE)

Documentation

Compile fortune file.

If called with a prefix asks for the FILE to compile, otherwise uses the value of fortune-file. This currently cannot handle directories.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/play/fortune.el.gz
;;; **************
;;; Compile new database with strfile
;;;###autoload
(defun fortune-compile (&optional file)
  "Compile fortune file.

If called with a prefix asks for the FILE to compile, otherwise uses
the value of `fortune-file'.  This currently cannot handle directories."
  (interactive
   (list
    (if current-prefix-arg
	(fortune-ask-file)
      fortune-file)))
  (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))))
         (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 strfile fortune-strfile-options
                           " " fortune-file fortune-quiet-strfile-options)))))
	  (t (error "Can't compile fortune file %s" fortune-file)))))