;;; recentf.el --- setup a menu of recently opened files
;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005 Free Software Foundation, Inc.
+;; 2005, 2006 Free Software Foundation, Inc.
;; Author: David Ponce <david@dponce.com>
;; Created: July 19 1999
(if (eq widget-type (widget-type (widget-at (point))))
(setq done t)
(widget-move 1))))
- (goto-char (point-min))))
+ (error
+ (goto-char (point-min)))))
(defvar recentf-dialog-mode-map
(let ((km (copy-keymap recentf--shortcuts-keymap)))
(defun recentf-edit-list ()
"Show a dialog to delete selected files from the recent list."
(interactive)
+ (unless recentf-list
+ (error "The list of recent files is empty"))
(recentf-dialog (format "*%s - Edit list*" recentf-menu-title)
(set (make-local-variable 'recentf-edit-list) nil)
(widget-insert
:button-prefix ""
:button-suffix ""
:button-face default
- :format "%[%t%]\n"
+ :format "%[%t\n%]"
:help-echo ,(concat "Open " (cdr menu-element))
:action recentf-open-files-action
,(cdr menu-element))))
If optional argument BUFFER-NAME is non-nil, it is a buffer name to
use for the dialog. It defaults to \"*`recentf-menu-title'*\"."
(interactive)
+ (unless (or files recentf-list)
+ (error "There is no recent file to open"))
(recentf-dialog (or buffer-name (format "*%s*" recentf-menu-title))
(widget-insert "Click on a file"
(if recentf-show-file-shortcuts-flag