From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Pohlack Subject: Re: Using org-mode as day planner Date: Mon, 13 Aug 2012 20:20:11 +0200 Message-ID: <5029455B.6000208@os.inf.tu-dresden.de> References: <5023F648.1060701@jugband.net> <871ujf4193.fsf@gnu.org> <87wr15wy7w.fsf@altern.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0zFm-0007sK-46 for emacs-orgmode@gnu.org; Mon, 13 Aug 2012 14:20:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0zFi-0001p8-DQ for emacs-orgmode@gnu.org; Mon, 13 Aug 2012 14:20:38 -0400 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: John Hendy Cc: Bastien , emacs-orgmode@gnu.org, Jack Erwin On 12.08.2012 17:48, John Hendy wrote: > On Sat, Aug 11, 2012 at 4:34 AM, Bastien wrote: >> Hi John, >> >> John Hendy writes: >> >>> Date trees are the obvious way to be able to do this, but they don't >>> have any of the neat search functionality that I know of. >> >> Can you describe the search functionality you would like for date-trees? >> I'm not sure I groked it. > > Date trees allow for a very nice way for filing notes in chronological > order, but =C-c / dateRange= does not work for date trees. Previously, > active time stamps worked, but I didn't want all my notes showing up > in my agenda, so I just dealt with not having a great solution. Then > you provided one with the sparse-tree search timestamp-type selection > ability, which rocks. > > Date trees are still the best way to use capture for foolproof > chronological storage of notes quickly... but I wouldn't be able to > extract notes in a particular date-range with current functionality. Hi John, I have a very similar use case. I capture all my stuff into a date tree and for my weekly report I parse that and extract a subset. It looks a bit crude (hardcoded stuff for my setup) but works for now. I must say that date-trees in their current form feel a bit un-org-mody as they use a completely different data format: ---------------------------------------------------------------------- (defun mp26/org-find-headline-prefix-in-buffer (heading &optional buffer pos-only) "Find node with heading-prefix HEADING in BUFFER. Return a marker to the heading if it was found, or nil if not. If POS-ONLY is set, return just the position instead of a marker. The heading prefix must match as prefix of the full headline. It may have a TODO keyword, a priority cookie and tags in the standard locations." (with-current-buffer (or buffer (current-buffer)) (save-excursion (save-restriction (widen) (goto-char (point-min)) (let (case-fold-search) (if (re-search-forward (format org-complex-heading-regexp-format (concat (regexp-quote heading) ".*")) nil t) (if pos-only (match-beginning 0) (move-marker (make-marker) (match-beginning 0))))))))) ; fixme: optional parameter for starting date (defun mp26/org-week-from-journal () "Insert a copy of the current week from the journal." (interactive) (insert (mapconcat 'identity (with-current-buffer "Journal.org" (loop for days in '(-6 -5 -4 -3 -2 -1 0) collect (let* ((date (calendar-current-date days)) (date-string (format "%d-%02d-%02d" (nth 2 date) (nth 0 date) (nth 1 date)))) (setq pos (mp26/org-find-headline-prefix-in-buffer date-string nil t)) (when pos (goto-char pos) (org-copy-subtree) (car kill-ring))))) ""))) ----------------------------------------------------------------------