From 11bc824c4a8fff9cabc9421f09b13940b22a0f99 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 23 Aug 2001 17:45:33 +0000 Subject: [PATCH] * lib/edit.indent.rc: Create cooledit.error right away to override its old contents. Don't use ksh extentions. Treat *.C files as C++. Recognize more C++ extensions. Support java. Update URL for "astyle". Quote all arguments to protect spaces. * lib/edit.spell.rc: Don't save terminal settings - mc does it itself. Quote all arguments to protect spaces. --- ChangeLog | 9 +++++++++ lib/edit.indent.rc | 28 +++++++++++++++++----------- lib/edit.spell.rc | 8 +------- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8a32384d9..38740e8aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-08-23 Pavel Roskin + + * lib/edit.indent.rc: Create cooledit.error right away to + override its old contents. Don't use ksh extentions. Treat *.C + files as C++. Recognize more C++ extensions. Support java. + Update URL for "astyle". Quote all arguments to protect spaces. + * lib/edit.spell.rc: Don't save terminal settings - mc does it + itself. Quote all arguments to protect spaces. + 2001-08-21 Pavel Roskin * doc-gnome/C/figs/Makefile.am: Don't install GNOME-specific diff --git a/lib/edit.indent.rc b/lib/edit.indent.rc index dc2bd4996..a60e27f70 100644 --- a/lib/edit.indent.rc +++ b/lib/edit.indent.rc @@ -4,19 +4,25 @@ # $1 - edit file name # $2 - highlight block file name # $3 - error file name - -case "$(echo $1 |sed s/^.*\\.//)" in #got extesion - c|C) - #ftp://ftp.gnu.org/pub/gnu/indent-2.2.5.tar.gz - indent -kr -pcs $2 1>/dev/null 2>$3 + +exec >/dev/null +exec 2>"$3" + +case `echo $1 |sed 's/^.*\.//'` in + c|h) + # ftp://ftp.gnu.org/pub/gnu/indent/ + indent -kr -pcs "$2" ;; - cc|CC) - #http://gene.md.huji.ac.il/~tald/astyle/stable/src/astyle_1.11.5_src.tar.gz - astyle $2 1>/dev/null 2>$3 + C|cc|CC|cxx|CXX|cpp|CPP) + # http://astyle.sourceforge.net/ + astyle "$2" + ;; + java|JAVA) + # http://astyle.sourceforge.net/ + astyle --style=java --mode=java "$2" ;; *) - mv -f $2 $2.tmp #ftp://alpha.gnu.org/gnu/fetish/textutils-2.0.tar.gz - fmt $2.tmp 1>$2 2>$3 - rm -f $2.tmp + fmt "$2" >"$2.tmp" && rm -f "$2" && mv -f "$2.tmp" "$2" + ;; esac diff --git a/lib/edit.spell.rc b/lib/edit.spell.rc index 1e1a99540..122e49f74 100644 --- a/lib/edit.spell.rc +++ b/lib/edit.spell.rc @@ -5,10 +5,4 @@ # $2 - highlight block file name # $3 - error file name -# The editor doesn't save stty. Save it manually. -stty_save=`stty -g` -reset -clear -ispell $2 2>$3 -clear -stty $stty_save +ispell "$2" 2>"$3"