diff options
| author | David Ponce | 2005-12-15 20:23:46 +0000 |
|---|---|---|
| committer | David Ponce | 2005-12-15 20:23:46 +0000 |
| commit | a07efa9f7cd227e55bd7c151997e1744d5f8ef0c (patch) | |
| tree | 349f283cb4fee414e711c0aae7784c05c9de3d83 | |
| parent | d0ccae3ee4e6967504062094f735fba27f6d9db3 (diff) | |
| download | emacs-a07efa9f7cd227e55bd7c151997e1744d5f8ef0c.tar.gz emacs-a07efa9f7cd227e55bd7c151997e1744d5f8ef0c.zip | |
(recentf-dialog-goto-first): Fix missing error condition.
(recentf-edit-list, recentf-open-files): Signal an error when
there is no recent file.
| -rw-r--r-- | lisp/recentf.el | 7 |
1 files changed, 6 insertions, 1 deletions
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." | |||
| 1038 | (if (eq widget-type (widget-type (widget-at (point)))) | 1038 | (if (eq widget-type (widget-type (widget-at (point)))) |
| 1039 | (setq done t) | 1039 | (setq done t) |
| 1040 | (widget-move 1)))) | 1040 | (widget-move 1)))) |
| 1041 | (goto-char (point-min)))) | 1041 | (error |
| 1042 | (goto-char (point-min))))) | ||
| 1042 | 1043 | ||
| 1043 | (defvar recentf-dialog-mode-map | 1044 | (defvar recentf-dialog-mode-map |
| 1044 | (let ((km (copy-keymap recentf--shortcuts-keymap))) | 1045 | (let ((km (copy-keymap recentf--shortcuts-keymap))) |
| @@ -1100,6 +1101,8 @@ IGNORE arguments." | |||
| 1100 | (defun recentf-edit-list () | 1101 | (defun recentf-edit-list () |
| 1101 | "Show a dialog to delete selected files from the recent list." | 1102 | "Show a dialog to delete selected files from the recent list." |
| 1102 | (interactive) | 1103 | (interactive) |
| 1104 | (unless recentf-list | ||
| 1105 | (error "The list of recent files is empty")) | ||
| 1103 | (recentf-dialog (format "*%s - Edit list*" recentf-menu-title) | 1106 | (recentf-dialog (format "*%s - Edit list*" recentf-menu-title) |
| 1104 | (set (make-local-variable 'recentf-edit-list) nil) | 1107 | (set (make-local-variable 'recentf-edit-list) nil) |
| 1105 | (widget-insert | 1108 | (widget-insert |
| @@ -1194,6 +1197,8 @@ files to choose from. It defaults to the whole recent list. | |||
| 1194 | If optional argument BUFFER-NAME is non-nil, it is a buffer name to | 1197 | If optional argument BUFFER-NAME is non-nil, it is a buffer name to |
| 1195 | use for the dialog. It defaults to \"*`recentf-menu-title'*\"." | 1198 | use for the dialog. It defaults to \"*`recentf-menu-title'*\"." |
| 1196 | (interactive) | 1199 | (interactive) |
| 1200 | (unless (or files recentf-list) | ||
| 1201 | (error "There is no recent file to open")) | ||
| 1197 | (recentf-dialog (or buffer-name (format "*%s*" recentf-menu-title)) | 1202 | (recentf-dialog (or buffer-name (format "*%s*" recentf-menu-title)) |
| 1198 | (widget-insert "Click on a file" | 1203 | (widget-insert "Click on a file" |
| 1199 | (if recentf-show-file-shortcuts-flag | 1204 | (if recentf-show-file-shortcuts-flag |