summary refs log tree commit diff stats
path: root/lisp/+titlecase.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/+titlecase.el')
-rw-r--r--lisp/+titlecase.el26
1 files changed, 26 insertions, 0 deletions
diff --git a/lisp/+titlecase.el b/lisp/+titlecase.el new file mode 100644 index 0000000..1366a46 --- /dev/null +++ b/lisp/+titlecase.el
@@ -0,0 +1,26 @@
1;;; +titlecase.el --- Titlecase extras -*- lexical-binding: t; -*-
2
3;;; Commentary:
4
5;;; Code:
6
7(defun +titlecase-sentence-style-dwim ()
8 "Titlecase a sentence."
9 (interactive)
10 (titlecase-dwim 'sentence))
11
12(defun +titlecase-org-headings ()
13 (interactive)
14 (save-excursion
15 (goto-char (point-min))
16 ;; See also `org-map-tree'. I'm not using that function because I want to
17 ;; skip the first headline. A better solution would be to patch
18 ;; `titlecase-line' to ignore org-mode metadata (TODO cookies, tags, etc).
19 (let ((level (funcall outline-level)))
20 (while (and (progn (outline-next-heading)
21 (> (funcall outline-level) level))
22 (not (eobp)))
23 (titlecase-line)))))
24
25(provide '+titlecase)
26;;; +titlecase.el ends here