fcadb6b56c2a86256972057c82845fe37ecd202e
[riece] / lisp / riece-mini.el
1 ;;; riece-mini.el --- "riece on minibuffer" add-on
2 ;; Copyright (C) 2003 OHASHI Akira
3
4 ;; Author: OHASHI Akira <bg66@koka-in.org>
5 ;; Keywords: IRC, riece
6
7 ;; This file is part of Riece.
8
9 ;; This program is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
12 ;; any later version.
13
14 ;; This program is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 ;; GNU General Public License for more details.
18
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 ;; Boston, MA 02111-1307, USA.
23
24 ;;; Commentary:
25
26 ;; This add-on shows arrival messages to minibuffer. And you can send
27 ;; message using minibuffer.
28 ;;
29 ;; By using this add-on, you can use always "mini riece", even if you
30 ;; are visiting other buffers.
31
32 ;; To use, add the following line to your ~/.riece/init.el:
33 ;; (add-to-list 'riece-addons 'riece-mini)
34 ;;
35 ;; For using conveniently, bind any global key to
36 ;; `riece-mini-send-message' and `riece-mini-show-backlog'.
37 ;; For example:
38 ;; (global-set-key "\C-cm" 'riece-mini-send-message)
39 ;; (global-set-key "\C-cb" 'riece-mini-show-backlog)
40
41 ;;; Code:
42
43 (require 'riece-message)
44 (require 'riece-biff)
45
46 (defgroup riece-mini nil
47   "Riece on minibuffer."
48   :group 'riece)
49
50 (defcustom riece-mini-backlog-size 5
51   "*Line numbers for logging back log."
52   :type 'integer
53   :group 'riece-mini)
54
55 (defvar riece-mini-last-channel nil)
56 (defvar riece-mini-backlog-history nil)
57 (defvar riece-mini-backlog-shown nil)
58
59 (defvar riece-mini-enabled nil)
60
61 (defconst riece-mini-description
62   "Send arrival messages to minibuffer")
63
64 (defun riece-mini-message-no-log (string &rest args)