0

Given this org-file as an example:

org syntax example
​
* header
#+TITLE: Tasks
:PROPERTIES:
:TMP01: Azat
:ID: 123
:END:
​
* hh.2
** hh.2.1
another date [2019-01-25 Fri]
more date <2019-01-25 Fri 20:08>
* TODO [#A] hh.1 :tag1:tag2:
:PROPERTIES:
:TMP01: Dav
:ID: 123
:END:
*some* thing in water
** hh.1.1
unordered lists
- bold *love*
- italic /slanted text/
- underline _undies_
- verbatim =as is=
- code ~1+1=3~ but +wrong+
#+BEGIN_CENTER
does not compute
#+END_CENTER
*** hh.1.1.1
#+BEGIN_EXAMPLE
var x = 3
x + 4
#+END_EXAMPLE
*** hh.1.1.2
DEADLINE: <2019-01-25 Fri>
learn emacs lisp
#+BEGIN_SRC emacs-lisp
(+ 3 4)
#+END_SRC
** hh.1.2
** hh.1.3

if you try to org-sort it by property named TMP01, you get a headline without properties in the middle, which is not what I expect.

Nevertheless, if you reverse-sort it by property by inputting R, it does reverse sort well. Is it a bug?

4
  • Put the relevant part of the example in the question. Reduce that to something minimal, which shows the problem. The question is not clear without posting that code.
    – Drew
    Jan 30 at 15:02
  • Drew, sorry I didn't quite understand you. The whole text is relevant and not so big. I don't see how can I reduce it. Thank you. Jan 31 at 4:57
  • The question isn't comprehensible on its own, and that's a no-no. Readers should be able to understand just what you're asking, without following links. You should be able to provide more information, from that link, to make the question better stand on its own.
    – Drew
    Jan 31 at 16:35
  • 1
    I edited your question to show you what @Drew meant: if you can include the Org mode file in the question, then there is no need for a pastebin and a link and the question becomes self contained. Pastebins generally expire after a time, so if that happens, the link would be dead and the question would not make any sense any more.
    – NickD
    Jan 31 at 17:20

1 Answer 1

0

This is almost certainly a bug, but it has an easy workaround: move the #+TITLE: to the top of the file: although keyword lines like this can theoretically appear anywhere in the file, most people put them at the top of the file (after all, they affect the whole file, not a particular section, no matter where you put them)[1]. IIRC, originally Org mode required them to be at the top of the file, but the restriction was relaxed later, but since most people still put them at the top of the file, bugs like this can easily creep through.

So try sorting the following file and let me know whether it works for you:

#+TITLE: Tasks

org syntax example
​
* header
:PROPERTIES:
:TMP01: Azat
:ID: 123
:END:
​
* hh.2
** hh.2.1
another date [2019-01-25 Fri]
more date <2019-01-25 Fri 20:08>
* TODO [#A] hh.1 :tag1:tag2:
:PROPERTIES:
:TMP01: Dav
:ID: 123
:END:
*some* thing in water
** hh.1.1
unordered lists
- bold *love*
- italic /slanted text/
- underline _undies_
- verbatim =as is=
- code ~1+1=3~ but +wrong+
#+BEGIN_CENTER
does not compute
#+END_CENTER
*** hh.1.1.1
#+BEGIN_EXAMPLE
var x = 3
x + 4
#+END_EXAMPLE
*** hh.1.1.2
DEADLINE: <2019-01-25 Fri>
learn emacs lisp
#+BEGIN_SRC emacs-lisp
(+ 3 4)
#+END_SRC
** hh.1.2
** hh.1.3

If it works, then you can submit a bug report to the mailing list with M-x org-submit-bug-report (or if you prefer, I can submit it in your name - let me know).


[1] Do not confuse these "global" keywords with so-called "affiliated" keywords which need to be tightly coupled with the object they are affiliated to. E.g. #+ATTR_LATEX: keywords that modify the default rendering of a table in LaTeX export have to be physically attached to the table:

...
     #+ATTR_LATEX: :environment longtable :align l|lp{3cm}r|l
     | ... | ... |
     | ... | ... |

There should not be even an empty line separating the affiliated keyword line from the object it is attached to.

1
  • 1
    thank you very much NickD, I have submitted a bug report on my own. Feb 1 at 7:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.