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.
This commit is contained in:
Griffin Smith 2019-05-02 11:03:08 -04:00
parent 01c684396d
commit 1cd9f9f006

View file

@ -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)