;; Author: Steve Youngs <steve@sxemacs.org>
;; Maintainer: Steve Youngs <steve@sxemacs.org>
;; Created: <2007-12-02>
-;; Time-stamp: <Friday May 15, 2015 21:44:46 steve>
+;; Time-stamp: <Monday Jun 15, 2015 10:22:22 steve>
;; Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
;; HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/16-riece-sy.html>
;; Git Repo: git clone http://git.sxemacs.org/syinit
(add-hook 'riece-command-mode-hook
#'(lambda ()
- (local-set-key [iso-left-tab] #'sy-riece-complete-user-backwards)))
+ ;; Define a few keys here so they don't have the `C-c' prefix
+ (local-set-key [iso-left-tab] #'sy-riece-complete-user-backwards)
+ (local-set-key [(super next)] #'riece-command-user-list-scroll-up)
+ (local-set-key [(super prior)] #'riece-command-user-list-scroll-down)
+ (local-set-key [(hyper next)] #'riece-command-scroll-up)
+ (local-set-key [(hyper prior)] #'riece-command-scroll-down)))
(defun riece-me:command-complete-user (&optional reverse)
"Like `riece-command-complete-user' but restrict to current chan.
(message "Channel: %s added to riece-biff channel list."
(riece-identity-prefix riece-current-channel))))
+(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)))
;; Define keys for those functions.
(define-key riece-command-map (kbd "C-c C") #'sy-riece-clear-unread-chans)
(define-key riece-command-map (kbd "C-c b") #'sy-riece-add-rem-biff-channel)
(define-key riece-command-map (kbd "C-c ?") #'sy-riece-think)
(define-key riece-command-map (kbd "C-c R") #'sy-riece-reverse)
+(define-key riece-command-map (kbd "C-c T") #'sy-riece-sxemacs-topic-version-update)
(define-key riece-command-map (kbd "C-c U") #'sy-riece-sxe-uptime)
(define-key riece-command-map [a] #'sy-riece-say-all-purpose)