aboutsummaryrefslogtreecommitdiff
path: root/japanese/diclookup-emacs20/files/setup-diclookup.sh
diff options
context:
space:
mode:
authorSatoshi Asami <asami@FreeBSD.org>1998-08-03 00:15:02 +0000
committerSatoshi Asami <asami@FreeBSD.org>1998-08-03 00:15:02 +0000
commitf53a04c335f471c16a0336d6c38d313c5fbf7f6e (patch)
tree0bcb549d871162a7bb53fcc7436910f7cac6cdb1 /japanese/diclookup-emacs20/files/setup-diclookup.sh
parentbe10e3a77d734bdb347e80f7cb83c8c05e94014d (diff)
downloadports-f53a04c335f471c16a0336d6c38d313c5fbf7f6e.tar.gz
ports-f53a04c335f471c16a0336d6c38d313c5fbf7f6e.zip
Notes
Diffstat (limited to 'japanese/diclookup-emacs20/files/setup-diclookup.sh')
-rw-r--r--japanese/diclookup-emacs20/files/setup-diclookup.sh61
1 files changed, 61 insertions, 0 deletions
diff --git a/japanese/diclookup-emacs20/files/setup-diclookup.sh b/japanese/diclookup-emacs20/files/setup-diclookup.sh
new file mode 100644
index 000000000000..e0d033b901d6
--- /dev/null
+++ b/japanese/diclookup-emacs20/files/setup-diclookup.sh
@@ -0,0 +1,61 @@
+#!/bin/sh
+/usr/bin/dialog --title "ja-diclookup setup" --clear \
+ --yesno "\n\
+You have to install appropreate startup code for diclookup-mule. \n\
+This setup script automatically it to: \n\
+PREFIX_DIR/lib/mule/site-lisp/site-start.el. \n\n\
+Are you sure?" -1 -1
+RETVAL=$?
+# RETVAL=0 for yes, 1 for no, 255 for ESC.
+
+if [ "X${RETVAL}" = "X0" ] ; then # answer is `Yes'. hack diclookup-mule.
+
+# Hack PREFIX_DIR/lib/mule/site-lisp/site-start.el
+rm -f /tmp/hack-site-start.el
+echo "(defun hack-site-start ()" >> /tmp/hack-site-start.el
+echo " (interactive)" >> /tmp/hack-site-start.el
+echo " (message \"Updating site-start.el. \")" >> /tmp/hack-site-start.el
+echo " (let* ((args command-line-args-left)" >> /tmp/hack-site-start.el
+echo " (fname (expand-file-name (nth 0 args)))" >> /tmp/hack-site-start.el
+echo " (dir (nth 1 args)))" >> /tmp/hack-site-start.el
+echo " (setq command-line-args-left (cdr (cdr command-line-args-left)))" >> /tmp/hack-site-start.el
+echo " (set-buffer (get-buffer-create \" *x*\"))" >> /tmp/hack-site-start.el
+echo " (erase-buffer)" >> /tmp/hack-site-start.el
+echo " (if (file-exists-p fname)" >> /tmp/hack-site-start.el
+echo " (insert-file-contents fname))" >> /tmp/hack-site-start.el
+echo " (goto-char (point-min))" >> /tmp/hack-site-start.el
+echo " (if (search-forward \";;; diclookup-mule: Online dictionary\" nil t)" >> /tmp/hack-site-start.el
+echo " (message \"No changes made.\")" >> /tmp/hack-site-start.el
+echo " (goto-char (point-max))" >> /tmp/hack-site-start.el
+echo " (insert \"\n;;; diclookup-mule: Online dictionary\n\")" >> /tmp/hack-site-start.el
+echo " (insert \"(autoload 'online-dictionary \\\"diclookup-mule\\\" \")" >> /tmp/hack-site-start.el
+echo " (insert \"\\\"Online dictionary.\\\" t nil)\n\")" >> /tmp/hack-site-start.el
+echo " (insert \"(autoload 'od:lookup-pattern-edit \\\"diclookup-mule\\\" \")" >> /tmp/hack-site-start.el
+echo " (insert \"\\\"Look up a word.\\\" t nil)\n\")" >> /tmp/hack-site-start.el
+echo " (insert \"(setq od-chujiten-flag t) ; diclookup-mule\n\")" >> /tmp/hack-site-start.el
+echo " (insert \"(setq od-dictfile-list '(\\\"od-chujiten\\\" \\\"od-kojien\\\" \\\"od-readers\\\" \\\"od-crown\\\")) \")" >> /tmp/hack-site-start.el
+echo " (insert \"; diclookup-mule\n\")" >> /tmp/hack-site-start.el
+echo " (insert \"(setq dserver-server-list '(\\\"localhost\\\")) ; diclookup-mule\n\")" >> /tmp/hack-site-start.el
+echo " (insert \"(setq od-frame-geometry \\\"+0-0\\\" od-hide-frame \")" >> /tmp/hack-site-start.el
+echo " (insert \"'make-invisible) ; diclookup-mule\n\")" >> /tmp/hack-site-start.el
+echo " (insert \"(add-hook 'od-really-quit-hook 'od-delete-frame) \")" >> /tmp/hack-site-start.el
+echo " (insert \"; diclookup-mule\n\")" >> /tmp/hack-site-start.el
+echo " (insert \"(define-key-after menu-bar-file-menu [dictionary] \")" >> /tmp/hack-site-start.el
+echo " (insert \"; diclookup-mule\n\")" >> /tmp/hack-site-start.el
+echo " (insert \" '(\\\"Online Dictionary\\\" . online-dictionary) 'calendar) \")" >> /tmp/hack-site-start.el
+echo " (insert \"; diclookup-mule\n\")" >> /tmp/hack-site-start.el
+echo " (write-file fname))))" >> /tmp/hack-site-start.el
+
+mule -batch -q -l /tmp/hack-site-start.el -f hack-site-start \
+ PREFIX_DIR/lib/mule/site-lisp/site-start.el ;
+rm -f /tmp/hack-site-start.el
+
+/usr/bin/dialog --title "ja-diclookup setup" --clear \
+ --msgbox "\n\
+original file is saved in PREFIX_DIR/lib/mule/site-lisp/site-start.el.bak" -1 -1
+
+else
+/usr/bin/dialog --title "ja-diclookup setup" --clear \
+ --msgbox "\n\
+For setup, documents under PREFIX_DIR/lib/dserver will be helpful." -1 -1
+fi