emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: 노정태 <basil83@gmail.com>
To: Matt Lundin <mdl@imapmail.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Search files in a folder
Date: Wed, 15 Sep 2010 01:06:25 +0900	[thread overview]
Message-ID: <AANLkTik_d3ca-JtxME9X0CBUZ_j0U7J042Ft_3cV5EjE@mail.gmail.com> (raw)
In-Reply-To: <87eicxzkdw.fsf@archdesk.localdomain>


[-- Attachment #1.1: Type: text/plain, Size: 1399 bytes --]

Wow, It works like a magic! Thank you so much.

I wrote it to my .emacs. Thank you.

Sincerely, Jeongtae



2010/9/14 Matt Lundin <mdl@imapmail.org>

> 노정태 <basil83@gmail.com> writes:
>
> > Suvayu, I read your comment, and googled about what I can't understand.
> >
> > In Emacs, M-x grep <RET> Filename * <RET> does what I want. Thank you.
> >
> > And now, I want to make it as one elisp command.
> >
> > What should I do? Can anybody write a simple script?
>
> FWIW, here's my elisp function to search all my org files with lgrep:
>
> --8<---------------cut here---------------start------------->8---
>  (defun my-org-grep (search &optional context)
>    "Search for word in org files.
>
> Prefix argument determines number of lines."
>    (interactive "sSearch for: \nP")
>    (let ((grep-find-ignored-files '("#*" ".#*"))
>          (grep-template (concat "grep <X> -i -nH "
>                                 (when context
>                                   (concat "-C" (number-to-string context)))
>                                 " -e <R> <F>")))
>      (lgrep search "*org*" "/home/matt/org/")))
>
>  (global-set-key (kbd "<f8>") 'my-org-grep)
> --8<---------------cut here---------------end--------------->8---
>
> A prefix argument (e.g., C-u 3 <f8>) will change the number of
> contextual lines pulled up by the search.
>
> Best,
> Matt
>

[-- Attachment #1.2: Type: text/html, Size: 2361 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2010-09-14 16:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-12 19:11 Search files in a folder 노정태
2010-09-12 19:31 ` Eric S Fraga
2010-09-12 20:29   ` suvayu ali
2010-09-13  1:51   ` Matt Lundin
2010-09-13  4:09     ` 노정태
2010-09-13  4:22       ` suvayu ali
2010-09-13  7:15         ` 노정태
2010-09-13 16:19           ` Matt Lundin
2010-09-14 16:06             ` 노정태 [this message]
2010-09-20  8:31             ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTik_d3ca-JtxME9X0CBUZ_j0U7J042Ft_3cV5EjE@mail.gmail.com \
    --to=basil83@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mdl@imapmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).