Skip to content

Commit

Permalink
* helm-buffers.el (helm-multi-occur-as-action): Force searching in cu…
Browse files Browse the repository at this point in the history
…rrent buffer with a prefix arg.

* helm-regexp.el (helm-multi-occur): same.
  • Loading branch information
thierryvolpiatto committed Sep 9, 2012
1 parent cb576f8 commit 3211573
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
5 changes: 4 additions & 1 deletion helm-buffers.el
Expand Up @@ -482,7 +482,10 @@ See `helm-ediff-marked-buffers'."
(defun helm-multi-occur-as-action (_candidate) (defun helm-multi-occur-as-action (_candidate)
"Multi occur action for `helm-c-source-buffers-list'. "Multi occur action for `helm-c-source-buffers-list'.
Can be used by any source that list buffers." Can be used by any source that list buffers."
(let ((buffers (helm-marked-candidates)) (let ((helm-moccur-always-search-in-current
(or helm-moccur-always-search-in-current
helm-current-prefix-arg))
(buffers (helm-marked-candidates))
(input (loop for i in (split-string helm-pattern " " t) (input (loop for i in (split-string helm-pattern " " t)
thereis (and (string-match "\\`@\\(.*\\)" i) thereis (and (string-match "\\`@\\(.*\\)" i)
(match-string 1 i))))) (match-string 1 i)))))
Expand Down
4 changes: 2 additions & 2 deletions helm-help.el
Expand Up @@ -166,8 +166,8 @@ This list is customizable, see `helm-buffers-favorite-modes'.
\nSpecific commands for `helm-buffers-list': \nSpecific commands for `helm-buffers-list':
\\<helm-c-buffer-map> \\<helm-c-buffer-map>
\\[helm-buffer-run-zgrep]\t\t->Grep Buffer(s) works as zgrep too. (C-u grep all buffers but non--file buffers). \\[helm-buffer-run-zgrep]\t\t->Grep Buffer(s) works as zgrep too (C-u grep all buffers but non--file buffers).
\\[helm-buffers-run-multi-occur]\t\t->Multi Occur buffer or marked buffers. \\[helm-buffers-run-multi-occur]\t\t->Multi Occur buffer or marked buffers. (C-u force searching current-buffer).
\\[helm-buffer-switch-other-window]\t\t->Switch other window. \\[helm-buffer-switch-other-window]\t\t->Switch other window.
\\[helm-buffer-switch-other-frame]\t\t->Switch other frame. \\[helm-buffer-switch-other-frame]\t\t->Switch other frame.
\\[helm-buffer-run-query-replace-regexp]\t\t->Query replace regexp in marked buffers. \\[helm-buffer-run-query-replace-regexp]\t\t->Query replace regexp in marked buffers.
Expand Down
12 changes: 10 additions & 2 deletions helm-regexp.el
Expand Up @@ -387,11 +387,19 @@ the center of window, otherwise at the top of window.")
(defun helm-multi-occur (buffers) (defun helm-multi-occur (buffers)
"Preconfigured helm for multi occur. "Preconfigured helm for multi occur.
BUFFERS is a list of buffers to search through." BUFFERS is a list of buffers to search through.
With a prefix arg, force searching in current buffer
even if `helm-moccur-always-search-in-current' is nil.
The prefix arg can be set before calling `helm-multi-occur'
or during the buffer selection."
(interactive (list (helm-comp-read (interactive (list (helm-comp-read
"Buffers: " (helm-c-buffer-list) "Buffers: " (helm-c-buffer-list)
:marked-candidates t))) :marked-candidates t)))
(helm-multi-occur-1 buffers)) (let ((helm-moccur-always-search-in-current
(or helm-moccur-always-search-in-current
(or current-prefix-arg
helm-current-prefix-arg))))
(helm-multi-occur-1 buffers)))


;;;###autoload ;;;###autoload
(defun helm-browse-code () (defun helm-browse-code ()
Expand Down

0 comments on commit 3211573

Please sign in to comment.