diff options
author | Case Duckworth | 2022-05-23 20:12:53 -0500 |
---|---|---|
committer | Case Duckworth | 2022-05-23 20:12:59 -0500 |
commit | dd3afe747ecf51f87d33318c2ad68953d153495f (patch) | |
tree | c364d2c59741f68bb3f51e8a28f84a2a9712fd37 /lisp/+titlecase.el | |
parent | Add timers (diff) | |
download | emacs-dd3afe747ecf51f87d33318c2ad68953d153495f.tar.gz emacs-dd3afe747ecf51f87d33318c2ad68953d153495f.zip |
meh
Diffstat (limited to 'lisp/+titlecase.el')
-rw-r--r-- | lisp/+titlecase.el | 26 |
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 | ||