(require 'riece-channel)
(require 'riece-server)
(require 'riece-user)
+(require 'riece-mode)
(defun riece-get-buffer-create (name &optional init-major-mode)
(let ((buffer (get-buffer name)))
(insert (format-time-string "%H:%M") " " string)
(if (and (not (riece-frozen (current-buffer)))
(get-buffer-window (current-buffer)))
- (set-window-point (get-buffer-window (current-buffer))
- (point)))
+ (recenter -1 (get-buffer-window (current-buffer))))
(run-hook-with-args 'riece-after-insert-functions start (point))))
(setq buffers (cdr buffers))))
(while (string-match "^\\([^ ]+\\) +" string)
(setq parameters (nconc parameters (list (match-string 1 string)))
string (substring string (match-end 0)))
- (and (not (equal "" string)) (eq ?: (aref string 0))
- (setq string (substring string 1))
- (throw 'done nil))))
- (or (equal "" string)
- (setq parameters (nconc parameters (list string))))
+ (when (and (not (equal "" string)) (eq ?: (aref string 0)))
+ (setq string (substring string 1)
+ parameters (nconc parameters (list string)))
+ (throw 'done nil)))
+ (or (equal "" string)
+ (setq parameters (nconc parameters (list string)))))
parameters)))
(defun riece-concat-channel-topic (target string)
(riece-with-server-buffer (riece-identity-server target)
(let ((modes (riece-channel-get-modes (riece-identity-prefix target))))
(if modes
- (concat string " [" (apply #'string modes) "]")
+ (concat string " ["
+ (mapconcat
+ (lambda (mode)
+ (if (riece-mode-parameter mode)
+ (format "%c(%s)"
+ (riece-mode-flag mode)
+ (riece-mode-parameter mode))
+ (char-to-string (riece-mode-flag mode))))
+ modes "")
+ "]")
string))))
(defun riece-concat-message (string message)
(defun riece-concat-server-name (string)
(if (equal riece-server-name "")
string
- (concat string " (from " riece-server-name ")")))
+ (let ((server-name (concat " (from " riece-server-name ")")))
+ (put-text-property 0 (length server-name)
+ 'riece-server-name riece-server-name
+ server-name)
+ (concat string server-name))))
(defun riece-concat-user-status (status string)
(if status