Christian Tietze has an informative post that tells us how to keep an Org file sorted. Your first question should be, “What do you mean by sorted?” Your second question should be, “What does ‘keep sorted’ mean?”
Tietze answers both these questions. The answer to the second question is easier. By “keep sorted” he means that after adding an entry to the file, it will automatically be inserted into its proper “sorted” place without the user having to do anything special.
The answer to the first question is “it depends”. Not very helpful, I know. The precise answer is “whatever sorting order you can describe with org-sort-entries
.” Take a look at its documentation to see how many possibilities that entails. You can also provide your own comparison and data extraction functions so the practical answer is “just about any order you desire.”
There is, of course, a bit of configuration that you have to do to have all this take place. Tietze’s post explains how to set things up. The org-sort-entries
function is so flexible that it will cover most cases out of the box but there is, as I said, an escape hatch for special needs.
This is another example of how much flexibility is built into Emacs and Org. Most users probably don’t need and aren’t even aware of the functionality that Tietze writes about but it’s there for those who do need it.
As I and others keep telling you, it’s not an editor, it’s a Lisp instance with built in editing commands. You can make just about anything you need happen, usually pretty easily.