[BACK]Return to use-asir-mode.sh CVS log [TXT][DIR] Up to [local] / OpenXM / src / asir-mode

Annotation of OpenXM/src/asir-mode/use-asir-mode.sh, Revision 1.4

1.1       takayama    1: #!/bin/sh
1.4     ! takayama    2: # $OpenXM: OpenXM/src/asir-mode/use-asir-mode.sh,v 1.3 2019/06/12 06:14:20 takayama Exp $
1.1       takayama    3:
                      4: _ok_local() {
                      5:        echo "------------------------------------------------------------------"
                      6:        echo "This script install $OpenXM_HOME/share/emacs/asir-mode.el"
                      7:     echo "to your .emacs.d and modify your .emacs.d/init.el to enable asir-mode.el"
                      8:        echo -n "y: go ahead, n: stop  : "
                      9:     read ans
                     10:        if [ $ans = "y" ]; then
                     11:                return
                     12:        fi
                     13:        if [ $ans = "n" ]; then
                     14:                echo "Aborting use-asir-mode.sh" ; \
                     15:                exit
                     16:     fi
                     17: }
                     18:
                     19: _install_local() {
                     20:        mkdir -p $HOME/.emacs.d/OpenXM
1.4     ! takayama   21:        sed -e 's/(insert "asir")/(insert "openxm asir")/g' $OpenXM_HOME/share/emacs/asir-mode.el >$HOME/.emacs.d/OpenXM/asir-mode.el
1.1       takayama   22:        cat $OpenXM_HOME/share/emacs/use-asir-mode-local.txt >>$HOME/.emacs.d/init.el
                     23: }
                     24:
1.3       takayama   25: _check() {
                     26:     if [ -f $HOME/.emacs ]; then
                     27:        grep 'emacs\.d/init\.el' $HOME/.emacs ;
                     28:        if [ $? -eq 0 ]; then
                     29:            echo "OK ...";
                     30:        else
                     31:            echo "Warning! init.el is not loaded from .emacs. Check if you load init.el";
                     32:            echo "  Example:  Add the following line ";
                     33:            echo "       (load \"~/.emacs.d/init.el\") ";
                     34:            echo "  to $HOME/.emacs";
                     35:         fi
                     36:     fi
                     37: }
                     38:
1.1       takayama   39: _install() {
                     40:        cat $OpenXM_HOME/share/emacs/use-asir-mode-local.txt >>$HOME/.emacs.d/init.el
                     41: }
1.3       takayama   42: _check ;
1.1       takayama   43: if [ $# = 0 ]; then
                     44:        echo "Usage: use-asir-mode.sh --local" ; \
1.2       takayama   45:        echo "       use-asir-mode.sh --local-yes" ; \
1.1       takayama   46:        echo "       --use-site-lisp has not been implemented." ; \
                     47: fi
                     48:
                     49: if [ $# = 1 ]; then
                     50: if [ $1 = "--local" ]; then
                     51:  _ok_local ; \
                     52:  _install_local ; \
                     53: fi
1.2       takayama   54: if [ $1 = "--local-yes" ]; then
                     55:  _install_local ; \
                     56: fi
1.1       takayama   57: fi
                     58:
                     59:
                     60:
                     61:
                     62:
                     63:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>