From dd3afe747ecf51f87d33318c2ad68953d153495f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 23 May 2022 20:12:53 -0500 Subject: meh --- lisp/+titlecase.el | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lisp/+titlecase.el (limited to 'lisp/+titlecase.el') 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 @@ +;;; +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 -- cgit 1.4.1-21-gabe81