diff options
author | Glenn Morris <rgm@gnu.org> | 2013-02-14 20:30:11 -0500 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2013-02-14 20:30:11 -0500 |
commit | dec2a322921d74de8f251a54931d4c50ab00713d (patch) | |
tree | c8e1371cdfcade6800ce65dea9a55e051938b853 /lisp/play | |
parent | 51b3a99c948dc83f3387f440702ab6e175b61e0f (diff) | |
download | emacs-dec2a322921d74de8f251a54931d4c50ab00713d.tar.gz |
* lisp/play/fortune.el (fortune-compile): Simplify and fix previous change.
Since file-newer-than-p returns non-nil if FILE2 does not exist,
the actual fix for bug#5338 is just a one-liner. But there is no test
case or explanation of what the issue actually is in bug#5338, so one
has to wonder if the initial (file-exists-p fortune-dat) test was
there for a reason...
Diffstat (limited to 'lisp/play')
-rw-r--r-- | lisp/play/fortune.el | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lisp/play/fortune.el b/lisp/play/fortune.el index 0920012b280..cb58c0d0af0 100644 --- a/lisp/play/fortune.el +++ b/lisp/play/fortune.el @@ -244,17 +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)))) - (fortune-dat-exist (file-exists-p fortune-dat))) - (cond ((file-exists-p fortune-file) - (if (or (not fortune-dat-exist) - (and fortune-dat-exist - (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))))) + (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))))) ;;; ************** |