From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] Faulty logic in org-cmp-tag/alpha Date: Sun, 10 Mar 2019 11:15:50 +0100 Message-ID: <874l8bjaqx.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:34847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2vUo-0005w4-CZ for emacs-orgmode@gnu.org; Sun, 10 Mar 2019 06:15:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2vUn-0005oC-Qa for emacs-orgmode@gnu.org; Sun, 10 Mar 2019 06:15:54 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:53211) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h2vUn-0005mv-JN for emacs-orgmode@gnu.org; Sun, 10 Mar 2019 06:15:53 -0400 In-Reply-To: (Carlos Pita's message of "Sat, 9 Mar 2019 17:55:41 -0300") 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: Carlos Pita Cc: emacs-orgmode Hello, Carlos Pita writes: > Hi all, > > there is a problem in this kind of logic: > > (cond ((not ta) +1) > ((not tb) -1) > ((string-lessp ta tb) -1) > ((string-lessp tb ta) +1)))) > > in that when both ta and tb are nil then they are arbitrarily sorted. > Since the agenda sorting strategy is lexicographic this logic > virtually invalidates any strategy that puts tag or alpha first, v.g. > '(tag-up priority-down). > > I've attached a patch returning nil when both ta and tb are nil so as > to fallback to the next sorting criterion without favoring lhs nor > rhs. Applied. Thank you. Regards, -- Nicolas Goaziou