From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: How to change agenda sorting order temporarily? Date: Mon, 30 May 2016 10:38:02 -0500 Message-ID: <87r3cjblph.fsf@fastmail.fm> References: <87wpmbblxf.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7PGk-0005fK-Ja for emacs-orgmode@gnu.org; Mon, 30 May 2016 11:38:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7PGg-0000jr-Ih for emacs-orgmode@gnu.org; Mon, 30 May 2016 11:38:18 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:47118) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7PGe-0000hL-9F for emacs-orgmode@gnu.org; Mon, 30 May 2016 11:38:14 -0400 In-Reply-To: <87wpmbblxf.fsf@fastmail.fm> (Matt Lundin's message of "Mon, 30 May 2016 10:33:16 -0500") 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: Martin Beck Cc: emacs orgmode-mailinglist Matt Lundin writes: > "Martin Beck" writes: > >> I'm working with a lot of pre-defined agendas, but I sometimes would >> like to change the sorting order of one of those to different criteria >> (by time, alphanumerically, etc.). >> >> I did not find a way to do that in org-mode directly - did I overlook >> something, or do I really have to change the configuration of the >> whole agenda and rebuild it? >> >> Related problem: >> If I change the configuration of the agenda by changing the >> customizing options, those changes do only have an effect, if I kill >> the agenda buffer and launch the agenda again. >> It would be nice, if I just could rebuild the existing agenda with "r" >> or "g", but that does not seem to be sufficient? >> > > Here's a quick function that works for me: > > (defun my-org-agenda-change-sorting-strategy (strategy) > "Change the sorting strategy." > (interactive (list > (completing-read "Choose a strategy: " > (mapcar 'cdr (cdr org-sorting-choice)) > nil t))) > ;; adjust the following types as needed - e.g., add 'agenda, etc. > (org-agenda-check-type t 'todo 'tags 'search) > (let ((org-agenda-sorting-strategy (list (intern strategy)))) > (org-agenda-redo))) I should add that with this function the new sort order is temporary. Pressing "r" for refresh will restore the default sort order for the buffer. Matt