Fixed.
[riece] / lisp / riece-skk-kakutei.el
1 ;;; riece-skk-kakutei.el --- add-on skk-kakutei
2 ;; Copyright (C) 2003 TAKAHASHI Kaoru
3
4 ;; Author: TAKAHASHI "beatmaria" Kaoru <kaoru@kaisei.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
10 ;; modify it under the terms of the GNU General Public License as
11 ;; published by the Free Software Foundation; either version 2, or (at
12 ;; your option) any later version.
13
14 ;; This program is distributed in the hope that it will be useful, but
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 ;; 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 deny SKK's sankaku send.
27
28 ;; To use, add the following line to your ~/.riece/init.el:
29 ;; (add-to-list 'riece-addons 'riece-skk-kakutei)
30
31 ;;; Code:
32
33 (eval-when-compile (require 'riece))
34
35 (defvar riece-skk-kakutei-enabled nil)
36
37 (defconst riece-skk-kakutei-description
38   "Deny SKK's sankaku send")
39
40 (defun riece-skk-kakutei-command-enter-message ()
41   "Send the current line to the current channel."
42   (interactive)
43   (when (riece-skk-kakutei)
44     (riece-command-enter-message)))
45
46 (defun riece-skk-kakutei-command-enter-message-as-notice ()
47   "Send the current line to the current channel as NOTICE."
48   (interactive)
49   (when (riece-skk-kakutei)
50     (riece-command-enter-message-as-notice)))
51
52 (defun riece-skk-kakutei ()
53   "When required after-follow return `t'."
54   (interactive)
55   (cond ((or (not (boundp 'skk-mode)) (not skk-mode))
56          t)
57         ((and (boundp 'skk-henkan-mode) (not skk-henkan-mode))
58          t)
59         ((and (boundp 'skk-henkan-on) (not skk-henkan-on))
60          t)
61         (skk-egg-like-newline
62          (skk-kakutei)
63          nil)
64         (t
65          (skk-kakutei)
66          t)))
67
68 (defun riece-skk-kakutei-insinuate ()
69   )
70
71 (defun riece-skk-kakutei-enable ()
72   (riece-define-keys riece-command-mode-map
73     "\r" riece-skk-kakutei-command-enter-message
74     [(control return)] riece-skk-kakutei-command-enter-message-as-notice)
75   (setq riece-skk-kakutei-enabled t))
76
77 (defun riece-skk-kakutei-disable ()
78   (riece-define-keys riece-command-mode-map
79     "\r" riece-command-enter-message
80     [(control return)] riece-command-enter-message-as-notice)
81   (setq riece-skk-kakutei-enabled nil))
82
83 (provide 'riece-skk-kakutei)
84
85 ;;; riece-skk-kakutei.el ends here