From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: sort habits by priority Date: Fri, 28 Apr 2017 00:52:55 +0200 Message-ID: <87lgqlzcmw.fsf@nicolasgoaziou.fr> References: <86583c1c-ed6a-6229-0e46-f48052edfa15@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3sHV-0001lA-0n for emacs-orgmode@gnu.org; Thu, 27 Apr 2017 18:53:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3sHR-0004gE-Tu for emacs-orgmode@gnu.org; Thu, 27 Apr 2017 18:53:01 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:37461) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d3sHR-0004f6-Nn for emacs-orgmode@gnu.org; Thu, 27 Apr 2017 18:52:57 -0400 In-Reply-To: <86583c1c-ed6a-6229-0e46-f48052edfa15@gmail.com> (Jesse Johnson's message of "Thu, 27 Apr 2017 15:33:05 -0700") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Jesse Johnson Cc: emacs-orgmode@gnu.org Hello, Jesse Johnson 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