From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Minning Org-files Date: Sat, 10 Oct 2015 08:06:44 -0400 Message-ID: References: <4C0B4DC8-B1BD-4BDC-8717-A317C551E046@ur.rochester.edu> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZksvJ-0007aA-Qa for emacs-orgmode@gnu.org; Sat, 10 Oct 2015 08:06:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZksvG-0003r0-KD for emacs-orgmode@gnu.org; Sat, 10 Oct 2015 08:06:49 -0400 Received: from mail-qg0-x229.google.com ([2607:f8b0:400d:c04::229]:32904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZksvG-0003qm-GD for emacs-orgmode@gnu.org; Sat, 10 Oct 2015 08:06:46 -0400 Received: by qgew37 with SMTP id w37so30757920qge.0 for ; Sat, 10 Oct 2015 05:06:46 -0700 (PDT) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Doyley, Marvin M." Cc: "emacs-orgmode@gnu.org" sure, if you make an interactive function that takes a search argument. Something like this (defun some-name (search-arg) (interactive "sQuery: ") ; insert code below and change "TODO=\"DONE\"" to search-arg ) Doyley, Marvin M. writes: > Is there anyway of making the search term a variable ? > >> On Oct 9, 2015, at 1:24 PM, John Kitchin wrote: >> >> You can do something like this: >> >> By TODO keyword to grab the DONE entries. >> >> #+BEGIN_SRC emacs-lisp >> (let ((entries (org-map-entries >> (lambda () >> (save-restriction >> (org-narrow-to-subtree) >> (buffer-string))) >> "TODO=\"DONE\""))) >> (switch-to-buffer (get-buffer-create "new")) >> (org-mode) >> (mapcar 'insert entries)) >> #+END_SRC >> >> >> >> Doyley, Marvin M. writes: >> >>> Hi there, >>> >>> I have a huge org-file with notes I have taken on various topics (my commonplace org file). Is there an easy way to grab all the entires with a given tag or keyword to a new org-file ? >>> >>> Thanks, >>> M >>> >>> --- >>> Marvin Doyley Ph.D. >>> University of Rochester >>> Associate Professor of Electrical and Computer Engineering >>> Associate Professor of Biomedical Engineering >>> 333 Hopeman Engineering Building >>> Rochester NY 14627 >> >> -- >> Professor John Kitchin >> Doherty Hall A207F >> Department of Chemical Engineering >> Carnegie Mellon University >> Pittsburgh, PA 15213 >> 412-268-7803 >> @johnkitchin >> https://urldefense.proofpoint.com/v2/url?u=http-3A__kitchingroup.cheme.cmu.edu&d=BQIBAg&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=T41F_5QsIVBGYhPPUkgYHUp9iPHgs2rOCjs7rfKaTMU&m=ZjP3xZzVOvLNMInBTkxBhV_-2rP9uP3owADCIadxXxk&s=ry0y4fD4NMUUCHUpPSK5djnyUZWt57fxbXHuhqUfSls&e= -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu