Allow last-search-buffer to resume last search even if no saved search

With this patch, it's possible to resume last search done with ag even
if there's no saved search

Fixes #3707
This commit is contained in:
Muneeb Shaikh 2015-11-08 12:07:53 +05:30 committed by Eivind Fonn
parent 951462f316
commit 17f6225c5d

View file

@ -614,11 +614,14 @@ Removes the automatic guessing of the initial value based on thing at point. "
(defun spacemacs/last-search-buffer ()
"open last helm-ag or hgrep buffer."
(interactive)
(if (get-buffer "*helm ag results*")
(switch-to-buffer-other-window "*helm ag results*")
(if (get-buffer "*hgrep*")
(switch-to-buffer-other-window "*hgrep*")
(message "No previous search buffer found"))))
(cond ((get-buffer "*helm ag results*")
(switch-to-buffer-other-window "*helm ag results*"))
((get-buffer "*helm-ag*")
(helm-resume "*helm-ag*"))
((get-buffer "*hgrep*")
(switch-to-buffer-other-window "*hgrep*"))
(t
(message "No previous search buffer found"))))
(defun spacemacs/helm-faces ()
"Describe face."