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