emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Lundin <mdl@imapmail.org>
To: Martin Beck <Elwood151@web.de>
Cc: emacs orgmode-mailinglist <emacs-orgmode@gnu.org>
Subject: Re: How to change agenda sorting order temporarily?
Date: Mon, 30 May 2016 10:33:16 -0500	[thread overview]
Message-ID: <87wpmbblxf.fsf@fastmail.fm> (raw)
In-Reply-To: <trinity-12df1f97-3fb6-4531-8ce6-760b47882ac5-1464610443241@3capp-webde-bs01> (Martin Beck's message of "Mon, 30 May 2016 14:14:03 +0200")

"Martin Beck" <Elwood151@web.de> 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

  parent reply	other threads:[~2016-05-30 15:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-30 12:14 How to change agenda sorting order temporarily? Martin Beck
2016-05-30 15:25 ` Richard Lawrence
2016-05-30 15:33 ` Matt Lundin [this message]
2016-05-30 15:38   ` Matt Lundin
2016-05-30 17:55 ` Samuel Wales

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wpmbblxf.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --cc=Elwood151@web.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).