Skip to content

Commit

Permalink
First Attempt to run EmacsPortable under Linux. Compiled under
Browse files Browse the repository at this point in the history
precise puppy.  (Issue #9)
  • Loading branch information
mattfidler committed Nov 6, 2012
1 parent d8fb7ab commit b5d72fa
Show file tree
Hide file tree
Showing 10 changed files with 215 additions and 58 deletions.
Binary file added .DirIcon
Binary file not shown.
50 changes: 0 additions & 50 deletions App/eps/get-git.sh

This file was deleted.

156 changes: 156 additions & 0 deletions App/linux/EmacsPortable
@@ -0,0 +1,156 @@
#!/bin/bash --login

EMACSDIR=`dirname $0`
if [ $EMACSDIR = "." ]; then
EMACSDIR=`pwd`
fi
EPUSB=`echo $EMACSDIR | sed 's/\(\/mnt\/[^\/]*\/\).*/\1/'`
EPOTHER=`echo $EMACSDIR | sed 's/\/App.*/\/Other\//'`
DICPATH=`echo $EMACSDIR | sed 's/\/App.*/\/App\/hunspell\/epdic/'`
DATPATH=`echo $EMACSDIR | sed 's/\/App.*/\/Data/'`
EXEDIR=`echo $EMACSDIR | sed 's/\/App.*/\//'`
OHOME=$HOME
TEMP=/tmp/

##Get what version of Emacs is specified.
EMACSAPP=`echo $EMACSDIR | sed 's/\/App.*/\/App/'`
EMACSDAT=`echo $EMACSDIR | sed 's/\/App.*/\/Data/'`

cp $EMACSDAT/ini/EmacsPortableApp.ini /tmp/epi.ini

EPINI=/tmp/epi.ini
EMACSVER=`cat $EPINI | grep "[Ll]inux[vV]ersion *= *" | tr -d '\15' | cut -f 2 -d "="`
GEOMETRY=`cat $EPINI | grep "[Gg]eometry *= *" | tr -d '\15' | cut -f 2 -d "="`
FOREGROUND=`cat $EPINI | grep "[Ff]oreground *= *" | tr -d '\15' | cut -f 2 -d "="`
BACKGROUND=`cat $EPINI | grep "[Bb]ackground *= *" | tr -d '\15' | cut -f 2 -d "="`

MAXIMIZED=`cat $EPINI | grep "[Mm]ax *= *" | tr -d '\15' | cut -f 2 -d "="`

FULLWIDTH=`cat $EPINI | grep "[Ff]ull[Ww]idth *= *" | tr -d '\15' | cut -f 2 -d "="`

FULLHEIGHT=`cat $EPINI | grep "[Ff]ull[Hh]eight *= *" | tr -d '\15' | cut -f 2 -d "="`
EPSTART=`cat $EPINI | grep "[Ss]tartup *= *" | tr -d \15 | cut -f 2 -d "="`

OPT=""

## if [ "$GEOMETRY" != "" ]; then
## OPT="$OPT --geometry $GEOMETRY"
## fi

if [ "$FOREGROUND" != "" ]; then
OPT="$OPT -fg $FOREGROUND"
fi

if [ "$BACKGROUND" != "" ]; then
OPT="$OPT -bg $BACKGROUND"
fi

## if [ "$MAXIMIZED" == "1" ]; then
## OPT="$OPT -mm"
## fi

## if [ "$FULLWIDTH" == "1" ]; then
## OPT="$OPT -fw"
## fi

## if [ "$FULLHEIGHT" == "1" ]; then
## OPT="$OPT -fh"
## fi

## Set Emacs Specific Directories


EMACSDATA="${EMACSAPP}/emacs-${EMACSVER}/etc"
EMACSDOC="${EMACSAPP}/emacs-${EMACSVER}/etc"

EMACSLOADPATH=$EMACSAPP/emacs-$EMACSVER/lisp/:$EMACSAPP/site-lisp/

EMACSDIR=$EMACSAPP/emacs-$EMACSVER/linux/bin


OPHOME=`cat $EPINI | egrep "[Hh]ome *= *" | tr -d '\15' | cut -f 2 -d "=" | sed 's/\\\\/\\//g' | sed 's/\\/$//'`

OPTYPE=`echo $OPHOME | sed 's/\(USB\).*/\1/' | sed 's/\(EXEDIR\).*/\1/'`

if [ "$OPTYPE" == "EXEDIR" ]; then
OPHOME=`echo $OPHOME | sed 's/EXEDIR:\///'`
HOME="$EXEDIR$OPHOME"
export HOME
fi

if [ "$OPTYPE" == "USB" ]; then
OPHOME=`echo $OPHOME | sed 's/USB:\///'`
HOME="$EPUSB$OPHOME"
export HOME
fi

#HOME=$EPUSB/Documents

echo HOME: $HOME
echo OPHOME: $OPHOME
echo OPTYPE: $OPTYPE
echo EPUSB: $EPUSB
echo EPOTHER: $EPOTHER
echo TEMP: $TEMP
echo DICPATH: $DICPATH
#echo PATH: $PATH
echo EMACSDIR: $EMACSDIR

echo EMACSVER: $EMACSVER

echo EMACSAPP: $EMACSAPP
echo EMACSDATA: $EMACSDATA
echo EMACSLOADPATH: $EMACSLOADPATH
echo GEOMETRY: $GEOMETRY
echo FOREGROUND: $FOREGROUND
echo BACKGROUND: $BACKGROUND
echo OPT: $OPT
echo DATPATH: $DATPATH
echo EPSTART: $EPSTART

EPSTARTDIR=$EMACSAPP/../Data/start/$EPSTART
echo EPSTARTDIR: $EPSTARTDIR

if [ -e $DATPATH/ini/Environment.ini ]; then
rm /tmp/ep-environment.sh
sed 's/\[[Ee]nvironment\]/#!\/bin\/bash/' $DATPATH/ini/Environment.ini | sed 's/\(.*\)=\(.*\)/\1="\2"; export \1/' > /tmp/ep-environment.sh
echo "" >> /tmp/ep-environment.sh
./flip.osx -u /tmp/ep-environment.sh
source /tmp/ep-environment.sh
fi

if [ -e $DATPATH/start/shared/Environment.ini ]; then
rm /tmp/ep-environment.sh
sed 's/\[[Ee]nvironment\]/#!\/bin\/bash/' $DATPATH/start/shared/Environment.ini | sed 's/\(.*\)=\(.*\)/\1="\2"; export \1/' > /tmp/ep-environment.sh
echo "" >> /tmp/ep-environment.sh
source /tmp/ep-environment.sh
fi


echo ERGOEMACS_KEYBOARD_LAYOUT: $ERGOEMACS_KEYBOARD_LAYOUT

export OHOME
export EPUSB
export EPOTHER
export TEMP
export DICPATH
export PATH
export EMACSDIR
export EMACSDATA
export EMACSLOADPATH
export EMACSDOC
export EMACSVER
export EPSTART
export EPSTARTDIR

REALVER=`$EMACSDIR/emacs-$EMACSVER --version 2>&1 | head -n1 | sed 's/[^0-9]*\([0-9].*\)/\1/'`


echo REALVER: $REALVER
##
if ! [ -e $EMACSDATA/DOC-$REALVER ]; then
cp $EMACSDATA/DOC-X $EMACSDATA/DOC-$REALVER
fi
echo $OPT
rm $EPINI
$EMACSDIR/emacs-$EMACSVER $OPT
8 changes: 5 additions & 3 deletions App/site-lisp/build-nsi.el
Expand Up @@ -49,9 +49,6 @@
;;
;;; Code:

(defvar ep-ver 0.02
"Version for EmacsPortable.")

(defun build-nsi-file (file-list out-path &optional exclude-reg)
"Builds NSIS file information"
(let (changed-out
Expand Down Expand Up @@ -95,6 +92,7 @@
"Build NSI based on current install"
(interactive)
(let (ret
(ep-ver (format-time-string "%y.%m.%d"))
tmp
tmp2
(tmp-file (make-temp-file "emacs-make" nil "bat"))
Expand Down Expand Up @@ -221,6 +219,10 @@ FunctionEnd
(directory-files (expand-file-name "~ep/") t ".*[.]exe")))
(insert (format "File \"%s\*.html\"\n" tmp))
(insert (format "File \"%s\*.org\"" tmp))
(insert (format "File \"%s\AppRun\"" tmp))
(insert (format "File \"%s\AppInfo.xml\"" tmp))
(insert (format "File \"%s\.DirIcon\"" tmp))
(insert (format "File \"%s\EmacsLinux.desktop\"" tmp))
(build-nsi-file (directory-files "~ep/Contents" t)
"$INSTDIR\\Contents")
(build-nsi-file (directory-files (concat "~app/emacs-" emacs-ver) t)
Expand Down
6 changes: 5 additions & 1 deletion App/site-lisp/start.org
Expand Up @@ -395,10 +395,14 @@ This also attempts to speed up the recent files cleanup list by
:type 'boolean
:group 'EmacsPortable)

(defun ep-not-file-remote-p (file &optional identification connected)
"Do not keep remote files"
(not (file-remote-p file identification connected)))

(when EmacsPortable-start-recentf
(condition-case err
(progn
(setq recentf-keep '(file-remote-p file-readable-p))
(setq recentf-keep '(ep-not-file-remote-p file-readable-p))
(setq recentf-auto-cleanup 'mode)
(setq recentf-max-menu-items 20)
(setq recentf-max-saved-items 1000)
Expand Down
11 changes: 11 additions & 0 deletions AppInfo.xml
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<AppInfo>
<Summary xml:lang="en">EmacsPortable.App is a portable, extensible,
customizable text editor -- and more.</Summary>
<About xml:lang="en">
<Purpose>Text Editor</Purpose>
<Authors>Matthew Fidler and Gnu Emacs team</Authors>
<License>GNU General Public License v3</License>
<Homepage>https://github.com/mlf176f2/EmacsPortable.App/</Homepage>
</About>
</AppInfo>
13 changes: 13 additions & 0 deletions AppRun
@@ -0,0 +1,13 @@
#!/bin/sh
SOURCE="${BASH_SOURCE[0]}"
DIR="$( dirname "$SOURCE" )"
while [ -h "$SOURCE" ]
do
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

cd $DIR/App/linux
./EmacsPortable $@
11 changes: 11 additions & 0 deletions EmacsLinux.desktop
@@ -0,0 +1,11 @@
[Desktop Entry]
Name=EmacsPortable.App
GenericName=Text Editor
Comment=Edit text
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Exec=./AppRun %F
Icon=./.DirIcon
Type=Application
Terminal=false
Categories=Development;TextEditor;
StartupWMClass=Emacs
2 changes: 1 addition & 1 deletion Other/source/nsi/build.el
Expand Up @@ -141,7 +141,7 @@
(when (re-search-backward "<div id=\"content\">" nil t)
(replace-match "<div id=\"header-wrapper\"><div id=\"header\"><div id=\"logo\">")
(when (re-search-forward "</h1>" nil t)
(insert "<p>Run Emacs Portably on Windows and Mac OSX</p></div></div></div><div id=\"page\"><div id=\"page-bgtop\"><div id=\"page-bgbtm\"><div id=\"page-content\">")
(insert "<p>Run Emacs Portably on Windows, Linux and Mac OSX</p></div></div></div><div id=\"page\"><div id=\"page-bgtop\"><div id=\"page-bgbtm\"><div id=\"page-content\">")
(when (re-search-forward "<div id=\"outline-container-1\"" nil t)
(goto-char (match-beginning 0))
(insert "<div id=\"content\">"))
Expand Down
16 changes: 13 additions & 3 deletions README.org
Expand Up @@ -3,18 +3,20 @@
#+OPTIONS: LaTeX:t
* Introduction
EmacsPortable.App attempts to make a portable version of Emacs that
runs off a USB drive under either Windows, or Mac OSX.
runs off a USB drive under either Windows, Linux, or Mac OSX.

The features of this distribution:
- Automatic Registering of extensions (and org-protocol)
- Will use LiberKey when requsted
- Will use LiberKey when requested
- Will generate an appropriate Info.plist for Mac OS X
- No support under Linux
- Temporarily Install of fonts
- Temporarily install fonts on windows so you can always carry your
favorite mono-spaced font
- Copy the fonts to ~/Library/Fonts under Mac OSX
- The fonts you use should be free, so you are not copying fonts
that should not be copied
that should not be copied
- Currently no support under Linux
*Window Only Features:*
- Psuedo-Daemon
- Finding support applications and dictionaries
Expand Down Expand Up @@ -602,6 +604,14 @@ then:

Therefore, you do not need to always manually edit proxy settings, and
plink should work most of the time.
*** PuTTY and R
R can connect to remote sessions using ssh.el. When you use PuTTY to
connect you will need to set the following option:

#+BEGIN_SRC emacs-lisp
(setq ssh-program "plink")
#+END_SRC

** Bleeding edge emacs (Not supported yet)
These are notes to use the bleeding edge emacs.

Expand Down

0 comments on commit b5d72fa

Please sign in to comment.