emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* sort habits by priority
@ 2017-04-27 22:33 Jesse Johnson
  2017-04-27 22:52 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Jesse Johnson @ 2017-04-27 22:33 UTC (permalink / raw)
  To: emacs-orgmode

I want to sort habits by priority, such that priority overrides all 
other criteria (schedule, deadline, consistency, etc.).

In attempting to implement this I discovered that org-habit-get-priority 
is an inline function and thus cannot be overridden by the user. There 
seems to be no straightforward way to accomplish my goal without editing 
the org source code directly.

I am not the only one to run into this problem: 
http://stackoverflow.com/questions/37200762/sort-todays-habits-by-priority-in-main-agenda-view

I think the best solution is either to make org-habit-get-priority a 
regular function (assuming this doesn't cause a serious performance 
degradation) or to add user-customizable variable(s) which can configure 
how habits are prioritized.

Thoughts?

Jesse

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

* Re: sort habits by priority
  2017-04-27 22:33 sort habits by priority Jesse Johnson
@ 2017-04-27 22:52 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2017-04-27 22:52 UTC (permalink / raw)
  To: Jesse Johnson; +Cc: emacs-orgmode

Hello,

Jesse Johnson <holocronweaver@gmail.com> writes:

> I want to sort habits by priority, such that priority overrides all
> other criteria (schedule, deadline, consistency, etc.).
>
> In attempting to implement this I discovered that
> org-habit-get-priority is an inline function and thus cannot be
> overridden by the user. There seems to be no straightforward way to
> accomplish my goal without editing the org source code directly.
>
> I am not the only one to run into this problem:
> http://stackoverflow.com/questions/37200762/sort-todays-habits-by-priority-in-main-agenda-view
>
> I think the best solution is either to make org-habit-get-priority
> a regular function (assuming this doesn't cause a serious performance
> degradation) or to add user-customizable variable(s) which can
> configure how habits are prioritized.
>
> Thoughts?

You can implement your own sorting strategy. See
`org-agenda-cmp-user-defined'. So you don't need to change or override
this function.

Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2017-04-27 22:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-27 22:33 sort habits by priority Jesse Johnson
2017-04-27 22:52 ` Nicolas Goaziou

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