From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Dmitri Minaev" Subject: Re: in-buffer settings for priorities Date: Mon, 21 May 2007 18:11:15 +0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hq7fU-0000Fp-9M for emacs-orgmode@gnu.org; Mon, 21 May 2007 09:11:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hq7fS-0000FK-TF for emacs-orgmode@gnu.org; Mon, 21 May 2007 09:11:19 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hq7fS-0000F6-CT for emacs-orgmode@gnu.org; Mon, 21 May 2007 09:11:18 -0400 Received: from ug-out-1314.google.com ([66.249.92.175]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hq7fR-0003Ez-G8 for emacs-orgmode@gnu.org; Mon, 21 May 2007 09:11:18 -0400 Received: by ug-out-1314.google.com with SMTP id j3so1022807ugf for ; Mon, 21 May 2007 06:11:16 -0700 (PDT) In-Reply-To: Content-Disposition: inline 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: emacs-orgmode@gnu.org copying to the list: Thank you. I thought about using sorting strategy to sort by tags, but the requirement that the score must be the last tag has stopped me. I like the approach you describe, but it still has some deficiencies. First, any tag not included in the set of the pre-defined tags breaks the order of tags making the score to appear before this tag. Second, I would say that it's more visually pleasing to have the rating in a fixed place, separate from tags. The idea of priorities itself fits the task better, IMHO. BTW, after upgrade to 4.74, I noticed a couple of things: 1. When the state of an item changes from nothing to the first in the TODO sequence, no note is taken and the state change is not logged. Is this by design? 2. When I run org-tags-sparse-tree with a regexp like {score[X-Y]}, the resulting tree includes one and only one item with the score less than X. I simplified the tree and .emacs as much as possible and even the example as simple as the one below still demonstrates this behaviour: * qwer ** qwer :score9: ** asdf :score7: ** zxcv :score5: ** nmkj :score7: ** poi :score4: C-c \ {[score[8-9]} gives the result: * qwer ** qwer :score9: ** asdf :score7:... On 5/20/07, Carsten Dominik wrote: > 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 > > -- With best regards, Dmitri Minaev Russian history blog: http://minaev.blogspot.com