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:33:16 -0500 Message-ID: <87wpmbblxf.fsf@fastmail.fm> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7PC9-00020e-Ee for emacs-orgmode@gnu.org; Mon, 30 May 2016 11:33:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7PC4-0008KI-Ch for emacs-orgmode@gnu.org; Mon, 30 May 2016 11:33:32 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:49341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7PC1-0008Gp-UB for emacs-orgmode@gnu.org; Mon, 30 May 2016 11:33:28 -0400 In-Reply-To: (Martin Beck's message of "Mon, 30 May 2016 14:14:03 +0200") 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 "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: --8<---------------cut here---------------start------------->8--- (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))) --8<---------------cut here---------------end--------------->8--- Matt