/* ########################################################################

		    SMAC FILE USED BY XCORAL EDITOR

   File: 
   Path: 
   Description: 
   Created: Thu Jan 23 10:26:29 MET 1997
   Author: Lionel Fournigault
   Modified: Thu Jan 23 10:26:31 MET 1997
   Last maintained by: Lionel Fournigault

   RCS $Revision$ $State$
   

   ########################################################################

   Note: 

   Requires: 

   Defines: 

   Suggested bindings: 

   Procedure: 

   ########################################################################

   Copyright (c) : Lionel Fournigault

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

   ######################################################################## */

{
  if (! function("forward_c_form"))
    load_file("mode.sc");

  key_def("Java", "\t", "c_indent_line");
  key_def("Java", "\r", "c_insert_and_indent");

  key_def("Java", "}", "c_insert_blink_matched_char_and_indent");
  key_def("Java", "]", "c_insert_blink_matched_char_and_indent");
  key_def("Java", ")", "c_insert_blink_matched_char_and_indent");

  key_def("Java", "{", "c_insert_and_indent");
  key_def("Java", ":", "c_insert_and_indent");

  key_def("Java", "^[a", "goto_beginning_of_c_definition");
  key_def("Java", "^[f", "forward_c_form");
  key_def("Java", "^[b", "backward_c_form");

  key_def("Java", "^[d", "delete_next_c_form");
  key_def("Java", "^[\b", "delete_previous_c_form");
  key_def("Java", "^[\177", "delete_previous_c_form");

  key_def("Java", "^[i", "c_indent_region");
  
  key_def("Java", "^[u", "upcase_word");
  key_def("Java", "^[l", "downcase_word");
  key_def("Java", "^[c", "capitalize_word");
  
  key_def("Java", "^[?", "select_c_object");
  key_def("Java", "^[^[", "edit_c_object");
}
/* -----------------------------------------------
   Java mode.
   Yes, it's a hack, a sordid hack but I like it.
    Lionel.
   -----------------------------------------------  */

char *java_cl = "-e s/}/};/ -e s/extends/:/ ";
char *java_in = "-e s/implements/,/ -e s/interface/class/ ";
char *java_me = "-e s/protected// -e s/private// -e s/public// ";
char *java_pk = "-e s/^import.*$// -e s/^package.*$// ";
char *java_na = "-e s|\\([A-Za-z][A-Za-z]*\\)\\.|\\1__|g ";
char *java_mi = "-e s/final// -e s/synchronized// ";

char *java_op = concat2(concat3(java_cl,java_in,java_me),
			concat3(java_pk,java_mi,java_na));
{
  browser_set_pp("Java","/bin/sed");
  browser_set_pp_options("Java",java_op);
}
