Skip to content

Instantly share code, notes, and snippets.

@derdesign
Created November 3, 2012 18:41

Revisions

  1. Ernesto Méndez revised this gist Nov 3, 2012. 1 changed file with 20 additions and 1 deletion.
    21 changes: 20 additions & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,31 @@
    #!/bin/bash

    # Get first argument

    if [ $1 ]
    then
    FILE=$1
    else
    FILE=$HOME
    fi

    # Get realpath

    FILE=`python -c "import os,sys; print os.path.realpath(sys.argv[1])" $FILE`

    nohup /Applications/Emacs.app/Contents/MacOS/Emacs --name `basename $FILE` $FILE >> /dev/null &
    # Get directory path.

    if [ -f $FILE ]
    then
    cd `dirname $FILE`
    else
    cd $FILE
    fi

    # Opens Emacs without a Dired window, useful with speedbar or sr-speedbar

    nohup /Applications/Emacs.app/Contents/MacOS/Emacs --name `basename $FILE` >> /dev/null &

    # Opens Emacs with a Dired window for the directory specified

    # nohup /Applications/Emacs.app/Contents/MacOS/Emacs --name `basename $FILE` $FILE >> /dev/null &
  2. Ernesto Méndez revised this gist Nov 3, 2012. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -7,4 +7,6 @@ else
    FILE=$HOME
    fi

    FILE=`python -c "import os,sys; print os.path.realpath(sys.argv[1])" $FILE`

    nohup /Applications/Emacs.app/Contents/MacOS/Emacs --name `basename $FILE` $FILE >> /dev/null &
  3. Ernesto Méndez revised this gist Nov 3, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -7,4 +7,4 @@ else
    FILE=$HOME
    fi

    nohup /Applications/Emacs.app/Contents/MacOS/Emacs --name `basename $FILE` $FILE >> /dev/null &2>1
    nohup /Applications/Emacs.app/Contents/MacOS/Emacs --name `basename $FILE` $FILE >> /dev/null &
  4. Ernesto Méndez revised this gist Nov 3, 2012. 1 changed file with 0 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,10 @@
    #!/bin/bash

    # Emacs IDE Launcher
    # ==================

    # Either open $HOME or File
    if [ $1 ]
    then
    FILE=$1
    else
    FILE=$HOME
    fi

    # Launch Emacs in the background
    nohup /Applications/Emacs.app/Contents/MacOS/Emacs --name `basename $FILE` $FILE >> /dev/null &2>1
  5. Ernesto Méndez created this gist Nov 3, 2012.
    15 changes: 15 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/bin/bash

    # Emacs IDE Launcher
    # ==================

    # Either open $HOME or File
    if [ $1 ]
    then
    FILE=$1
    else
    FILE=$HOME
    fi

    # Launch Emacs in the background
    nohup /Applications/Emacs.app/Contents/MacOS/Emacs --name `basename $FILE` $FILE >> /dev/null &2>1