X-Git-Url: http://cgit.sxemacs.org/?p=riece;a=blobdiff_plain;f=lisp%2Friece-history.el;h=e49b356a1b21e9e7c856f6362b8ab9511482a105;hp=65da96016b102f78c9cd268ff845d8a87a61d284;hb=c694c12685b03816d35bc0a35b0202ddaeb56118;hpb=a86316a5d418673f99e35a21a59356b57a778a3d;ds=sidebyside diff --git a/lisp/riece-history.el b/lisp/riece-history.el index 65da960..e49b356 100644 --- a/lisp/riece-history.el +++ b/lisp/riece-history.el @@ -44,6 +44,19 @@ :type 'integer :group 'riece-history) +(defface riece-channel-list-history-face + '((((class color) + (background dark)) + (:foreground "PaleTurquoise")) + (((class color) + (background light)) + (:foreground "SeaGreen3")) + (t + (:bold t))) + "Face used for displaying history channels." + :group 'riece-highlight-faces) +(defvar riece-channel-list-history-face 'riece-channel-list-history-face) + (defvar riece-channel-history nil) (defun riece-guess-channel-from-history () @@ -55,6 +68,13 @@ index (1+ index))) (nreverse result))) +(defun riece-history-format-channel-list-line (index channel) + (if (and (not (ring-empty-p riece-channel-history)) + (riece-identity-equal channel (ring-ref riece-channel-history 0))) + (concat (format "%2d:+" index) + (riece-format-identity channel) + "\n"))) + ;;; (defun riece-history-requires () ;;; (if (memq 'riece-guess riece-addons) ;;; '(riece-guess))) @@ -69,7 +89,14 @@ (setq riece-channel-history nil))) (add-hook 'riece-after-switch-to-channel-functions (lambda (last) - (ring-insert riece-channel-history last))) + (unless (riece-identity-equal last riece-current-channel) + (ring-insert riece-channel-history last)))) + (add-hook 'riece-format-channel-list-line-functions + 'riece-history-format-channel-list-line) + (if (memq 'riece-highlight riece-addons) + (setq riece-channel-list-mark-face-alist + (cons '(?+ . riece-channel-list-history-face) + riece-channel-list-mark-face-alist))) ;;; (if (memq 'riece-guess riece-addons) ;;; (add-hook 'riece-guess-channel-try-functions ;;; 'riece-guess-channel-from-history))