emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* in-buffer settings for priorities
@ 2007-05-16  9:43 Dmitri Minaev
  2007-05-16 11:47 ` Dmitri Minaev
  2007-05-20 15:45 ` Carsten Dominik
  0 siblings, 2 replies; 8+ messages in thread
From: Dmitri Minaev @ 2007-05-16  9:43 UTC (permalink / raw)
  To: emacs-orgmode

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.
Basically, the only way to sort them is to use priorities instead of
tags. Three grades were not enough, of course, so I set
org-lowest-priority to J. On the contrary, 10 grades were too much for
other files, like todo lists. So, I decided to add per-file settings
for priorities: parameter #+PRIORITY_LOW.

This worked, but using letters to rate books was not the best idea and
I decided to add digits from 0 to 9 to the list of priorities. Now I
think that it might have been better to add a kind of a
#+PRIORITY_STYLE with values 'abc' and 'num', for example, but at that
moment I added another variable -- org-highest-priority and a
corresponding in-buffer setting #+PRIORITY_HIGH. I also had to replace
the regexps for priorities with [A-Z0-9],  I changed the
org-default-priority value from \B to org-lowest-priority, added
#+PRIORITY_DEF setting and adapted the prompts to use
org-highest-priority instead of \A.

Now, I could add this to the reading list:
#+PRIORITY_HIGH: 0
#+PRIORITY_LOW: 9
#+PRIORITY_DEF: 5

Now, only a small change in the .emacs was needed to add a new agenda
custom command that changes the sorting strategy to priority-up, et
voila! I only have to type C-c a 1 b to see the list of books sorted
by my rating.

What still confuses me is the necessity to press S-down to _increase_
the rating. Or, perhaps, I should just get used to the fact the best
books should have rating 1 instead of 9.

The patch against version 4.74 is below. Don't judge me too harshly :)


--- ../org.el	2007-05-16 12:17:15.000000000 +0500
+++ org.el	2007-05-16 13:20:17.000000000 +0500
@@ -1527,9 +1527,8 @@
   :tag "Org Priorities"
   :group 'org-todo)

-(defcustom org-default-priority ?B
-  "The default priority of TODO items.
-This is the priority an item get if no explicit priority is given."
+(defcustom org-highest-priority ?A
+  "The highest priority of TODO items.  A character like ?A, ?B etc."
   :group 'org-priorities
   :type 'character)

@@ -1538,6 +1537,12 @@
   :group 'org-priorities
   :type 'character)

+(defcustom org-default-priority org-lowest-priority
+  "The default priority of TODO items.
+This is the priority an item get if no explicit priority is given."
+  :group 'org-priorities
+  :type 'character)
+
 (defgroup org-time nil
   "Options concerning time stamps and deadlines in Org-mode."
   :tag "Org Time"
@@ -3346,9 +3351,9 @@
     (org-set-local 'org-todo-sets nil)
     (let ((re (org-make-options-regexp
 	       '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO"
-		 "STARTUP" "ARCHIVE" "TAGS" "LINK")))
+		 "STARTUP" "ARCHIVE" "TAGS" "LINK" "PRIORITY_HIGH" "PRIORITY_LOW"
"PRIORITY_DEFAULT")))
 	  (splitre "[ \t]+")
-	  kwds key value cat arch tags links hw dws tail sep kws1)
+	  kwds key value cat arch tags links hw dws tail sep kws1 prio-high
prio-low prio-def)
       (save-excursion
 	(save-restriction
 	  (widen)
@@ -3371,6 +3376,12 @@
 		(push (cons (match-string 1 value)
 			    (org-trim (match-string 2 value)))
 		      links)))
+	     ((equal key "PRIORITY_HIGH")
+	      (setq prio-high value))
+	     ((equal key "PRIORITY_LOW")
+	      (setq prio-low value))
+	     ((equal key "PRIORITY_DEFAULT")
+	      (setq prio-def value))
 	     ((equal key "STARTUP")
 	      (let ((opts (org-split-string value splitre))
 		    l var val)
@@ -3390,6 +3401,9 @@
 				      '(face t fontified t) arch)))
 	    )))
       (and cat (org-set-local 'org-category cat))
+      (and prio-high (org-set-local 'org-highest-priority (aref prio-high 0)))
+      (and prio-low (org-set-local 'org-lowest-priority (aref prio-low 0)))
+      (and prio-def (org-set-local 'org-default-priority (aref prio-def 0)))
       (and arch (org-set-local 'org-archive-location arch))
       (and links (setq org-link-abbrev-alist-local (nreverse links)))
       ;; Process the TODO keywords
@@ -4150,7 +4164,7 @@
 	   (list (concat "^\\*+[ \t]*" org-not-done-regexp)
 		 '(1 'org-todo t))
 	   ;; Priorities
-	   (list (concat "\\[#[A-Z]\\]") '(0 'org-special-keyword t))
+	   (list (concat "\\[#[A-Z0-9]\\]") '(0 'org-special-keyword t))
 	   ;; Special keywords
 	   (list org-repeat-re  '(0 'org-special-keyword t))
 	   (list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t))
@@ -11983,7 +11997,7 @@

 ;;;; Priorities

-(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z]\\)\\] ?\\)"
+(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z0-9]\\)\\] ?\\)"
   "Regular expression matching the priority indicator.")

 (defvar org-remove-priority-next-time nil)
