simplenote2 doesn't provide a way to publish or unpublish a note. Fortunately, simplenote2 has necessary infrastructure for updating the published property of systemtags. It was just a matter few hours before I could come up with M-x simplenote2-publish RET and M-x simplenote2-unpublish RET to publish or unpublish a note. In simple cases, the following commands seems to work
(defun simplenote2-publish-or-unpublish (publishp)
"Publish or Un-Publish the current note."
(let* ((file (buffer-file-name))
(key (file-name-nondirectory file))
(note-info (simplenote2--get-note-info key)))
(cond
(note-info
(let ((publishp (not (not publishp))))
(setf (nth 8 note-info) publishp)
(setf (nth 7 note-info) t)
(simplenote2-browser-refresh)
(message "%sPublished" (if publishp "" "Un-"))))
(t
(message "This buffer is not a Simplenote note")))))
(defun simplenote2-publish ()
"Publish the current note."
(interactive)
(simplenote2-publish-or-unpublish 'publish))
(defun simplenote2-unpublish ()
"Un-Publish the current note."
(interactive)
(simplenote2-publish-or-unpublish (not 'publish)))
Recipe: Publishing a note
@alpha22jp
simplenote2
doesn't provide a way topublish
orunpublish
a note. Fortunately,simplenote2
has necessary infrastructure for updating thepublished
property ofsystemtags
. It was just a matter few hours before I could come up withM-x simplenote2-publish RET
andM-x simplenote2-unpublish RET
to publish or unpublish a note. In simple cases, the following commands seems to work