From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: in-buffer settings for priorities Date: Sun, 20 May 2007 17:45:08 +0200 Message-ID: References: Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hpnat-0005Lc-47 for emacs-orgmode@gnu.org; Sun, 20 May 2007 11:45:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hpnar-0005Gv-AD for emacs-orgmode@gnu.org; Sun, 20 May 2007 11:45:13 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hpnar-0005Gs-7T for emacs-orgmode@gnu.org; Sun, 20 May 2007 11:45:13 -0400 Received: from korteweg.uva.nl ([146.50.98.70]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hpnaq-0005lC-Q2 for emacs-orgmode@gnu.org; Sun, 20 May 2007 11:45:13 -0400 In-Reply-To: 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: Dmitri Minaev Cc: emacs-orgmode@gnu.org Hi Dmitri, before I look deeper into your patch, please try the following and tell us if this does the trick: On May 16, 2007, at 11:43, Dmitri Minaev wrote: > Hello, > > I'd like to know the opinion of the community (and Carsten's in > particular, of course) on the following idea -- do you think it would > be useful to have in-buffer settings to customize priorities? > > The background story (sorry if it's verbose) is like this. I keep my > reading list in org-mode (quite naturally). Normally, the entries are > stored in the chronological order, but sometimes I would like to see > the best or the worst read books. I started by using tags like > :score2:, :score8:, etc., so I could search for tags using regexps > like {score[7-9]}. Unfortunately, the entries were not sorted. You can influence the sorting strategy, The following should work: (setq org-agenda-custom-commands '(("P" tags "{^score[0-9]}" ((org-agenda-files '("~/org/books.org")) (org-agenda-sorting-strategy '(tag-down)) (org-agenda-prefix-format " %T: "))))) This sets up the command `C-c a P' to select books with a score tag, and to sort the list by score. The parameters make sure that only the file ~/org/books.org is checked, set up the sorting strategy to only look at the tag, and change the prefix to only show the score tag. The one complication/limitation is that the setup above will require that the score tag is the last tag in the list of tags, because only that tag will be used for sorting. A good way to do this is to make the score tags the last in your tags setup, for example: #+TAGS: xxx yyy zzz #+TAGS: { score0(0) score1(1) score2(2) score3(3) score4(4) #+TAGS: score5(5) score6(6) score7(7) score8(8) score9(9) } As you see, the score tags are set up as mutually exclusive (they are grouped in {...}), and all other tags are listed before them. So after changing tags with C-c C-c, tags will always be sorted to have the score last. - Carsten