From: David Ponce Date: Thu, 15 Dec 2005 20:23:46 +0000 (+0000) Subject: (recentf-dialog-goto-first): Fix missing error condition. X-Git-Tag: emacs-pretest-22.0.90~5266 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a07efa9f7cd227e55bd7c151997e1744d5f8ef0c;p=emacs.git (recentf-dialog-goto-first): Fix missing error condition. (recentf-edit-list, recentf-open-files): Signal an error when there is no recent file. --- diff --git a/lisp/recentf.el b/lisp/recentf.el index d92bc92f6ee..1106fea18b6 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -1038,7 +1038,8 @@ Go to the beginning of buffer if not found." (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))) @@ -1100,6 +1101,8 @@ IGNORE arguments." (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 @@ -1194,6 +1197,8 @@ files to choose from. It defaults to the whole recent list. 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