Rename from riece-unread-display-message-function.
(riece-unread-after-switch-to-channel-function): Rename from
riece-unread-channel-switch-hook.
(riece-guess-channel-from-unread): New function.
(riece-unread-requires): Require 'riece-guess and 'riece-history.
(riece-unread-insinuate): Setup riece-guess-channel-try-functions.
* riece-options.el (riece-addons): Add riece-guess, riece-history,
and riece-url.
* riece-layout.el (riece-reconfigure-windows-predicate): Don't
check riece-last-channel.
* riece-display.el (riece-switch-to-channel): Rename
riece-channel-switch-hook to
riece-after-switch-to-channel-functions.
(riece-switch-to-nearest-channel): Ditto.
* riece-guess.el: New add-on.
* COMPILE (riece-modules): Add riece-guess.
* Makefile.am (EXTRA_DIST): Add riece-guess.el
* riece-history.el: New add-on.
* COMPILE (riece-modules): Add riece-history.
* Makefile.am (EXTRA_DIST): Add riece-history.el
riece-unread
riece-doctor
riece-alias
- riece-skk-kakutei))))
+ riece-skk-kakutei
+ riece-guess
+ riece-history))))
(defun riece-compile-modules (modules)
(let ((load-path (cons nil load-path)))
2003-08-27 Daiki Ueno <ueno@unixuser.org>
+ * riece-unread.el (riece-unread-after-display-message-function):
+ Rename from riece-unread-display-message-function.
+ (riece-unread-after-switch-to-channel-function): Rename from
+ riece-unread-channel-switch-hook.
+ (riece-guess-channel-from-unread): New function.
+ (riece-unread-requires): Require 'riece-guess and 'riece-history.
+ (riece-unread-insinuate): Setup riece-guess-channel-try-functions.
+
+ * riece-options.el (riece-addons): Add riece-guess, riece-history,
+ and riece-url.
+
+ * riece-layout.el (riece-reconfigure-windows-predicate): Don't
+ check riece-last-channel.
+
+ * riece-display.el (riece-switch-to-channel): Rename
+ riece-channel-switch-hook to
+ riece-after-switch-to-channel-functions.
+ (riece-switch-to-nearest-channel): Ditto.
+
+ * riece-guess.el: New add-on.
+ * COMPILE (riece-modules): Add riece-guess.
+ * Makefile.am (EXTRA_DIST): Add riece-guess.el
+
+ * riece-history.el: New add-on.
+ * COMPILE (riece-modules): Add riece-history.
+ * Makefile.am (EXTRA_DIST): Add riece-history.el
+
+2003-08-27 Daiki Ueno <ueno@unixuser.org>
+
* riece-options.el (riece-connection-timeout): Abolish.
* riece-server.el (riece-clear-system): Abolish.
riece-xemacs.el riece.el \
riece-ctcp.el riece-url.el riece-unread.el \
riece-ndcc.el riece-rdcc.el riece-log.el riece-mini.el \
- riece-doctor.el riece-alias.el riece-layout.el riece-skk-kakutei.el
+ riece-doctor.el riece-alias.el riece-layout.el riece-skk-kakutei.el \
+ riece-guess.el riece-history.el
CLEANFILES = auto-autoloads.el custom-load.el *.elc
FLAGS ?= -batch -q -no-site-file
(current-buffer)))
(defun riece-switch-to-channel (identity)
- (setq riece-last-channel riece-current-channel
- riece-current-channel identity)
- (run-hooks 'riece-channel-switch-hook))
+ (let ((last riece-current-channel))
+ (setq riece-current-channel identity)
+ (run-hook-with-args 'riece-after-switch-to-channel-functions last)))
(defun riece-join-channel (identity)
(unless (riece-identity-member identity riece-current-channels)
(setq identity (car pointer)))
(if identity
(riece-switch-to-channel identity)
- (setq riece-last-channel riece-current-channel
- riece-current-channel nil))))
+ (let ((last riece-current-channel))
+ (run-hook-with-args 'riece-after-switch-to-channel-functions last)
+ (setq riece-current-channel nil)))))
(defun riece-part-channel (identity)
(let ((pointer (riece-identity-member identity riece-current-channels)))
"The channel you currently have joined.")
(defvar riece-current-channels nil
"The channels you have currently joined.")
-(defvar riece-channel-history nil
- "List of channels user has visited.")
(defvar riece-save-variables-are-dirty nil
"Non nil if the variables in `riece-saved-forms' are changed.")
(if (looking-at riece-prefix-regexp)
(put-text-property (match-beginning 1) (match-end 1) 'invisible t))))
-(defun riece-channel-list-mark-current-channel ()
+(defun riece-channel-list-mark-current-channel (last)
(if (and riece-channel-list-buffer-mode
riece-current-channel)
(save-excursion
'riece-dialogue-schedule-turn-on-font-lock)
(put 'riece-channel-list-mode 'font-lock-defaults
'(riece-channel-list-font-lock-keywords t))
- (add-hook 'riece-channel-switch-hook
+ (add-hook 'riece-after-switch-to-channel-functions
'riece-channel-list-mark-current-channel)
(add-hook 'riece-after-load-startup-hook
'riece-channel-list-schedule-turn-on-font-lock))
(defun riece-reconfigure-windows-predicate ()
"Return t, if window reconfiguration is needed.
This function is used by \"default\" layout."
- ;; The current channel is changed, and some buffers are visible.
- (unless (equal riece-last-channel riece-current-channel)
- (let ((buffers riece-buffer-list))
- (catch 'found
- (while buffers
- (if (and (buffer-live-p (car buffers))
- (get-buffer-window (car buffers)))
- (throw 'found t)
- (setq buffers (cdr buffers))))))))
+ ;; Check whether there is a buffer which belongs to Riece is visible.
+ (let ((buffers riece-buffer-list))
+ (catch 'found
+ (while buffers
+ (if (and (buffer-live-p (car buffers))
+ (get-buffer-window (car buffers)))
+ (throw 'found t)
+ (setq buffers (cdr buffers)))))))
(defun riece-configure-windows-top (&optional plist)
"Candidate of `riece-configure-windows-function'.
:type '(repeat (file :tag "Initialization File"))
:group 'riece-options)
-(defcustom riece-addons '(riece-highlight riece-ctcp riece-unread)
+(defcustom riece-addons '(riece-highlight
+ riece-ctcp
+ riece-guess
+ riece-unread
+ riece-history
+ riece-url)
"Add-ons insinuated into Riece."
:type '(repeat symbol)
:group 'riece-options)
(defvar riece-unread-channels nil)
-(defun riece-unread-display-message-function (message)
+(defun riece-unread-after-display-message-function (message)
(unless (or (riece-message-own-p message)
(equal (riece-message-target message) riece-current-channel))
(setq riece-unread-channels
(riece-message-target message))
(riece-unread-update-channel-list-buffer)))
-(defun riece-unread-channel-switch-hook ()
+(defun riece-unread-after-switch-to-channel-function (last)
(setq riece-unread-channels
(delete riece-current-channel
riece-unread-channels))
(riece-command-switch-to-channel (car riece-unread-channels))
(error "No unread channel!")))
+(defun riece-guess-channel-from-unread ()
+ riece-unread-channels)
+
(defvar riece-command-mode-map)
(defvar riece-dialogue-mode-map)
(defvar riece-channel-list-mode-map)
(defun riece-unread-requires ()
- (if (memq 'riece-highlight riece-addons)
- '(riece-highlight)))
+ (let (requires)
+ (if (memq 'riece-highlight riece-addons)
+ (setq requires (cons 'riece-highlight requires)))
+ (if (memq 'riece-guess riece-addons)
+ (setq requires (cons 'riece-guess requires)))
+ ;; riece-guess-channel-from-unread should be prior to
+ ;; riece-guess-channel-from-history.
+ (if (memq 'riece-history riece-addons)
+ (setq requires (cons 'riece-history requires)))
+ requires))
(defun riece-unread-insinuate ()
(add-hook 'riece-after-display-message-functions
- 'riece-unread-display-message-function)
- (add-hook 'riece-channel-switch-hook
- 'riece-unread-channel-switch-hook)
+ 'riece-unread-after-display-message-function)
+ (add-hook 'riece-after-switch-to-channel-functions
+ 'riece-unread-after-switch-to-channel-function)
(add-hook 'riece-update-buffer-functions
'riece-unread-update-channel-list-buffer t)
(define-key riece-command-mode-map
(if (memq 'riece-highlight riece-addons)
(setq riece-channel-list-mark-face-alist
(cons '(?! . riece-channel-list-unread-face)
- riece-channel-list-mark-face-alist))))
+ riece-channel-list-mark-face-alist)))
+ (if (memq 'riece-guess riece-addons)
+ (add-hook 'riece-guess-channel-try-functions
+ 'riece-guess-channel-from-unread)))
(provide 'riece-unread)
riece-channel-list-indicator "No channel"
riece-away-indicator "-"
riece-operator-indicator "-"
- riece-freeze-indicator "-"
- riece-channel-history nil)
+ riece-freeze-indicator "-")
(delete-other-windows)
(run-hooks 'riece-exit-hook))