;;; fortune.el --- use fortune to create signatures
-;; Copyright (C) 1999, 2001-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2001-2013 Free Software Foundation, Inc.
;; Author: Holger Schauer <Holger.Schauer@gmx.de>
;; Keywords: games utils mail
;; (lambda ()
;; (define-key gnus-article-mode-map "i" 'fortune-from-region)))
;; which allows marking a region and then pressing "i" so that the marked
-;; region will be automatically added to my favourite fortune-file.
+;; region will be automatically added to my favorite fortune-file.
;;; Code:
(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))))
- (fortune-file-exist (file-exists-p fortune-file))
- (fortune-dat-exist (file-exists-p fortune-dat))
- (fortune-file-newer (file-newer-than-file-p
- fortune-file fortune-dat)))
- (cond
- (fortune-file-exist
- (if (or (not fortune-dat-exist)
- (and fortune-dat-exist
- fortune-file-newer))
- (message "Compiling new fortune database %s" fortune-dat)
- (shell-command
- (concat fortune-strfile fortune-strfile-options
- " " fortune-file fortune-quiet-strfile-options))))
- (t (error "Can't compile fortune file %s" fortune-file)))))
+ (concat fortune-file fortune-database-extension)))))
+ (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
+ " " fortune-file fortune-quiet-strfile-options)))))
+ (t (error "Can't compile fortune file %s" fortune-file)))))
;;; **************