jaromail

a commandline tool to easily and privately handle your e-mail
git clone git://parazyd.org/jaromail.git
Log | Files | Refs | Submodules | README

commit 1d740b3a0ebe5d40e45a9feb7502091827640bae
parent 2fb1b7f08cc2c24aa1b279628dce4253c73d1a4a
Author: Jaromil <jaromil@dyne.org>
Date:   Mon,  9 Jul 2012 16:19:06 +0200

better known editor options for emacs/vim and sqlite3 check at build on gnu systems

Diffstat:
Mbuild/build-gnu.sh | 2+-
Msrc/zlibs/helpers | 16++++++++++++----
2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/build/build-gnu.sh b/build/build-gnu.sh @@ -29,9 +29,9 @@ case $distro in which gcc || sudo apt-get install gcc which bison || sudo apt-get install bison which flex || sudo apt-get install flex + which sqlite3 || sudo apt-get install sqlite3 [ -r /usr/share/doc/libgnome-keyring-dev/copyright ] || \ sudo apt-get install libglib2.0-dev libgnome-keyring-dev - echo "All dependencies installed" cd src echo -n "Compiling the address parser... " diff --git a/src/zlibs/helpers b/src/zlibs/helpers @@ -70,20 +70,28 @@ autostart() { # however the default is nano if nothing else is choosen. editor() { { test ${EDITOR} } && { - ${=EDITOR} ${PARAM[1]} + case ${EDITOR} in + # refine settings for email + vi|vim) vim -c 'set fo=tcrq' -c 'set tw=76' ${=PARAM} ;; + emacs) emacsclient -a emacs ${=PARAM} ;; + *) ${=EDITOR} ${=PARAM} ;; + esac return $? } + # if we are here we need to guess case $OS in - MAC) open -t ${PARAM[1]} ;; + MAC) open -t ${=PARAM} ;; GNU) + { ps ax|grep '[e]macs' } && { emacsclient -a ${=PARAM} } + { ps ax|grep '[v]im' } && { vim -c 'set fo=tcrq' -c 'set tw=76' ${=PARAM} } { which nano > /dev/null } && { - nano -m -S -Q ">" -I -E -D -T 4 -U -W -c -i -k -r 72 ${PARAM[1]} } + nano -m -S -Q ">" -I -E -D -T 4 -U -W -c -i -k -r 72 ${=PARAM} } error "No editor found, please configure the EDITOR environment variable." - sleep 3 ;; esac return $? } + ############## ## Open a File open_file() {