3 # Installation Script Copyright (C) 1992 Bob Kerns <rwk@crl.dec.com>
7 Installation script for edict.el, an gnu emacs interface to EDICTJ
8 Public Domain japanese/english dictionary.
10 Contents Copyright (c) 1991, 1992 by Per Hammarlund <perham@nada.kth.se>
11 and Copyright (c) 1992 Bob Kerns <rwk@crl.dec.com>
13 edict.el written by Per Hammarlund <perham@nada.kth.se>
14 Morphology and private dictionary handling/editing by Bob Kerns <rwk@crl.dec.com>
15 International installation script by Bob Kerns <rwk@crl.dec.com>
16 Helpful remarks from Ken-Ichi Handa <handa@etl.go.jp>.
17 The EDICTJ PD dictionary is maintained by Jim Breen <jwb@monu6.cc.monash.edu.au>
18 Your credits here if you contribute!
20 This program is free software; you can redistribute it and/or modify
21 it under the terms of the GNU General Public License as published by
22 the Free Software Foundation; either version 1, or (at your option)
25 This program is distributed in the hope that it will be useful,
26 but WITHOUT ANY WARRANTY; without even the implied warranty of
27 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 GNU General Public License for more details.
30 You should have received a copy of the GNU General Public License
31 along with this program; if not, write to the Free Software
32 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
40 PATH=$EPATH:/bin:/usr/bin:$PATH
46 # Script for installing the edict nemacs library.
48 if [ -d $EPATH ] || [ -f $EPATH ]; then
52 trap "rm -rf $EPATH" 0
55 if [ -f $EPATH/failure ]; then
59 cat <<'ENDMSG' >$EPATH/msg
63 if [ ! X = 'EN' ]; then
64 if egrep "^$X[ ]?$1[ ]?" $EPATH/text >/dev/null; then
71 egrep "^$X[ ]?$1[ ]?" $EPATH/text >/dev/null ||
73 echo "Could not find $X message $1"
77 # Do this to get variable substitution in messages.
78 # Some /bin/sh's aren't 8-bit clean, and all of them will screw up
79 # due to the the '$' chars in the JIS KI/KO sequences.
80 # So we have to do things the hard way. Instead of allowing arbitrary
81 # variable substitutions, we substitute for a fixed set of vars.
82 # If you add a variable to this list, be sure it's exported!
86 s!@EMACSDIR!$EMACSDIR!;
90 s!@INSTDIR!$INSTDIR!" $EPATH/text |
91 sed -n -e "s/^$X[ ][ ]*$1[ ][ ]*//p"
95 cat <<'ENDLOG' >$EPATH/log
98 # Log the user's responses & the program's actions & discoveries.
100 msg $1 >>/tmp/edict.log.$LN
102 # For the sake of bug reports, log it in english as well.
107 msg $1 >>/tmp/edict.log.$LN
114 cat <<'ENDLOGAPPEND' >$EPATH/logappend
117 # Append a file to the log file(s)
119 cat $1 >>/tmp/edict.log.EN
123 *) cat $1 >>/tmp/edict.log.$LN
128 chmod a+x $EPATH/logappend
130 cat <<'ENDCOPY' >$EPATH/copy
133 # Copy a file, logging and echoing that fact.
139 mv $2 $2.orig >>$EPATH/mv.out 2>&1 ||
145 echo "mv $2 $2.orig" >>$EPATH/copy.out
146 cat $EPATH/mv.out >>$EPATH/copy.out
151 cp -p $1 $2 >>$EPATH/cp.out 2>&1 ||
156 echo "cp -p $1 $2" >>$EPATH/copy.out
157 cat $EPATH/cp.out >>$EPATH/copy.out
160 touch $EPATH/chmod.out
162 chmod 0644 $2 >>$EPATH/chmod.out 2>&1 ||
167 echo "chmod 0644 $2" >>$EPATH/copy.out
168 cat $EPATH/chmod.out >>$EPATH/copy.out
171 logappend $EPATH/copy.out
174 chmod a+x $EPATH/copy
176 # Build our database of textual messages
177 # First item is the two-character language code.
178 # Second item is the message name. A multiline message is
179 # formed by having multiple lines with that name.
180 # The remainder of the line is the text which should be printed.
181 cat <<'END' >$EPATH/text
182 # It is OK to have comments in here.
183 # If a translation for a message does not exist, the english version will be used.
184 EN LANGUAGE Using english messages.
185 JA LANGUAGE ÆüËܸì¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£
186 SW LANGUAGE Anv{nder svenska meddelanden.
187 EN DISTDIR What directory has the edict files? [@PWD]
188 JA DISTDIR edict¤Î¥Õ¥¡¥¤¥ë¤ÎÅÐÏ¿Êí¤Ï¤É¤³¤Ç¤¹¤«¡© [@PWD]
189 SW DISTDIR Var finns edictprogrammets filer? [@PWD]
190 EN XDISTDIR The edict files are in @DISTDIR
191 JA XDISTDIR edict ¤Î¥Õ¥¡¥¤¥ë¤ÎÅÐÏ¿Êí¤Ï @DISTDIR ¤Ë¤¢¤ê¤Þ¤¹¡£
192 SW XDISTDIR Edictprogrammets filer finns i @DISTDIR.
193 EN EDICTJDIR What directory has the edictj dictionary? [@DISTDIR]
194 JA EDICTJDIR edictj ¤È¤¤¤¦ÅŻҼŵ¤Ï¤É¤³¤Ç¤¹¤«¡© [@DISTDIR]
195 SW EDICTJDIR Var finns lexikonet EDICTJ? [@DISTDIR]
196 EN XEDICTJDIR The edictj dictionary is in @DISTDIR.
197 JA XEDICTJDIR edictj¤Ï@DISTDIR¤Ë¤¢¤ê¤Þ¤¹¡£
198 SW XEDICTJDIR Lexikonet EDICTJ finns i @DISTDIR.
199 EN INSTDIR Normally, this software should be placed in the directory
200 EN INSTDIR which holds your site's emacs libraries. However, you do
201 EN INSTDIR not have write access to that directory, so you will need to
202 EN INSTDIR place them somewhere else.
204 EN INSTDIR In what directory should I put the edict files? [leave in @DISTDIR]
205 JA INSTDIR Æüº¢¡¢¤³¤Î¥½¥Õ¥È¥¦¥§¥¢¤Ï¥µ¥¤¥È¤Înemacs¤Î¥é¥¤¥Ö¥é¥ê¤ÎÅÐÏ¿Êí¤Ë
206 JA INSTDIR ³ÊǼ¤¹¤ë¤â¤Î¤Ç¤¹¡£¤Ç¤â¡¢¤¢¤Ê¤¿¤Ï¤½¤ÎÅÐÏ¿Êí¤ò½ñ¤±¤Þ¤»¤ó¡£¤³¤ì¤«¤é¡¢
207 JA INSTDIR ¥½¥Õ¥È¥¦¥§¥¢¤Ï;½ê¤Ë³ÊǼ¤·¤Þ¤·¤ç¤¦¡£
209 JA INSTDIR edict ¤Ï¡¢¤É¤ÎÅÐÏ¿Êí¤Ë³ÊǼ¤·¤Æ¤ª¤¤Þ¤·¤ç¤¦¤«¡© [@DISTDIR]
210 SW INSTDIR Egentligen skall edictprogrammets filer placeras i katalogen
211 SW INSTDIR som har emacs |vriga filer; emacs "bibliotek". Men iom att
212 SW INSTDIR du inte har skrivr{ttigheter d{r, s} m}ste du l{gga dem
213 SW INSTDIR n}gon annanstans.
215 SW INSTDIR I vilken katalog ska jag placera edictprogrammets filer? [@DISTDIR]
216 EN XINSTDIR The installation will be in @INSTDIR
217 JA XINSTDIR ¥½¥Õ¥È¥¦¥§¥¢¤Ï@INSTDIR¤Ë³ÊǼ¤·¤Þ¤¦¤¹¡£
218 SW XINSTDIR Edictprogrammet kommer att installeras i @INSTDIR.
219 EN BYTECOMP Emacs byte-compiling @DISTDIR/edict.el and
220 EN BYTECOMP @DISTDIR/edict-test.el.
221 SW BYTECOMP Emacs byte-compiling @DISTDIR/edict.el och
222 SW BYTECOMP @DISTDIR/edict-test.el. (Detta ger dig
223 SW BYTECOMP en "snabbare", kompilerad, version av programmen.)
224 JA BYTECOMP emacs ¤Ç @DISTDIR/edict.el ¤È
225 JA BYTECOMP @DISTDIR/edict-test.el ¤ò byte-compile ¤·¤Æ¤¤¤Þ¤¹¡£
226 EN DEFAULTS In the following questions, if a default value may appear between
227 EN DEFAULTS square brackets. [] If you type Return, I will use that value.
228 SW DEFAULTS I de f|ljande fr}gorna s} kan det finnas ett standardsvar, givet mellan
229 SW DEFAULTS hakparenteser ([]), om du bara trycker RETURN kommer detta standardsvar att
230 SW DEFAULTS anv{ndas.
231 EN DOTEMACSQ Should I add the default key bindings and setup to your .emacs file?
232 EN DOTEMACSQ You may type SHOW to see what will be inserted.
233 EN DOTEMACSQ Please type yes, no, or show.
234 SW DOTEMACSQ Ska jag l{gga till n|dv{ndig initieringskod till din .emacs-fil?
235 SW DOTEMACSQ Om du skriver VISA visar jag vad som kommer att l{ggas till.
236 SW DOTEMACSQ Svara JA, NEJ, eller VISA.
237 EN DOTEMACSADD @HOME/.emacs updated.
238 SW DOTEMACSADD @HOME/.emacs uppdaterad.
239 EN YESORNO Please answer yes, no, or show.
240 JA YESORNO ¡Ö¤Ï¤¤¡×¤«¡Ö¤¤¤¤¤¨¡×¤«¡Ö¼¨¤·¤Æ¡×¤«¤ÈÅú¤¨¤Æ²¼¤µ¤¤¡£¥í¥Þ»ú¤Ê¤É¤¤¤¤¤Ç¤¹¡£
241 JA YESORNO ±Ñ¸ì¤â¤¤¤¤¤Ç¤¹¡£
242 SW YESORNO Svara JA, NEJ eller VISA.
244 JA YESNOCONV sed 's/HAI/YES/; s/IIE/NO/; s/SHIME.*/SHOW/;\
245 JA YESNOCONV s/¤Ï¤¤/YES/; s/¤¤¤¤¤¨/NO/; s/¼¨.*/SHOW/; s/¤·¤á.*/SHOW/'
246 SW YESNOCONV sed 's/JA/YES/; s/NEJ/NO/; s/VISA/SHOW/'
247 EN LOGHEADER ----------------------------------------------------------------
248 EN LOGHEADER Installation at @DATE.
249 SW LOGHEADER ----------------------------------------------------------------
250 SW LOGHEADER Installering gjord @DATE.
251 EN LOGBEGIN2 A log file is being kept in english in /tmp/edict.log.EN
252 SW LOGBEGIN2 En logfil med engelsk inneh}ll kommer att skapas och underh}llas.
253 SW LOGBEGIN2 Filen heter /tmp/edict.log.EN.
254 EN LOGBEGIN A log file is being kept in /tmp/edict.log.@LN.
255 SW LOGBEGIN En logfil som visar vad jag g|r finns. Den heter /tmp/edict.log.@LN.
256 EN SUCCESS Installation successfully completed.
257 SW SUCCESS Installationen gick bra.
258 EN FAILURE Installation encountered errors.
259 SW FAILURE Installationen gick inte bra, n}got fel intr{ffade.
260 EN NOCPYEDIR The emacs libraries are already in the right locations.
261 SW NOCPYEDIR Emacsbiblioteken finns redan p} r{tt plats.
262 EN NOCPYEJDIR The edictj dictionary file is already in the right location.
263 SW NOCPYEJDIR Lexikonet EDICTJ finns redan p} r{tt st{lle.
264 EN EJUSEDEMO Using the demo version of the EDICTJ file.
265 EN EJUSEDEMO Please place the real one in @INSTDIR/edictj
266 JA EJUSEDEMO ¤¤¤Þ¡¢¥Ç¥âedict¤ò»È¤Ã¤Æ¤¤¤Þ¤¹. ¤¢¤ÎÂÅÅöedictj¤¬¥¤¥ó¥¹¥È¥ë²¼¤µ¤¤¡£
267 SW EJUSEDEMO Jag kommer att anv{nde en demoversion av lexikonet
268 SW EJUSEDEMO EDICTJ. Installera det riktiga lexikonet som
269 SW EJUSEDEMO @INSTDIR/edictj
270 EN .EMACSCOMNT ;;; This sets up the standard key bindings for edict commands to
271 EN .EMACSCOMNT ;;; autoload from @INSTDIR.
273 EN .EMACSCOMNT ;;; Place this in your $HOME/.emacs file.
274 EN .EMACSCOMNT ;;; Edit the global-set-key forms if you wish to change the key assignments.
275 EN .EMACSCOMNT ;;; The default key assignments are as follows (m- is the same as ESC-)
276 EN .EMACSCOMNT ;;; m-* edict-search-english Search for an english word.
277 EN .EMACSCOMNT ;;; m-& edict-search-kanji Search for a Japanese word.
278 EN .EMACSCOMNT ;;; m-+ edict-insert Insert the last match.
279 JA .EMACSCOMNT ;;; ¤³¤ì¤Ï¡¢edict ¤Îɸ½à¤Î¥¡¼¥Ð¥¤¥ó¥Ç¥£¥ó¥°¤ò¹þ¤ßΩ¤Æ¤Þ¤¹¡£
280 JA .EMACSCOMNT ;;; ¤½¤Îµ¡Ç½¤¬ @INSTDIR ¤«¤éautoload ¼«Æ°¥í¡¼¥É¤¹¤ë¤Î¤ò¹þ¤ßΩ¤Æ¤Þ¤¹¡£
282 JA .EMACSCOMNT ;;; ¤³¤Î¥³¡¼¥É¤Ï $HOME/.emacs ¤ËÃÖ¤¤¤Æ²¼¤µ¤¤¡£
283 JA .EMACSCOMNT ;;; ¥¡¼¥Ð¥¤¥ó¥Ç¥£¥ó¥°¤òÊѹ¹¤¹¤ë¤È¡¢global-set-key ¤Î·Á¤òÊÔ½¸¤·¤Æ²¼¤µ¤¤¡£
284 JA .EMACSCOMNT ;;; °Ê²¼¡¢¥Ç¥Õ¥¡¡¼¥ë¥È¥¡¼¥Ð¥¤¥ó¥Ç¥£¥ó¥°¤¬¤¢¤ê¤Þ¤¹¡£
285 JA .EMACSCOMNT ;;; (¡Öm-¡×¤È ¡ÖESC-¡×¤ÏƱ¤¸¤Ç¤¹¡£)
286 JA .EMACSCOMNT ;;; m-* edict-search-english ±Ñ¸ì¤Î¸ÀÍÕ¤òõ¤»
287 JA .EMACSCOMNT ;;; m-& edict-search-kanji ÆüËܸì¤Î¸ÀÍÕ¤òõ¤»
288 JA .EMACSCOMNT ;;; m-+ edict-insert °ìºò°ìÃפòÁÞÆþ¤·¤í
289 SW .EMACSCOMNT ;;; F|ljande kod ser till att edictprogrammet laddas automatiskt
290 SW .EMACSCOMNT ;;; fr}n @INSTDIR.
292 SW .EMACSCOMNT ;;; Skriv in detta i din $HOME/.emacs fil.
293 SW .EMACSCOMNT ;;; [ndra global-set-key anropen om du vill att kommandona
294 SW .EMACSCOMNT ;;; skall anropas fr}n andra tangenter.
295 SW .EMACSCOMNT ;;; Detta {r standardtangentmappningarna (m- {r samma som ESC-)
296 SW .EMACSCOMNT ;;; m-* edict-search-english S|k med ett engelskt ord.
297 SW .EMACSCOMNT ;;; m-& edict-search-kanji S|k med ett japanskt ord.
298 SW .EMACSCOMNT ;;; m-+ edict-insert Skriv in senaste hittade ord.
301 # deduce which tr we have: v6 or v7
302 case "`echo B | tr A-Z a-z `" in
304 B) trversion=v6 ;; # or System V
308 # Some systems use LANG, not LANGUAGE (i.e. ultrix)
314 LN=`echo $LN | sed -n -e 's/^\(..\).*/\1/p'`
315 LN=`echo $LN | case "$trversion" in
316 v6) tr [a-z] [A-Z] ;;
325 echo 'What language should I use?'
326 echo '(EN = English, JA = Japanese, SW = Swedish) [EN]'
331 LN=`echo $LN | case "$trversion" in
332 v6) tr [a-z] [A-Z] ;;
336 # Handle any common aliases for the language identifiers, such as the native terms
340 EN|ENGLISH|BRITISH|BRITAIN|ENGLAND|US|AMERICAN) LN='EN' ;;
341 JA|'ÆüËÜ'|'ÆüËܸì'|JAPANESE|NIHONGO|JP|NIHON|JAPAN) LN='JA' ;;
342 SW|SWEDISH|SWEDEN|SWE|SE|SVENSKA|SVERIGE) LN='SW' ;;
343 *) echo "I don't understand the language $LN."
370 [ $DISTDIR ] || DISTDIR=`pwd`
376 [ $EDICTJDIR ] || EDICTJDIR=$DISTDIR
380 echo "# Values extracted from nemacs." >$EPATH/emacs.vars
382 cat <<END >$EPATH/emacs.info
383 (setq epath (reverse load-path))
384 (setq edir (expand-file-name (car epath)))
385 (if (string-match "/$" edir)
386 (setq edir (substring edir 0 (- (length edir) 1))))
387 (princ (format "export EMACSDIR\nEMACSDIR=%s\n" edir))
388 (princ (format "export EMACSPATH\nEMACSPATH=%s" (car epath)))
389 (let ((path (cdr epath)))
391 (princ (format ":%s" (car path)))
392 (setq path (cdr path))))
396 nemacs -batch -load $EPATH/emacs.info >>$EPATH/emacs.vars
399 echo "# End of values extracted from nemacs." >>$EPATH/emacs.vars
401 logappend $EPATH/emacs.vars
403 # OK, let's see if we can install it into the normal location.
405 if [ -w $EMACSDIR ]; then
414 [ $INSTDIR ] || INSTDIR=$DISTDIR
420 # Byte compile the program.
424 cat <<END >$EPATH/emacs.comp
425 (load-library "bytecomp")
427 ;;; Fix emacs byte compiler bug...
428 ;;; This used to blow out if given anything with a non-symbol
429 ;;; in the CAR. Emacs 18.57 has a different form of the bug,
430 ;;; where &optional or &rest in the argument list of a lambda
431 ;;; combination silently mis-compiles. --RWK
432 (defun byte-compile-form (form)
433 (setq form (macroexpand form byte-compile-macro-environment))
434 (cond ((eq form 'nil)
435 (byte-compile-constant form))
437 (byte-compile-constant form))
439 (byte-compile-variable-ref 'byte-varref form))
441 (byte-compile-constant form))
442 ((symbolp (car form))
443 (let ((handler (get (car form) 'byte-compile)))
445 (funcall handler form)
446 (byte-compile-normal-call form))))
447 ((and (consp (car form))
448 (eq (car (car form)) 'lambda))
449 ;; It's a lambda combination. Turn it into a LET.
450 (let* ((lambda-expr (car form))
451 (arglist (nth 1 lambda-expr))
452 (body (nthcdr 2 lambda-expr))
454 (original-arglist arglist) ; For error reporting
455 (original-params params) ; For error reporting
456 (state nil) ;Last &-keyword seen.
457 (binding-list nil) ;LET's binding list.
459 ;; Parse the argument list, and build the binding list.
460 ;; Check for invalid arglist syntax as we go.
462 (setq arg (car arglist)
463 arglist (cdr arglist))
465 ((eq arg '&optional )
467 (error "Illegal argument list syntax: &optional after %s."
473 (eq state '&optional)))
474 (t (error "Illegal argument list syntax: &rest after %s."
476 (setq arg (car arglist)
477 arglist (cdr arglist))
479 (cons (list arg (list* 'list params))
483 (t (cond ((eq state '&rest)
484 (error "Extra junk after &rest parameter: %s."
485 (cons arg arglist))))
486 (unless (eq state '&optional)
488 (error "Insufficient arguments. Arglist=%s\nParameters=%s"
489 original-arglist original-params)))
491 (cons (list arg (car params))
493 params (cdr params)))))
495 (error "Too many arguments. Arglist=%s\nParameters=%s"
496 original-arglist original-params))
497 (setq binding-list (nreverse binding-list))
499 (list* 'let binding-list body))))
500 ;; Things like autoload, macro, mock-lisp.
501 ((consp (car form)) (byte-compile-normal-call form))
502 (t (error "Illegal form: %s" form)))
503 (setq byte-compile-maxdepth
504 (max byte-compile-maxdepth
505 (setq byte-compile-depth (1+ byte-compile-depth)))))
507 ;;; Now here's another compiler fix: Add eval-when !!
509 (defmacro eval-when (when &rest forms)
510 (and (or (member 'eval when)
511 (member ':execute when))
512 (mapcar (function eval) forms))
513 (and (or (member 'load when)
514 (member ':load-toplevel when))
515 (cons 'progn forms)))
517 (defun macro-function (name)
519 (let ((fun (symbol-function name)))
520 (and (not (atom fun))
521 (eq (car fun) 'macro)
524 (defun macroexpand-1 (form)
526 (if (listp (car form)) form
527 (let ((expander (macro-function (car form))))
528 (apply expander (cdr form))))))
530 (defun byte-compile-file-form (form)
531 (let ((expander nil))
532 (cond ((not (listp form))
534 ((memq (car form) '(defun defmacro))
535 (let* ((name (car (cdr form)))
536 (tem (assq name byte-compile-macro-environment)))
537 (if (eq (car form) 'defun)
539 (message "Compiling %s (%s)..." filename (nth 1 form))
540 (cond (tem (setcdr tem nil))
542 (eq (car-safe (symbol-function name)) 'macro))
543 ;; shadow existing macro definition
544 (setq byte-compile-macro-environment
545 (cons (cons name nil)
546 byte-compile-macro-environment))))
547 (prog1 (cons 'defun (byte-compile-lambda (cdr form)))
548 (if (not noninteractive)
549 (message "Compiling %s..." filename))))
552 (setcdr tem (cons 'lambda (cdr (cdr form))))
553 (setq byte-compile-macro-environment
554 (cons (cons name (cons 'lambda (cdr (cdr form))))
555 byte-compile-macro-environment)))
556 (cons 'defmacro (byte-compile-lambda (cdr form))))))
557 ((eq (car form) 'progn)
559 (mapcar (function byte-compile-file-form) (cdr form))))
560 ((listp (car form)) form)
561 ((setq expander (macro-function (car form)))
562 (byte-compile-file-form (macroexpand-1 form)))
563 ((setq expander (get (car form) 'byte-compile-top-level-handler))
564 (byte-compile-file-form (funcall expander form)))
565 ((eq (car form) 'require)
570 (put 'eval-when 'eval-when-top-level-handler 'byte-compile-top-level-handler)
571 (defun eval-when-top-level-handler (form)
572 (let ((when (nth 1 form))
573 (body (nthcdr 2 form)))
574 (princ (format "Eval-when %s...\n" when))
575 (and (or (member 'compile when)
576 (member ':compile-toplevel when))
577 (mapcar (function print) body)
578 (mapcar (function eval) body))
579 (and (or (member 'load when)
580 (member ':load-toplevel when))
581 (cons 'progn body))))
583 ;;; Now compile our two files.
584 (byte-compile-file "$DISTDIR/edict.el")
585 (byte-compile-file "$DISTDIR/edict-test.el")
588 nemacs -batch -load $EPATH/emacs.comp | tee $EPATH/emacs.comp.out
590 logappend $EPATH/emacs.comp
591 logappend $EPATH/emacs.comp.out
593 # Now copy, if they're not already there.
594 if [ $DISTDIR = $INSTDIR ]; then
598 copy $DISTDIR/edict.ChangeLog $INSTDIR/edict.ChangeLog
599 copy $DISTDIR/edict.el $INSTDIR/edict.el
600 copy $DISTDIR/edict.elc $INSTDIR/edict.elc
601 copy $DISTDIR/edict-test.el $INSTDIR/edict-test.el
602 copy $DISTDIR/edict-test.elc $INSTDIR/edict-test.elc
603 copy $DISTDIR/edict.texinfo $INSTDIR/edict.texinfo
606 if [ $EDICTJDIR = $INSTDIR ]; then
607 if [ -f $INSTDIR/edictj ]; then
613 copy $DISTDIR/edictj.demo $INSTDIR/edictj
616 if [ -r $EDICTJDIR/edictj ]; then
617 copy $EDICTJDIR/edictj $INSTDIR/edictj
618 elif [ -f $INSTDIR/edictj ]; then
621 copy $DISTDIR/edictj.demo $INSTDIR/edictj
625 if [ "$INSTDIR" = "$EMACSDIR" ]; then
628 LOADFILE=$INSTDIR/edict
631 # Build a file of suggested .emacs setup.
632 echo >$INSTDIR/edict.emacs
633 # Start it off with a language-specific explanatory comment.
634 msg .EMACSCOMNT >>$INSTDIR/edict.emacs
636 sed -e "s!@LOADFILE!$LOADFILE!; s!@INSTDIR!$INSTDIR!" <<'EMACSEND' >>$INSTDIR/edict.emacs
638 (cond ((fboundp 'convert-region-kanji-code)
639 (autoload 'edict-search-english "@LOADFILE"
640 "Search for a translation of an English word")
641 (global-set-key "\e*" 'edict-search-english)
643 (autoload 'edict-search-kanji "@LOADFILE"
644 "Search for a translation of a Kanji sequence")
645 (global-set-key "\e&" 'edict-search-kanji)
647 (autoload 'edict-add-english "@LOADFILE"
648 "Add a translation of an English word")
650 (autoload 'edict-add-kanji "@LOADFILE"
651 "Add a translation of a Kanji sequence")
653 (autoload 'edict-insert "@LOADFILE"
654 "Insert the last item looked up in edict.")
656 (global-set-key "\e+" 'edict-insert)
658 (autoload 'edict-insert-english "@LOADFILE"
659 "Insert the last item looked up in edict.")
660 (autoload 'edict-insert-ÆüËܸì "@LOADFILE"
661 "Insert the last item looked up in edict.")
663 (setq *edict-files* '("@INSTDIR/edictj"))))
667 # Extract the script for canonicalizing yes or no from whatever natural language.
668 msg YESNOCONV >$EPATH/yesnoconv
670 while [ "ALWAYS" ]; do
673 DOTEMACSQ=`echo $DOTEMACSQ | case "$trversion" in
674 v6) tr [a-z] [A-Z] ;;
678 DOTEMACSQ=`echo $DOTEMACSQ | (. $EPATH/yesnoconv)`
681 sed -e '/;;; Start of EDICT/,/;;; End of EDICT/ D' $HOME/.emacs >$EPATH/.emacs.out
682 echo ";;; Start of EDICT's automatically-added stuff." >>$EPATH/.emacs.out
683 cat $INSTDIR/edict.emacs >>$EPATH/.emacs.out
684 echo ";;; End of EDICT's automatically-added stuff." >>$EPATH/.emacs.out
685 [ -f $HOME/.emacs ] && mv $HOME/.emacs $HOME/.emacs.orig
686 mv $EPATH/.emacs.out $HOME/.emacs
695 echo more $INSTDIR/edict.emacs
696 more $INSTDIR/edict.emacs
703 if [ -f $EPATH/failure ]; then