]> code.delx.au - gnu-emacs/commitdiff
* lisp/play/fortune.el (fortune-compile): Simplify and fix previous change.
authorGlenn Morris <rgm@gnu.org>
Fri, 15 Feb 2013 01:30:11 +0000 (20:30 -0500)
committerGlenn Morris <rgm@gnu.org>
Fri, 15 Feb 2013 01:30:11 +0000 (20:30 -0500)
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...

lisp/ChangeLog
lisp/play/fortune.el

index 5a752fe0c3a8a28870d90d35985082c446ba44de..9172866b49cde9f1752d02c818554e2af968574a 100644 (file)
@@ -1,3 +1,7 @@
+2013-02-15  Glenn Morris  <rgm@gnu.org>
+
+       * play/fortune.el (fortune-compile): Simplify and fix previous change.
+
 2013-02-14  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp.el (tramp-debug-message): Add
index 0920012b28043a736c2745a0994a07fc9de7ae71..cb58c0d0af06e5136d430bd402bd595dadae215f 100644 (file)
@@ -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)))))
 
 
 ;;; **************