From 1cd9f9f00655ad1f7e997ce7ff6e73643108de90 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Thu, 2 May 2019 11:03:08 -0400 Subject: [PATCH] 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. --- org-clubhouse.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/org-clubhouse.el b/org-clubhouse.el index dd5e73ea8..e82cd48d0 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)