about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Dao <alex@urbint.com>2018-03-27T02·25-0400
committerAlex Dao <35239179+alexdao3@users.noreply.github.com>2018-06-14T22·09-0400
commit1d7734ce32ae840009e2668ef5fd1dbaec939234 (patch)
treefd84a6a783892d5909f83f9ffe2539408f504635
parentc4096e5dbb2212fb816c58780a453b62314af6dc (diff)
feat: support updating the story title
Defines an 'org-clubhouse-update-story-title' interactive function. Can
only be invoked if cursor is over the Headline title

fixes string-to-int -> string-to-number (unsupported as of Emacs 26)
-rw-r--r--org-clubhouse.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/org-clubhouse.el b/org-clubhouse.el
index fed65b3779ec..f7a570ae50a2 100644
--- a/org-clubhouse.el
+++ b/org-clubhouse.el
@@ -585,6 +585,18 @@ If the stories already have a CLUBHOUSE-ID, they are filtered and ignored."
 ;;; Story updates
 ;;;
 
+(defun org-clubhouse-update-story-title ()
+  (interactive)
+
+  (when-let (clubhouse-id (org-element-clubhouse-id))
+    (let* ((elt (org-element-find-headline))
+           (title (plist-get elt :title)))
+    (org-clubhouse-update-story-internal
+     clubhouse-id
+     :name title)
+    (message "Successfully updated story title to \"%s\""
+             title))))
+
 (cl-defun org-clubhouse-update-story-internal
     (story-id &rest attrs)
   (assert (and (integerp story-id)