diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2011-01-02 19:25:52 +0100 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2011-02-18 12:45:09 +0100 |
commit | c32e39786dcc5e42d49a0195a2b91da3d7733e08 (patch) | |
tree | 83afc66f1dfdc83dd1643c9c38c6fdd611739804 | |
parent | 884d983188a09c60787ba2035b4a4c577767a8ec (diff) | |
download | org-mode-c32e39786dcc5e42d49a0195a2b91da3d7733e08.tar.gz |
org-list: small corrections to sort list
* lisp/org-list.el (org-sort-list): fix number of arguments to
`org-list-repair', plus make end-record go to end of item before any
blank line to keep them from being swallowed in the sorting.
-rw-r--r-- | lisp/org-list.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/org-list.el b/lisp/org-list.el index aa9a10a..4485a42 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -2351,7 +2351,8 @@ compare entries." (skip-chars-forward " \r\t\n") (beginning-of-line))) (end-record (lambda () - (goto-char (org-list-get-item-end (point) struct)))) + (goto-char (org-list-get-item-end-before-blank + (point) struct)))) (value-to-sort (lambda () (when (looking-at "[ \t]*[-+*0-9.)]+\\([ \t]+\\[[- X]\\]\\)?[ \t]+") @@ -2385,7 +2386,9 @@ compare entries." value-to-sort nil sort-func) - (org-list-repair nil) + ;; Read and fix list again, as `sort-subr' probably destroyed + ;; its structure. + (org-list-repair) (run-hooks 'org-after-sorting-entries-or-items-hook) (message "Sorting items...done"))))) |