From d9189451c3ece272da294106aa7efa764b8d1905 Mon Sep 17 00:00:00 2001 From: rubikitch Date: Mon, 6 Sep 2010 18:09:38 +0900 Subject: [PATCH] anything.el (anything-keep-selection): do nothing when source and selection are null. --- anything.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/anything.el b/anything.el index 7ab82e0..4cde676 100644 --- a/anything.el +++ b/anything.el @@ -2159,14 +2159,15 @@ If current source has `update' attribute, a function without argument, call it b (anything-keep-selection source selection)))) (defun anything-keep-selection (source selection) - (with-anything-window - (anything-goto-source source) - (forward-char -1) ;back to \n - (if (search-forward (concat "\n" selection "\n") nil t) - (forward-line -1) - (goto-char (point-min)) - (forward-line 1)) - (anything-mark-current-line))) + (when (and source selection) + (with-anything-window + (anything-goto-source source) + (forward-char -1) ;back to \n + (if (search-forward (concat "\n" selection "\n") nil t) + (forward-line -1) + (goto-char (point-min)) + (forward-line 1)) + (anything-mark-current-line)))) (defun anything-remove-candidate-cache (source) (setq anything-candidate-cache -- 2.11.4.GIT