yewton / dot-emacs

obsolete
https://github.com/yewton/.emacs.d
3 stars 0 forks source link

+STARTUP: showall

[[https://github.com/yewton/.emacs.d]] に移行しました。

以下は依存パッケージのビルドに必要です。

=gitsubmodule= で管理しているモノもあるので、 =--recursive= を使えるなら使いましょう。 使えない場合は =git submodule init= 、 =git submodule update= で。

+BEGIN_SRC sh

git clone --recursive https://github.com/yewton/dot-emacs.git ~/yewton.emacs.d

+END_SRC

** for Mac OS X brew でインストールしたものとします。 そうでない場合、主に =emacsclient= の場所が違ったりすると思うので、適宜読み替えてください。

シェルスクリプトと Automator を使います。

まず、 =/usr/local/bin/myemacs= として、以下の様なシェルスクリプトを置いてください:

+BEGIN_SRC shell-script

!/bin/sh

open -a /Applications/Emacs.app --args -q --debug-init -l ~/dot-emacs/init.el --chdir ~ "$@"

+END_SRC

次に、Automator でアプリケーションを新規作成し、 =シェルスクリプトを実行= を選択して、以下のように書いてください:

+BEGIN_SRC shell-script

/usr/local/bin/myemacs

+END_SRC

これを =/Applications= に保存して、Dock にでも入れておきましょう。 ここでは =MyEmacs.app= という名前で保存したとします。

各種アプリケーションから =MyEmacs.app= を利用できるように、 Automator でアプリケーションを新規作成し、 =シェルスクリプトを実行= を選択して、以下のように書いてください:

+BEGIN_SRC shell-script

/usr/local/bin/emacsclient -n "$1" --alternate-editor /usr/local/bin/myemacs "$1"

+END_SRC

例えば、[[https://addons.mozilla.org/ja/firefox/addon/its-all-text/][It's All Text!]] などにこのアプリケーションを指定すると、 すでに起動している Emacs の frame で、あるいは新しく Emacs を起動して編集することが出来ます。

また、以下の様なシェルスクリプトを作って =VISUAL= に指定しておけば、 ターミナルからの編集作業( =sudo -e= とか)にも利用することが出来ます。

+BEGIN_SRC shell-script

!/bin/sh

set -e

if [ "$#" -eq 0 ]; then

Emacs doesn't activate itself when there's no filename.

    /usr/local/bin/emacsclient -c -a /usr/local/bin/myemacs &
    sleep 0.1
    osascript -e "tell application \"Emacs\" to activate"
    wait

else /usr/local/bin/emacsclient -c -a /usr/local/bin/myemacs "$@" fi

+END_SRC

** for Windows ショートカットを使います。

=--debug-init -l ~/yewton.emacs.d/init.el= という起動オプションつきのショートカットを作成してください。

GNU Win 32 版の TexInfo に付属の =install-info= でないと、 =el-get= が動かないので注意しましょう([[https://github.com/dimitri/el-get#installation-dependencies][参考]])。

** for Linux 色々やりようはあると思いますが、一例としてショートカットを使うことにします。

=/usr/bin/emacs24 -q --debug-init -l ~/yewton.emacs.d/init.el= とかで動くと思います。