From 3211573acf9d718b8bea70b3b20b37ca776db680 Mon Sep 17 00:00:00 2001 From: Thierry Volpiatto Date: Sun, 9 Sep 2012 07:32:40 +0200 Subject: [PATCH] * helm-buffers.el (helm-multi-occur-as-action): Force searching in current buffer with a prefix arg. * helm-regexp.el (helm-multi-occur): same. --- helm-buffers.el | 5 ++++- helm-help.el | 4 ++-- helm-regexp.el | 12 ++++++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/helm-buffers.el b/helm-buffers.el index cfb94688f..9be3d8c72 100644 --- a/helm-buffers.el +++ b/helm-buffers.el @@ -482,7 +482,10 @@ See `helm-ediff-marked-buffers'." (defun helm-multi-occur-as-action (_candidate) "Multi occur action for `helm-c-source-buffers-list'. 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) thereis (and (string-match "\\`@\\(.*\\)" i) (match-string 1 i))))) diff --git a/helm-help.el b/helm-help.el index 41823518f..ac42875e0 100644 --- a/helm-help.el +++ b/helm-help.el @@ -166,8 +166,8 @@ This list is customizable, see `helm-buffers-favorite-modes'. \nSpecific commands for `helm-buffers-list': \\ -\\[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-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. (C-u force searching current-buffer). \\[helm-buffer-switch-other-window]\t\t->Switch other window. \\[helm-buffer-switch-other-frame]\t\t->Switch other frame. \\[helm-buffer-run-query-replace-regexp]\t\t->Query replace regexp in marked buffers. diff --git a/helm-regexp.el b/helm-regexp.el index 98521716f..076fb6136 100644 --- a/helm-regexp.el +++ b/helm-regexp.el @@ -387,11 +387,19 @@ the center of window, otherwise at the top of window.") (defun helm-multi-occur (buffers) "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 "Buffers: " (helm-c-buffer-list) :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 (defun helm-browse-code ()