Guard against empty headings when sorting
* org.el (org-sort-entries): Guard against empty headings when sorting alphabetically, numerically. Due to how ‘org-complex-heading-regexp’ is defined, the title capture group currently returns nil in empty headings, which we don’t want to pass on to ‘org-sort-remove-invisible’.
This commit is contained in:
parent
681f870b25
commit
1af7f303d5
12
lisp/org.el
12
lisp/org.el
|
@ -8734,15 +8734,11 @@ function is being called interactively."
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(cond
|
(cond
|
||||||
((= dcst ?n)
|
((= dcst ?n)
|
||||||
(if (looking-at org-complex-heading-regexp)
|
(string-to-number
|
||||||
(string-to-number
|
(org-sort-remove-invisible (org-get-heading t t t t))))
|
||||||
(org-sort-remove-invisible (match-string 4)))
|
|
||||||
nil))
|
|
||||||
((= dcst ?a)
|
((= dcst ?a)
|
||||||
(if (looking-at org-complex-heading-regexp)
|
(funcall case-func
|
||||||
(funcall case-func
|
(org-sort-remove-invisible (org-get-heading t t t t))))
|
||||||
(org-sort-remove-invisible (match-string 4)))
|
|
||||||
nil))
|
|
||||||
((= dcst ?k)
|
((= dcst ?k)
|
||||||
(or (get-text-property (point) :org-clock-minutes) 0))
|
(or (get-text-property (point) :org-clock-minutes) 0))
|
||||||
((= dcst ?t)
|
((= dcst ?t)
|
||||||
|
|
Loading…
Reference in New Issue