emin@martinian.com's password: --- org.el 2010-10-29 07:41:17.254401572 -0400 +++ org.mine.el 2010-10-29 07:41:49.162423931 -0400 @@ -6,7 +6,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 7.02trans +;; Version: 7.01trans ;; ;; This file is part of GNU Emacs. ;; @@ -185,7 +185,7 @@ identifier." ;;; Version -(defconst org-version "7.02trans" +(defconst org-version "7.01trans" "The version number of the file org.el.") (defun org-version (&optional here) @@ -12129,7 +12129,7 @@ from the `before-change-functions' in th ;;;; Priorities -(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z0-9]\\)\\] ?\\)" +(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z0-9]\\)\\]\\(-[0-9]+\\)? ?\\)" "Regular expression matching the priority indicator.") (defvar org-remove-priority-next-time nil) @@ -12211,13 +12211,27 @@ ACTION can be `set', `up', `down', or a (message "Priority of current item set to %s" news)))) (defun org-get-priority (s) - "Find priority cookie and return priority." - (save-match-data - (if (not (string-match org-priority-regexp s)) - (* 1000 (- org-lowest-priority org-default-priority)) - (* 1000 (- org-lowest-priority - (string-to-char (match-string 2 s))))))) + "Find priority cookie and return priority. +Priorities of the form [#]- or +[#]+ are supported with +/- being +optional and modifying the letter priority. The letter priority +is multiplied by 100000 and then the number priority is added +on. Thus a priority string of [#B]+5 is higher than [#B] which is +higher than [#B]-2 and all are lower than [#A]. +" + (save-match-data + (let* ((priority-match (string-match org-priority-regexp s)) + (priority-value (if priority-match + (* 100000 (- org-lowest-priority + (string-to-char (match-string 2 s)))) + (* 100000 (- org-lowest-priority +org-default-priority)))) + (sub-priority-match (match-string 3 s)) + (sub-priority-value (if sub-priority-match + (string-to-number sub-priority-match) 0))) + (+ priority-value sub-priority-value)))) + ;;;; Tags (defvar org-agenda-archives-mode)