summaryrefslogtreecommitdiff
path: root/lisp/init-org.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-12-10 01:14:01 -0500
committerKyle Meyer <kyle@kyleam.com>2014-12-10 01:14:01 -0500
commit294e3c389f7fa883eb950bf1864e94fa1d34986e (patch)
tree4547891688a8c290f063f9960e8f5324ae7c05a9 /lisp/init-org.el
parent36dacdabd7a30db7d577d6faee48cb72af59b2f6 (diff)
downloademacs.d-294e3c389f7fa883eb950bf1864e94fa1d34986e.tar.gz
Clean up org-sort-heading-ignoring-articles
Diffstat (limited to 'lisp/init-org.el')
-rw-r--r--lisp/init-org.el21
1 files changed, 10 insertions, 11 deletions
diff --git a/lisp/init-org.el b/lisp/init-org.el
index 9aedbac..e1fa33f 100644
--- a/lisp/init-org.el
+++ b/lisp/init-org.el
@@ -203,17 +203,16 @@ under the current heading."
(defun km/org-sort-heading-ignoring-articles ()
"Sort alphabetically, but ignore any leading articles."
- (if (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 " "))
- nil))
+ (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 " "))))
(defun km/org-remove-title-leader ()
"Remove leader from Org heading title.