summary refs log tree commit diff stats
path: root/lisp/+titlecase.el
blob: 1366a46b8f749fec5b4d5929fbca12ddd7b4e221 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
;;; +titlecase.el --- Titlecase extras -*- lexical-binding: t; -*-

;;; Commentary:

;;; Code:

(defun +titlecase-sentence-style-dwim ()
  "Titlecase a sentence."
  (interactive)
  (titlecase-dwim 'sentence))

(defun +titlecase-org-headings ()
  (interactive)
  (save-excursion
    (goto-char (point-min))
    ;; See also `org-map-tree'.  I'm not using that function because I want to
    ;; skip the first headline.  A better solution would be to patch
    ;; `titlecase-line' to ignore org-mode metadata (TODO cookies, tags, etc).
    (let ((level (funcall outline-level)))
      (while (and (progn (outline-next-heading)
                         (> (funcall outline-level) level))
                  (not (eobp)))
        (titlecase-line)))))

(provide '+titlecase)
;;; +titlecase.el ends here