+(defun sy-riece-get-sxemacs-topic-version ()
+ "Return the \"version\" section of #sxemacs topic."
+ (let* ((topic (riece-with-server-buffer
+ (riece-identity-server riece-current-channel)
+ (riece-channel-get-topic "#sxemacs")))
+ (ver (third (split-string-by-char topic ?\ ))))
+ ver))
+
+(defun sy-riece-sxemacs-topic-version-update (&optional newver)
+ "*Updates the \"version\" section of #sxemacs topic with NEWVER.
+With a prefix arg, prompt for the new version string."
+ (interactive "P")
+ (let* ((oldver (sy-riece-get-sxemacs-topic-version))
+ (gitver (substring (shell-command-to-string
+ "( cd ${SXEWD}; git describe master )")
+ 0 -1))
+ (newver (or (and current-prefix-arg
+ (read-string "New Version: "
+ sxemacs-git-version nil
+ sxemacs-git-version))
+ gitver))
+ (chan (riece-identity-prefix riece-current-channel)))
+ (unless (string= chan "#sxemacs")
+ (error 'invalid-argument "Wrong channel" chan))
+ (riece-command-send-message
+ (format ",topic change 1 s/%s/%s/" oldver newver) nil)))