Browse Source

updated wnn7egg

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@5586 ec354946-7b23-47d6-9f5a-488ba84defc7
munepi 12 years ago
parent
commit
7f79e4cef9

+ 70 - 0
w/wnn7egg/vine-default-wnn7egg.el

@@ -0,0 +1,70 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  -*- coding: utf-8-unix -*-
+;;  FSF Emacs 23 用 Vine Linux wnn7egg 設定
+;;    Munehiro Yamamoto <munepi@cg8.so-net.ne.jp>
+;;	$Id: vine-default-wnn7egg.el,v 1.1 2009/04/22 16:02:01 munepi Exp $	
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Wnn7Egg (Wnn7 フロントエンド) の設定
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(if (or (equal emacs-ime "wnn7egg")
+	(equal emacs-ime "wnn7")
+        (equal emacs-ime "Wnn7"))
+    (progn
+      ;; (setq load-path (append '("/usr/share/wnn7/elisp/emacs20") load-path))
+      (global-set-key "\C-\\" 'toggle-input-method)
+      ;; Shift-Space または 半角/全角 でも起動
+      (global-set-key [?\S-\ ] 'toggle-input-method)
+      (global-set-key [zenkaku-hankaku] 'toggle-input-method)
+      ;; canna like toggle keybind
+      ;;(global-set-key "\C-o" 'toggle-input-method)
+      (load "wnn7egg-leim")
+      (set-input-method "japanese-egg-wnn7")
+      (set-language-info "Japanese" 'input-method "japanese-egg-wnn7")
+
+      ;; "nn" で「ん」を入力
+      (setq enable-double-n-syntax t)
+      ;; 候補選択モード
+      ;(egg-use-input-predict)
+      (setq egg-predict-realtime nil)
+      ;; インライン候補選択モード
+      (setq egg-predict-mode "inline")
+      ;; ウインドウ候補選択モード
+      (setq egg-predict-mode "window")
+
+      ;; ;; 候補リスト表示
+      ;; (define-key wnn7-henkan-mode-map " " 'wnn7-henkan-select-kouho-dai)
+
+      ;; ;; 1234567890%#%"'/\| を「半角」で入力
+      ;; (let ((its:*defrule-verbose* nil))
+      ;;   (its-define-mode "roma-kana")
+      ;;   (dolist (symbol '("1" "2" "3" "4" "5" 
+      ;;                     "6" "7" "8" "9" "0"
+      ;;                     "#" "%" "\"" "'" "/" "\\" "|"))
+      ;;           (its-defrule symbol symbol)))
+
+      ;; ;; 「、」を使う時は、次行を「;」でコメントする
+      ;; (its-defrule "," "," nil nil "roma-kana")
+      ;; ;; 「。」を使う時は、次行を「;」でコメントする
+      ;; (its-defrule "." "." nil nil "roma-kana")
+      ;; ;; 「/」を使うときは、次行を「;」でコメントする
+      ;; (its-defrule "/" "・" nil nil "roma-kana")
+
+      ;; ;; デフォルトの句読点「、。」を「,.」に変更する
+      ;; (setq use-touten-for-comma nil)
+      ;; (setq use-kuten-for-period nil)
+
+      ;; 部首・画数変換を可能にする wnn7egg には busyu.el はない
+      (load "busyu")
+    )
+)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(provide 'vine-default-wnn7egg)
+
+;; Local Variables:
+;; mode: emacs-lisp
+;; End:

+ 17 - 0
w/wnn7egg/wnn7egg-init.el

@@ -0,0 +1,17 @@
+;;
+;; wnn7egg-init.el
+;;
+;; 	for Vine Linux with emacsen-common
+;; 	Munehiro Yamamoto <munepi@vinelinux.org>
+
+(defcustom vine-default-wnn7egg t
+  "A boolean for vine-default-wnn7egg"
+  :type 'boolean)
+
+(add-hook 'vine-default-setup-hook
+	  (lambda()
+	    (when vine-default-wnn7egg
+	      (message "Loading vine-default-wnn7egg ...")
+	      (require 'vine-default-wnn7egg))))
+
+;;; end of file

+ 77 - 0
w/wnn7egg/wnn7egg-install.sh

@@ -0,0 +1,77 @@
+#!/bin/sh -e
+#  /usr/lib/emacsen-common/packages/install/wnn7egg
+# [ This particular script hasn't been tested, so be careful. ]
+### based on Debian wnn7egg_1.02-7.diff.gz
+
+set -e
+
+FLAVOR=$1
+PACKAGE="wnn7egg"
+
+if [ "X${FLAVOR}" = "X" ]; then
+    echo Need argument to determin FLAVOR of emacs;
+    exit 1
+fi
+
+if [ "X${PACKAGE}" = "X" ]; then
+    echo Internal error: need package name;
+    exit 1;
+fi
+
+ELDIR=/usr/share/emacs/site-lisp/${PACKAGE}
+ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
+
+STARTDIR=/etc/${FLAVOR}/site-start.d
+STARTFILE="${PACKAGE}-init.el";
+
+SITELISP=/usr/share/${FLAVOR}/site-lisp
+
+EL_ONLY="eggrc-wnn7 eggrc-wnn7_for-wnn8 wnn7egg-edep.el its-v309 vine-default-wnn7egg.el"
+FILES="wnn7egg-cnv.el wnn7egg-leim.el wnn7egg-jsymbol.el wnn7egg-lib.el wnn7egg.el wnn7egg-com.el wnn7egg-rpc.el busyu.el"
+FLAGS="--no-site-file -q -batch -l path.el -l ./wnn7egg-lib.el -f batch-byte-compile"
+
+
+case "${FLAVOR}" in
+
+    *)
+
+	echo -n "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..."
+
+	rm -rf ${ELCDIR}
+	install -m 755 -d ${ELCDIR}
+
+	# Byte compile
+	(
+	    cd ${ELDIR}
+	    cp -r ${FILES} ${EL_ONLY} ${ELCDIR}
+	    cd ${ELCDIR}
+
+	    # Setup for Wnn8
+	    if [ -f /usr/lib/wnn8/ja_JP/wnnenvrc ] \
+		&& [ -x /usr/sbin/jserver ]; then
+		cp -f eggrc-wnn7_for-wnn8 eggrc-wnn7
+		echo "Note: already setup for Wnn8" \
+		    > eggrc-wnn7_for-wnn8
+	    fi
+	    
+	    echo '(setq load-path (cons "." load-path) byte-compile-warnings nil)'> path.el
+
+	    ${FLAVOR} ${FLAGS} ${FILES} > CompilationLog 2>&1
+	    rm -f ${FILES} path.el
+	)
+
+	gzip -9 ${ELCDIR}/CompilationLog
+
+	if [ ! -d ${STARTDIR} ]; then
+	    install -m 755 -d ${STARTDIR}
+	fi
+
+	ln -sf ${ELDIR}/${STARTFILE} ${STARTDIR}/50${STARTFILE};
+
+	echo " done."
+
+	;;
+
+esac
+
+exit 0;

+ 40 - 0
w/wnn7egg/wnn7egg-remove.sh

@@ -0,0 +1,40 @@
+#!/bin/sh
+# /usr/lib/emacsen-common/packages/remove/wnn7egg
+# [ This particular script hasn't been tested either, so be careful. ]
+### based on Debian wnn7egg_1.02-7.diff.gz
+
+set -e
+
+FLAVOR=$1
+PACKAGE="wnn7egg"
+
+if [ "X${FLAVOR}" = "X" ]; then
+    echo Need argument to determin FLAVOR of emacs;
+    exit 1
+fi
+
+if [ "X${PACKAGE}" = "X" ]; then
+    echo Internal error: need package name;
+    exit 1;
+fi
+
+ELDIR=/usr/share/emacs/site-lisp/${PACKAGE}
+ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
+STARTDIR=/etc/${FLAVOR}/site-start.d
+STARTFILE="${PACKAGE}-init.el";
+
+SITELISP=/usr/share/${FLAVOR}/site-lisp
+
+case "${FLAVOR}" in
+
+    *)
+
+	echo -n "remove/${PACKAGE}: Handling removal of emacsen flavor ${FLAVOR} ..."
+	rm -rf ${ELCDIR}
+	rm -f ${STARTDIR}/50${STARTFILE}*;
+	echo " done."
+
+	;;
+esac
+
+exit 0;

+ 8 - 5
w/wnn7egg/wnn7egg-vl.spec

@@ -5,7 +5,7 @@
 
 Name:          wnn7egg
 Version:       1.02
-Release:       7%{?_dist_release}
+Release:       8%{?_dist_release}
 License:       GPL
 Source0:       http://www.omronsoft.co.jp/SP/unix/wnn7s/support/modules/wnn7-elisp-el-%{version}-1.tgz
 Source1:       %{name}-install.sh
@@ -100,8 +100,8 @@ popd
 [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
 
 mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/emacs/site-lisp/%{name}
-mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/emacsen-common/packages/install
-mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/emacsen-common/packages/remove
+mkdir -p ${RPM_BUILD_ROOT}%{emacsen_pkgdir}/install
+mkdir -p ${RPM_BUILD_ROOT}%{emacsen_pkgdir}/remove
 mkdir -p ${RPM_BUILD_ROOT}%{_infodir}
 
 
@@ -157,11 +157,14 @@ fi
 %files
 %defattr(-,root,root)
 %{_datadir}/emacs/site-lisp/%{name}/
-%{_libdir}/emacsen-common/packages/install/%{name}
-%{_libdir}/emacsen-common/packages/remove/%{name}
+%{emacsen_pkgdir}/install/%{name}
+%{emacsen_pkgdir}/remove/%{name}
 
 
 %changelog
+* Sun Feb  5 2012 Munehiro Yamamoto <munepi@vinelinux.org> 1.02-8
+- use %%emacsen_pkgdir macro
+
 * Wed May 06 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.02-7
 - updated wnn7egg-install.sh
   - *-init.el: changed from hard copy to symbolic link