aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pearl.el3
-rw-r--r--tests/test-pearl-output.el11
2 files changed, 13 insertions, 1 deletions
diff --git a/pearl.el b/pearl.el
index 3f65617..4b31b2f 100644
--- a/pearl.el
+++ b/pearl.el
@@ -2897,7 +2897,8 @@ page cap was hit. Pure function, no side effects."
(name (pearl--source-name src))
(filter (plist-get src :filter)))
(with-temp-buffer
- (insert (format "#+title: Linear — %s\n" name))
+ (insert (format "#+title: Linear — %s\n"
+ (if pearl-title-case-headings (pearl--title-case name) name)))
(insert "#+STARTUP: show3levels\n")
(insert (format "#+TODO: %s\n"
(if (bound-and-true-p org-todo-keywords)
diff --git a/tests/test-pearl-output.el b/tests/test-pearl-output.el
index f9f66eb..6eafbb4 100644
--- a/tests/test-pearl-output.el
+++ b/tests/test-pearl-output.el
@@ -68,6 +68,17 @@
(should (string-match-p "^#\\+title:" out))
(should-not (string-match-p "^\\*\\*\\* " out))))
+(ert-deftest test-pearl-build-org-content-title-cases-view-name ()
+ "The view name in the file title is title-cased when title-casing is on, raw when off."
+ (let ((case-fold-search nil) ; strict so casing actually matters
+ (source '(:type filter :name "my open bugs" :filter nil)))
+ (let ((pearl-title-case-headings t))
+ (should (string-match-p "^#\\+title: Linear — My Open Bugs$"
+ (pearl--build-org-content '() source))))
+ (let ((pearl-title-case-headings nil))
+ (should (string-match-p "^#\\+title: Linear — my open bugs$"
+ (pearl--build-org-content '() source))))))
+
;;; --read-active-source
(ert-deftest test-pearl-read-active-source-absent ()