diff options
author | Kyle Meyer <kyle@kyleam.com> | 2015-02-15 22:29:03 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2015-02-15 22:29:03 -0500 |
commit | 55690769d49041c62c67be74bb8597bf17d89e85 (patch) | |
tree | 396ee2f666fa71df0a39bcac854425363fa272e6 /lisp | |
parent | ac7f622e1f5bff481046b0c965d3e320cf746a8d (diff) | |
download | emacs.d-55690769d49041c62c67be74bb8597bf17d89e85.tar.gz |
Rewrite org-sort-heading-ignoring-articles
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/init-org.el | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lisp/init-org.el b/lisp/init-org.el index c5ee07b..de283e8 100644 --- a/lisp/init-org.el +++ b/lisp/init-org.el @@ -154,16 +154,14 @@ current heading." (defun km/org-sort-heading-ignoring-articles () "Sort alphabetically, but ignore any leading articles." - (when (looking-at org-complex-heading-regexp) - (let ((ignored-words '("a" "an" "the")) - heading heading-words) - (setq heading - (funcall 'downcase - (org-sort-remove-invisible (match-string 4)))) - (setq heading-words (split-string heading)) - (when (member (car heading-words) ignored-words) - (setq heading-words (cdr heading-words))) - (mapconcat 'identity heading-words " ")))) + (let* ((ignored-words '("a" "an" "the")) + (heading (org-no-properties + (org-get-heading 'no-tags 'no-todo))) + (heading-words (split-string heading))) + (when (member (downcase (car heading-words)) + ignored-words) + (setq heading-words (cdr heading-words))) + (mapconcat #'identity heading-words " "))) (defun km/org-remove-title-leader () "Remove leader from Org heading title. |