From: Daiki Ueno Date: Mon, 13 Oct 2003 05:36:55 +0000 (+0000) Subject: * riece-button.el (riece-button-insinuate): Buttonize channel buffers. X-Git-Url: http://cgit.sxemacs.org/?p=riece;a=commitdiff_plain;h=c694c12685b03816d35bc0a35b0202ddaeb56118 * riece-button.el (riece-button-insinuate): Buttonize channel buffers. * riece-history.el (riece-channel-list-history-face): New face. (riece-history-format-channel-list-line): New function. (riece-history-insinuate): Add ?+ to riece-channel-list-mark-face-alist; add riece-history-format-channel-list-line to riece-format-channel-list-line-functions. * riece-highlight.el (riece-channel-list-current-face): Arrange colors. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d455de5..4590d95 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,16 @@ +2003-10-13 Daiki Ueno + + * riece-button.el (riece-button-insinuate): Buttonize channel buffers. + + * riece-history.el (riece-channel-list-history-face): New face. + (riece-history-format-channel-list-line): New function. + (riece-history-insinuate): Add ?+ to + riece-channel-list-mark-face-alist; add + riece-history-format-channel-list-line to + riece-format-channel-list-line-functions. + + * riece-highlight.el (riece-channel-list-current-face): Arrange colors. + 2003-10-13 Daiki Ueno * riece-unread.el (riece-unread-after-display-message-function): diff --git a/lisp/riece-button.el b/lisp/riece-button.el index f65e7bf..fcf3026 100644 --- a/lisp/riece-button.el +++ b/lisp/riece-button.el @@ -60,7 +60,7 @@ (message "%s" (substitute-command-keys "Type \\[riece-command-join] to join the channel"))))) -(defun riece-button-add-channel-buttons (start end length) +(defun riece-button-add-channel-buttons (start end) (save-excursion (catch 'done (while t @@ -85,7 +85,7 @@ (set-buffer riece-channel-list-buffer) (let ((inhibit-read-only t) buffer-read-only) - (riece-button-add-channel-buttons (point-min) (point-max) nil))))) + (riece-button-add-channel-buttons (point-min) (point-max)))))) (defun riece-button-requires () '(riece-highlight)) @@ -95,7 +95,11 @@ (lambda () (set-keymap-parent riece-channel-list-mode-map widget-keymap) (add-hook 'riece-update-buffer-functions - 'riece-button-update-channel-list-buffer t)))) + 'riece-button-update-channel-list-buffer t))) + (add-hook 'riece-dialogue-mode-hook + (lambda () + (set-keymap-parent riece-dialogue-mode-map widget-keymap))) + (add-hook 'riece-after-insert-functions 'riece-button-add-channel-buttons)) (provide 'riece-button) diff --git a/lisp/riece-highlight.el b/lisp/riece-highlight.el index a56b4fa..8eefc61 100644 --- a/lisp/riece-highlight.el +++ b/lisp/riece-highlight.el @@ -162,10 +162,10 @@ (defface riece-channel-list-current-face '((((class color) (background dark)) - (:foreground "PaleTurquoise" :underline t)) + (:foreground "turquoise" :underline t)) (((class color) (background light)) - (:foreground "ForestGreen" :underline t)) + (:foreground "SeaGreen" :underline t)) (t ())) "Face used for displaying the current channel." 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))