From 70ee9ce5beb9a1a73814596003382c1ecf159d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Neumann?= Date: Sat, 27 Oct 2012 12:07:26 +0200 Subject: Launch isabelle in background (+ some comments and small cleanup) --- .zsh/functions/IE | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to '.zsh') diff --git a/.zsh/functions/IE b/.zsh/functions/IE index c65c93b..989cdec 100644 --- a/.zsh/functions/IE +++ b/.zsh/functions/IE @@ -1,3 +1,19 @@ +# This function is a wrapper around 'isabelle {emacs,jedit}' +# Usage: IE [logic-pattern] [file] [options] +# IJ ... +# +# IE launches emacs, IJ jedit +# +# - logic-pattern: this is expanded to *logic-pattern* and matched +# against all logics as returned by `isabelle findlogics` +# the first match wins +# - file: file to open +# - options: options passed verbatim to 'isabelle emacs' +# +# If no logic-pattern is given, the file .isabelle-logic is +# evaluated: This file should contain one line, being either the logic to load, +# or '..', which makes the script take the .isabelle-logic in the parent directory. + readonly default="HOL" local file logic program defargs @@ -22,9 +38,10 @@ case x$1 in x-*);; # argument to isabelle emacs -> ignore x) ;; # empty -> ignore x*) # a logic pattern :) - logic=$1; shift - if [[ -n $1 && $1 != -* ]]; then - file=$1; shift + logic=$1 + if [[ -n $2 && $2 != -* ]]; then + file=$2 + shift 2 fi esac @@ -75,7 +92,7 @@ if [[ -z $logic ]]; then echo "Defaulting to '$logic'." fi -# AAAAND ... FIRE! -isabelle ${program} ${=defargs} "$@" -l $logic $file +# AAAAND ... FIRE! (in the background) +isabelle ${program} ${=defargs} "$@" -l $logic $file &! # vim: ft=zsh -- cgit v1.2.3