changeset 38662:dd6bc9395c61

(recentf-dump-variable): Handle a value of nil correctly.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 02 Aug 2001 10:54:25 +0000
parents 2511f86ea47a
children d9122c191349
files lisp/recentf.el
diffstat 1 files changed, 9 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/recentf.el	Thu Aug 02 10:36:22 2001 +0000
+++ b/lisp/recentf.el	Thu Aug 02 10:54:25 2001 +0000
@@ -1,6 +1,6 @@
 ;;; recentf.el --- setup a menu of recently opened files
 
-;; Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
 
 ;; Author: David Ponce <david@dponce.com>
 ;; Created: July 19 1999
@@ -846,18 +846,14 @@
 Optional argument LIMIT specifies a maximum length when VARIABLE value
 is a list (default to the full list)."
   (let ((value (symbol-value variable)))
-    (insert (format "(setq %S\n      '(\n" variable))
-    (cond ((consp value)
-           (if (and (integerp limit) (> limit 0))
-               (setq value (recentf-trunc-list value limit)))
-           (mapc (function
-                  (lambda (e)
-                    (insert (format "        %S\n" e))))
-                 value))
-          (t
-           (insert (format "        %S\n" value))))
-    (insert "        ))\n")
-    ))
+    (if (listp value)
+	(progn
+	  (when (and (integerp limit) (> limit 0))
+	    (setq value (recentf-trunc-list value limit)))
+	  (insert (format "(setq %S '(" variable))
+	  (mapc (lambda (e) (insert (format "\n%S" e))) value)
+	  (insert "))\n"))
+      (insert (format "(setq %S %S)\n" variable value)))))
 
 ;;;###autoload
 (defun recentf-save-list ()