Fixed.
[riece] / lisp / riece-skk-kakutei.el
1 ;;; riece-skk-kakutei.el --- remove SKK's preedit mark before sending messages
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., 51 Franklin Street, Fifth Floor,
22 ;; Boston, MA 02110-1301, USA.
23
24 ;;; Commentary:
25
26 ;; NOTE: This is an add-on module for Riece.
27
28 ;;; Code:
29
30 (eval-when-compile (require 'riece))
31
32 (defvar skk-mode)
33 (defvar skk-henkan-mode)
34 (defvar skk-henkan-on)
35 (defvar skk-egg-like-newline)
36 (autoload 'skk-kakutei "skk")
37
38 (defconst riece-skk-kakutei-description
39   "Remove SKK's preedit mark before sending messages.")
40
41 (defun riece-skk-kakutei-command-enter-message ()
42   "Send the current line to the current channel."
43   (interactive)
44   (when (riece-skk-kakutei)
45     (riece-command-enter-message)))
46
47 (defun riece-skk-kakutei-command-enter-message-as-notice ()
48   "Send the current line to the current channel as NOTICE."
49   (interactive)
50   (when (riece-skk-kakutei)
51     (riece-command-enter-message-as-notice)))
52
53 (defun riece-skk-kakutei ()
54   "When required after-follow return `t'."
55   (interactive)
56   (cond ((or (not (boundp 'skk-mode)) (not skk-mode))
57          t)
58         ((and (boundp 'skk-henkan-mode) (not skk-henkan-mode))
59          t)
60         ((and (boundp 'skk-henkan-on) (not skk-henkan-on))
61          t)
62         (skk-egg-like-newline
63          (skk-kakutei)
64          nil)
65         (t
66          (skk-kakutei)
67          t)))
68
69 (defun riece-skk-kakutei-insinuate ()
70   )
71
72 (defun riece-skk-kakutei-enable ()
73   (riece-define-keys riece-command-mode-map
74     "\r" riece-skk-kakutei-command-enter-message
75     [(control return)] riece-skk-kakutei-command-enter-message-as-notice))
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
82 (provide 'riece-skk-kakutei)
83
84 ;;; riece-skk-kakutei.el ends here