diff options
author | Gerd Moellmann <gerd@gnu.org> | 2001-08-02 10:54:51 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2001-08-02 10:54:51 +0000 |
commit | 7f7d5b9ec49cf106b372e5ec3bd1852088a77691 (patch) | |
tree | 962facab9367fd11b904ecae4cc2724fa704755c /lisp/recentf.el | |
parent | 843c16a53a51198e303603e2ae2257d459bafd7e (diff) | |
download | emacs-7f7d5b9ec49cf106b372e5ec3bd1852088a77691.tar.gz |
(recentf-dump-variable): Handle a value of nil
correctly.
Diffstat (limited to 'lisp/recentf.el')
-rw-r--r-- | lisp/recentf.el | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/lisp/recentf.el b/lisp/recentf.el index 461edf069f0..dc79e6c0bc9 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -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 @@ These are the special commands of `recentf-dialog-mode' mode: 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 () |