]> gitweb @ CieloNegro.org - sugar.git/blob - dot-files/_navi2ch/elisp/navi2ch-migemo_el
Auto commit by The Sugar System.
[sugar.git] / dot-files / _navi2ch / elisp / navi2ch-migemo_el
1 ;;; navi2ch-migemo.el --- migemo support for Navi2ch
2
3 ;; Copyright (C) 2002 by Navi2ch Project
4
5 ;; Author: Nanashi San <nanashi@users.sourceforge.net>
6 ;; Keywords: 2ch, network, matching
7
8 ;; This file is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation; either version 2, or (at your option)
11 ;; any later version.
12
13 ;; This file is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 ;; GNU General Public License for more details.
17
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GNU Emacs; see the file COPYING.  If not, write to
20 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 ;; Boston, MA 02111-1307, USA.
22
23 ;;; Commentary:
24
25 ;; To use this module, put following code into your `~/.navi2ch/init.el':
26 ;; (require 'navi2ch-migemo)
27
28 ;;; Code:
29 (provide 'navi2ch-migemo)
30
31 ;; migemo \e$B$,$J$/$F$b%3%s%Q%$%k$G$-$k$h$&$K!#\e(B
32 (eval '(require 'migemo))
33
34 (require 'navi2ch-search)
35
36 (defvar navi2ch-migemo-enable t
37   "*\e$B8!:w%Q%?!<%s$K\e(Bmigemo\e$B$rE,MQ$9$k$+$I$&$+!#\e(B")
38
39 (defadvice navi2ch-search-board-subject-regexp
40   (before navi2ch-migemo-search-board-subject-regexp activate)
41   "\e$B8!:w%Q%?!<%s$K\e(Bmigemo\e$B$rE,MQ$9$k!#\e(B"
42   (if navi2ch-migemo-enable
43       (ad-set-arg 1 (migemo-get-pattern (ad-get-arg 1)))))
44
45 (defadvice navi2ch-search-article-regexp
46   (before navi2ch-migemo-search-article-regexp activate)
47   "\e$B8!:w%Q%?!<%s$K\e(Bmigemo\e$B$rE,MQ$9$k!#\e(B"
48   (if navi2ch-migemo-enable
49       (ad-set-arg 1 (migemo-get-pattern (ad-get-arg 1)))))
50
51 (defun navi2ch-migemo-toggle-enable ()
52   (setq navi2ch-migemo-enable (not navi2ch-migemo-enable)))
53
54 ;;; navi2ch-migemo.el ends here