From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: A puzzle to solve: saved categories vs. tags Date: Mon, 8 Oct 2007 13:48:18 +0200 Message-ID: <4d056197e283a9e8c04025b4ad022c2e@science.uva.nl> References: <7fc2c048b6b1f8d2359406c8e67b3e0e@science.uva.nl> <87lkad98rz.fsf@bzg.ath.cx> <87tzp14w7h.fsf@bzg.ath.cx> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: multipart/mixed; boundary=Apple-Mail-2-936017668 Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ier5p-0006jO-Kv for emacs-orgmode@gnu.org; Mon, 08 Oct 2007 07:48:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ier5o-0006j4-7O for emacs-orgmode@gnu.org; Mon, 08 Oct 2007 07:48:13 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ier5o-0006j1-2K for emacs-orgmode@gnu.org; Mon, 08 Oct 2007 07:48:12 -0400 Received: from korteweg.uva.nl ([146.50.98.70]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ier5n-000259-Av for emacs-orgmode@gnu.org; Mon, 08 Oct 2007 07:48:11 -0400 In-Reply-To: <87tzp14w7h.fsf@bzg.ath.cx> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: org-mode list --Apple-Mail-2-936017668 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On Oct 8, 2007, at 14:39, Bastien wrote: > Carsten Dominik writes: > >> Arrrgh! >> >> make that (org-buffer-property-keys t) for now, bug fix in next >> release. > > This patch is also needed: Indeed, thanks a lot. So to make this simpler, here is the modified version that should work out of the box. Sorry once again for the mess and the bandwidth waste. - Carsten --Apple-Mail-2-936017668 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name="org-sparse-tree-interactive.el" Content-Disposition: attachment; filename=org-sparse-tree-interactive.el (defun org-sparse-tree (&optional arg) "Create a sparse tree, prompt for the details. This command can create sparse trees. You first need to select the type of match used to create the tree: t Show entries with a specific TODO keyword. T Show entries selected by a tags match. p Enter a property name and its value (both with completion on existing names/values) and show entries with that property. r Show entries matching a regular expression" (interactive "P") (let (ans kwd value) (message "Sparse tree: [r]egexp [t]odo-kwd [T]ag [p]roperty") (setq ans (read-char-exclusive)) (cond ((equal ans ?t) (org-show-todo-tree '(4))) ((equal ans ?T) (call-interactively 'org-tags-sparse-tree)) ((member ans '(?p ?P)) (setq kwd (completing-read "Property: " (mapcar 'list (org-buffer-property-keys)))) (setq value (completing-read "Value: " (mapcar 'list (org-property-values kwd)))) (unless (string-match "\\`{.*}\\'" value) (setq value (concat "\"" value "\""))) (org-tags-sparse-tree arg (concat kwd "=" value))) ((member ans '(?r ?R)) (call-interactively 'org-occur)) (t (error "No such sparse tree command \"%c\"" ans))))) (defun org-property-values (key) "Return a list of all values of property KEY." (save-excursion (save-restriction (widen) (goto-char (point-min)) (let ((re (concat "^[ \t]*:" key ":[ \t]*\\(\\S-.*\\)")) values) (while (re-search-forward re nil t) (add-to-list 'values (org-trim (match-string 1)))) (delete "" values))))) --Apple-Mail-2-936017668 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --Apple-Mail-2-936017668--