]> git.eshelyaron.com Git - emacs.git/commitdiff
(view-emacs-news): Rewritten for new naming scheme
authorGerd Moellmann <gerd@gnu.org>
Thu, 17 Aug 2000 15:36:54 +0000 (15:36 +0000)
committerGerd Moellmann <gerd@gnu.org>
Thu, 17 Aug 2000 15:36:54 +0000 (15:36 +0000)
for old NEWS files.

lisp/help.el

index c9c816bbc65b6b034e518458379c94d2287d025c..abb59fc0b16b0c2b5cabede200f62a1428f7cd87 100644 (file)
@@ -436,12 +436,19 @@ of the key sequence that ran this command."
 
 (defun view-emacs-news (&optional arg)
   "Display info on recent changes to Emacs.
-With numeric argument display information on correspondingly older changes."
+With numeric argument, display information on correspondingly older changes."
   (interactive "P")
-  (let* ((arg (if arg (prefix-numeric-value arg) 0)))
-    (find-file-read-only
-     (expand-file-name (concat (make-string arg ?O) "NEWS")
-                      data-directory))))
+  (let* ((arg (if arg (prefix-numeric-value arg) 0))
+        (file (cond ((eq arg 0) "NEWS")
+                    ((eq arg 1) "ONEWS")
+                    (t
+                     (nth (- arg 2)
+                          (nreverse (directory-files data-directory
+                                                     nil "^NEWS\\.[0-9]+$"
+                                                     nil)))))))
+    (if file
+       (find-file-read-only (expand-file-name file data-directory))
+      (error "No such old news"))))
 
 (defun view-emacs-FAQ ()
   "Display the Emacs Frequently Asked Questions (FAQ) file."