aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2013-02-14 20:30:11 -0500
committerGlenn Morris2013-02-14 20:30:11 -0500
commitdec2a322921d74de8f251a54931d4c50ab00713d (patch)
treec8e1371cdfcade6800ce65dea9a55e051938b853
parent51b3a99c948dc83f3387f440702ab6e175b61e0f (diff)
downloademacs-dec2a322921d74de8f251a54931d4c50ab00713d.tar.gz
emacs-dec2a322921d74de8f251a54931d4c50ab00713d.zip
* 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...
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/play/fortune.el19
2 files changed, 12 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5a752fe0c3a..9172866b49c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12013-02-15 Glenn Morris <rgm@gnu.org>
2
3 * play/fortune.el (fortune-compile): Simplify and fix previous change.
4
12013-02-14 Michael Albinus <michael.albinus@gmx.de> 52013-02-14 Michael Albinus <michael.albinus@gmx.de>
2 6
3 * net/tramp.el (tramp-debug-message): Add 7 * net/tramp.el (tramp-debug-message): Add
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."
244 (let* ((fortune-file (expand-file-name (substitute-in-file-name file))) 244 (let* ((fortune-file (expand-file-name (substitute-in-file-name file)))
245 (fortune-dat (expand-file-name 245 (fortune-dat (expand-file-name
246 (substitute-in-file-name 246 (substitute-in-file-name
247 (concat fortune-file fortune-database-extension)))) 247 (concat fortune-file fortune-database-extension)))))
248 (fortune-dat-exist (file-exists-p fortune-dat))) 248 (cond ((file-exists-p fortune-file)
249 (cond ((file-exists-p fortune-file) 249 (cond ((file-newer-than-file-p fortune-file fortune-dat)
250 (if (or (not fortune-dat-exist) 250 (message "Compiling new fortune database %s" fortune-dat)
251 (and fortune-dat-exist 251 (shell-command
252 (file-newer-than-file-p fortune-file fortune-dat))) 252 (concat fortune-strfile fortune-strfile-options
253 (message "Compiling new fortune database %s" fortune-dat) 253 " " fortune-file fortune-quiet-strfile-options)))))
254 (shell-command 254 (t (error "Can't compile fortune file %s" fortune-file)))))
255 (concat fortune-strfile fortune-strfile-options
256 " " fortune-file fortune-quiet-strfile-options))))
257 (t (error "Can't compile fortune file %s" fortune-file)))))
258 255
259 256
260;;; ************** 257;;; **************