@@ -12012,18 +12026,18 @@
 	(setq current org-default-priority))
       (cond
        ((eq action 'set)
-	(message "Priority A-%c, SPC to remove: " org-lowest-priority)
+	(message "Priority %c-%c, SPC to remove: " org-highest-priority
org-lowest-priority)
 	(setq new (read-char-exclusive))
 	(cond ((equal new ?\ ) (setq remove t))
-	      ((or (< (upcase new) ?A) (> (upcase new) org-lowest-priority))
+	      ((or (< (upcase new) org-highest-priority) (> (upcase new)
org-lowest-priority))
 	       (error "Priority must be between `%c' and `%c'"
-		      ?A org-lowest-priority))))
+		      org-highest-priority org-lowest-priority))))
        ((eq action 'up)
 	(setq new (1- current)))
        ((eq action 'down)
 	(setq new (1+ current)))
        (t (error "Invalid action")))
-      (setq new (min (max ?A (upcase new)) org-lowest-priority))
+      (setq new (min (max org-highest-priority (upcase new))
org-lowest-priority))
       (setq news (format "%c" new))
       (if have
 	  (if remove
@@ -14219,7 +14233,7 @@
 	(setq tmp (calendar-date-string tmp)))
       (setq props (plist-put props 'date tmp)))
     (when (setq tmp (plist-get props 'txt))
-      (when (string-match "\\[#\\([A-Z]\\)\\] ?" tmp)
+      (when (string-match "\\[#\\([A-Z0-9]\\)\\] ?" tmp)
 	(plist-put props 'priority-letter (match-string 1 tmp))
 	(setq tmp (replace-match "" t t tmp)))
       (when (and (setq re (plist-get props 'org-todo-regexp))
@@ -19499,7 +19513,7 @@
 				 (substring hd (match-end 1))))
 	      (setq pri org-default-priority))
 	    (setq pri (floor (1+ (* 8. (/ (float (- org-lowest-priority pri))
-					  (- org-lowest-priority ?A))))))
+					  (- org-lowest-priority org-highest-priority))))))

 	    (princ (format "BEGIN:VTODO
 %s
@@ -20509,7 +20523,7 @@
 	(push (org-point-in-group p 4 :tags) clist))
       (goto-char p)
       (skip-chars-backward "^[\n\r \t") (or (eobp) (backward-char 1))
-      (if (looking-at "\\[#[A-Z]\\]")
+      (if (looking-at "\\[#[A-Z0-9]\\]")
 	  (push (org-point-in-group p 0 :priority) clist)))

      ((org-at-item-p)



-- 
With best regards,
Dmitri Minaev

Russian history blog: http://minaev.blogspot.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: in-buffer settings for priorities
  2007-05-16  9:43 in-buffer settings for priorities Dmitri Minaev
@ 2007-05-16 11:47 ` Dmitri Minaev
  2007-05-20 15:45 ` Carsten Dominik
  1 sibling, 0 replies; 8+ messages in thread
From: Dmitri Minaev @ 2007-05-16 11:47 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 137 bytes --]

Sorry, there was a wrapped line in the diff. See

-- 
With best regards,
Dmitri Minaev

Russian history blog: http://minaev.blogspot.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org.diff --]
[-- Type: text/x-patch; name="org.diff", Size: 5086 bytes --]

--- ../org-4.74/org.el	2007-05-13 12:25:40.000000000 +0500
+++ org.el	2007-05-16 13:20:17.000000000 +0500
@@ -1527,9 +1527,8 @@
   :tag "Org Priorities"
   :group 'org-todo)
 
-(defcustom org-default-priority ?B
-  "The default priority of TODO items.
-This is the priority an item get if no explicit priority is given."
+(defcustom org-highest-priority ?A
+  "The highest priority of TODO items.  A character like ?A, ?B etc."
   :group 'org-priorities
   :type 'character)
 
@@ -1538,6 +1537,12 @@
   :group 'org-priorities
   :type 'character)
 
+(defcustom org-default-priority org-lowest-priority
+  "The default priority of TODO items.
+This is the priority an item get if no explicit priority is given."
+  :group 'org-priorities
+  :type 'character)
+
 (defgroup org-time nil
   "Options concerning time stamps and deadlines in Org-mode."
   :tag "Org Time"
@@ -3346,9 +3351,9 @@
     (org-set-local 'org-todo-sets nil)
     (let ((re (org-make-options-regexp
 	       '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO"
-		 "STARTUP" "ARCHIVE" "TAGS" "LINK")))
+		 "STARTUP" "ARCHIVE" "TAGS" "LINK" "PRIORITY_HIGH" "PRIORITY_LOW" "PRIORITY_DEFAULT")))
 	  (splitre "[ \t]+")
-	  kwds key value cat arch tags links hw dws tail sep kws1)
+	  kwds key value cat arch tags links hw dws tail sep kws1 prio-high prio-low prio-def)
       (save-excursion
 	(save-restriction
 	  (widen)
@@ -3371,6 +3376,12 @@
 		(push (cons (match-string 1 value)
 			    (org-trim (match-string 2 value)))
 		      links)))
+	     ((equal key "PRIORITY_HIGH")
+	      (setq prio-high value))
+	     ((equal key "PRIORITY_LOW")
+	      (setq prio-low value))
+	     ((equal key "PRIORITY_DEFAULT")
+	      (setq prio-def value))
 	     ((equal key "STARTUP")
 	      (let ((opts (org-split-string value splitre))
 		    l var val)
@@ -3390,6 +3401,9 @@
 				      '(face t fontified t) arch)))
 	    )))
       (and cat (org-set-local 'org-category cat))
+      (and prio-high (org-set-local 'org-highest-priority (aref prio-high 0)))
+      (and prio-low (org-set-local 'org-lowest-priority (aref prio-low 0)))
+      (and prio-def (org-set-local 'org-default-priority (aref prio-def 0)))
       (and arch (org-set-local 'org-archive-location arch))
       (and links (setq org-link-abbrev-alist-local (nreverse links)))
       ;; Process the TODO keywords
@@ -4150,7 +4164,7 @@
 	   (list (concat "^\\*+[ \t]*" org-not-done-regexp)
 		 '(1 'org-todo t))
 	   ;; Priorities
-	   (list (concat "\\[#[A-Z]\\]") '(0 'org-special-keyword t))
+	   (list (concat "\\[#[A-Z0-9]\\]") '(0 'org-special-keyword t))
 	   ;; Special keywords
 	   (list org-repeat-re  '(0 'org-special-keyword t))
 	   (list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t))
@@ -11983,7 +11997,7 @@
 
 ;;;; Priorities
 
-(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z]\\)\\] ?\\)"
+(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z0-9]\\)\\] ?\\)"
   "Regular expression matching the priority indicator.")
 
 (defvar org-remove-priority-next-time nil)
@@ -12012,18 +12026,18 @@
 	(setq current org-default-priority))
       (cond
        ((eq action 'set)
-	(message "Priority A-%c, SPC to remove: " org-lowest-priority)
+	(message "Priority %c-%c, SPC to remove: " org-highest-priority org-lowest-priority)
 	(setq new (read-char-exclusive))
 	(cond ((equal new ?\ ) (setq remove t))
-	      ((or (< (upcase new) ?A) (> (upcase new) org-lowest-priority))
+	      ((or (< (upcase new) org-highest-priority) (> (upcase new) org-lowest-priority))
 	       (error "Priority must be between `%c' and `%c'"
-		      ?A org-lowest-priority))))
+		      org-highest-priority org-lowest-priority))))
        ((eq action 'up)
 	(setq new (1- current)))
        ((eq action 'down)
 	(setq new (1+ current)))
        (t (error "Invalid action")))
-      (setq new (min (max ?A (upcase new)) org-lowest-priority))
+      (setq new (min (max org-highest-priority (upcase new)) org-lowest-priority))
       (setq news (format "%c" new))
       (if have
 	  (if remove
@@ -14219,7 +14233,7 @@
 	(setq tmp (calendar-date-string tmp)))
       (setq props (plist-put props 'date tmp)))
     (when (setq tmp (plist-get props 'txt))
-      (when (string-match "\\[#\\([A-Z]\\)\\] ?" tmp)
+      (when (string-match "\\[#\\([A-Z0-9]\\)\\] ?" tmp)
 	(plist-put props 'priority-letter (match-string 1 tmp))
 	(setq tmp (replace-match "" t t tmp)))
       (when (and (setq re (plist-get props 'org-todo-regexp))
@@ -19499,7 +19513,7 @@
 				 (substring hd (match-end 1))))
 	      (setq pri org-default-priority))
 	    (setq pri (floor (1+ (* 8. (/ (float (- org-lowest-priority pri))
-					  (- org-lowest-priority ?A))))))
+					  (- org-lowest-priority org-highest-priority))))))
 
 	    (princ (format "BEGIN:VTODO
 %s
@@ -20509,7 +20523,7 @@
 	(push (org-point-in-group p 4 :tags) clist))
       (goto-char p)
       (skip-chars-backward "^[\n\r \t") (or (eobp) (backward-char 1))
-      (if (looking-at "\\[#[A-Z]\\]")
+      (if (looking-at "\\[#[A-Z0-9]\\]")
 	  (push (org-point-in-group p 0 :priority) clist)))
 
      ((org-at-item-p)

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: in-buffer settings for priorities
  2007-05-16  9:43 in-buffer settings for priorities Dmitri Minaev
  2007-05-16 11:47 ` Dmitri Minaev
@ 2007-05-20 15:45 ` Carsten Dominik
  2007-05-21 13:11   ` Dmitri Minaev
  1 sibling, 1 reply; 8+ messages in thread
From: Carsten Dominik @ 2007-05-20 15:45 UTC (permalink / raw)
  To: Dmitri Minaev; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: in-buffer settings for priorities
  2007-05-20 15:45 ` Carsten Dominik
@ 2007-05-21 13:11   ` Dmitri Minaev
  2007-05-21 14:35     ` Carsten Dominik
  2007-05-22  4:57     ` Carsten Dominik
  0 siblings, 2 replies; 8+ messages in thread
From: Dmitri Minaev @ 2007-05-21 13:11 UTC (permalink / raw)
  To: emacs-orgmode

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 <dominik@science.uva.nl> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: in-buffer settings for priorities
  2007-05-21 13:11   ` Dmitri Minaev
@ 2007-05-21 14:35     ` Carsten Dominik
  2007-05-22  8:07       ` Dmitri Minaev
  2007-05-22  4:57     ` Carsten Dominik
  1 sibling, 1 reply; 8+ messages in thread
From: Carsten Dominik @ 2007-05-21 14:35 UTC (permalink / raw)
  To: Dmitri Minaev; +Cc: emacs-orgmode


On May 21, 2007, at 15:11, Dmitri Minaev wrote:

> 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.

You can certainly use priorities, even though for now it is letters.
I am not sure yet about the changes you propose, will need more time
to think about this.

> 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?

Yes.

>
> 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:


Check out the variable org-show-following-heading, and its companions 
org-show-hierarchy-above and org-show-siblings.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: in-buffer settings for priorities
  2007-05-21 13:11   ` Dmitri Minaev
  2007-05-21 14:35     ` Carsten Dominik
@ 2007-05-22  4:57     ` Carsten Dominik
  1 sibling, 0 replies; 8+ messages in thread
From: Carsten Dominik @ 2007-05-22  4:57 UTC (permalink / raw)
  To: Dmitri Minaev; +Cc: emacs-orgmode

Actually, lets just take your patch, it is useful.

One change:  The in-buffer setting will be

    #+PRIORITIES: highest lowest default

for example

    #+PRIORITIES: A C B

or

    #+PRIORITIES: 1 9 9

Thanks!

- Carsten

On May 21, 2007, at 15:11, Dmitri Minaev wrote:

> 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 <dominik@science.uva.nl> 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
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: in-buffer settings for priorities
  2007-05-21 14:35     ` Carsten Dominik
@ 2007-05-22  8:07       ` Dmitri Minaev
  2007-05-29 15:27         ` Carsten Dominik
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitri Minaev @ 2007-05-22  8:07 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

On 5/21/07, Carsten Dominik <dominik@science.uva.nl> wrote:

> > 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?
>
> Yes.

I should have upgraded more often :). In 4.60, which I used prior to
the last upgrade, this feature was absent. Is there a way to bring the
old behaviour back?

> Check out the variable org-show-following-heading, and its companions
> org-show-hierarchy-above and org-show-siblings.

Thank you.

> Actually, lets just take your patch

I hope the reason was not that I was obstinate :)

-- 
With best regards,
Dmitri Minaev

Russian history blog: http://minaev.blogspot.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: in-buffer settings for priorities
  2007-05-22  8:07       ` Dmitri Minaev
@ 2007-05-29 15:27         ` Carsten Dominik
  0 siblings, 0 replies; 8+ messages in thread
From: Carsten Dominik @ 2007-05-29 15:27 UTC (permalink / raw)
  To: Dmitri Minaev; +Cc: emacs-orgmode


On May 22, 2007, at 10:07, Dmitri Minaev wrote:

> On 5/21/07, Carsten Dominik <dominik@science.uva.nl> wrote:
>
>> > 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?
>>
>> Yes.
>
> I should have upgraded more often :). In 4.60, which I used prior to
> the last upgrade, this feature was absent. Is there a way to bring the
> old behaviour back?

Yes.  Turns out it was not a feature but a bug, I was mistaken.
Sorry about that.  Fixed for 4.76.
>
>> Actually, lets just take your patch
>
> I hope the reason was not that I was obstinate :)

No.  But I needed time to understand exactly what it did, and to see
if there is anything missing (there was, a side issue with
`org-get-current-options).  First I wanted to wait until the
next release, but then I changed my mind.


- Carsten

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-05-29 16:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-16  9:43 in-buffer settings for priorities Dmitri Minaev
2007-05-16 11:47 ` Dmitri Minaev
2007-05-20 15:45 ` Carsten Dominik
2007-05-21 13:11   ` Dmitri Minaev
2007-05-21 14:35     ` Carsten Dominik
2007-05-22  8:07       ` Dmitri Minaev
2007-05-29 15:27         ` Carsten Dominik
2007-05-22  4:57     ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).