org-grep icon indicating copy to clipboard operation
org-grep copied to clipboard

No results found?

Open alphapapa opened this issue 8 years ago • 6 comments

Hi,

I'm excited to use org-grep, but every time I use org-grep or org-grep-full, a buffer is opened with no results found, e.g.:

#+TITLE: org (org-grep -i)     browse [[elisp:(org-grep-display-edit)][edit]] [[elisp:(org-grep-display-tree)][tree]]

* Occurrences

I just installed it from MELPA, version 20151202.429. I'm using org-mode version 8.2.4.

Thanks for your help.

alphapapa avatar Mar 22 '16 00:03 alphapapa

I encountered the same problem in Mac. If you are also a Mac user and defining org-grep-extensions with multiple extensions, could you please try the following code?

(defun org-grep-from-org-shell-command (regexp)
               (if org-grep-directories
                   (concat "find -E "
                           (if org-grep-directories
                               (mapconcat #'identity org-grep-directories " ")
                             org-directory)
                           (and org-grep-extensions
                                (concat " -regex '.*("
                                        (mapconcat #'regexp-quote org-grep-extensions "|")
                                        ")$'"))
                           " -print0 | xargs -0 grep " org-grep-grep-options
                           " -n -- " (shell-quote-argument regexp))
                 ":"))

takaxp avatar Aug 16 '16 15:08 takaxp

Sorry, I'm on Linux. I never got org-grep to work, so I ended up making this: https://github.com/alphapapa/helm-org-rifle It has functions to search directories of Org files. It works by opening them in Emacs buffers, though, so it may not be as fast for searching many separate files. In the future I may add some features to search directories using external tools like grep and git-grep.

alphapapa avatar Aug 23 '16 02:08 alphapapa

It's OK :-) The proposed org-grep-from-org-shell-command is modified version to execute find command with correct options, and also regex syntax was not valid for Mac environment. BTW, We have several methods for searching such as the keyword search in org-agenda (C-c a s), ag.el, helm-swoop for inbuffer. I'm new to helm-org-rifle but It looks fancy for me!

takaxp avatar Aug 23 '16 02:08 takaxp

On Mon, Aug 22, 2016 at 9:38 PM, Takaaki ISHIKAWA [email protected] wrote:

I'm new to helm-org-rifle but It looks fancy for me!

It's basically an enhanced version of helm-swoop for Org. Give it a try, it's very easy to use. ;)

alphapapa avatar Aug 23 '16 15:08 alphapapa

@takaxp's function worked for me on OS X. 👍

Seems like this repo may not be supported, but should submit a PR :)

sshaw avatar Apr 29 '17 16:04 sshaw

This issue is not occurring in my present environment, El Capitan/Emacs 25.2(NS build)/Org Mode 9.0, anymore. So I think we don't need a PR to update the original code and this issue could be closed if other people do not suffer from the problem.

takaxp avatar May 24 '17 14:05 takaxp