Skip to content

Commit

Permalink
Merge pull request #231 from yasuyk/occur-form-isearch
Browse files Browse the repository at this point in the history
Add commands to invoke (multi) occur form isearch
  • Loading branch information
Thierry Volpiatto committed Apr 1, 2013
2 parents 12cde93 + 975eaf1 commit e30f22c
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
20 changes: 18 additions & 2 deletions helm-config.el
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1680,8 +1680,9 @@ Preconfigured helm to show org headlines.


;;;*** ;;;***


;;;### (autoloads (helm-browse-code helm-multi-occur helm-occur helm-regexp) ;;;### (autoloads (helm-browse-code helm-multi-occur-from-isearch
;;;;;; "helm-regexp" "helm-regexp.el" (20813 57659 911717 901000)) ;;;;;; helm-multi-occur helm-occur-from-isearch helm-occur helm-regexp)
;;;;;; "helm-regexp" "helm-regexp.el" (20825 26373 0 0))
;;; Generated autoloads from helm-regexp.el ;;; Generated autoloads from helm-regexp.el


(autoload 'helm-regexp "helm-regexp" "\ (autoload 'helm-regexp "helm-regexp" "\
Expand All @@ -1695,6 +1696,11 @@ Preconfigured helm for Occur.
\(fn)" t nil) \(fn)" t nil)


(autoload 'helm-occur-from-isearch "helm-regexp" "\
Invoke `helm-occur' from isearch.
\(fn)" t nil)

(autoload 'helm-multi-occur "helm-regexp" "\ (autoload 'helm-multi-occur "helm-regexp" "\
Preconfigured helm for multi occur. Preconfigured helm for multi occur.
Expand All @@ -1706,6 +1712,16 @@ or during the buffer selection.
\(fn BUFFERS)" t nil) \(fn BUFFERS)" t nil)


(autoload 'helm-multi-occur-from-isearch "helm-regexp" "\
Invoke `helm-multi-occur' from isearch.
With a prefix arg, reverse the behavior of
`helm-moccur-always-search-in-current'.
The prefix arg can be set before calling
`helm-multi-occur-from-isearch' or during the buffer selection.
\(fn &optional ARG)" t nil)

(autoload 'helm-browse-code "helm-regexp" "\ (autoload 'helm-browse-code "helm-regexp" "\
Preconfigured helm to browse code. Preconfigured helm to browse code.
Expand Down
38 changes: 38 additions & 0 deletions helm-regexp.el
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -449,6 +449,22 @@ the center of window, otherwise at the top of window.")
:buffer "*helm occur*" :buffer "*helm occur*"
:history 'helm-grep-history)) :history 'helm-grep-history))


;;;###autoload
(defun helm-occur-from-isearch ()
"Invoke `helm-occur' from isearch."
(interactive)
(let ((input (if isearch-regexp
isearch-string
(regexp-quote isearch-string))))
(isearch-exit)
(setq helm-multi-occur-buffer-list (list (buffer-name (current-buffer))))
(helm-occur-init-source)
(helm-attrset 'name "Occur" helm-source-occur)
(helm :sources 'helm-source-occur
:buffer "*helm occur*"
:history 'helm-grep-history
:input input)))

;;;###autoload ;;;###autoload
(defun helm-multi-occur (buffers) (defun helm-multi-occur (buffers)
"Preconfigured helm for multi occur. "Preconfigured helm for multi occur.
Expand All @@ -468,6 +484,28 @@ or during the buffer selection."
helm-moccur-always-search-in-current))) helm-moccur-always-search-in-current)))
(helm-multi-occur-1 buffers))) (helm-multi-occur-1 buffers)))


;;;###autoload
(defun helm-multi-occur-from-isearch (&optional arg)
"Invoke `helm-multi-occur' from isearch.
With a prefix arg, reverse the behavior of
`helm-moccur-always-search-in-current'.
The prefix arg can be set before calling
`helm-multi-occur-from-isearch' or during the buffer selection."
(interactive "p")
(let ((helm-moccur-always-search-in-current
(if (or current-prefix-arg
helm-current-prefix-arg)
(not helm-moccur-always-search-in-current)
helm-moccur-always-search-in-current))
(input (if isearch-regexp
isearch-string
(regexp-quote isearch-string))))
(isearch-exit)
(helm-multi-occur-1
(helm-comp-read "Buffers: " (helm-buffer-list) :marked-candidates t)
input)))

;;;###autoload ;;;###autoload
(defun helm-browse-code () (defun helm-browse-code ()
"Preconfigured helm to browse code." "Preconfigured helm to browse code."
Expand Down

0 comments on commit e30f22c

Please sign in to comment.