From 1d7734ce32ae840009e2668ef5fd1dbaec939234 Mon Sep 17 00:00:00 2001 From: Alex Dao Date: Mon, 26 Mar 2018 22:25:30 -0400 Subject: [PATCH] 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) --- org-clubhouse.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/org-clubhouse.el b/org-clubhouse.el index fed65b377..f7a570ae5 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)