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:38:02 -0500	[thread overview]
Message-ID: <87r3cjblph.fsf@fastmail.fm> (raw)
In-Reply-To: <87wpmbblxf.fsf@fastmail.fm> (Matt Lundin's message of "Mon, 30 May 2016 10:33:16 -0500")

Matt Lundin <mdl@imapmail.org> writes:

> "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:
>
> (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

  reply	other threads:[~2016-05-30 15:38 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
2016-05-30 15:38   ` Matt Lundin [this message]
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=87r3cjblph.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).