;;; emchat-buddy.el --- "Buddy" code for EMchat
-;; Copyright (C) 2007 - 2010 Steve Youngs
+;; Copyright (C) 2007 - 2011 Steve Youngs
;; Author: Steve Youngs <steve@emchat.org>
;; Maintainer: Steve Youngs <steve@emchat.org>
"*Width of window for `emchat-buddy-buffer'."
:group 'emchat-interface)
-(defcustom emchat-buddy-view
+(defcustom emchat-buddy-view
'emchat-connected-aliases
"*View of buddy buffer.
It determines what aliases to be display in buddy buffer. For example,
`emchat-buddy-view-active'."
:group 'emchat-buddy
:type '(choice (item emchat-all-aliases)
- (item emchat-connected-aliases)
- (item emchat-active-aliases))
+ (item emchat-connected-aliases)
+ (item emchat-active-aliases))
:initialize 'custom-initialize-default)
(defcustom emchat-buddy-show-xface nil
(when (and face
(or (not emchat-buddy-prefer-cface-to-xface)
(not cface)))
- (set-extent-begin-glyph
+ (set-extent-begin-glyph
ext
(make-glyph (list (vector 'xface
:data (concat "X-Face: " face)
See `emchat-buddy-view' and `emchat-buddy-status-color-hint-flag'."
(interactive)
(when (or (not (buffer-live-p emchat-buddy-buffer))
- new)
+ new)
(setq emchat-buddy-buffer (get-buffer-create "*emchat buddy*"))
(set-buffer emchat-buddy-buffer)
(erase-buffer)
(when (and face
(or (not emchat-buddy-prefer-cface-to-xface)
(not cface)))
- (set-extent-begin-glyph
+ (set-extent-begin-glyph
ext
(make-glyph (list (vector 'xface
:data (concat "X-Face: " face)
(let ((alias (progn
(set-buffer balloon-help-buffer)
(goto-char (point-min))
- (when (re-search-forward "\\(^.*\\) (" (eolp) t)
+ (when (re-search-forward "\\(^.*\\) (" (point-at-eol) t)
(substring (match-string 1) 1)))))
(when alias
(emchat-buddy-show-xface-in-balloon alias)))))
(goto-char (point-min))
(if (search-forward-regexp
- ;; use "^" alias "$" so searching "foo" will not get "foobar"
- (concat "^"
- ;; to allow funny characters in alias
- (regexp-quote alias)
- "$")
- nil t)
- ;; old alias
- (if delete
- (delete-region
- (point-at-bol)
- ;; take care of last line
- (min (1+ (point-at-eol)) (point-max))))
- ;; new alias
- (unless delete
- (insert alias "\n")
- (forward-line -1)))
+ ;; use "^" alias "$" so searching "foo" will not get "foobar"
+ (concat "^"
+ ;; to allow funny characters in alias
+ (regexp-quote alias)
+ "$")
+ nil t)
+ ;; old alias
+ (if delete
+ (delete-region
+ (point-at-bol)
+ ;; take care of last line
+ (min (1+ (point-at-eol)) (point-max))))
+ ;; new alias
+ (unless delete
+ (insert alias "\n")
+ (forward-line -1)))
(unless delete
(let* ((ext (extent-at (point)))
- (bhelp (format
+ (bhelp (format
"%s (%s)\n Status: %s\n Groups: %s\nHistory: %s\n\n\n"
alias
(emchat-alias-uin alias)
Current view is `emchat-buddy-view'."
(loop for x in (symbol-value emchat-buddy-view)
if (or (null predicate)
- (funcall predicate x))
+ (funcall predicate x))
do (emchat-group-select-aliases state x)))
(defun emchat-buddy-select-all-in-view-by-status (status)
(provide 'emchat-buddy)
;;; emchat-buddy.el ends here
-