about summary refs log tree commit diff
path: root/org-clubhouse.el
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-05-02T15·03-0400
committerGriffin Smith <root@gws.fyi>2019-05-02T15·03-0400
commit1cd9f9f00655ad1f7e997ce7ff6e73643108de90 (patch)
tree3cdf08ee915bca33af21f1d4be7ab55459f61bfe /org-clubhouse.el
parent01c684396d8455fa68b058b365695bd54794391c (diff)
feat: make headline-from-story prompt for story
Rename the previous org-clubhouse-headline-from-story to
org-clubhouse-headline-from-story-*id*, and make -headline-from-story
use prompt-for-story to allow autocompletion of the title of the story
to pull down.
Diffstat (limited to 'org-clubhouse.el')
-rw-r--r--org-clubhouse.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/org-clubhouse.el b/org-clubhouse.el
index dd5e73ea8215..e82cd48d02a4 100644
--- a/org-clubhouse.el
+++ b/org-clubhouse.el
@@ -997,9 +997,8 @@ which labels to set."
                     "\n")
        ""))))
 
-(defun org-clubhouse-headline-from-story (level story-id)
+(defun org-clubhouse-headline-from-story-id (level story-id)
   "Create a single `org-mode' headline at LEVEL based on the given clubhouse STORY-ID."
-
   (interactive "*nLevel: \nnStory ID: ")
   (let* ((story (org-clubhouse-get-story story-id)))
     (if (equal '((message . "Resource not found.")) story)
@@ -1050,6 +1049,16 @@ resulting stories at headline level LEVEL."
             :action (lambda (s) (funcall cb (get-text-property 0 'story s)))
             :require-match t))
 
+(defun org-clubhouse-headline-from-story (level)
+  "Prompt for a story, and create an org headline at LEVEL from that story."
+  (interactive "*nLevel: ")
+  (org-clubhouse-prompt-for-story
+   (lambda (story)
+     (save-mark-and-excursion
+       (insert (org-clubhouse--story-to-headline-text level story))
+       (org-align-tags)))))
+
+
 (defun org-clubhouse-link ()
   "Link the current `org-mode' headline with an existing clubhouse story."
   (interactive)