Dear Experts, I'd like to propose a replacement for the org-get-priority function which is backward compatible with the current version but allows the user to add a sub-priority such as [#A]-5 or [#B]+3: (defun org-get-priority (s) "Find priority cookie and return priority. Priorities of the form [#<letter>]-<number> or [#<letter>]+<number> are supported with +/-<number> 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]. The number sub-priorities allow finer control of sorting in org agendas. " (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))))
[-- Attachment #1.1: Type: text/plain, Size: 605 bytes --] At Wed, 20 Oct 2010 13:14:39 -0400, I.S. wrote: > > Dear Experts, > > I'd like to propose a replacement for the org-get-priority function > which is backward compatible with the current version but allows the > user to add a sub-priority such as [#A]-5 or [#B]+3: > Could you provide a patch against current master and send it to the list as a text/plain attachment? This way the proposed modification will end up in Org's patchtracker[1]. Best, -- David [1] http://patchwork.newartisans.com/project/org-mode/ -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de [-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --] [-- Attachment #2: Type: text/plain, Size: 201 bytes --] _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
At Wed, 20 Oct 2010 13:14:39 -0400, I.S. wrote: > Priorities of the form [#<letter>]-<number> or [#<letter>]+<number> > are supported with +/-<number> 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]. > The number sub-priorities allow finer control of sorting in org > agendas. This *could* help with what I would like to see. Every day I would like to arrange my agenda tasks for the day in the order that I would like to do them. (Setting fake times-of-day for each is somewhat time consuming; I am now experimenting with an A-Z priority range. The real-world priority of my tasks is basically all the same, so I thought I could commandeer the priority setting to get sequencing.) If easy to set, the sub-priority could be helpful in my sequencing goal.
[-- Attachment #1: Type: text/plain, Size: 1220 bytes --] On 10/24/2010 3:18 PM, David Maus wrote: > At Wed, 20 Oct 2010 13:14:39 -0400, > I.S. wrote: >> Dear Experts, >> >> I'd like to propose a replacement for the org-get-priority function >> which is backward compatible with the current version but allows the >> user to add a sub-priority such as [#A]-5 or [#B]+3: >> > Could you provide a patch against current master and send it to the > list as a text/plain attachment? This way the proposed modification > will end up in Org's patchtracker[1]. > > Best, > -- David > > [1] http://patchwork.newartisans.com/project/org-mode/ > -- > OpenPGP... 0x99ADB83B5A4478E6 > Jabber.... dmjena@jabber.org > Email..... dmaus@ictsoc.de I tried looing at patchwork but couldn't figure out what I was supposed to do. Please advise on usage instructions. Instead, I attached a manually generated patch against org.el in the development version from git. I created this patch via $ git clone git://repo.or.cz/org-mode.git $ emacs org-mode/lisp/org.el # to modify the file and write it to org.mine.el $ diff -rup org.el org.mine.el > org-get-priority.patch Please advise on proper procedure as I love org and would enjoy the chance to contribute in the future. Thanks, -I.S. [-- Attachment #2: org-get-priority.patch --] [-- Type: text/plain, Size: 1465 bytes --] emin@martinian.com's password: --- org.el 2010-10-27 07:47:50.702497227 -0400 +++ org.mine.el 2010-10-27 07:48:59.090619203 -0400 @@ -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 [#<letter>]-<number> or +[#<letter>]+<number> are supported with +/-<number> 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) [-- Attachment #3: Type: text/plain, Size: 201 bytes --] _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1466 bytes --] Sorry, I realized the previous patch did not contain updates to the org-priority-regexp. An updated patch is attached. Sorry, -I.S. On 10/27/2010 8:01 AM, I.S. wrote: > On 10/24/2010 3:18 PM, David Maus wrote: >> At Wed, 20 Oct 2010 13:14:39 -0400, >> I.S. wrote: >>> Dear Experts, >>> >>> I'd like to propose a replacement for the org-get-priority function >>> which is backward compatible with the current version but allows the >>> user to add a sub-priority such as [#A]-5 or [#B]+3: >>> >> Could you provide a patch against current master and send it to the >> list as a text/plain attachment? This way the proposed modification >> will end up in Org's patchtracker[1]. >> >> Best, >> -- David >> >> [1] http://patchwork.newartisans.com/project/org-mode/ >> -- >> OpenPGP... 0x99ADB83B5A4478E6 >> Jabber.... dmjena@jabber.org >> Email..... dmaus@ictsoc.de > > I tried looing at patchwork but couldn't figure out what I was > supposed to do. Please advise on usage instructions. > > Instead, I attached a manually generated patch against org.el in the > development version from git. I created this patch via > > $ git clone git://repo.or.cz/org-mode.git > $ emacs org-mode/lisp/org.el # to modify the file and write it to > org.mine.el > $ diff -rup org.el org.mine.el > org-get-priority.patch > > Please advise on proper procedure as I love org and would enjoy the > chance to contribute in the future. > > Thanks, > -I.S. > -- Thanks, -I.S. [-- Attachment #2: org-get-priority.patch --] [-- Type: text/plain, Size: 2246 bytes --] 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 <carsten at orgmode dot org> ;; 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 [#<letter>]-<number> or +[#<letter>]+<number> are supported with +/-<number> 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) [-- Attachment #3: Type: text/plain, Size: 201 bytes --] _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1657 bytes --] Sorry, previous patch had some junk in it. Attached is the final version (really). Sorry again for the confusion, -I.S. On 10/29/2010 7:45 AM, I.S. wrote: > Sorry, I realized the previous patch did not contain updates to the > org-priority-regexp. An updated patch is attached. > > Sorry, > -I.S. > > > > On 10/27/2010 8:01 AM, I.S. wrote: >> On 10/24/2010 3:18 PM, David Maus wrote: >>> At Wed, 20 Oct 2010 13:14:39 -0400, >>> I.S. wrote: >>>> Dear Experts, >>>> >>>> I'd like to propose a replacement for the org-get-priority function >>>> which is backward compatible with the current version but allows the >>>> user to add a sub-priority such as [#A]-5 or [#B]+3: >>>> >>> Could you provide a patch against current master and send it to the >>> list as a text/plain attachment? This way the proposed modification >>> will end up in Org's patchtracker[1]. >>> >>> Best, >>> -- David >>> >>> [1] http://patchwork.newartisans.com/project/org-mode/ >>> -- >>> OpenPGP... 0x99ADB83B5A4478E6 >>> Jabber.... dmjena@jabber.org >>> Email..... dmaus@ictsoc.de >> >> I tried looing at patchwork but couldn't figure out what I was >> supposed to do. Please advise on usage instructions. >> >> Instead, I attached a manually generated patch against org.el in the >> development version from git. I created this patch via >> >> $ git clone git://repo.or.cz/org-mode.git >> $ emacs org-mode/lisp/org.el # to modify the file and write it to >> org.mine.el >> $ diff -rup org.el org.mine.el > org-get-priority.patch >> >> Please advise on proper procedure as I love org and would enjoy the >> chance to contribute in the future. >> >> Thanks, >> -I.S. >> [-- Attachment #2: org-get-priority.patch --] [-- Type: text/plain, Size: 1764 bytes --] --- org.el 2010-10-29 07:41:17.254401572 -0400 +++ org.mine.el 2010-10-29 07:49:11.814892725 -0400 @@ -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 [#<letter>]-<number> or +[#<letter>]+<number> are supported with +/-<number> 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) [-- Attachment #3: Type: text/plain, Size: 201 bytes --] _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Hi everyone,
I would like to have a show of hands who is interested in this
treatment of finer priorities. Should we add this patch (I don't vote
because I do not use priorities)
Thanks!
- Carsten
On Oct 29, 2010, at 1:53 PM, I.S. wrote:
> Sorry, previous patch had some junk in it. Attached is the final
> version (really).
>
> Sorry again for the confusion,
> -I.S.
>
> On 10/29/2010 7:45 AM, I.S. wrote:
>> Sorry, I realized the previous patch did not contain updates to the
>> org-priority-regexp. An updated patch is attached.
>>
>> Sorry,
>> -I.S.
>>
>>
>>
>> On 10/27/2010 8:01 AM, I.S. wrote:
>>> On 10/24/2010 3:18 PM, David Maus wrote:
>>>> At Wed, 20 Oct 2010 13:14:39 -0400,
>>>> I.S. wrote:
>>>>> Dear Experts,
>>>>>
>>>>> I'd like to propose a replacement for the org-get-priority
>>>>> function
>>>>> which is backward compatible with the current version but allows
>>>>> the
>>>>> user to add a sub-priority such as [#A]-5 or [#B]+3:
>>>>>
>>>> Could you provide a patch against current master and send it to the
>>>> list as a text/plain attachment? This way the proposed
>>>> modification
>>>> will end up in Org's patchtracker[1].
>>>>
>>>> Best,
>>>> -- David
>>>>
>>>> [1] http://patchwork.newartisans.com/project/org-mode/
>>>> --
>>>> OpenPGP... 0x99ADB83B5A4478E6
>>>> Jabber.... dmjena@jabber.org
>>>> Email..... dmaus@ictsoc.de
>>>
>>> I tried looing at patchwork but couldn't figure out what I was
>>> supposed to do. Please advise on usage instructions.
>>>
>>> Instead, I attached a manually generated patch against org.el in
>>> the development version from git. I created this patch via
>>>
>>> $ git clone git://repo.or.cz/org-mode.git
>>> $ emacs org-mode/lisp/org.el # to modify the file and write it to
>>> org.mine.el
>>> $ diff -rup org.el org.mine.el > org-get-priority.patch
>>>
>>> Please advise on proper procedure as I love org and would enjoy
>>> the chance to contribute in the future.
>>>
>>> Thanks,
>>> -I.S.
>>>
>
> <org-get-
> priority.patch>_______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
- Carsten
I'm against feature-itis.
Orgmode has been losing some of its elegance to feature requests. And
by 'elegance' I mean ease of learning and using and maintaining, and
not having to decide between N different ways of achieving something
just because so many border-case features exist.
The agenda is for things you have to do today. Just do them.
If you need ordering, you have outlines and lists, properties, LISP,
hooks, column view, custom agenda views, etc.
Regards,
.j.
On Mon, Nov 15, 2010 at 11:25:30AM +0100, Carsten Dominik wrote:
> I would like to have a show of hands who is interested in this
> treatment of finer priorities.
On Nov 15, 2010, at 1:07 PM, Juan Pechiar wrote: > I'm against feature-itis. > > Orgmode has been losing some of its elegance to feature requests. Do you have concrete examples? Maybe we can correct mistakes? - Carsten > And > by 'elegance' I mean ease of learning and using and maintaining, and > not having to decide between N different ways of achieving something > just because so many border-case features exist. > > The agenda is for things you have to do today. Just do them. > > If you need ordering, you have outlines and lists, properties, LISP, > hooks, column view, custom agenda views, etc. > > Regards, > .j. > > On Mon, Nov 15, 2010 at 11:25:30AM +0100, Carsten Dominik wrote: >> I would like to have a show of hands who is interested in this >> treatment of finer priorities. - Carsten
On 11/15/2010 7:07 AM, Juan Pechiar wrote:
> I'm against feature-itis.
>
> Orgmode has been losing some of its elegance to feature requests. And
> by 'elegance' I mean ease of learning and using and maintaining, and
> not having to decide between N different ways of achieving something
> just because so many border-case features exist.
>
> The agenda is for things you have to do today. Just do them.
>
> If you need ordering, you have outlines and lists, properties, LISP,
> hooks, column view, custom agenda views, etc.
>
> Regards,
> .j.
>
> On Mon, Nov 15, 2010 at 11:25:30AM +0100, Carsten Dominik wrote:
>> I would like to have a show of hands who is interested in this
>> treatment of finer priorities.
That may be a fair point (although I tend to think that most of the
features in orgmode are really useful). I'd like to point out, however,
that the proposed change is completely backward compatible. If you don't
want finer grained priorities, just don't add -<NUM>.
Personally, I vote yes because I find the priorities in TODO lists very
useful. In addition, I often find that I want to insert a new item
between two existing ones and therefore having fine-grained priorities
makes this easy to do.
--
Thanks,
-I.S.
I would use tags to accomplish the same thing as enhanced priorities. User-defined sorting allows this in both the agenda and the outline. Maybe somebody can summarize the benefits of enhanced priorities over more priorites, tags, properties, etc.?
Carsten Dominik <carsten.dominik@gmail.com> writes:
> I would like to have a show of hands who is interested in this
> treatment of finer priorities. Should we add this patch (I don't vote
> because I do not use priorities)
-1
Org-mode power users in need of finer-grained priority control already
have the option of widening the range of priorities with
org-highest-priority and org-lowest-priority or a #+PRIORITIES line. One
could also use custom "tags" + a user defined sorting command to
accomplish something similar.
I believe that, as a rule, if a peculiar use-case can already be
accomplished with current hooks and variables, a new way of doing the
same thing should not be hard-coded, unless it dramatically simplifies
the code and user experience.
- Matt
Hi I.S.
I have not added you patch as it is, because in some ways the syntax
it adds is
questionable, and, as others have pointed out, sorting can be done in
different ways, too.
However, instead, I have introduced a variable that can be set to a
user-defined function to compute the base priority of a node. So you
can simply put your function into that variable and continue to use
your special syntax, with us making it an official Org syntax.
The name of the variable is org-get-priority-function.
I hope this helps.
- Carsten
On Nov 15, 2010, at 7:05 PM, I.S. wrote:
> On 11/15/2010 7:07 AM, Juan Pechiar wrote:
>> I'm against feature-itis.
>>
>> Orgmode has been losing some of its elegance to feature requests. And
>> by 'elegance' I mean ease of learning and using and maintaining, and
>> not having to decide between N different ways of achieving something
>> just because so many border-case features exist.
>>
>> The agenda is for things you have to do today. Just do them.
>>
>> If you need ordering, you have outlines and lists, properties, LISP,
>> hooks, column view, custom agenda views, etc.
>>
>> Regards,
>> .j.
>>
>> On Mon, Nov 15, 2010 at 11:25:30AM +0100, Carsten Dominik wrote:
>>> I would like to have a show of hands who is interested in this
>>> treatment of finer priorities.
> That may be a fair point (although I tend to think that most of the
> features in orgmode are really useful). I'd like to point out,
> however, that the proposed change is completely backward compatible.
> If you don't want finer grained priorities, just don't add -<NUM>.
>
> Personally, I vote yes because I find the priorities in TODO lists
> very useful. In addition, I often find that I want to insert a new
> item between two existing ones and therefore having fine-grained
> priorities makes this easy to do.
>
> --
> Thanks,
> -I.S.
>
- Carsten
On 11/17/2010 3:16 AM, Carsten Dominik wrote:
> Hi I.S.
>
> I have not added you patch as it is, because in some ways the syntax
> it adds is
> questionable, and, as others have pointed out, sorting can be done in
> different ways, too.
>
> However, instead, I have introduced a variable that can be set to a
> user-defined function to compute the base priority of a node. So you
> can simply put your function into that variable and continue to use
> your special syntax, with us making it an official Org syntax.
>
> The name of the variable is org-get-priority-function.
>
> I hope this helps.
>
> - Carsten
>
Thank you. That is a fine solution for me.
--
Thanks,
-I.S.
Carsten Dominik <carsten.dominik@gmail.com> writes:
> I have not added you patch as it is, because in some ways the syntax
> it adds is questionable, and, as others have pointed out, sorting can
> be done in different ways, too.
>
> However, instead, I have introduced a variable that can be set to a
> user-defined function to compute the base priority of a node. So you
> can simply put your function into that variable and continue to use
> your special syntax, with us making it an official Org syntax.
>
> The name of the variable is org-get-priority-function.
Thanks, Carsten, as always, for coming up with an elegant solution that
keeps Org nice and simple for new users, while nonetheless allowing us
power users to keep refining our ~/.emacs. :)
Best,
Matt