summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Wrobel <wrobel@gentoo.org>2005-10-27 08:15:11 +0000
committerGunnar Wrobel <wrobel@gentoo.org>2005-10-27 08:15:11 +0000
commitbe370e5c0adb3608b53282d96a7c3026d98e9fd6 (patch)
tree86bf7841acf28a218484c2214bb4677204e85292 /app-emacs/else-mode
parentFixed digests (diff)
downloadoverlay-be370e5c0adb3608b53282d96a7c3026d98e9fd6.tar.gz
overlay-be370e5c0adb3608b53282d96a7c3026d98e9fd6.tar.bz2
overlay-be370e5c0adb3608b53282d96a7c3026d98e9fd6.zip
Renaming application
svn path=/; revision=482
Diffstat (limited to 'app-emacs/else-mode')
-rw-r--r--app-emacs/else-mode/Manifest14
-rw-r--r--app-emacs/else-mode/else-1.20.ebuild50
-rw-r--r--app-emacs/else-mode/files/50else-gentoo.el3
-rw-r--r--app-emacs/else-mode/files/C-cust.lse443
-rw-r--r--app-emacs/else-mode/files/C.lse1355
-rw-r--r--app-emacs/else-mode/files/Emacs-Lisp.lse1849
-rw-r--r--app-emacs/else-mode/files/LaTeX-cust.lse128
-rw-r--r--app-emacs/else-mode/files/LaTeX.lse738
-rw-r--r--app-emacs/else-mode/files/Python-cust.lse254
-rw-r--r--app-emacs/else-mode/files/Python.lse1307
-rw-r--r--app-emacs/else-mode/files/Template-cust.lse398
-rw-r--r--app-emacs/else-mode/files/Template.lse648
-rw-r--r--app-emacs/else-mode/files/digest-else-1.200
-rw-r--r--app-emacs/else-mode/files/else-mode.el4716
-rw-r--r--app-emacs/else-mode/files/else.info3215
-rw-r--r--app-emacs/else-mode/files/setnu.el448
16 files changed, 15566 insertions, 0 deletions
diff --git a/app-emacs/else-mode/Manifest b/app-emacs/else-mode/Manifest
new file mode 100644
index 0000000..d57dcc3
--- /dev/null
+++ b/app-emacs/else-mode/Manifest
@@ -0,0 +1,14 @@
+MD5 62705200c7207d13dd91c6389dab0b36 else-1.20.ebuild 759
+MD5 8ccb76306406ddabb96bcf25b696c00d files/Emacs-Lisp.lse 40640
+MD5 8dbc706c76de6f32f55f13d5e2e27df8 files/C-cust.lse 11630
+MD5 9ea68bee4243a3f8e4428854bc22bd90 files/C.lse 29175
+MD5 f711cbb3f6a2407278a6f886f71201df files/Template-cust.lse 11330
+MD5 56afc00dd0f5dad97290b1d31625c73e files/LaTeX-cust.lse 4755
+MD5 ec9daf849b952be50901e9644161ef5c files/LaTeX.lse 15398
+MD5 01e370c5241e0cc91a989c5835f30c59 files/Python-cust.lse 6999
+MD5 f7d5120d3535264b1efc4333842b0bc4 files/Python.lse 27885
+MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-else-1.20 0
+MD5 30d4479283c8dbf63f2521d54525b8cf files/Template.lse 15915
+MD5 ec7a68fc6bfb504caccfa4d070bf2d14 files/else-mode.el 198411
+MD5 be2f6dac99d16adb6567aad75fa089cd files/else.info 133204
+MD5 63c1fd52d0e634f474b3bf66584a6324 files/setnu.el 16650
diff --git a/app-emacs/else-mode/else-1.20.ebuild b/app-emacs/else-mode/else-1.20.ebuild
new file mode 100644
index 0000000..02b0283
--- /dev/null
+++ b/app-emacs/else-mode/else-1.20.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit elisp
+
+DESCRIPTION="ELSE provides templates to generate code in several different languages"
+HOMEPAGE="http://www.zipworld.com.au/~peterm/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+
+IUSE=""
+
+DEPEND="virtual/emacs"
+
+SITEFILE=50else-gentoo.el
+
+S=${WORKDIR}
+
+src_unpack() {
+ cd ${S}
+ cp ${FILESDIR}/*.el .
+}
+
+src_compile() {
+ elisp-compile *.el || die
+}
+
+src_install() {
+
+ doinfo ${FILESDIR}/else.info
+
+ mkdir ${D}/usr/share/${PN}
+ insinto /usr/share/${PN}
+ doins ${FILESDIR}/*.lse
+
+ elisp-install ${PN} *.el *.elc
+ elisp-site-file-install ${FILESDIR}/${SITEFILE}
+}
+
+pkg_postinst() {
+ elisp-site-regen
+}
+
+pkg_postrm() {
+ elisp-site-regen
+}
diff --git a/app-emacs/else-mode/files/50else-gentoo.el b/app-emacs/else-mode/files/50else-gentoo.el
new file mode 100644
index 0000000..b056b14
--- /dev/null
+++ b/app-emacs/else-mode/files/50else-gentoo.el
@@ -0,0 +1,3 @@
+(add-to-list 'load-path "/usr/share/emacs/site-lisp/else")
+
+(require 'else-mode)
diff --git a/app-emacs/else-mode/files/C-cust.lse b/app-emacs/else-mode/files/C-cust.lse
new file mode 100644
index 0000000..2ff473d
--- /dev/null
+++ b/app-emacs/else-mode/files/C-cust.lse
@@ -0,0 +1,443 @@
+;; Copyright (C) 2001, 2004 Peter Milliken
+;;
+;; Author: Peter Milliken <peterm@resmed.com.au>,
+;; <peterm@unwired.com.au>
+;;
+;; Keywords: language sensitive abbreviation template placeholder token
+;;
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;******************************************************************************
+;; These definitions are my personal customisations for the language. This is
+;; where you should place YOUR customisations.
+;;
+;; Sometimes there is a definition(s) in here that override definitions in the
+;; main language template file that are here to make that definition more
+;; "usable" - this is because I (primarily) try and generate/maintain the main
+;; .lse files from EBNF definitions of the language. Sometimes I just can't
+;; express the appropriate customisation in the EBNF and so I am forced to
+;; override the placeholder definition in this file.
+;;
+;; This entries in this file should be used as an example of how to create your
+;; own customisations. I would caution that you don't delete any definitions
+;; though until you are sure that your edit sessions will not be adversely
+;; affected. The best way to check out the effects of a delete is to "compile"
+;; (else-compile-buffer) the "delete" command for that definition (this will
+;; remove it from your edit session and you can nolonger access the definition
+;; until next you load language template files) and then see whether anything
+;; has been "lost" in your code generation ability i.e. say you think you don't
+;; need the definition for placeholder XXX, just place the following lines at
+;; the end of one of your source files (when ELSE is enabled for that buffer)
+;; and perform a compile (M-x else-compile-buffer) with the cursor positioned at
+;; the beginning of the line:
+;;
+;; DELETE PLACEHOLDER XXX -
+;; /LANGUAGE = "C" -
+;;
+;; This will delete definition XXX from memory.
+;;
+;;******************************************************************************
+DELETE PLACEHOLDER COMPILATION_UNIT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER COMPILATION_UNIT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "[module_level_comments]"
+ "[{include_files}...]"
+ " "
+ "[{data_types_or_declarations}...]"
+ " "
+ "[{function_definition}...]"
+ " "
+ "[main_function]"
+
+END DEFINE
+
+DELETE PLACEHOLDER #INCLUDE -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER #INCLUDE -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "#include <{file_name}>"
+ "#include "{file_name}""
+
+END DEFINE
+
+DELETE PLACEHOLDER FILE_NAME -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER FILE_NAME -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the name of the include file here i.e. stdio.h"
+
+END DEFINE
+
+
+DELETE PLACEHOLDER MODULE_LEVEL_COMMENTS -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER MODULE_LEVEL_COMMENTS -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "/* ===[ {module} ]=============================================================="
+ ""
+ "@@Description: {text}"
+ ""
+ "@@Revisions:"
+ ""
+ "@@@@REV DATE BY DESCRIPTION"
+ "@@------ --------- --- ------------------------------------------------"
+ "@@[text] [text] [text] [text]"
+ "@@-----------------------------------------------------------------------------"
+ ""
+ "@@@@This item is the property of ResMed Ltd, and contains confidential and trade"
+ "@@@@secret information. It may not be transfered from the custody or control of"
+ "@@@@ResMed except as authorised in writing by an officer of ResMed. Neither this"
+ "@@@@item nor the information it contains may be used, transfered, reproduced,"
+ "@@@@published, or disclosed, in whole or in part, and directly or indirectly,"
+ "@@@@except as expressly authorised by an officer of ResMed, pursuant to written"
+ "@@@@agreement."
+ ""
+ "@@@@Copyright (c) 2004 ResMed Ltd. All rights reserved."
+ "@@===========================================================================*/"
+ ""
+
+END DEFINE
+
+DELETE PLACEHOLDER MODULE -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER MODULE -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the name of the module i.e. gs_lib.c"
+
+END DEFINE
+
+DELETE PLACEHOLDER FUNCTION_DEFINITION -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER FUNCTION_DEFINITION -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "[declaration_specifiers] {declarator}"
+ "[declaration]..."
+ "{"
+ " [declaration]..."
+ " [statement]..."
+ "}"
+
+END DEFINE
+
+DELETE TOKEN MAIN_FUNCTION_DEF -
+ /LANGUAGE="C" -
+DEFINE TOKEN MAIN_FUNCTION_DEF -
+ /LANGUAGE="C" -
+ /DESCRIPTION="defines a main function"
+
+ "[function_level_comments]"
+ "{main() OR main function that accept arguments from the command line}"
+ "{"
+ " [block_decl]..."
+ ""
+ " {statement}..."
+ "}"
+
+END DEFINE
+
+DELETE PLACEHOLDER FUNCTION_LEVEL_COMMENTS -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER FUNCTION_LEVEL_COMMENTS -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "/* ===[ {text} ]==============================================="
+ ""
+ "@@@Summary: {text}"
+ ""
+ "@@@Description: {text}"
+ ""
+ "@@@Return Value: {text} always returns P_SUCCESS"
+ ""
+ "@@@========================================================================== */"
+
+END DEFINE
+
+DELETE PLACEHOLDER CONDITIONAL_EXPRESSION -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER CONDITIONAL_EXPRESSION -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "logical_or_expression"/PLACEHOLDER
+ "{logical_or_expression} ? {expression} : {conditional_expression}"
+
+END DEFINE
+
+DELETE PLACEHOLDER CASE_PART -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER CASE_PART -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "case {constant_expression}:"
+ "[case {constant_expression}:]..."
+ " [statement]..."
+ " break;"
+
+END DEFINE
+
+DELETE PLACEHOLDER DEFAULT_PART -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER DEFAULT_PART -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "default :"
+ " [statement]..."
+ " break;"
+
+END DEFINE
+
+DELETE PLACEHOLDER WHILE_STATEMENT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER WHILE_STATEMENT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "while ({expression})"
+ "{"
+ " {statement}..."
+ "}"
+
+END DEFINE
+
+
+DELETE PLACEHOLDER IF_STATEMENT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER IF_STATEMENT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "if ({expression})"
+ "{"
+ " {statement}..."
+ "}"
+ "[elsif_part]..."
+ "[else_part]"
+
+END DEFINE
+
+DELETE PLACEHOLDER ELSIF_PART -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER ELSIF_PART -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "else if ({expression})"
+ "{"
+ " {statement}..."
+ "}"
+
+END DEFINE
+
+DELETE PLACEHOLDER ELSE_PART -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER ELSE_PART -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "else"
+ "{"
+ " {statement}..."
+ "}"
+
+END DEFINE
+
+DELETE PLACEHOLDER SWITCH_STATEMENT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER SWITCH_STATEMENT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "switch ({expression})"
+ "{"
+ " [case_part]..."
+ " [default_part]"
+ "}"
+
+END DEFINE
+
+DELETE PLACEHOLDER DO_STATEMENT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER DO_STATEMENT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "do"
+ "{"
+ " {statement}..."
+ "} while ({expression});"
+
+END DEFINE
+
+DELETE PLACEHOLDER DEFAULT_PART -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER DEFAULT_PART -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+ /RUN_CODE=eut-test1/BEFORE
+ /RUN_CODE=eut-test2/AFTER
+ /RUN_CODE=eut-test3/ONINSERT
+
+ "default :"
+ " [statement]..."
+ " break;"
+
+END DEFINE
+
+
+DELETE PLACEHOLDER FOR_STATEMENT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER FOR_STATEMENT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "for ([loop_init]; [loop_control]; [expression])"
+ "{"
+ " {statement}..."
+ "}"
+
+END DEFINE
+
+
+DELETE PLACEHOLDER PROTOTYPE_DECLARATION -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER PROTOTYPE_DECLARATION -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "[function_level_comments]"
+ "[static_or_extern] {data_type_specifier} [*]{function_name} ([{parameter_declaration}...[, ...]]);"
+
+END DEFINE
+
+DELETE TOKEN COMMENT -
+ /LANGUAGE="C" -
+DEFINE TOKEN COMMENT -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=COMMENT_STATEMENT
+
+END DEFINE
+
+DELETE TOKEN C -
+ /LANGUAGE="C" -
+DEFINE TOKEN C -
+ /LANGUAGE="C" -
+
+ "/* {text} */"
+
+END DEFINE
+
+DELETE TOKEN P -
+ /LANGUAGE="C" -
+DEFINE TOKEN P -
+ /LANGUAGE="C" -
+ /RUN_CODE=eut-test2/AFTER
+
+ "p_report_format(0, rinfo_p, str);"
+
+END DEFINE
+
diff --git a/app-emacs/else-mode/files/C.lse b/app-emacs/else-mode/files/C.lse
new file mode 100644
index 0000000..da0d8e9
--- /dev/null
+++ b/app-emacs/else-mode/files/C.lse
@@ -0,0 +1,1355 @@
+;; Copyright (C) 2001, 2004 Peter Milliken
+;;
+;; Author: Peter Milliken <peterm@resmed.com.au>,
+;; <peterm@unwired.com.au>
+;;
+;; Keywords: language sensitive abbreviation template placeholder token
+;;
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+DELETE LANGUAGE C -
+DEFINE LANGUAGE C -
+ /INITIAL_STRING="{compilation_unit}" -
+ /PUNCTUATION_CHARACTERS="*.;()," -
+ /SELF_INSERT_CHARACTERS=" `~!@#$%^&*(),.<>/?;:'[]{}=\-+|"
+ /VALID_IDENTIFIER_CHARACTERS="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789"
+ /INDENT_SIZE=2 -
+ /VERSION=1.14
+
+END DEFINE
+
+DELETE PLACEHOLDER -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+
+END DEFINE
+
+DELETE PLACEHOLDER BREAK; -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER BREAK; -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "break;"
+
+END DEFINE
+
+DELETE PLACEHOLDER TEXT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER TEXT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ ""Just enter some text please.""
+
+END DEFINE
+
+DELETE PLACEHOLDER "= {CONSTANT_EXPRESSION}" -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER = {CONSTANT_EXPRESSION} -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "= {constant_expression}"
+
+END DEFINE
+
+DELETE PLACEHOLDER ITERATION_STATEMENT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER ITERATION_STATEMENT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "while_statement"/PLACEHOLDER
+ "do_statement"/PLACEHOLDER
+ "for_statement"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER {INCLUDE_FILES}... -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER {INCLUDE_FILES}... -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{include_files}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER WHILE_STATEMENT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER WHILE_STATEMENT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "while ({expression}) {"
+ " {statement}..."
+ "}"
+
+END DEFINE
+
+DELETE PLACEHOLDER ARRAY_DECLARATOR -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER ARRAY_DECLARATOR -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{identifier}[[constant_expression]]"
+
+END DEFINE
+
+DELETE PLACEHOLDER UNION_SPECIFIER -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER UNION_SPECIFIER -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "union [identifier] [{{struct_declaration}...}]"
+
+END DEFINE
+
+DELETE PLACEHOLDER [TYPE_QUALIFIER]... -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER [TYPE_QUALIFIER]... -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "[type_qualifier]..."
+
+END DEFINE
+
+DELETE PLACEHOLDER FOR_STATEMENT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER FOR_STATEMENT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "for ([loop_init]; [loop_control]; [expression]) {"
+ " {statement}..."
+ "}"
+
+END DEFINE
+
+DELETE PLACEHOLDER ENUMERATOR -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER ENUMERATOR -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=", " -
+ /TYPE=NONTERMINAL -
+
+ "{identifier} [= {constant_expression}]"
+
+END DEFINE
+
+DELETE PLACEHOLDER STATIC_OR_EXTERN -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER STATIC_OR_EXTERN -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "static"
+ "extern"
+
+END DEFINE
+
+DELETE PLACEHOLDER COMPILATION_UNIT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER COMPILATION_UNIT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "[{include_files}...]"
+ " "
+ "[{data_types_or_declarations}...]"
+ " "
+ "[{function_definition}...]"
+ " "
+ "[main_function]"
+
+END DEFINE
+
+DELETE PLACEHOLDER ELSE_PART -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER ELSE_PART -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "else {"
+ " {statement}..."
+ "}"
+
+END DEFINE
+
+DELETE PLACEHOLDER "= {INITIALIZER}" -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER = {INITIALIZER} -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "= {initializer}"
+
+END DEFINE
+
+DELETE PLACEHOLDER LABELED_STATEMENT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER LABELED_STATEMENT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{identifier} :"
+ " {statement}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER DECLARATION_LIST -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER DECLARATION_LIST -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{declaration}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER INIT_DECLARATOR -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER INIT_DECLARATOR -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=", " -
+ /TYPE=NONTERMINAL -
+
+ "{declarator} [= {initializer}]"
+
+END DEFINE
+
+DELETE PLACEHOLDER DIRECT_ABSTRACT_DECLARATOR -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER DIRECT_ABSTRACT_DECLARATOR -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "({abstract_declarator})"
+ "[ ]"
+ "[ {constant_expression} ]"
+ "{direct_abstract_declarator} [ ]"
+ "{direct_abstract_declarator} [ {constant_expression} ]"
+ "()"
+ "({parameter_declaration}...[, ...])"
+ "{direct_abstract_declarator} ()"
+ "{direct_abstract_declarator} ({parameter_declaration}...[, ...])"
+
+END DEFINE
+
+DELETE PLACEHOLDER PROTOTYPE_DECLARATION -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER PROTOTYPE_DECLARATION -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "[static_or_extern] {data_type_specifier} [*]{function_name} ([{parameter_declaration}...[, ...]]);"
+
+END DEFINE
+
+DELETE PLACEHOLDER IDENTIFIER -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER IDENTIFIER -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=", " -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid identifier"
+
+END DEFINE
+
+DELETE PLACEHOLDER INITIALIZER -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER INITIALIZER -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "constant_expression"/PLACEHOLDER
+ "{{init_expression}...}"
+ ""{string_literal}""
+
+END DEFINE
+
+DELETE PLACEHOLDER OBJECT_DECLARATION -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER OBJECT_DECLARATION -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "[storage_class_specifier] [[type_qualifier]...] {data_type_specifier} {init_declarator};"
+
+END DEFINE
+
+DELETE PLACEHOLDER {{STRUCT_DECLARATION}...} -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER {{STRUCT_DECLARATION}...} -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{{struct_declaration}...}"
+
+END DEFINE
+
+DELETE PLACEHOLDER SWITCH_STATEMENT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER SWITCH_STATEMENT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "switch ({expression}) {"
+ " [case_part]..."
+ " [default_part]"
+ "}"
+
+END DEFINE
+
+DELETE PLACEHOLDER TYPE_SPECIFIER -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER TYPE_SPECIFIER -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid type_specifier"
+
+END DEFINE
+
+DELETE PLACEHOLDER COMPOUND_STATEMENT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER COMPOUND_STATEMENT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{"
+ " [data_types_or_declarations]..."
+ " "
+ " [statement]..."
+ "}"
+
+END DEFINE
+
+DELETE PLACEHOLDER POINTER -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER POINTER -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "* [type_qualifier_list] [pointer]"
+
+END DEFINE
+
+DELETE PLACEHOLDER TYPE_QUALIFIER_LIST -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER TYPE_QUALIFIER_LIST -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{type_qualifier}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER DATA_TYPES_OR_DECLARATIONS -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER DATA_TYPES_OR_DECLARATIONS -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "object_declaration"/PLACEHOLDER
+ "prototype_declaration"/PLACEHOLDER
+ "typedef_declaration"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER STRING_LITERAL -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER STRING_LITERAL -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ ""Enter a literal string i.e. "abc"""
+
+END DEFINE
+
+DELETE PLACEHOLDER DECLARATOR -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER DECLARATOR -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=", " -
+ /TYPE=MENU -
+
+ "identifier"/PLACEHOLDER
+ "({declarator})"
+ "array_declarator"/PLACEHOLDER
+ "function_declarator"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER INCLUDE_FILES -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER INCLUDE_FILES -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "#include <{file_name}>"
+ "#include "{string_literal}""
+
+END DEFINE
+
+DELETE PLACEHOLDER STRUCT_DECLARATOR -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER STRUCT_DECLARATOR -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "[declarator]... : {constant_expression}"
+
+END DEFINE
+
+DELETE PLACEHOLDER FUNCTION_DECLARATOR -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER FUNCTION_DECLARATOR -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{identifier} ([{parameter_declaration}...[, ...]])"
+
+END DEFINE
+
+DELETE PLACEHOLDER TYPE_QUALIFIER -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER TYPE_QUALIFIER -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=" " -
+ /TYPE=MENU -
+
+ "const"
+ "volatile"
+
+END DEFINE
+
+DELETE PLACEHOLDER DEFAULT_PART -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER DEFAULT_PART -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "default :"
+ " [statement]..."
+
+END DEFINE
+
+DELETE PLACEHOLDER EXPRESSION -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER EXPRESSION -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ ""Just type in standard expression""
+
+END DEFINE
+
+DELETE PLACEHOLDER TYPEDEF_DECLARATION -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER TYPEDEF_DECLARATION -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "typedef [type_qualifier]... {data_type_specifier} {declarator}...;"
+
+END DEFINE
+
+DELETE PLACEHOLDER STORAGE_CLASS_SPECIFIER -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER STORAGE_CLASS_SPECIFIER -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "extern"
+ "static"
+ "auto"
+ "register"
+
+END DEFINE
+
+DELETE PLACEHOLDER TYPE_NAME -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER TYPE_NAME -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{specifier_qualifier_list} [abstract_declarator]"
+
+END DEFINE
+
+DELETE PLACEHOLDER "CASE {CONSTANT_EXPRESSION}:" -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER CASE {CONSTANT_EXPRESSION}: -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "case {constant_expression}:"
+
+END DEFINE
+
+DELETE PLACEHOLDER ABSTRACT_DECLARATOR -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER ABSTRACT_DECLARATOR -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "[pointer] [direct_abstract_declarator]"
+
+END DEFINE
+
+DELETE PLACEHOLDER {DATA_TYPES_OR_DECLARATIONS}... -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER {DATA_TYPES_OR_DECLARATIONS}... -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{data_types_or_declarations}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER MAIN_FUNCTION_DECLARATOR -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER MAIN_FUNCTION_DECLARATOR -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "{data_type_specifier} main()"
+ "{data_type_specifier} main(int argc, char *argv[])"
+ "{data_type_specifier} main(int argc, char *argv[], char *envp[])"
+
+END DEFINE
+
+DELETE PLACEHOLDER * -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER * -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "*"
+
+END DEFINE
+
+DELETE PLACEHOLDER STATEMENT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER STATEMENT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "labeled_statement"/PLACEHOLDER
+ "compound_statement"/PLACEHOLDER
+ "{assignment_expression};"
+ "selection_statement"/PLACEHOLDER
+ "iteration_statement"/PLACEHOLDER
+ "jump_statement"/PLACEHOLDER
+ "comment_statement"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER CONSTANT_EXPRESSION -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER CONSTANT_EXPRESSION -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ ""Just enter a constant expression""
+
+END DEFINE
+
+DELETE PLACEHOLDER FUNCTION_NAME -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER FUNCTION_NAME -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid function_name"
+
+END DEFINE
+
+DELETE PLACEHOLDER LOOP_INIT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER LOOP_INIT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{expression}"
+
+END DEFINE
+
+DELETE PLACEHOLDER CASE_PART -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER CASE_PART -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "case {constant_expression}:"
+ "[case {constant_expression}:]..."
+ " [statement]..."
+ " [break;]"
+
+END DEFINE
+
+DELETE PLACEHOLDER PRIMARY_EXPRESSION -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER PRIMARY_EXPRESSION -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "identifier"/PLACEHOLDER
+ "constant"/PLACEHOLDER
+ "string_literal"/PLACEHOLDER
+ "({expression})"
+
+END DEFINE
+
+DELETE PLACEHOLDER DECLARATION -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER DECLARATION -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "[type_qualifier] [storage_class_specifier] {data_type_specifier} {init_declarator}...;"
+
+END DEFINE
+
+DELETE PLACEHOLDER JUMP_STATEMENT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER JUMP_STATEMENT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "goto {identifier};"
+ "continue;"
+ "break;"
+ "return [expression];"
+
+END DEFINE
+
+DELETE PLACEHOLDER STRUCT_SPECIFIER -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER STRUCT_SPECIFIER -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "struct [identifier] [{{struct_declaration}...}]"
+
+END DEFINE
+
+DELETE PLACEHOLDER MAIN_FUNCTION -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER MAIN_FUNCTION -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{main_function_declarator}"
+ "{"
+ " {data_types_or_declarations}..."
+ " "
+ " {statement}..."
+ "}"
+
+END DEFINE
+
+DELETE PLACEHOLDER CONSTANT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER CONSTANT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid constant"
+
+END DEFINE
+
+DELETE PLACEHOLDER FILE_NAME -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER FILE_NAME -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid file_name"
+
+END DEFINE
+
+DELETE PLACEHOLDER LOOP_CONTROL -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER LOOP_CONTROL -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{expression}"
+
+END DEFINE
+
+DELETE PLACEHOLDER ", ..." -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER , ... -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ ", ..."
+
+END DEFINE
+
+DELETE PLACEHOLDER STRUCT_DECLARATION -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER STRUCT_DECLARATION -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="; " -
+ /TYPE=NONTERMINAL -
+
+ "{data_type_specifier} {declarator}"
+
+END DEFINE
+
+DELETE PLACEHOLDER INIT_EXPRESSION -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER INIT_EXPRESSION -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=", " -
+ /TYPE=NONTERMINAL -
+
+ "{initializer}"
+
+END DEFINE
+
+DELETE PLACEHOLDER "{PARAMETER_DECLARATION}...[, ...]" -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER {PARAMETER_DECLARATION}...[, ...] -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{parameter_declaration}...[, ...]"
+
+END DEFINE
+
+DELETE PLACEHOLDER SELECTION_STATEMENT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER SELECTION_STATEMENT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "if_statement"/PLACEHOLDER
+ "switch_statement"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER DO_STATEMENT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER DO_STATEMENT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "do {"
+ " {statement}..."
+ "} while ({expression});"
+
+END DEFINE
+
+DELETE PLACEHOLDER PARAMETER_DECLARATION -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER PARAMETER_DECLARATION -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=", " -
+ /TYPE=NONTERMINAL -
+
+ "{data_type_specifier} {declarator}"
+
+END DEFINE
+
+DELETE PLACEHOLDER IF_STATEMENT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER IF_STATEMENT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "if ({expression}) {"
+ " {statement}..."
+ "}"
+ "[elsif_part]..."
+ "[else_part]"
+
+END DEFINE
+
+DELETE PLACEHOLDER COMMENT_STATEMENT -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER COMMENT_STATEMENT -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "/* {text} */"
+
+END DEFINE
+
+DELETE PLACEHOLDER ASSIGNMENT_EXPRESSION -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER ASSIGNMENT_EXPRESSION -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid assignment_expression"
+
+END DEFINE
+
+DELETE PLACEHOLDER ELSIF_PART -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER ELSIF_PART -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "else if ({expression}) {"
+ " {statement}..."
+ "}"
+
+END DEFINE
+
+DELETE PLACEHOLDER IDENTIFIER_LIST -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER IDENTIFIER_LIST -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{identifier}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER {FUNCTION_DEFINITION}... -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER {FUNCTION_DEFINITION}... -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{function_definition}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER FUNCTION_DEFINITION -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER FUNCTION_DEFINITION -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "[static_or_extern] {data_type_specifier} [*]{function_name} ([{parameter_declaration}...[, ...]])"
+ "{"
+ " [declaration]..."
+ " "
+ " [statement]..."
+ "}"
+
+END DEFINE
+
+DELETE PLACEHOLDER ENUM_SPECIFIER -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER ENUM_SPECIFIER -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "enum [identifier] {{enumerator}...}"
+
+END DEFINE
+
+DELETE PLACEHOLDER SPECIFIER_QUALIFIER_LIST -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER SPECIFIER_QUALIFIER_LIST -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "{type_specifier} {specifier_qualifier_list}"
+ "type_specifier"/PLACEHOLDER
+ "{type_qualifier} {specifier_qualifier_list}"
+ "type_qualifier"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER DATA_TYPE_SPECIFIER -
+ /LANGUAGE="C" -
+DEFINE PLACEHOLDER DATA_TYPE_SPECIFIER -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "void"
+ "char"
+ "int"
+ "float"
+ "double"
+ "unsigned char"
+ "signed char"
+ "unsigned short int"
+ "signed short int"
+ "short int"
+ "unsigned int"
+ "signed int"
+ "unsigned long int"
+ "signed long int"
+ "long int"
+ "struct_specifier"/PLACEHOLDER
+ "union_specifier"/PLACEHOLDER
+ "enum_specifier"/PLACEHOLDER
+ "type_name"/PLACEHOLDER
+
+END DEFINE
+
+The following tokens are generated automatically:
+DELETE TOKEN CASE -
+ /LANGUAGE="C" -
+DEFINE TOKEN CASE -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=CASE_PART -
+
+END DEFINE
+
+DELETE TOKEN DO -
+ /LANGUAGE="C" -
+DEFINE TOKEN DO -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=DO_STATEMENT -
+
+END DEFINE
+
+DELETE TOKEN TYPEDEF -
+ /LANGUAGE="C" -
+DEFINE TOKEN TYPEDEF -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=TYPEDEF_DECLARATION -
+
+END DEFINE
+
+DELETE TOKEN CONST -
+ /LANGUAGE="C" -
+DEFINE TOKEN CONST -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=TYPE_QUALIFIER -
+
+END DEFINE
+
+DELETE TOKEN GOTO -
+ /LANGUAGE="C" -
+DEFINE TOKEN GOTO -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=JUMP_STATEMENT -
+
+END DEFINE
+
+DELETE TOKEN FOR -
+ /LANGUAGE="C" -
+DEFINE TOKEN FOR -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=FOR_STATEMENT -
+
+END DEFINE
+
+DELETE TOKEN DEFAULT -
+ /LANGUAGE="C" -
+DEFINE TOKEN DEFAULT -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=DEFAULT_PART -
+
+END DEFINE
+
+DELETE TOKEN UNION -
+ /LANGUAGE="C" -
+DEFINE TOKEN UNION -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=UNION_SPECIFIER -
+
+END DEFINE
+
+DELETE TOKEN VOID -
+ /LANGUAGE="C" -
+DEFINE TOKEN VOID -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=DATA_TYPE_SPECIFIER -
+
+END DEFINE
+
+DELETE TOKEN ENUM -
+ /LANGUAGE="C" -
+DEFINE TOKEN ENUM -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=ENUM_SPECIFIER -
+
+END DEFINE
+
+DELETE TOKEN WHILE -
+ /LANGUAGE="C" -
+DEFINE TOKEN WHILE -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=WHILE_STATEMENT -
+
+END DEFINE
+
+DELETE TOKEN STRUCT -
+ /LANGUAGE="C" -
+DEFINE TOKEN STRUCT -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=STRUCT_SPECIFIER -
+
+END DEFINE
+
+DELETE TOKEN ELSE -
+ /LANGUAGE="C" -
+DEFINE TOKEN ELSE -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=ELSE_PART -
+
+END DEFINE
+
+DELETE TOKEN #INCLUDE -
+ /LANGUAGE="C" -
+DEFINE TOKEN #INCLUDE -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=INCLUDE_FILES -
+
+END DEFINE
+
+DELETE TOKEN SWITCH -
+ /LANGUAGE="C" -
+DEFINE TOKEN SWITCH -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=SWITCH_STATEMENT -
+
+END DEFINE
+
+DELETE TOKEN STATIC -
+ /LANGUAGE="C" -
+DEFINE TOKEN STATIC -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=STATIC_OR_EXTERN -
+
+END DEFINE
+
+DELETE TOKEN EXTERN -
+ /LANGUAGE="C" -
+DEFINE TOKEN EXTERN -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=STORAGE_CLASS_SPECIFIER -
+
+END DEFINE
+
+DELETE TOKEN IF -
+ /LANGUAGE="C" -
+DEFINE TOKEN IF -
+ /LANGUAGE="C" -
+ /PLACEHOLDER=IF_STATEMENT -
+
+END DEFINE
+
diff --git a/app-emacs/else-mode/files/Emacs-Lisp.lse b/app-emacs/else-mode/files/Emacs-Lisp.lse
new file mode 100644
index 0000000..1fc10d5
--- /dev/null
+++ b/app-emacs/else-mode/files/Emacs-Lisp.lse
@@ -0,0 +1,1849 @@
+;; Copyright (C) 1997,1998,1999,2000,2001,2002,2003 Peter Milliken
+;;
+;; Author: Peter Milliken <peterm@resmed.com.au>,
+;; <peterm@unwired.com.au>
+;;
+;; Keywords: language sensitive abbreviation template placeholder token
+;;
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+DELETE LANGUAGE "Emacs-Lisp" -
+DEFINE LANGUAGE "Emacs-Lisp" -
+ /INITIAL_STRING="{compilation_unit}" -
+ /PUNCTUATION_CHARACTERS=",;()*.'" -
+ /SELF_INSERT_CHARACTERS=" `~!@#$%^&*(),.<>/?;:'[]{}=\-+|""
+ /VALID_IDENTIFIER_CHARACTERS="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789"
+ /INDENT_SIZE=2
+ /VERSION=1.9
+
+END DEFINE
+
+DELETE PLACEHOLDER COMPILATION_UNIT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER COMPILATION_UNIT -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "[file_header]"
+ "[def]..."
+ "[defun]..."
+ "[defcustom]..."
+
+END DEFINE
+
+DELETE PLACEHOLDER FILE_HEADER -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER FILE_HEADER -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ ";;; {file-name}.el --- {package-name}"
+ ""
+ ";; Copyright (C) {year}... {author-name}"
+ ";;"
+ ";; Author: {author-name} [email-address]"
+ ";;"
+ ";; $Date[please_expand_me]$"
+ ";; Version: {text}"
+ ";; Keywords: {text}..."
+ ";;"
+ ";;"
+ ";; GNU Emacs 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."
+ ""
+ ";; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the"
+ ";; Free Software Foundation, Inc., 59 Temple Place - Suite 330,"
+ ";; Boston, MA 02111-1307, USA."
+ ""
+ ";;; Commentary:"
+ ""
+ ";; {text}"
+ ""
+ ";;; Change Log:"
+ ""
+ ";;; Code:"
+ ""
+
+END DEFINE
+
+DELETE PLACEHOLDER PACKAGE-NAME -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER PACKAGE-NAME -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the name of the package"
+
+END DEFINE
+
+DELETE PLACEHOLDER YEAR -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER YEAR -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=", " -
+ /TYPE=TERMINAL
+
+ "Enter the year of the copyright"
+
+END DEFINE
+
+DELETE PLACEHOLDER EMAIL-ADDRESS -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER EMAIL-ADDRESS -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter your email address"
+
+END DEFINE
+
+DELETE PLACEHOLDER PLEASE_EXPAND_ME -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER PLEASE_EXPAND_ME -
+ /LANGUAGE="Emacs-Lisp" -
+ /TYPE=NONTERMINAL
+
+ ":"
+
+END DEFINE
+
+DELETE PLACEHOLDER AUTHOR-NAME -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER AUTHOR-NAME -
+ /LANGUAGE="Emacs-Lisp" -
+ /AUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the name of the author"
+
+END DEFINE
+
+
+DELETE PLACEHOLDER FILE-NAME -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER FILE-NAME -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Please enter the name of the file"
+
+END DEFINE
+
+DELETE PLACEHOLDER DEF -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER DEF -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "defmacro"/PLACEHOLDER
+ "defvar"/PLACEHOLDER
+ "defadvice"/PLACEHOLDER
+ "defalias"/PLACEHOLDER
+ "defconst"/TOKEN
+
+END DEFINE
+
+DELETE PLACEHOLDER DEFUN -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER DEFUN -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Define a lisp function" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "(defun {identifier} ([defun_arguments]...)"
+ " [Documentation]"
+ " [interactive]"
+ " {statement}...)"
+
+END DEFINE
+
+DELETE PLACEHOLDER DEFUN_ARGUMENTS -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER DEFUN_ARGUMENTS -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="lisp defun arguments" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+ /PLACEHOLDER=IDENTIFIER
+
+END DEFINE
+
+DELETE PLACEHOLDER DEFVAR -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER DEFVAR -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Define a variable" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "(defvar {identifier} [value]"
+ " [Documentation])"
+
+END DEFINE
+
+DELETE PLACEHOLDER IDENTIFIER -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER IDENTIFIER -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=" " -
+ /TYPE=TERMINAL
+
+ "Just type in a legal Elisp identifier"
+
+END DEFINE
+
+DELETE PLACEHOLDER DOCUMENTATION -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER DOCUMENTATION -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="lisp function Documentation" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ ""[text]""
+
+END DEFINE
+
+DELETE PLACEHOLDER TEXT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER TEXT -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="lisp function template" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=" " -
+ /TYPE=TERMINAL
+
+ "Just type some text"
+
+END DEFINE
+
+DELETE PLACEHOLDER LOCAL_DEFINITIONS -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER LOCAL_DEFINITIONS -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="lisp local argument" -
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "({identifier} [value])"
+
+END DEFINE
+
+DELETE PLACEHOLDER VALUE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER VALUE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="lisp local argument initialisation value" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Type a valid initialisation value that you want to use"
+
+END DEFINE
+
+DELETE PLACEHOLDER STATEMENT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER STATEMENT -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="lisp statement menu" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "let_statement"/PLACEHOLDER
+ "if_statement"/PLACEHOLDER
+ "progn_statement"/PLACEHOLDER
+ "plain_statement"/PLACEHOLDER
+ "cond_statement"/PLACEHOLDER
+ "while_statement"/PLACEHOLDER
+ "setq_stmt"/PLACEHOLDER
+ "catch_stmt"/PLACEHOLDER
+ "throw"/TOKEN
+ "unless"/TOKEN
+ "when"/TOKEN
+ "dolist"/TOKEN
+ "dotimes"/TOKEN
+ "error"/TOKEN
+ "signal"/TOKEN
+ "condition-case"/PLACEHOLDER
+ "unwind-protect"/PLACEHOLDER
+ "property-list-stmt"/PLACEHOLDER/NOFOLLOW
+ "symbols"/PLACEHOLDER/NOFOLLOW
+ "sequences"/PLACEHOLDER/NOFOLLOW
+ "association_lists"/PLACEHOLDER/NOFOLLOW
+ "boolean-vectors"/PLACEHOLDER/NOFOLLOW
+ "arrays"/PLACEHOLDER/NOFOLLOW
+ "lists-sets"/PLACEHOLDER/NOFOLLOW
+ "string-stmts"/PLACEHOLDER/NOFOLLOW
+
+END DEFINE
+
+DELETE PLACEHOLDER IF_STATEMENT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER IF_STATEMENT -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="if statement" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "(if {condition}"
+ " {statement}"
+ " [statement]...)"
+
+END DEFINE
+
+DELETE PLACEHOLDER LET_STATEMENT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER LET_STATEMENT -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="let statement" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "(let ([local_definitions]...)"
+ " {statement}...)"
+
+END DEFINE
+
+DELETE PLACEHOLDER PROGN_STATEMENT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER PROGN_STATEMENT -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="progn statement" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "(progn"
+ " {statement}...)"
+
+END DEFINE
+
+DELETE PLACEHOLDER PLAIN_STATEMENT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER PLAIN_STATEMENT -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="plain statement" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "({function} [fun_arguments]...)"
+
+END DEFINE
+
+DELETE PLACEHOLDER FUN_ARGUMENTS -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER FUN_ARGUMENTS -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="arguments to a function call" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /PLACEHOLDER=IDENTIFIER
+
+END DEFINE
+
+DELETE PLACEHOLDER FUNCTION -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER FUNCTION -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="function call" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Type in a Lisp function name ie setq, assoc etc"
+
+END DEFINE
+
+
+DELETE PLACEHOLDER COND_STATEMENT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER COND_STATEMENT -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="cond statement" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "(cond {cond_alternative}...)"
+
+END DEFINE
+
+DELETE PLACEHOLDER COND_ALTERNATIVE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER COND_ALTERNATIVE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="cond alternative statement" -
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "({condition}"
+ " {statement}...)"
+
+END DEFINE
+
+DELETE PLACEHOLDER WHILE_STATEMENT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER WHILE_STATEMENT -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="While statement" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "(while {condition}"
+ " {statement}...)"
+
+END DEFINE
+
+DELETE PLACEHOLDER CONDITION -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER CONDITION -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=" " -
+ /TYPE=TERMINAL
+
+ "Just type a condition"
+
+END DEFINE
+
+DELETE PLACEHOLDER DEFADVICE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER DEFADVICE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="lisp advice template" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "(defadvice {identifier} ({ad_type} {identifier} [ad_flag]...)"
+ " [Documentation]"
+ " [interactive]"
+ " {statement}...)"
+
+END DEFINE
+
+DELETE PLACEHOLDER DEFMACRO -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER DEFMACRO -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Define a macro" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "(defmacro {identifier} ([fun_arguments])"
+ " [Documentation]"
+ " [interactive]"
+ " {statement}...)"
+
+END DEFINE
+
+DELETE PLACEHOLDER DEFALIAS -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER DEFALIAS -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Define an alias" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "(defalias '{identifier} '{identifier})"
+
+END DEFINE
+
+DELETE PLACEHOLDER AD_FLAG -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER AD_FLAG -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="lisp advice type menu" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=" " -
+ /TYPE=MENU
+
+ "activate"
+ "protect"
+ "compile"
+ "preactivate"
+ "disable"
+
+
+END DEFINE
+
+DELETE PLACEHOLDER INTERACTIVE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER INTERACTIVE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="lisp interactive statement" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "(interactive [interactive_string])"
+
+END DEFINE
+
+DELETE PLACEHOLDER INTERACTIVE_STRING -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER INTERACTIVE_STRING -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="lisp function Documentation" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ ""[text]""
+
+END DEFINE
+
+DELETE PLACEHOLDER AD_TYPE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER AD_TYPE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="lisp advice type menu" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "before"
+ "around"
+ "after"
+
+END DEFINE
+
+DELETE TOKEN DEFUN -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN DEFUN -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=DEFUN
+
+END DEFINE
+
+DELETE TOKEN DEFVAR -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN DEFVAR -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=DEFVAR
+
+END DEFINE
+
+DELETE TOKEN DEFCONST -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN DEFCONST -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Define a const expression"
+
+ "(defconst {identifier} [value]"
+ " [Documentation])"
+
+END DEFINE
+
+DELETE TOKEN DEFMACRO -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN DEFMACRO -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=DEFMACRO
+
+END DEFINE
+
+DELETE TOKEN DEFADVICE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN DEFADVICE -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=DEFADVICE
+
+END DEFINE
+
+DELETE TOKEN DEFALIAS -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN DEFALIAS -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=DEFALIAS
+
+END DEFINE
+
+DELETE TOKEN DF -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN DF -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=DEFUN
+
+END DEFINE
+
+DELETE TOKEN DV -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN DV -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=DEFVAR
+
+END DEFINE
+
+DELETE TOKEN DA -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN DA -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=DEFADVICE
+
+END DEFINE
+
+DELETE TOKEN IF -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN IF -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=IF_STATEMENT
+
+END DEFINE
+
+DELETE TOKEN PROGN -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN PROGN -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=PROGN_STATEMENT
+
+END DEFINE
+
+DELETE TOKEN COND -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN COND -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=COND_STATEMENT
+
+END DEFINE
+
+DELETE TOKEN WHILE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN WHILE -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=WHILE_STATEMENT
+
+END DEFINE
+
+DELETE PLACEHOLDER CATCH_STMT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER CATCH_STMT -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "(catch '{catch-name}"
+ " {statement}...)"
+
+END DEFINE
+
+DELETE PLACEHOLDER CATCH-NAME -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER CATCH-NAME -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter a valid Elisp name for the throw to identify"
+
+END DEFINE
+
+DELETE TOKEN CATCH -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN CATCH -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=CATCH_STMT
+
+END DEFINE
+
+DELETE PLACEHOLDER SETQ_STMT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER SETQ_STMT -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "(setq {variable} {statement})"
+
+END DEFINE
+
+DELETE PLACEHOLDER VARIABLE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER VARIABLE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter an elisp variable name."
+
+END DEFINE
+
+DELETE TOKEN SET -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN SET -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=SETQ_STMT -
+
+END DEFINE
+
+DELETE PLACEHOLDER DEFCUSTOM -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER DEFCUSTOM -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "(defcustom {variable} {default-value}"
+ " "{documentation}""
+ " {custom-type}..."
+ " :group {group-name})"
+
+END DEFINE
+
+DELETE PLACEHOLDER COMPOSITE-TYPE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER COMPOSITE-TYPE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "(restricted-sexp :match-alternatives ({criteria}))"
+ "(cons {car-type} {cdr-type}"
+ "(list {element-types}...)"
+ "(vector {element-types}...)"
+ "(choice {alternative-types}...)"
+ "("
+
+END DEFINE
+
+DELETE PLACEHOLDER CDR-TYPE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER CDR-TYPE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+ /PLACEHOLDER=simple-type
+
+ "Enter a valid CDR Type i.e. symbol"
+
+END DEFINE
+
+
+DELETE PLACEHOLDER CAR-TYPE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER CAR-TYPE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter a car type i.e. string, integer etc"
+
+END DEFINE
+
+
+DELETE PLACEHOLDER CRITERIA -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER CRITERIA -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "This should be a list and each element should be one of these possibilities:"
+ " "
+ "predicate - that is, a function of one argument that has no"
+ " side effects, and returns either `nil' or non-`nil' according"
+ " to the argument. Using a predicate in the list says that"
+ " objects for which the predicate returns non-`nil' are"
+ " acceptable."
+ ""
+ "quoted constant--that is, `'OBJECT'. This sort of element"
+ " in the list says that OBJECT itself is an acceptable value."
+ " For example,"
+ ""
+ " (restricted-sexp :match-alternatives"
+ " (integerp 't 'nil))"
+ ""
+ " allows integers, `t' and `nil' as legitimate values."
+
+END DEFINE
+
+DELETE PLACEHOLDER ELEMENT-TYPES -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER ELEMENT-TYPES -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=SIMPLE-TYPE
+
+END DEFINE
+
+DELETE PLACEHOLDER ALTERNATIVE-TYPES -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER ALTERNATIVE-TYPES -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "alternative"/PLACEHOLDER
+ "simple-type"/PLACEHOLDER
+ "constant"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER ALTERNATIVE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER ALTERNATIVE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "({simple-type} :tag "[text]")"
+
+END DEFINE
+
+DELETE PLACEHOLDER CONSTANT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER CONSTANT -
+ /STLANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "(const {value})"
+ "(const :tag "[text]" {value})"
+ "(other :tag "[text]" {value})"
+ "(function-item {function})"
+ "(variable-item {variable})"
+ "(set {elements}...)"
+ "(repeat {element-type})"
+
+END DEFINE
+
+DELETE PLACEHOLDER VALUE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER VALUE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter a value such as nil or t or 'anything else'"
+
+END DEFINE
+
+
+DELETE PLACEHOLDER SIMPLE-TYPE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER SIMPLE-TYPE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "'(integer)"
+ "'(boolean)"
+ "'(sexp)"
+ "'(number)"
+ "'(string)"
+ "'(regexp)"
+ "'(character)"
+ "'(file)"
+ "'(file :must-match t)"
+ "'(directory)"
+ "'(hook)"
+ "'(symbol)"
+ "'(function)"
+ "'(variable)"
+ "'(face)"
+
+END DEFINE
+
+
+DELETE PLACEHOLDER C-TYPE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER C-TYPE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "simple-type"/PLACEHOLDER
+ "composite-type"/PLACEHOLDER
+ "type-keywords"/PLACEHOLDER
+
+END DEFINE
+
+
+DELETE PLACEHOLDER CUSTOM-TYPE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER CUSTOM-TYPE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ ":type {c-type}"
+
+END DEFINE
+
+
+DELETE PLACEHOLDER DEFAULT-VALUE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER DEFAULT-VALUE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter a default value i.e. t, nil, "diff""
+
+END DEFINE
+
+
+DELETE PLACEHOLDER VARIABLE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER VARIABLE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter a variable name"
+
+END DEFINE
+
+
+DELETE TOKEN UNLESS -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN UNLESS -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="" -
+
+ "(unless {condition}"
+ " {statement}...)"
+
+END DEFINE
+
+DELETE TOKEN WHEN -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN WHEN -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="" -
+
+ "(when {condition}"
+ " {statement}...)"
+
+END DEFINE
+
+DELETE TOKEN DOLIST -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN DOLIST -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Iterate over a list" -
+
+ "(dolist ({var} {list} [result])"
+ " {statement}...)"
+
+END DEFINE
+
+DELETE PLACEHOLDER VAR -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER VAR -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter a variable name"
+
+END DEFINE
+
+DELETE PLACEHOLDER LIST -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER LIST -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the name of a list or an actual list i.e. (2 3)"
+
+END DEFINE
+
+DELETE PLACEHOLDER RESULT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER RESULT -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "nil"
+ "var"/PLACEHOLDER
+ "expression"/PLACEHOLDER
+
+END DEFINE
+
+DELETE TOKEN DOTIMES -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN DOTIMES -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Repeat a set of statements a fixed number of times." -
+
+ "(dotimes ({var} {count} [result])"
+ " {statement}...)"
+
+END DEFINE
+
+DELETE PLACEHOLDER COUNT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER COUNT -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the number of times the loop should repeat."
+
+END DEFINE
+
+DELETE TOKEN THROW -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN THROW -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="" -
+
+ "(throw {catch-name} {result})"
+
+END DEFINE
+
+DELETE TOKEN ERROR -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN ERROR -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Error Statement" -
+
+ "(error {format-string} [rest_args])"
+
+END DEFINE
+
+DELETE PLACEHOLDER FORMAT-STRING -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER FORMAT-STRING -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="String format" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ ""{text}""
+
+END DEFINE
+
+DELETE TOKEN SIGNAL -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN SIGNAL -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Signal an error" -
+
+ "(signal {err-symbol} {data})"
+
+END DEFINE
+
+DELETE PLACEHOLDER ERR-SYMBOL -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER ERR-SYMBOL -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Error Symbol i.e. 'wrong-number-of-arguments" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter an error symbol i.e. 'wong-number-of-arguments."
+
+END DEFINE
+
+DELETE PLACEHOLDER DATA -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER DATA -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="List of addition Lisp objects relevant to the error." -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter a list of additional Lisp objects relevant to the error"
+ "i.e. '(x y) or '("My unknown error condition")"
+
+END DEFINE
+
+DELETE PLACEHOLDER CONDITION-CASE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER CONDITION-CASE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Establish error handlers around protected forms" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "(condition-case [var]"
+ " {protected-forms}"
+ " {handlers}...)"
+
+END DEFINE
+
+DELETE PLACEHOLDER PROTECTED-FORMS -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER PROTECTED-FORMS -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=STATEMENT
+
+END DEFINE
+
+DELETE PLACEHOLDER HANDLERS -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER HANDLERS -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="condition-case handlers" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "(({error-cond-name}...)"
+ " {statement}...)"
+
+END DEFINE
+
+DELETE PLACEHOLDER ERROR-COND-NAME -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER ERROR-COND-NAME -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Name of the error condition" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the name of an error condition i.e. arith-error, file-error"
+
+END DEFINE
+
+DELETE PLACEHOLDER REST_ARGS -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER REST_ARGS -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the arguments for the format string."
+
+END DEFINE
+
+DELETE PLACEHOLDER UNWIND-PROTECT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER UNWIND-PROTECT -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Return a data structure to a consistant state in the event of an error" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "(unwind-protect"
+ " {statement}..."
+ " {cleanup-forms})"
+
+END DEFINE
+
+DELETE PLACEHOLDER CLEANUP-FORMS -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER CLEANUP-FORMS -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=STATEMENT
+
+END DEFINE
+
+DELETE PLACEHOLDER PROPERTY-LIST-STMT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER PROPERTY-LIST-STMT -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Property List Statements" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "(symbol-plist {symbol})"
+ "(setplist {symbol} {plist})"
+ "(get {symbol} {property})"
+ "(put {symbol} {property} {value})"
+
+END DEFINE
+
+DELETE PLACEHOLDER SYMBOL -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER SYMBOL -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Emacs variable" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the name of a symbol i.e. 'foo"
+
+END DEFINE
+
+DELETE PLACEHOLDER PLIST -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER PLIST -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Property List" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter a property list i.e. '(a 1 b (2 3) c nil)"
+
+END DEFINE
+
+DELETE PLACEHOLDER PROPERTY -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER PROPERTY -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Property" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the name of a property i.e. the property list is "
+ "'(a 1 b (2 3) c nil) then a property of this property list"
+ "would be 'a"
+
+END DEFINE
+
+DELETE PLACEHOLDER SYMBOLS -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER SYMBOLS -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Statements dealing with Symbols i.e. intern, make-symbol etc" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "(symbol-name {symbol})"
+ "(make-symbol {string})"
+ "(intern {symbol} [obarray])"
+ "(intern-soft {symbol} [obarray])"
+ "(mapatoms {function} [obarray])"
+ "(unintern {symbol} [obarray])"
+
+END DEFINE
+
+DELETE PLACEHOLDER OBARRAY -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER OBARRAY -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Name of an obarray" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the name of an obarray (declared using make-vector)"
+
+END DEFINE
+
+DELETE PLACEHOLDER FUNCTION -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER FUNCTION -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter a function name i.e. 'foo"
+
+END DEFINE
+
+DELETE PLACEHOLDER NAME -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER NAME -
+ /LANGUAGE="Emacs-Lisp" -
+ /PLACEHOLDER=TEXT
+
+END DEFINE
+
+DELETE PLACEHOLDER SEQUENCES -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER SEQUENCES -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Commands that operate on sequences i.e. length, elt" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "length"/TOKEN
+ "elt"/TOKEN
+ "(copy-sequence {var})"
+
+END DEFINE
+
+DELETE TOKEN LENGTH -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN LENGTH -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Return the length of the sequence" -
+
+ "(length {var})"
+
+END DEFINE
+
+DELETE TOKEN ELT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN ELT -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Return the 'index item from the sequence" -
+
+ "(elt {var} {index})"
+
+END DEFINE
+
+DELETE PLACEHOLDER INDEX -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER INDEX -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Index into the list/sequence - 0 is the first element"
+
+END DEFINE
+
+DELETE PLACEHOLDER ASSOCIATION_LISTS -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER ASSOCIATION_LISTS -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Association List commands i.e. assoc, copy-alist" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "assoc"/TOKEN
+ "rassoc"/TOKEN
+ "assq"/TOKEN
+ "rassq"/TOKEN
+ "assoc-default"/TOKEN
+ "copy-alist"/TOKEN
+ "assq-delete-all"/TOKEN
+
+END DEFINE
+
+DELETE TOKEN ASSQ-DELETE-ALL -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN ASSQ-DELETE-ALL -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Delete from alist all elements whose CAR is key, return alist" -
+
+ "(assq-delete-all {key} {alist})"
+
+END DEFINE
+
+DELETE TOKEN COPY-ALIST -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN COPY-ALIST -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Copy the alist" -
+
+ "(copy-alist {alist})"
+
+END DEFINE
+
+DELETE TOKEN ASSOC-DEFAULT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN ASSOC-DEFAULT -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Search alist for key using optional test function" -
+
+ "(assoc-default {key} {alist} [{function} {default-value}])"
+
+END DEFINE
+
+DELETE TOKEN RASSQ -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN RASSQ -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Similar to RASSOC except eq used instead of equal" -
+
+ "(rassq {value} {alist})"
+
+END DEFINE
+
+DELETE TOKEN ASSQ -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN ASSQ -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Similar to ASSOC except eq used" -
+
+ "(assq {key} {alist})"
+
+END DEFINE
+
+DELETE TOKEN RASSOC -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN RASSOC -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="return the first association with a value of value in the alist" -
+
+ "(rassoc {value} {alist})"
+
+END DEFINE
+
+DELETE TOKEN ASSOC -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN ASSOC -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Return the first association for key in the alist using equal" -
+
+ "(assoc {key} {alist})"
+
+END DEFINE
+
+DELETE PLACEHOLDER ALIST -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER ALIST -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Association list of the form ((a . 1) ("b" (2 3)))"
+
+END DEFINE
+
+DELETE PLACEHOLDER KEY -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER KEY -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Key to an alist" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter a key to an alist i.e. 'yellow"
+
+END DEFINE
+
+DELETE PLACEHOLDER STRING -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER STRING -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ ""{text}""
+
+END DEFINE
+
+DELETE PLACEHOLDER BOOLEAN-VECTORS -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER BOOLEAN-VECTORS -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Boolean vector commands" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "make-bool-vector"/TOKEN
+ "bool-vector-p"/TOKEN
+
+END DEFINE
+
+DELETE TOKEN MAKE-BOOL-VECTOR -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN MAKE-BOOL-VECTOR -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="" -
+
+ "(make-bool-vector {vect-length} {initial})"
+
+END DEFINE
+
+DELETE PLACEHOLDER INITIAL -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER INITIAL -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the initial value for each boolean element i.e. t or nil"
+
+END DEFINE
+
+
+DELETE PLACEHOLDER VECT-LENGTH -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER VECT-LENGTH -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter a length for the vector"
+
+END DEFINE
+
+DELETE PLACEHOLDER ARRAYS -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER ARRAYS -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Array commands" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "arrayp"/TOKEN
+ "aref"/TOKEN
+ "aset"/TOKEN
+ "fillarray"/TOKEN
+
+END DEFINE
+
+DELETE TOKEN FILLARRAY -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN FILLARRAY -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Fill array with object" -
+
+ "(fillarray {array} {object})"
+
+END DEFINE
+
+DELETE TOKEN ASET -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN ASET -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="set the indexth element of array to object" -
+
+ "(aset {array} {index} {object})"
+
+END DEFINE
+
+DELETE TOKEN ARRAYP -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN ARRAYP -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Test if an array" -
+
+ "(arrayp {object})"
+
+END DEFINE
+
+DELETE TOKEN AREF -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN AREF -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="return the indexth element of array" -
+
+ "(aref {array} {index})"
+
+END DEFINE
+
+DELETE PLACEHOLDER ARRAY -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER ARRAY -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter an array name"
+
+END DEFINE
+
+
+DELETE PLACEHOLDER OBJECT -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER OBJECT -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter an object name i.e. foo"
+
+END DEFINE
+
+
+DELETE PLACEHOLDER LISTS-SETS -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER LISTS-SETS -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Using lists as sets" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "memq"/TOKEN
+ "member"/TOKEN
+ "member-ignore-case"/TOKEN
+ "delq"/TOKEN
+ "delete"/TOKEN
+ "remove"/TOKEN
+ [menu placeholder body line]...
+
+END DEFINE
+
+DELETE TOKEN REMOVE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN REMOVE -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="non-destructively remove all objects in sequence" -
+
+ "(remove {object} {sequence})"
+
+END DEFINE
+
+DELETE TOKEN DELETE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN DELETE -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Destructively delete all object in sequence" -
+
+ "(delete {object} {sequence})"
+
+END DEFINE
+
+DELETE PLACEHOLDER SEQUENCE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE PLACEHOLDER SEQUENCE -
+ /LANGUAGE="Emacs-Lisp" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the name of a sequence i.e. 'foo"
+
+END DEFINE
+
+
+DELETE TOKEN MEMBER -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN MEMBER -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Test for membership using equal" -
+
+ "(member {object} {list})"
+
+END DEFINE
+
+DELETE TOKEN DELQ -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN DELQ -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Delete all object in the set/list using eq" -
+
+ "(delq {object} {list})"
+
+END DEFINE
+
+DELETE TOKEN MEMBER-IGNORE-CASE -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN MEMBER-IGNORE-CASE -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Ignore case when testing for membership (strings)" -
+
+ "(member-ignore-case {object} {list})"
+
+END DEFINE
+
+DELETE TOKEN MEMQ -
+ /LANGUAGE="Emacs-Lisp" -
+DEFINE TOKEN MEMQ -
+ /LANGUAGE="Emacs-Lisp" -
+ /DESCRIPTION="Test if object is a member of list" -
+
+ "(memq {object} {list})"
+
+END DEFINE
+
+DELETE LANGUAGE Template -
+ /LANGUAGE=Template
+
+[token_definition]... \ No newline at end of file
diff --git a/app-emacs/else-mode/files/LaTeX-cust.lse b/app-emacs/else-mode/files/LaTeX-cust.lse
new file mode 100644
index 0000000..dea1fc6
--- /dev/null
+++ b/app-emacs/else-mode/files/LaTeX-cust.lse
@@ -0,0 +1,128 @@
+;; Copyright (C) 1997,1998,1999,2000,2001 Peter Milliken
+;;
+;; Author: Peter Milliken <peterm@resmed.com.au>,
+;; <peterm@unwired.com.au>
+;; $Date: 2003/12/22 20:53:05 $
+;; Version: 1.7
+;; Keywords: language sensitive abbreviation template placeholder token
+;;
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;******************************************************************************
+;; These definitions are my personal customisations for the language. This is
+;; where you should place YOUR customisations.
+;;
+;; Sometimes there is a definition(s) in here that override definitions in the
+;; main language template file that are here to make that definition more
+;; "usable" - this is because I (primarily) try and generate/maintain the main
+;; .lse files from EBNF definitions of the language. Sometimes I just can't
+;; express the appropriate customisation in the EBNF and so I am forced to
+;; override the placeholder definition in this file.
+;;
+;; This entries in this file should be used as an example of how to create your
+;; own customisations. I would caution that you don't delete any definitions
+;; though until you are sure that your edit sessions will not be adversely
+;; affected. The best way to check out the effects of a delete is to "compile"
+;; (else-compile-buffer) the "delete" command for that definition (this will
+;; remove it from your edit session and you can nolonger access the definition
+;; until next you load language template files) and then see whether anything
+;; has been "lost" in your code generation ability i.e. say you think you don't
+;; need the definition for placeholder XXX, just place the following lines at
+;; the end of one of your source files (when ELSE is enabled for that buffer)
+;; and perform a compile (M-x else-compile-buffer) with the cursor positioned at
+;; the beginning of the line:
+;;
+;; DELETE PLACEHOLDER XXX -
+;; /LANGUAGE = "LaTeX" -
+;;
+;; This will delete definition XXX from memory.
+;;
+;;******************************************************************************
+
+DELETE PLACEHOLDER COMPILATION_UNIT -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER COMPILATION_UNIT -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "% $RCSfile[please_expand_me]$ $Revision[please_expand_me]$ $Date[please_expand_me]$"
+ "% $Source[please_expand_me]$
+ "\documentclass[[options]...]{article}"
+ "\usepackage[left=1.5cm,right=2.0cm,top=1.5cm,bottom=1.5cm]{geometry}"
+ "\usepackage{float,tabularx,lastpage,fancyhdr}"
+ "\usepackage[toc,page,title,titletoc,header]{appendix}"
+ "% The first page is spat out using the ``plain'' pagestyle, so re-define it so"
+ "% it print what we want on page 1."
+ "\fancypagestyle{plain}{%"
+ "\fancyhf{}"
+ "\fancyfoot[C]{\thepage\ of \pageref{LastPage}}"
+ "\fancyfoot[R]{Issue: {Issue_no} printed: \today}"
+ "\renewcommand{\headrulewidth}{0pt}"
+ "\renewcommand{\footrulewidth}{0pt}}"
+ "% Do this to make sure pages 2 - n do it as well :-)"
+ "\pagestyle{fancy}"
+ "\cfoot{\thepage\ of \pageref{LastPage}}"
+ "\rfoot{Issue: {Issue_No} printed: \today}"
+ "\newcommand{\ie}{i.e.\ }"
+ "\newcommand{\eg}{e.g.\ }"
+ "\newcommand{\smiley}{:-)}"
+ "{style}"
+
+END DEFINE
+
+DELETE PLACEHOLDER PLEASE_EXPAND_ME -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER PLEASE_EXPAND_ME -
+ /LANGUAGE="LaTeX" -
+ /TYPE=NONTERMINAL
+
+ ":"
+
+END DEFINE
+
+DELETE PLACEHOLDER AUTHOR_TEXT -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER AUTHOR_TEXT -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "Peter Milliken"
+
+END DEFINE
+
+DELETE PLACEHOLDER ISSUE_NO -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER ISSUE_NO -
+ /LANGUAGE="LaTeX" -
+ /AUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter an Issue No. of some kind ie Draft 01"
+
+END DEFINE
+
diff --git a/app-emacs/else-mode/files/LaTeX.lse b/app-emacs/else-mode/files/LaTeX.lse
new file mode 100644
index 0000000..0ebdc35
--- /dev/null
+++ b/app-emacs/else-mode/files/LaTeX.lse
@@ -0,0 +1,738 @@
+;; Copyright (C) 1997,1998,1999,2000,2001,2002,2003 Peter Milliken
+;;
+;; Author: Peter Milliken <peterm@resmed.com.au>,
+;; <peterm@unwired.com.au>
+;;
+;; Keywords: language sensitive abbreviation template placeholder token
+;;
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+
+DELETE LANGUAGE "LaTeX" -
+DEFINE LANGUAGE "LaTeX" -
+ /INITIAL_STRING="{compilation_unit}" -
+ /PUNCTUATION_CHARACTERS=",;()*.'" -
+ /SELF_INSERT_CHARACTERS=" `~!@#$%^&*(),.<>/?;:'[]{}=\-+|""
+ /VALID_IDENTIFIER_CHARACTERS="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789"
+ /INDENT_SIZE=2
+ /VERSION=1.10
+
+END DEFINE
+
+DELETE PLACEHOLDER STATEMENT -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER STATEMENT -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "list"/PLACEHOLDER
+ "section"/PLACEHOLDER
+ "subsection"/PLACEHOLDER
+ "subsubsection"/PLACEHOLDER
+ "verbatim_"/PLACEHOLDER
+ "quote"/PLACEHOLDER
+ "figure_"/PLACEHOLDER
+ "marginal_note"/PLACEHOLDER
+ "footnote"/PLACEHOLDER
+ "footnotemark"/PLACEHOLDER
+ "footnotetext"/PLACEHOLDER
+ "footnoterule"/PLACEHOLDER
+ "general_label"/PLACEHOLDER
+ "symbols"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER COMPILATION_UNIT -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER COMPILATION_UNIT -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\documentclass[[options]...]{article}"
+ "\newcommand{\ie}{i.e.\ }"
+ "\newcommand{\eg}{e.g.\ }"
+ "\newcommand{\smiley}{:-)}"
+ "{style}"
+
+END DEFINE
+
+DELETE PLACEHOLDER STYLE -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER STYLE -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "title"/PLACEHOLDER
+ "notitle"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER TITLE -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER TITLE -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\title{{title_text}}"
+ "\author{{author_text}}"
+ "\date{{date_text}}"
+ "\begin{document}"
+ "\maketitle"
+ "{statement}..."
+ "\end{document}"
+
+END DEFINE
+
+DELETE PLACEHOLDER NOTITLE -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER NOTITLE -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\begin{document}"
+ "{statement}..."
+ "\end{document}"
+
+END DEFINE
+
+DELETE PLACEHOLDER TEXT -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER TEXT -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Just type some text here, please"
+
+END DEFINE
+
+DELETE PLACEHOLDER OPTIONS -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER OPTIONS -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=HORIZONTAL -
+ /SEPARATOR=", " -
+ /TYPE=MENU
+
+ "a4paper"
+ "12pt"
+
+END DEFINE
+
+DELETE PLACEHOLDER SECTION -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER SECTION -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\section{{section_text}}"
+
+END DEFINE
+
+DELETE PLACEHOLDER SUBSECTION -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER SUBSECTION -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\subsection{{section_text}}"
+
+END DEFINE
+
+DELETE PLACEHOLDER SUBSUBSECTION -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER SUBSUBSECTION -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "\subsubsection{{section_text}}"
+
+END DEFINE
+
+DELETE PLACEHOLDER TITLE_TEXT -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER TITLE_TEXT -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter some title text, spaces are allowed"
+
+END DEFINE
+
+DELETE PLACEHOLDER SECTION_TEXT -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER SECTION_TEXT -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter some text for the section title, spaces are allowed"
+
+END DEFINE
+
+DELETE PLACEHOLDER AUTHOR_TEXT -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER AUTHOR_TEXT -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Either type your name here or redefine the placeholder to insert your name."
+
+END DEFINE
+
+DELETE PLACEHOLDER DATE_TEXT -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER DATE_TEXT -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the date ie 8th August 1997"
+
+END DEFINE
+
+DELETE PLACEHOLDER LIST -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER LIST -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "description_list"/PLACEHOLDER
+ "enumeration_list"/PLACEHOLDER
+ "itemise_list"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER DESCRIPTION_LIST -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER DESCRIPTION_LIST -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\begin{description}"
+ "{desc_list_item}..."
+ "\end{description}"
+ ""
+
+END DEFINE
+
+
+DELETE PLACEHOLDER DESC_LIST_ITEM -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER DESC_LIST_ITEM -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\item [{text}] {text}"
+ ""
+
+END DEFINE
+
+DELETE PLACEHOLDER ENUMERATION_LIST -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER ENUMERATION_LIST -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\begin{enumerate}"
+ "[item]..."
+ "\end{enumerate}"
+ ""
+
+END DEFINE
+
+DELETE PLACEHOLDER ITEM -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER ITEM -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\item {text}"
+ ""
+
+END DEFINE
+
+DELETE PLACEHOLDER ITEMISE_LIST -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER ITEMISE_LIST -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\begin{itemize}"
+ "[item]..."
+ "\end{itemize}"
+
+END DEFINE
+
+DELETE PLACEHOLDER VERBATIM_ -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER VERBATIM_ -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Provide the verbatim construct" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\begin{verbatim}"
+ "{text}"
+ "\end{verbatim}"{language_name}
+
+END DEFINE
+
+DELETE PLACEHOLDER FIGURE_ -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER FIGURE_ -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\begin{figure} [position]"
+ "[statement]..."
+ "[caption]"
+ "\end{figure}"
+
+END DEFINE
+
+DELETE PLACEHOLDER TABLE_ -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER TABLE_ -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "\begin{table} [position]"
+ "\begin{tabularx}{{width}}{{preamble}}
+ "[statement]..."
+ "[caption]"
+ "\end{table}"
+
+END DEFINE
+
+DELETE PLACEHOLDER CAPTION -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER CAPTION -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\caption[text]{{text}} [general_label]"
+
+END DEFINE
+
+DELETE PLACEHOLDER GENERAL_LABEL -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER GENERAL_LABEL -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Used to generate \label{text}" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\label{{text}}"
+
+END DEFINE
+
+DELETE PLACEHOLDER POSITION -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER POSITION -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "[h]"
+ "[ht]"
+ "[t]"
+ "[b]"
+ "[hb]"
+ "[H]"
+ "[p]"
+
+END DEFINE
+
+DELETE PLACEHOLDER MARGINAL_NOTE -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER MARGINAL_NOTE -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Generate a marginal note." -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\marginpar{{text}}"
+
+END DEFINE
+
+DELETE PLACEHOLDER FOOTNOTE -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER FOOTNOTE -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Generate a foot note" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\footnote[footnotenum]{{text}}"
+
+END DEFINE
+
+DELETE PLACEHOLDER FOOTNOTENUM -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER FOOTNOTENUM -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="The number of the footnote" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "[{foot_number}]"
+
+END DEFINE
+
+DELETE PLACEHOLDER FOOT_NUMBER -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER FOOT_NUMBER -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter a footnote number."
+
+END DEFINE
+
+DELETE PLACEHOLDER FOOTNOTEMARK -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER FOOTNOTEMARK -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Generate a foot note mark. Used with footnotetext." -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\footnotemark[footnotenum]"
+
+END DEFINE
+
+DELETE PLACEHOLDER FOOTNOTETEXT -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER FOOTNOTETEXT -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Used with footnotemark to footnote text." -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\footnotetext[footnotenum]{{text}}"
+
+END DEFINE
+
+DELETE PLACEHOLDER FOOTNOTERULE -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER FOOTNOTERULE -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Draws line separating footnote text from main text." -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\footnoterule"
+
+END DEFINE
+
+DELETE PLACEHOLDER SYMBOLS -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER SYMBOLS -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Special symbols" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "copyright"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER COPYRIGHT -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER COPYRIGHT -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Copyright symbol" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\copyright"
+
+END DEFINE
+
+DELETE PLACEHOLDER WIDTH -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER WIDTH -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter a width parameter."
+
+END DEFINE
+
+DELETE PLACEHOLDER PREAMBLE -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER PREAMBLE -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="|" -
+ /TYPE=TERMINAL
+
+ "Enter a preamble."
+
+END DEFINE
+
+[placeholder_definition]...
+
+
+END DEFINE
+
+DELETE PLACEHOLDER LABEL -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER LABEL -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "[{label_text}]"
+
+END DEFINE
+
+DELETE PLACEHOLDER LABEL_TEXT -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER LABEL_TEXT -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "This is the preliminary stuff followed by the style"
+ "ie EX i - will generate lists with 'EX' and then a Roman numeral"
+
+END DEFINE
+
+DELETE PLACEHOLDER QUOTE -
+ /LANGUAGE="LaTeX" -
+DEFINE PLACEHOLDER QUOTE -
+ /LANGUAGE="LaTeX" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Provide a quote construct" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "\begin{quote}"
+ "``[text]''"
+ "\end{quote}"
+ ""
+
+END DEFINE
+
+DELETE TOKEN QU -
+ /LANGUAGE="LaTeX" -
+DEFINE TOKEN QU -
+ /LANGUAGE="LaTeX" -
+ /PLACEHOLDER=QUOTE
+
+END DEFINE
+
+DELETE TOKEN LD -
+ /LANGUAGE="LaTeX" -
+DEFINE TOKEN LD -
+ /LANGUAGE="LaTeX" -
+ /PLACEHOLDER=DESCRIPTION_LIST
+
+END DEFINE
+
+DELETE TOKEN LE -
+ /LANGUAGE="LaTeX" -
+DEFINE TOKEN LE -
+ /LANGUAGE="LaTeX" -
+ /PLACEHOLDER=ENUMERATION_LIST
+
+END DEFINE
+
+DELETE TOKEN LI -
+ /LANGUAGE="LaTeX" -
+DEFINE TOKEN LI -
+ /LANGUAGE="LaTeX" -
+ /PLACEHOLDER=ITEMISE_LIST
+
+END DEFINE
+
+DELETE TOKEN VB -
+ /LANGUAGE="LaTeX" -
+DEFINE TOKEN VB -
+ /LANGUAGE="LaTeX" -
+ /PLACEHOLDER=VERBATIM_
+
+END DEFINE
+
+DELETE TOKEN IT -
+ /LANGUAGE="LaTeX" -
+DEFINE TOKEN IT -
+ /LANGUAGE="LaTeX" -
+ /DESCRIPTION="" - -
+
+ "\textit{{text}}"
+
+END DEFINE
+
+DELETE TOKEN BF -
+ /LANGUAGE="LaTeX" -
+DEFINE TOKEN BF -
+ /LANGUAGE="LaTeX" -
+ /DESCRIPTION="" - -
+
+ "\textbf{{text}}"
+
+END DEFINE
+
+DELETE TOKEN FIG -
+ /LANGUAGE="LaTeX" -
+DEFINE TOKEN FIG -
+ /LANGUAGE="LaTeX" -
+ /PLACEHOLDER=FIGURE_
+
+END DEFINE
+
+[token_definition]...
+[placeholder_definition]...
+
+DELETE TOKEN TB -
+ /LANGUAGE="LaTeX" -
+DEFINE TOKEN TB -
+ /LANGUAGE="LaTeX" -
+ /PLACEHOLDER=TABLE_
+
+END DEFINE
+
diff --git a/app-emacs/else-mode/files/Python-cust.lse b/app-emacs/else-mode/files/Python-cust.lse
new file mode 100644
index 0000000..15624cc
--- /dev/null
+++ b/app-emacs/else-mode/files/Python-cust.lse
@@ -0,0 +1,254 @@
+;; Copyright (C) 2000,2001,2002,2003 Peter Milliken
+;;
+;; Author: Peter Milliken <peterm@resmed.com.au>,
+;; <peterm@unwired.com.au>
+;; Version: 1.1
+;; Keywords: language sensitive abbreviation template placeholder token
+;;
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;******************************************************************************
+;; These definitions are my personal customisations for the language. This is
+;; where you should place YOUR customisations.
+;;
+;; Sometimes there is a definition(s) in here that override definitions in the
+;; main language template file that are here to make that definition more
+;; "usable" - this is because I (primarily) try and generate/maintain the main
+;; .lse files from EBNF definitions of the language. Sometimes I just can't
+;; express the appropriate customisation in the EBNF and so I am forced to
+;; override the placeholder definition in this file.
+;;
+;; This entries in this file should be used as an example of how to create your
+;; own customisations. I would caution that you don't delete any definitions
+;; though until you are sure that your edit sessions will not be adversely
+;; affected. The best way to check out the effects of a delete is to "compile"
+;; (else-compile-buffer) the "delete" command for that definition (this will
+;; remove it from your edit session and you can nolonger access the definition
+;; until next you load language template files) and then see whether anything
+;; has been "lost" in your code generation ability i.e. say you think you don't
+;; need the definition for placeholder XXX, just place the following lines at
+;; the end of one of your source files (when ELSE is enabled for that buffer)
+;; and perform a compile (M-x else-compile-buffer) with the cursor positioned at
+;; the beginning of the line:
+;;
+;; DELETE PLACEHOLDER XXX -
+;; /LANGUAGE = "Python" -
+;;
+;; This will delete definition XXX from memory.
+;;
+;;******************************************************************************
+
+
+DEFINE LANGUAGE Python -
+ /VALID_IDENTIFIER_CHARACTERS="#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789"
+ /INDENT_SIZE=2
+
+END DEFINE
+
+DELETE PLACEHOLDER ", IDENTIFIER" -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER ", IDENTIFIER" -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ ", {identifier}"
+
+END DEFINE
+
+
+DELETE PLACEHOLDER CALL_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER CALL_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{primary} ([parameter_association]...);"
+
+END DEFINE
+
+DELETE PLACEHOLDER FUNCDEF -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER FUNCDEF -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "def {identifier} ([defparameter]...):"
+ " [document_string]"
+ " {statement}..."
+ ""
+
+END DEFINE
+
+DELETE PLACEHOLDER CLASSDEF -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER CLASSDEF -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "class {classname} [inheritance]:"
+ " [init_def]"
+ " "
+ " [class_funcdef]..."
+ " "
+
+END DEFINE
+
+DELETE PLACEHOLDER INIT_DEF -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER INIT_DEF -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Provides an __init__ def." -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "def __init__ (self, [defparameter]...):"
+ " [document_string]"
+ " {statement}..."
+ ""
+
+END DEFINE
+
+DELETE PLACEHOLDER CLASS_FUNCDEF -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER CLASS_FUNCDEF -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Function definition when within a class" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "def {identifier} (self, [defparameter]...):"
+ " [document_string]"
+ " {statement}..."
+ " "
+
+END DEFINE
+
+
+DELETE PLACEHOLDER MY_CLASSDEF -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER MY_CLASSDEF -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "class {classname} ({superclass}...):"
+ ""
+ " def __init__(self):"
+ " {superclass}._init_(self)"
+ " [class_funcdef]..."
+ " "
+
+END DEFINE
+
+DELETE PLACEHOLDER SUPERCLASS -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER SUPERCLASS -
+ /LANGUAGE="Python" -
+ /AUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Type in the name of the superclass."
+
+END DEFINE
+
+DELETE PLACEHOLDER COMPILATION_UNIT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER COMPILATION_UNIT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ """"[text]...""""
+ "[import_stmt]..."
+ "{statement}..."
+ "[test_statement]"
+
+END DEFINE
+
+DELETE TOKEN CD -
+ /LANGUAGE="Python" -
+DEFINE TOKEN CD -
+ /LANGUAGE="Python" -
+ /DESCRIPTION="" -
+
+ "def {member_name} (self, value = None):"
+ " [document_string]"
+ " if value == {member_name}:"
+ " return self.{member_name}"
+ " else:"
+ " self.{member_name} = value"
+ " self.Dump()"
+
+END DEFINE
+
+DELETE PLACEHOLDER MEMBER_NAME -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER MEMBER_NAME -
+ /LANGUAGE="Python" -
+ /AUTO_SUBSTITUTE -
+ /SUBSTITUTE_COUNT=4
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the member name of the class"
+
+END DEFINE
+
+DELETE PLACEHOLDER TEST_STATEMENT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER TEST_STATEMENT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "if __name__ == '__main__':"
+ " {statement}..."
+
+END DEFINE
diff --git a/app-emacs/else-mode/files/Python.lse b/app-emacs/else-mode/files/Python.lse
new file mode 100644
index 0000000..0c88167
--- /dev/null
+++ b/app-emacs/else-mode/files/Python.lse
@@ -0,0 +1,1307 @@
+;; Copyright (C) 1997,1998,1999,2000,2001,2002,2003 Peter Milliken
+;;
+;; Author: Peter Milliken <peterm@resmed.com.au>,
+;; <peterm@unwired.com.au>
+;;
+;; Keywords: language sensitive abbreviation template placeholder token
+;;
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+DELETE LANGUAGE Python -
+DEFINE LANGUAGE Python -
+ /INITIAL_STRING="{compilation_unit}" -
+ /PUNCTUATION_CHARACTERS="*,()" -
+ /SELF_INSERT_CHARACTERS=" `~!@#$%^&*(),.<>/?;:'[]{}=\-+|"
+ /VALID_IDENTIFIER_CHARACTERS="#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789"
+ /INDENT_SIZE=2 -
+ /VERSION=1.10 -
+
+END DEFINE
+
+DELETE PLACEHOLDER FORMAL_PARAMETER_NAME -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER FORMAL_PARAMETER_NAME -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid formal_parameter_name"
+
+END DEFINE
+
+DELETE PLACEHOLDER TRY_FIN_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER TRY_FIN_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "try:"
+ " {statement}..."
+ "finally:"
+ " {statement}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER TRY_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER TRY_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "try_exc_stmt"/PLACEHOLDER
+ "try_fin_stmt"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER "{EXPRESSION}... [, {IDENTIFIER}]" -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER {EXPRESSION}... [, {IDENTIFIER}] -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{expression}... [, {identifier}]"
+
+END DEFINE
+
+DELETE PLACEHOLDER IMPORTS -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER IMPORTS -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{import_stmt}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER TEXT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER TEXT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid text"
+
+END DEFINE
+
+DELETE PLACEHOLDER SUBLIST -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER SUBLIST -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{parameter}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER MODULE -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER MODULE -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid module"
+
+END DEFINE
+
+DELETE PLACEHOLDER IF_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER IF_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "if {expression}:"
+ " {statement}..."
+ "[elif_part]..."
+ "[else_part]"
+
+END DEFINE
+
+DELETE PLACEHOLDER CLASSNAME -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER CLASSNAME -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+ /PLACEHOLDER=IDENTIFIER -
+
+END DEFINE
+
+DELETE PLACEHOLDER TRY_EXC_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER TRY_EXC_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "try:"
+ " {statement}..."
+ "[except_part]..."
+ "[else_part]"
+
+END DEFINE
+
+DELETE PLACEHOLDER RETURN_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER RETURN_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "return [expression]..."
+
+END DEFINE
+
+DELETE PLACEHOLDER "= {EXPRESSION}" -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER = {EXPRESSION} -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "= {expression}"
+
+END DEFINE
+
+DELETE PLACEHOLDER ENCLOSURE -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER ENCLOSURE -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "parenth_form"/PLACEHOLDER
+ "list_display"/PLACEHOLDER
+ "dict_display"/PLACEHOLDER
+ "string_conversion"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER DEFPARAMETER -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER DEFPARAMETER -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=", " -
+ /TYPE=MENU -
+
+ "{parameter} [= {expression}]"
+ "*{identifier}"
+ "**{identifier}"
+
+END DEFINE
+
+DELETE PLACEHOLDER "{FORMAL_PARAMETER_NAME} =" -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER {FORMAL_PARAMETER_NAME} = -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{formal_parameter_name} ="
+
+END DEFINE
+
+DELETE PLACEHOLDER BREAK_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER BREAK_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "break"
+
+END DEFINE
+
+DELETE PLACEHOLDER IMPORT_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER IMPORT_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "import {module} [as {name}], [module_as_name]..."
+ "from {module} import {identifier} [as {name}], [identifier_as_name]..."
+ "from {module} import *"
+
+END DEFINE
+
+DELETE PLACEHOLDER COMMENT_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER COMMENT_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "# {text}"
+
+END DEFINE
+
+DELETE PLACEHOLDER FLOATNUMBER -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER FLOATNUMBER -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid floatnumber"
+
+END DEFINE
+
+DELETE PLACEHOLDER ELIF_PART -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER ELIF_PART -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "elif {expression}:"
+ " {statement}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER CONTINUE_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER CONTINUE_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "continue"
+
+END DEFINE
+
+DELETE PLACEHOLDER EXCEPT_PART -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER EXCEPT_PART -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "except [exception_arguments]:"
+ " {statement}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER NAME -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER NAME -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid name"
+
+END DEFINE
+
+DELETE PLACEHOLDER PRINT_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER PRINT_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "print [expression]..."
+
+END DEFINE
+
+DELETE PLACEHOLDER LITERAL -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER LITERAL -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "stringliteral"/PLACEHOLDER
+ "integer"/PLACEHOLDER
+ "longinteger"/PLACEHOLDER
+ "floatnumber"/PLACEHOLDER
+ "imagnumber"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER ASSIGNMENT_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER ASSIGNMENT_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{target} = {expression}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER EXPRESSION_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER EXPRESSION_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{expression}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER ARGUMENT_LIST -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER ARGUMENT_LIST -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{parameter_association}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER STATEMENT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER STATEMENT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "if_stmt"/PLACEHOLDER
+ "while_stmt"/PLACEHOLDER
+ "for_stmt"/PLACEHOLDER
+ "try_stmt"/PLACEHOLDER
+ "funcdef"/PLACEHOLDER
+ "classdef"/PLACEHOLDER
+ "call_stmt"/PLACEHOLDER
+ "expression_stmt"/PLACEHOLDER
+ "assert_stmt"/PLACEHOLDER
+ "assignment_stmt"/PLACEHOLDER
+ "pass_stmt"/PLACEHOLDER
+ "del_stmt"/PLACEHOLDER
+ "print_stmt"/PLACEHOLDER
+ "return_stmt"/PLACEHOLDER
+ "yield_stmt"/PLACEHOLDER
+ "raise_stmt"/PLACEHOLDER
+ "break_stmt"/PLACEHOLDER
+ "continue_stmt"/PLACEHOLDER
+ "import_stmt"/PLACEHOLDER
+ "global_stmt"/PLACEHOLDER
+ "exec_stmt"/PLACEHOLDER
+ "comment_stmt"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER STRING_CONVERSION -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER STRING_CONVERSION -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid string_conversion"
+
+END DEFINE
+
+DELETE PLACEHOLDER SUBSCRIPTION -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER SUBSCRIPTION -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid subscription"
+
+END DEFINE
+
+DELETE PLACEHOLDER PARAMETER -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER PARAMETER -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=", " -
+ /TYPE=MENU -
+
+ "identifier"/PLACEHOLDER
+ "({sublist})"
+
+END DEFINE
+
+DELETE PLACEHOLDER IMAGNUMBER -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER IMAGNUMBER -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid imagnumber"
+
+END DEFINE
+
+DELETE PLACEHOLDER EXEC_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER EXEC_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "exec {expression} [in {expression}...]"
+
+END DEFINE
+
+DELETE PLACEHOLDER PARAMETER_ASSOCIATION -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER PARAMETER_ASSOCIATION -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=", " -
+ /TYPE=NONTERMINAL -
+
+ "[{formal_parameter_name} =] {expression}"
+
+END DEFINE
+
+DELETE PLACEHOLDER ATTRIBUTEREF -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER ATTRIBUTEREF -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid attributeref"
+
+END DEFINE
+
+DELETE PLACEHOLDER LONGINTEGER -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER LONGINTEGER -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid longinteger"
+
+END DEFINE
+
+DELETE PLACEHOLDER PARENTH_FORM -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER PARENTH_FORM -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "([expression]...)"
+
+END DEFINE
+
+DELETE PLACEHOLDER CALL_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER CALL_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{primary} [parameter_list]"
+
+END DEFINE
+
+DELETE PLACEHOLDER IDENTIFIER_AS_NAME -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER IDENTIFIER_AS_NAME -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=HORIZONTAL -
+ /SEPARATOR=", " -
+ /TYPE=NONTERMINAL -
+
+ "{identifier} [as {name}]"
+
+END DEFINE
+
+DELETE PLACEHOLDER CLASSDEF -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER CLASSDEF -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "class {classname}[inheritance]:"
+ " {statement}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER COMPILATION_UNIT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER COMPILATION_UNIT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "[import_stmt]..."
+ "{statement}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER PRIMARY -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER PRIMARY -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid primary"
+
+END DEFINE
+
+DELETE PLACEHOLDER ELSE_PART -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER ELSE_PART -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "else:"
+ " {statement}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER TARGET_LIST -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER TARGET_LIST -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{target}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER FOR_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER FOR_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "for {target_list} in {expression}...:"
+ " {statement}..."
+ "[else_part]"
+
+END DEFINE
+
+DELETE PLACEHOLDER "IN {EXPRESSION}..." -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER IN {EXPRESSION}... -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "in {expression}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER "AS {NAME}" -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER AS {NAME} -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "as {name}"
+
+END DEFINE
+
+DELETE PLACEHOLDER ATOM -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER ATOM -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "identifier"/PLACEHOLDER
+ "literal"/PLACEHOLDER
+ "enclosure"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER FUNCDEF -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER FUNCDEF -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "def {identifier}([defparameter]...):"
+ " [document_string]"
+ " {statement}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER INTEGER -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER INTEGER -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid integer"
+
+END DEFINE
+
+DELETE PLACEHOLDER RAISE_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER RAISE_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "raise [expression]..."
+
+END DEFINE
+
+DELETE PLACEHOLDER PASS_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER PASS_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "pass"
+
+END DEFINE
+
+DELETE PLACEHOLDER ASSERT_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER ASSERT_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "assert {expression}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER DICT_DISPLAY -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER DICT_DISPLAY -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid dict_display"
+
+END DEFINE
+
+DELETE PLACEHOLDER TARGET -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER TARGET -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=", " -
+ /TYPE=MENU -
+
+ "identifier"/PLACEHOLDER
+ "({target_list})"
+ "[{target_list}]"
+ "attributeref"/PLACEHOLDER
+ "subscription"/PLACEHOLDER
+ "slicing"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER PARAMETER_LIST -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER PARAMETER_LIST -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "({argument_list})"
+
+END DEFINE
+
+DELETE PLACEHOLDER GLOBAL_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER GLOBAL_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "global {identifier}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER ", {IDENTIFIER}" -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER , {IDENTIFIER} -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ ", {identifier}"
+
+END DEFINE
+
+DELETE PLACEHOLDER LIST_DISPLAY -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER LIST_DISPLAY -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "[[expression]...]"
+
+END DEFINE
+
+DELETE PLACEHOLDER STRINGLITERAL -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER STRINGLITERAL -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid stringliteral"
+
+END DEFINE
+
+DELETE PLACEHOLDER DEL_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER DEL_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "del {target}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER WHILE_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER WHILE_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "while {expression}:"
+ " {statement}..."
+ "[else_part]"
+
+END DEFINE
+
+DELETE PLACEHOLDER LAMBDA_FORM -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER LAMBDA_FORM -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid lambda_form"
+
+END DEFINE
+
+DELETE PLACEHOLDER INHERITANCE -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER INHERITANCE -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "([expression]...)"
+
+END DEFINE
+
+DELETE PLACEHOLDER EXCEPTION_ARGUMENTS -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER EXCEPTION_ARGUMENTS -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "[{expression}... [, {identifier}]]"
+
+END DEFINE
+
+DELETE PLACEHOLDER DOCUMENT_STRING -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER DOCUMENT_STRING -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ """"{text}...""""
+
+END DEFINE
+
+DELETE PLACEHOLDER MODULE_AS_NAME -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER MODULE_AS_NAME -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=HORIZONTAL -
+ /SEPARATOR=", " -
+ /TYPE=NONTERMINAL -
+
+ "{module} [as {name}]"
+
+END DEFINE
+
+DELETE PLACEHOLDER SLICING -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER SLICING -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid slicing"
+
+END DEFINE
+
+DELETE PLACEHOLDER IDENTIFIER -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER IDENTIFIER -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=", " -
+ /TYPE=TERMINAL -
+
+ ""Please enter a valid Python identifier.""
+
+END DEFINE
+
+DELETE PLACEHOLDER EXPRESSION -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER EXPRESSION -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=", " -
+ /TYPE=MENU -
+
+ "or_test"/PLACEHOLDER
+ "lambda_form"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER YIELD_STMT -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER YIELD_STMT -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "yield [expression]..."
+
+END DEFINE
+
+DELETE PLACEHOLDER OR_TEST -
+ /LANGUAGE="Python" -
+DEFINE PLACEHOLDER OR_TEST -
+ /LANGUAGE="Python" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Please enter a valid or_test"
+
+END DEFINE
+
+The following tokens are generated automatically:
+DELETE TOKEN ELIF -
+ /LANGUAGE="Python" -
+DEFINE TOKEN ELIF -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=ELIF_PART -
+
+END DEFINE
+
+DELETE TOKEN RETURN -
+ /LANGUAGE="Python" -
+DEFINE TOKEN RETURN -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=RETURN_STMT -
+
+END DEFINE
+
+DELETE TOKEN EXEC -
+ /LANGUAGE="Python" -
+DEFINE TOKEN EXEC -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=EXEC_STMT -
+
+END DEFINE
+
+DELETE TOKEN GLOBAL -
+ /LANGUAGE="Python" -
+DEFINE TOKEN GLOBAL -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=GLOBAL_STMT -
+
+END DEFINE
+
+DELETE TOKEN ELSE -
+ /LANGUAGE="Python" -
+DEFINE TOKEN ELSE -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=ELSE_PART -
+
+END DEFINE
+
+DELETE TOKEN BREAK -
+ /LANGUAGE="Python" -
+DEFINE TOKEN BREAK -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=BREAK_STMT -
+
+END DEFINE
+
+DELETE TOKEN PASS -
+ /LANGUAGE="Python" -
+DEFINE TOKEN PASS -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=PASS_STMT -
+
+END DEFINE
+
+DELETE TOKEN CLASS -
+ /LANGUAGE="Python" -
+DEFINE TOKEN CLASS -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=CLASSDEF -
+
+END DEFINE
+
+DELETE TOKEN IF -
+ /LANGUAGE="Python" -
+DEFINE TOKEN IF -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=IF_STMT -
+
+END DEFINE
+
+DELETE TOKEN ASSERT -
+ /LANGUAGE="Python" -
+DEFINE TOKEN ASSERT -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=ASSERT_STMT -
+
+END DEFINE
+
+DELETE TOKEN # -
+ /LANGUAGE="Python" -
+DEFINE TOKEN # -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=COMMENT_STMT -
+
+END DEFINE
+
+DELETE TOKEN RAISE -
+ /LANGUAGE="Python" -
+DEFINE TOKEN RAISE -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=RAISE_STMT -
+
+END DEFINE
+
+DELETE TOKEN FOR -
+ /LANGUAGE="Python" -
+DEFINE TOKEN FOR -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=FOR_STMT -
+
+END DEFINE
+
+DELETE TOKEN EXCEPT -
+ /LANGUAGE="Python" -
+DEFINE TOKEN EXCEPT -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=EXCEPT_PART -
+
+END DEFINE
+
+DELETE TOKEN YIELD -
+ /LANGUAGE="Python" -
+DEFINE TOKEN YIELD -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=YIELD_STMT -
+
+END DEFINE
+
+DELETE TOKEN TRY -
+ /LANGUAGE="Python" -
+DEFINE TOKEN TRY -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=TRY_EXC_STMT -
+
+END DEFINE
+
+DELETE TOKEN WHILE -
+ /LANGUAGE="Python" -
+DEFINE TOKEN WHILE -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=WHILE_STMT -
+
+END DEFINE
+
+DELETE TOKEN CONTINUE -
+ /LANGUAGE="Python" -
+DEFINE TOKEN CONTINUE -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=CONTINUE_STMT -
+
+END DEFINE
+
+DELETE TOKEN DEL -
+ /LANGUAGE="Python" -
+DEFINE TOKEN DEL -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=DEL_STMT -
+
+END DEFINE
+
+DELETE TOKEN PRINT -
+ /LANGUAGE="Python" -
+DEFINE TOKEN PRINT -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=PRINT_STMT -
+
+END DEFINE
+
+DELETE TOKEN IMPORT -
+ /LANGUAGE="Python" -
+DEFINE TOKEN IMPORT -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=IMPORT_STMT -
+
+END DEFINE
+
+DELETE TOKEN DEF -
+ /LANGUAGE="Python" -
+DEFINE TOKEN DEF -
+ /LANGUAGE="Python" -
+ /PLACEHOLDER=FUNCDEF -
+
+END DEFINE
diff --git a/app-emacs/else-mode/files/Template-cust.lse b/app-emacs/else-mode/files/Template-cust.lse
new file mode 100644
index 0000000..6dca3e6
--- /dev/null
+++ b/app-emacs/else-mode/files/Template-cust.lse
@@ -0,0 +1,398 @@
+;; These are customization Templates for the TEMPLATE language
+;; for use with the Emacs Language Sensitive Editor (ELSE).
+;;
+;; Created 2003 Douglas Harter
+;;
+;; Author: Douglas Harter <dharter46@comcast.net> and
+;; Peter Milliken <peterm@unwired.com.au>
+;;
+;; $Revision: 1.4 $
+;;
+;;******************************************************************************
+;; These definitions are my personal customisations for the language. This is
+;; where you should place YOUR customisations.
+;;
+;; Sometimes there is a definition(s) in here that override definitions in the
+;; main language template file that are here to make that definition more
+;; "usable" - this is because I (primarily) try and generate/maintain the main
+;; .lse files from EBNF definitions of the language. Sometimes I just can't
+;; express the appropriate customisation in the EBNF and so I am forced to
+;; override the placeholder definition in this file.
+;;
+;; This entries in this file should be used as an example of how to create your
+;; own customisations. I would caution that you don't delete any definitions
+;; though until you are sure that your edit sessions will not be adversely
+;; affected. The best way to check out the effects of a delete is to "compile"
+;; (else-compile-buffer) the "delete" command for that definition (this will
+;; remove it from your edit session and you can nolonger access the definition
+;; until next you load language template files) and then see whether anything
+;; has been "lost" in your code generation ability i.e. say you think you don't
+;; need the definition for placeholder XXX, just place the following lines at
+;; the end of one of your source files (when ELSE is enabled for that buffer)
+;; and perform a compile (M-x else-compile-buffer) with the cursor positioned at
+;; the beginning of the line:
+;;
+;; DELETE PLACEHOLDER XXX -
+;; /LANGUAGE = "Template" -
+;;
+;; This will delete definition XXX from memory.
+;;
+;;******************************************************************************
+
+DELETE PLACEHOLDER LANGUAGE_DEFINITION -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER LANGUAGE_DEFINITION -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "DELETE LANGUAGE {language_name} -"
+ "DEFINE LANGUAGE {language_name} -"
+ " /INITIAL_STRING="{compilation_unit}" -"
+ " /PUNCTUATION_CHARACTERS="{punctuation_characters}" -"
+ " /SELF_INSERT_CHARACTERS="{self_insert_characters}" -"
+ " /VALID_IDENTIFIER_CHARACTERS="{valid_identifier_characters}" -"
+ " /INDENT_SIZE={indent_number} -"
+ ""
+ "END DEFINE"
+ ""
+
+DELETE PLACEHOLDER indent_number -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER indent_number -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter a numerical value for the indentation of each line of code."
+
+END DEFINE
+
+DELETE PLACEHOLDER substitute_number -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER substitute_number -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter a numerical value for the *maximum* number of times this"
+ "placeholder repeats."
+
+END DEFINE
+
+
+DELETE PLACEHOLDER TYPE_TYPE -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER TYPE_TYPE -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "NONTERMINAL"
+ "TERMINAL"
+
+END DEFINE
+
+DELETE PLACEHOLDER punctuation_characters -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER punctuation_characters -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "default_punctuation"/PLACEHOLDER
+ "user_punctuation"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER default_punctuation -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER default_punctuation -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ ",;()*.'-"
+
+END DEFINE
+
+DELETE PLACEHOLDER user_punctuation -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER user_punctuation -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the punctuation characters for the language being defined. "
+ "The defaults are: ,;()*.'-"
+
+END DEFINE
+
+DELETE PLACEHOLDER self_insert_characters -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER self_insert_characters -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "default_self_insert"/PLACEHOLDER
+ "user_self_insert"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER default_self_insert -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER default_self_insert -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ " `~!@#$%^&*(),.<>/?;:'[]{}=\-+|""
+
+END DEFINE
+
+DELETE PLACEHOLDER user_self_insert -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER user_self_insert -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the characters that check to see if ELSE is within a placeholder"
+ "for self insert."
+ "The defaults are: `~!@#$%^&*(),.<>/?;:'[]{}=\-+|""
+
+END DEFINE
+
+DELETE PLACEHOLDER valid_identifier_characters -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER valid_identifier_characters -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "default_valid_identifier"/PLACEHOLDER
+ "user_valid_identifier"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER default_valid_identifier -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER default_valid_identifier -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789"
+
+END DEFINE
+
+DELETE PLACEHOLDER user_valid_identifier -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER user_valid_identifier -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter the characters that check to see if ELSE is within a placeholder"
+ "for valid identifier."
+ "The defaults are:"
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789"
+
+END DEFINE
+
+DELETE PLACEHOLDER PLACEHOLDER_DEFINITION -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER PLACEHOLDER_DEFINITION -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "DELETE PLACEHOLDER {place_name} -"
+ " /LANGUAGE="{language_name}" -"
+ "DEFINE PLACEHOLDER [place_name] -"
+ " /LANGUAGE="{language_name}" -"
+ "{placeholder_type}"
+ ""
+ "END DEFINE"
+ ""
+
+END DEFINE
+
+DELETE PLACEHOLDER placeholder_type -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER placeholder_type -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Type of placeholder" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "nonterminal|terminal_placeholder"/PLACEHOLDER
+ "menu_placeholder"/PLACEHOLDER
+ "cross_ref_placeholder"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER CROSS_REF_PLACEHOLDER -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER CROSS_REF_PLACEHOLDER -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="/PLACEHOLDER={place_name}" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "/PLACEHOLDER=[place_name]"
+
+END DEFINE
+
+DELETE PLACEHOLDER nonterminal|terminal_placeholder -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER nonterminal|terminal_placeholder -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Templates for NONTERMINAL and TERMINAL types" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ " /{substitute}"
+ " [substitute_count]"
+ " /DESCRIPTION={descriptive_text} -"
+ " /DUPLICATION={dup_type}"
+ " /SEPARATOR={separator_text}"
+ " /TYPE={type_type}"
+ ""
+ " {line_of_text}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER menu_placeholder -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER menu_placeholder -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Template for a MENU type -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ " /{substitute}"
+ " [substitute_count]"
+ " /DESCRIPTION={descriptive_text} -"
+ " /DUPLICATION={dup_type}"
+ " /SEPARATOR={separator_text}"
+ " /TYPE=MENU"
+ ""
+ "{menu placeholder body line}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER "menu placeholder body line" -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER "menu placeholder body line" -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ ""{menu body item}"[menu body qualifier]"
+
+END DEFINE
+
+DELETE PLACEHOLDER "menu body item" -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER "menu body item" -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "In a Menu Placeholder, you may have a string, a placeholder name, or"
+ "a token. Placeholders and Tokens must be followed by the appropriate"
+ "qualifier."
+
+END DEFINE
+
+DELETE PLACEHOLDER "menu body qualifier" -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER "menu body qualifier" -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU
+
+ "/PLACEHOLDER"
+ "/TOKEN"
+
+END DEFINE
+
+DELETE PLACEHOLDER PLACEHOLDER_REFERENCE -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER PLACEHOLDER_REFERENCE -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Token that references a placeholder definition" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL
+
+ "DELETE TOKEN {token_name} -"
+ " /LANGUAGE="{language_name}" -"
+ "DEFINE TOKEN [token_name] -"
+ " /LANGUAGE="{language_name}" -"
+ " /PLACEHOLDER={place_name}"
+ ""
+ "END DEFINE"
+ ""
diff --git a/app-emacs/else-mode/files/Template.lse b/app-emacs/else-mode/files/Template.lse
new file mode 100644
index 0000000..1176749
--- /dev/null
+++ b/app-emacs/else-mode/files/Template.lse
@@ -0,0 +1,648 @@
+;; Copyright (C) 1997,1998,1999,2000,2001,2002,2003 Peter Milliken
+;;
+;; Author: Peter Milliken <peterm@resmed.com.au>,
+;; <peterm@unwired.com.au>
+;; Douglas Harter <dharter46@comcast.net>
+;;
+;;
+;; Keywords: language sensitive abbreviation template placeholder token
+;;
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+DELETE LANGUAGE "Template" -
+DEFINE LANGUAGE "Template" -
+ /INITIAL_STRING="{compilation_unit}" -
+ /PUNCTUATION_CHARACTERS=",;()*.'-" -
+ /SELF_INSERT_CHARACTERS=" `~!@#$%^&*(),.<>/?;:'[]{}=\-+|"" -
+ /VALID_IDENTIFIER_CHARACTERS="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789" -
+ /INDENT_SIZE="4" -
+ /VERSION="1.10" -
+
+END DEFINE
+
+DELETE PLACEHOLDER COMPILATION_UNIT -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER COMPILATION_UNIT -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{language_definition}"
+ "{placeholder_definition}..."
+ "{token_definition}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER CROSS_REF_PLACEHOLDER -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER CROSS_REF_PLACEHOLDER -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="/PLACEHOLDER={place_name}"
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ " /PLACEHOLDER=[place_name]"
+
+END DEFINE
+
+DELETE PLACEHOLDER DESCRIPTIVE_TEXT -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER DESCRIPTIVE_TEXT -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ """"
+
+END DEFINE
+
+DELETE PLACEHOLDER DUP_TYPE -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER DUP_TYPE -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "CONTEXT_DEPENDENT -"
+ "VERTICAL -"
+ "HORIZONTAL -"
+
+END DEFINE
+
+DELETE PLACEHOLDER LANGUAGE_DEFINITION -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER LANGUAGE_DEFINITION -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "DELETE LANGUAGE {language_name} -"
+ "DEFINE LANGUAGE {language_name} -"
+ " /INITIAL_STRING="{compilation_unit}" -"
+ " /PUNCTUATION_CHARACTERS="{punctuation_characters}" -"
+ " /SELF_INSERT_CHARACTERS="{self_insert_characters}" -"
+ " /VALID_IDENTIFIER_CHARACTERS="{valid_identifier_characters}" -"
+ " /INDENT_SIZE={indent_number} -"
+ " /VERSION={version_number}"
+ ""
+ "END DEFINE"
+ ""
+
+END DEFINE
+
+DELETE PLACEHOLDER LANGUAGE_NAME -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER LANGUAGE_NAME -
+ /LANGUAGE="Template" -
+ /AUTO_SUBSTITUTE -
+ /SUBSTITUTE_COUNT=1 -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Change this definition to be the language name i.e. use else-extract-placeholder"
+ "make the change and then re-compiler the definition using else-compile-buffer"
+
+END DEFINE
+
+DELETE PLACEHOLDER LINE_OF_TEXT -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER LINE_OF_TEXT -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ ""{text}""
+
+END DEFINE
+
+DELETE PLACEHOLDER NUMBER -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER NUMBER -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Enter a numerical value for the *maximum* number of times this placeholder repeats"
+
+END DEFINE
+
+DELETE PLACEHOLDER PLACEHOLDER_DEFINITION -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER PLACEHOLDER_DEFINITION -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "DELETE PLACEHOLDER {place_name} -"
+ " /LANGUAGE="{language_name}" -"
+ "DEFINE PLACEHOLDER [place_name] -"
+ " /LANGUAGE="{language_name}" -"
+ "{placeholder_type}"
+ ""
+ "END DEFINE"
+ ""
+
+END DEFINE
+
+DELETE PLACEHOLDER PLACEHOLDER_REFERENCE -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER PLACEHOLDER_REFERENCE -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Token that references a placeholder definition"
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "DELETE TOKEN {token_name} -"
+ " /LANGUAGE="{language_name}" -"
+ "DEFINE TOKEN [token_name] -"
+ " /LANGUAGE="{language_name}" -"
+ " /PLACEHOLDER={place_name}"
+ ""
+ "END DEFINE"
+ ""
+
+END DEFINE
+
+DELETE PLACEHOLDER PLACE_NAME -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER PLACE_NAME -
+ /LANGUAGE="Template" -
+ /AUTO_SUBSTITUTE -
+ /SUBSTITUTE_COUNT=1 -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Just type the name."
+
+END DEFINE
+
+DELETE PLACEHOLDER SEPARATOR_TEXT -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER SEPARATOR_TEXT -
+ /LANGUAGE="Template" -
+ /AUTO_SUBSTITUTE -
+ /SUBSTITUTE_COUNT=1 -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ """ -"
+
+END DEFINE
+
+DELETE PLACEHOLDER STANDALONE_TOKEN_DEF -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER STANDALONE_TOKEN_DEF -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Token that contains the definition in the body"
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "DELETE TOKEN {token_name} -"
+ " /LANGUAGE="{language_name}" -"
+ "DEFINE TOKEN [token_name] -"
+ " /LANGUAGE="{language_name}" -"
+ " /DESCRIPTION={descriptive_text} -"
+ ""
+ " {line_of_text}..."
+ ""
+ "END DEFINE"
+
+END DEFINE
+
+DELETE PLACEHOLDER SUBSTITUTE -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER SUBSTITUTE -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="substitute menu"
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "NOAUTO_SUBSTITUTE -"
+ "AUTO_SUBSTITUTE -"
+
+END DEFINE
+
+DELETE PLACEHOLDER SUBSTITUTE_COUNT -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER SUBSTITUTE_COUNT -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "/SUBSTITUTE_COUNT={number}"
+
+END DEFINE
+
+DELETE PLACEHOLDER TEXT -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER TEXT -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Type something, anything will do"
+
+END DEFINE
+
+DELETE PLACEHOLDER TOKEN_DEFINITION -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER TOKEN_DEFINITION -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "placeholder_reference"/PLACEHOLDER
+ "standalone_token_def"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER TOKEN_NAME -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER TOKEN_NAME -
+ /LANGUAGE="Template" -
+ /AUTO_SUBSTITUTE -
+ /SUBSTITUTE_COUNT=1 -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Enter the name of the token, note that quotes must be used when"
+ "the name contains embedded spaces."
+
+END DEFINE
+
+DELETE PLACEHOLDER TYPE_TYPE -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER TYPE_TYPE -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "NONTERMINAL"
+ "TERMINAL"
+
+END DEFINE
+
+DELETE PLACEHOLDER default_punctuation -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER default_punctuation -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ ",;()*.'-"
+
+END DEFINE
+
+DELETE PLACEHOLDER default_self_insert -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER default_self_insert -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ " `~!@#$%^&*(),.<>/?;:'[]{}=\-+|""
+
+END DEFINE
+
+DELETE PLACEHOLDER default_valid_identifier -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER default_valid_identifier -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789"
+
+END DEFINE
+
+DELETE PLACEHOLDER indent_number -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER indent_number -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Enter a numerical value for the indentation of each line of code."
+
+END DEFINE
+
+DELETE PLACEHOLDER VERSION_NUMBER -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER VERSION_NUMBER -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter a version number i.e. 1.8"
+
+END DEFINE
+
+
+DELETE PLACEHOLDER "menu body item" -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER "menu body item" -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "In a Menu Placeholder, you may have a string, a placeholder name, or"
+ "a token. Placeholders and Tokens must be followed by the appropriate"
+ "qualifier."
+
+END DEFINE
+
+DELETE PLACEHOLDER "menu body qualifier" -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER "menu body qualifier" -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "/PLACEHOLDER"
+ "/TOKEN"
+ "/FOLLOW"
+ "/NOFOLLOW"
+
+END DEFINE
+
+DELETE PLACEHOLDER "menu placeholder body line" -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER "menu placeholder body line" -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ ""{menu body item}"[menu body qualifier]"
+
+END DEFINE
+
+DELETE PLACEHOLDER menu_placeholder -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER menu_placeholder -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ " /{substitute}"
+ " [substitute_count]"
+ " /DESCRIPTION={descriptive_text} -"
+ " /DUPLICATION={dup_type}"
+ " /SEPARATOR={separator_text}"
+ " /TYPE=MENU"
+ ""
+ " {menu placeholder body line}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER nonterminal|terminal_placeholder -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER nonterminal|terminal_placeholder -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Templates for NONTERMINAL and TERMINAL types"
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ " /{substitute}"
+ " [substitute_count]"
+ " /DESCRIPTION={descriptive_text} -"
+ " /DUPLICATION={dup_type}"
+ " /SEPARATOR={separator_text}"
+ " /TYPE={type_type}"
+ ""
+ " {line_of_text}..."
+
+END DEFINE
+
+DELETE PLACEHOLDER placeholder_type -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER placeholder_type -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="Type of placeholder"
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "nonterminal|terminal_placeholder"/PLACEHOLDER
+ "menu_placeholder"/PLACEHOLDER
+ "cross_ref_placeholder"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER punctuation_characters -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER punctuation_characters -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "default_punctuation"/PLACEHOLDER
+ "user_punctuation"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER self_insert_characters -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER self_insert_characters -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "default_self_insert"/PLACEHOLDER
+ "user_self_insert"/PLACEHOLDER
+
+END DEFINE
+
+DELETE PLACEHOLDER substitute_number -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER substitute_number -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Enter a numerical value for the *maximum* number of times this"
+ "placeholder repeats."
+
+END DEFINE
+
+DELETE PLACEHOLDER user_punctuation -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER user_punctuation -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Enter the punctuation characters for the language being defined. "
+ "The defaults are: ,;()*.'-"
+
+END DEFINE
+
+DELETE PLACEHOLDER user_self_insert -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER user_self_insert -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Enter the characters that check to see if ELSE is within a placeholder"
+ "for self insert."
+ "The defaults are: `~!@#$%^&*(),.<>/?;:'[]{}=\-+|""
+
+END DEFINE
+
+DELETE PLACEHOLDER user_valid_identifier -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER user_valid_identifier -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL -
+
+ "Enter the characters that check to see if ELSE is within a placeholder"
+ "for valid identifier."
+ "The defaults are:"
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789"
+
+END DEFINE
+
+DELETE PLACEHOLDER valid_identifier_characters -
+ /LANGUAGE="Template" -
+DEFINE PLACEHOLDER valid_identifier_characters -
+ /LANGUAGE="Template" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "default_valid_identifier"/PLACEHOLDER
+ "user_valid_identifier"/PLACEHOLDER
+
+END DEFINE
+
+DELETE TOKEN PLACE -
+ /LANGUAGE="Template" -
+DEFINE TOKEN PLACE -
+ /LANGUAGE="Template" -
+ /PLACEHOLDER=PLACEHOLDER_DEFINITION
+
+END DEFINE
+
+DELETE TOKEN TOKEN -
+ /LANGUAGE="Template" -
+DEFINE TOKEN TOKEN -
+ /LANGUAGE="Template" -
+ /PLACEHOLDER=TOKEN_DEFINITION
+
+END DEFINE
+
+
diff --git a/app-emacs/else-mode/files/digest-else-1.20 b/app-emacs/else-mode/files/digest-else-1.20
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/app-emacs/else-mode/files/digest-else-1.20
diff --git a/app-emacs/else-mode/files/else-mode.el b/app-emacs/else-mode/files/else-mode.el
new file mode 100644
index 0000000..033c3d5
--- /dev/null
+++ b/app-emacs/else-mode/files/else-mode.el
@@ -0,0 +1,4716 @@
+;;; else-mode.el --- Emacs Language Sensitive Editor (ELSE)
+;;
+;; Copyright (C) 1997,1998,1999,2000,2001,2002,2003, 2004 Peter Milliken
+;;
+;; Author: Peter Milliken <peterm@resmed.com.au>
+;; <peterm@unwired.com.au>
+;; Version: 1.20
+;; Keywords: language sensitive abbreviation template placeholder token
+;;
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; This facility is documented in the accompanying distribution file(s).
+
+;;; Change Log:
+
+;;; Code:
+
+;; This package provides line-numbering to the menu buffer (if enabled - see
+;; else-enable-lineno custom variable). Encase the conditional load within an
+;; error handling struct so that ELSE doesn't blow up on loading.
+(condition-case nil
+ (require 'setnu)
+ (error nil))
+
+;; The following constants are associated keys into the data structure which
+;; records the definition of a placeholder/token/language definition. Use the
+;; property list of a symbol to store the individual attributes of a
+;; definition. The following constants are the "keys" into the property list
+;; (see else-read-a-definition) for the setting of the property list
+;; information).
+;;
+(defconst else-placeholder-ref 0)
+(defconst else-type-ref 1)
+(defconst else-separator-ref 2)
+(defconst else-substitute-ref 3)
+(defconst else-duplication-ref 4)
+(defconst else-topic-ref 5) ;; Not used
+(defconst else-description-ref 6)
+(defconst else-body-ref 7)
+(defconst else-substitute-count-ref 8)
+(defconst else-Language-Name 9)
+(defconst else-Punctuation-ref 10)
+(defconst else-Punctuation-Length-ref 11)
+(defconst else-Initial-String-ref 12)
+(defconst else-Self-Insert-Characters-ref 13)
+(defconst else-Self-Insert-Characters-Length-ref 14)
+(defconst else-Valid-Idents-ref 15)
+(defconst else-Valid-Idents-Length-ref 16)
+(defconst else-tab-size-ref 17)
+(defconst else-original-name 18)
+(defconst else-language-version-ref 19)
+(defconst else-elisp-action 20)
+
+
+(defconst else-before-key "/BEFORE"
+ "association list key into the run-time action sequences.")
+
+(defconst else-after-key "/AFTER"
+ "association list key into the run-time action sequences.")
+
+(defconst else-oninsert-key "/ONINSERT"
+ "association list key into the run-time action sequences.")
+
+(defconst else-Extract-Column 4)
+
+(defconst else-Placeholder-Vector-Size 1023)
+(defconst else-Token-Vector-Size 512)
+
+;; XEmacs behaves differently in the before/after change functions than FSF
+;; Emacs. The following three variables are used in the XEmacs code. All XEmacs
+;; code is differentiated using a 'cond' statement and the
+;; 'else-in-xemacs variable setting.
+(defvar else-move-change nil)
+(defvar else-move-to-position nil)
+(defvar else-in-xemacs (integerp (string-match "XEmacs\\|Lucid" (emacs-version))))
+
+;; Do some compatability between XEmacs and FSF Emacs - hopefully can
+;; remove this one day when XEmacs matches FSF? If not, then it
+;; doesn't matter as the issue will work either way.
+(unless (boundp 'undo-in-progress)
+ (defvar undo-in-progress nil
+ "Indicate that an indo is in progress to before/after change fns.")
+ (defadvice undo-more (around else-undo-more activate compile)
+ (let ((undo-in-progress t)) ad-do-it)))
+
+;; The following constants define the offsets for the nth and nthcdr
+;; functions into the data element which records each line of the 'body' of a
+;; placeholder/token definition. The meanings are:
+;;
+;; else-body-type-ref - if menu line then /placeholder or /token (?p
+;; ?t or nil)
+;; else-body-indent-ref - indentation 'level'
+;; else-body-text-ref - actual text of line
+;; else-body-menu-follow-on-ref - if an item is a menu then the user can
+;; selectively disable/enable follow-on in the
+;; menu display. See also else-follow-menus.
+(defconst else-body-type-ref 0)
+(defconst else-body-indent-ref 1)
+(defconst else-body-text-ref 2)
+(defconst else-body-menu-follow-on-ref 3)
+
+;; The following constants are the regular expressions and the corresponding
+;; `match-data' offsets that are used in else. These are general expressions
+;; that are constructed as follows:
+;; `defining' construct:
+;; Each `defining' construct is one of (where []'s represent alternatives and
+;; (digit) represent the match-data offset):
+;;
+;; [LANGUAGE ]
+;; DELETE]____[TOKEN ]_____["some text enclosed by quotes"
+;; DEFINE] [PLACEHOLDER] [text not enclosed by quotes (no spaces).
+;; (1) (2) (3)
+;;
+;; Examples are:
+;;
+;; (a) DEFINE PLACEHOLDER "THIS IS A TEMPLATE"
+;; or
+;; (b) DELETE LANGUAGE ADA
+;;
+;; For example (a), the match-data would be (1) "DEFINE"
+;; (2) "PLACEHOLDER"
+;; (3) "\"THIS IS A TEMPLATE\""
+;;
+;; (b), the match-data would be (1) "DELETE"
+;; (2) "LANGUAGE"
+;; (3) "ADA"
+;;
+;; `body' construct:
+;; Each `body' construct is one of (where []'s represent alternatives and
+;; (digit) represent the match-data offset):
+;;
+;; ]/text=]_____________________________["some text in quotes"
+;; ] ] [text not enclosed by quotes
+;; ] ]_____________________________["some text in quotes" ]____________/text
+;; ] ] [text not enclosed by quotes]
+;; ]
+;; ]"some text enclosed by quotes"______[/text
+;; ] [or nothing.
+;; ]/text-
+;; ]
+;; END DEFINE
+;; (1), (3), (5) or (6) (2) or (4)
+;;
+;;
+;; Examples are:
+;;
+;; (a) /LANGUAGE=ADA -
+;;
+;; (b) /NOAUTOSUBSTITUTE -
+;;
+;; (c) /SEPARATOR=", " -
+;;
+;; (d) "null"/PLACEHOLDER
+;;
+;; (e) "enter a valid number"
+;;
+;; (f) END DEFINE
+;;
+;; For example (a), the match-data would be (1) "/LANGUAGE="
+;; (2) "ADA"
+;; (3) nil
+;; (4) nil
+;; (5) nil
+;; (6) nil
+;;
+;; For example (b), the match-data would be (1) nil
+;; (2) nil
+;; (3) nil
+;; (4) nil
+;; (5) "/NOAUTOSUBSTITUTE"
+;; (6) nil
+;;
+;; For example (c), the match-data would be (1) "/SEPARATOR="
+;; (2) ", "
+;; (3) nil
+;; (4) nil
+;; (5) nil
+;; (6) nil
+;;
+;; For example (d), the match-data would be (1) nil
+;; (2) nil
+;; (3) "null"
+;; (4) "/PLACEHOLDER"
+;; (5) nil
+;; (6) nil
+;;
+;; For example (e), the match-data would be (1) nil
+;; (2) nil
+;; (3) "enter a valid number"
+;; (4) nil
+;; (5) nil
+;; (6) nil
+;;
+;; For example (f), the match-data would be (1) nil
+;; (2) nil
+;; (3) nil
+;; (4) nil
+;; (5) nil
+;; (6) END DEFINE
+;;
+
+(defconst else-defining-string
+ "\\(DELETE\\|DEFINE\\) +\\(TOKEN\\|PLACEHOLDER\\|LANGUAGE\\) +\\(\".*\"\\|[ -~]+\\) +-")
+(defconst else-defining-command 1)
+(defconst else-defining-type 2)
+(defconst else-defining-name 3)
+
+(defconst else-body-string
+ "\\(/[A-Z_]+ *= *\\)\\(\".*\"\\|[-a-zA-Z_0-9\\.]+\\)\\([/A-Z_]+\\)*\\|\\(/[A-Z_]+ *-\\)\\|\\(\".*\"\\)\\(/[A-Z_]+\\)?\\(/NOFOLLOW\\|/FOLLOW\\)?\\|\\(END *DEFINE\\)")
+
+(defconst else-body-command-1 1)
+(defconst else-body-command-2 2)
+(defconst else-body-command-3 3)
+(defconst else-body-command-4 4)
+(defconst else-body-text-1 5)
+(defconst else-body-text-2 6)
+(defconst else-body-text-3 7)
+(defconst else-body-end 8)
+
+(defconst else-template-comment "^;;.*"
+ "Comment lines must start at the line beginning with ;;")
+
+(defvar else-deleted-string nil) ; The last placeholder text that is
+ ; currently being processed.
+(defvar else-definition-name nil) ; string of the definition being
+ ; processed i.e. identifier.
+(defvar else-fallback-text nil) ; The full original deleted text.
+(defvar else-deleted-column 0) ; Column from which the deleted string
+(defvar else-please-duplicate nil) ; t when the placeholder was followed
+ ; by ellipses.
+
+;; This is a flag which is used by the before and after change functions. It
+;; transfers information about whether the "auto-substitute" mode has just gone
+;; active to the after change function. This is because the after change
+;; function receives a confusing begin/end pair (because the before change
+;; function has deleted the placeholder) so it can't work out what has
+;; happened. This flag being set t means that it interprets the change as a
+;; single character insert.
+(defvar else-sub-active-toggle nil)
+
+(defvar else-Mandatory-Placeholder nil) ; Flag used to indicate if current
+ ; placeholder is mandatory {} or
+ ; optional [].
+
+(defvar else-placeholder-start 0
+ "Start position of the placeholder/token being processed")
+
+(defvar else-placeholder-end 0
+ "End position of the placeholder/token being processed")
+
+(defvar else-definition-type nil
+ "Definition type of the element bounded by else-placeholder-start/end")
+
+(defvar else-Auto-Sub-Active nil
+ "Used to determine if an auto-substitute string is Active")
+
+(defvar else-Auto-Sub-Marker-List nil
+ "A list of paired Auto Sub Markers, this list grows or shrinks as required.")
+
+(defvar else-Language-Definitions '(("Empty" . nil))
+ "alist containing all the language definitions.")
+
+(defvar else-Current-Language nil
+ "Holds the Language Identification string for the current buffer ie \"Ada\"")
+
+(defvar else-menu-mode-map
+ (let ((map (make-keymap)))
+ (suppress-keymap map t)
+ (define-key map "q" 'else-menu-quit)
+ (define-key map "s" 'else-menu-select)
+ (define-key map "Q" 'else-menu-quit)
+ (define-key map "S" 'else-menu-select)
+ (define-key map " " 'else-menu-next-line)
+ (define-key map "n" 'else-menu-next-line)
+ (define-key map "p" 'else-menu-previous-line)
+ (define-key map "N" 'else-menu-next-line)
+ (define-key map "P" 'else-menu-previous-line)
+ (define-key map "?" 'else-summary)
+ (define-key map "\r" 'else-menu-select)
+ map )
+ "Local keymap for else-mode.")
+
+(defvar else-mode-key-map
+ (let ((mode-map (make-sparse-keymap))
+ (prefix-map (make-sparse-keymap))
+ (command-map (make-sparse-keymap)))
+ (define-key mode-map "\C-c" prefix-map)
+ (define-key prefix-map "/" command-map)
+ (define-key command-map "e" 'else-expand-placeholder)
+ (define-key command-map "k" 'else-kill-placeholder)
+ (define-key command-map "n" 'else-next-placeholder)
+ (define-key command-map "p" 'else-previous-placeholder)
+ (define-key command-map "i" 'else-insert-placeholder)
+ (define-key command-map "c" 'else-comment-placeholders)
+ (define-key command-map "u" 'else-uncomment-placeholders)
+ mode-map))
+
+(defvar else-selected-text nil
+ "string selected by the user when multiple choices in the LSE word function are
+available" )
+
+(defvar else-type-of-item-being-expanded ?p
+ "'type' of item being expanded ie either a placeholder or a token")
+
+(defvar else-mode nil
+ "The minor mode flag")
+
+(defvar else-current-definition nil
+ "Current definition as found by else-in-placeholder")
+
+;; The following variables need to be local to each buffer in which they are
+;; used.
+(make-variable-buffer-local 'else-Auto-Sub-Active)
+(make-variable-buffer-local 'else-Auto-Sub-Marker-List)
+(make-variable-buffer-local 'else-Current-Language)
+(make-variable-buffer-local 'else-mode)
+(make-variable-buffer-local 'else-move-change)
+(make-variable-buffer-local 'else-move-to-position)
+(make-variable-buffer-local 'else-current-definition)
+(make-variable-buffer-local 'else-please-duplicate)
+(make-variable-buffer-local 'else-deleted-column)
+(make-variable-buffer-local 'else-deleted-string)
+(make-variable-buffer-local 'else-definition-type)
+(make-variable-buffer-local 'else-definition-name)
+(make-variable-buffer-local 'else-Mandatory-Placeholder)
+
+(setq-default else-mode nil)
+
+(defvar Placeholder ()
+ "Array holding the `placeholder' tokens for the current language")
+(defvar Token ()
+ "Array holding the `token' tokens for the current language" )
+(defvar Language-Specifics ()
+ "Structure that holds the language definition information for the current
+language")
+
+(defvar Language-Self-Insert-Characters-Vector
+ "Vector to look-up whether a character is 'self-insert'.
+Contains True or False (t or nil) and is indexed by character code")
+
+(defvar Language-Valid-Identifier-Characters-Vector
+ "Vector to look-up whether a character is a 'valid identifier'.
+Contains True or False (t or nil) and is indexed by character code")
+
+(defvar Language-Punctuation-Characters-Vector
+ "Vector to look-up whether a character is a 'punctuation' character.
+Contains True or False (t or nil) and is indexed by character code")
+
+
+(defconst else-character-vector-length 256
+ "Language character vectors length")
+
+
+;;; Now make these variables buffer local. At the moment, these are just
+;;; buffer local copies that refer to the full language templates, ideally, we
+;;; would want to offer the facility of being able to customise the templates
+;;; of a language for each buffer ie in one program you might be doing a lot
+;;; of case statements and in another buffer there may be more 'if' statements
+;;; so the user may decide it would be nice to have two versions of the
+;;; STATEMENT placeholder. This is currently not available but could easily be
+;;; added. At the moment, change one and all buffers are affected.
+(make-variable-buffer-local 'Placeholder)
+(make-variable-buffer-local 'Token)
+(make-variable-buffer-local 'Language-Specifics)
+(make-variable-buffer-local 'Language-Self-Insert-Characters-Vector)
+(make-variable-buffer-local 'Language-Valid-Identifier-Characters-Vector)
+(make-variable-buffer-local 'Language-Punctuation-Characters-Vector)
+
+;; The following variables are used purely for the fast save/load process
+;; (else-compile-fast-load and else-restore).
+
+;; This variable is used to communicate the "type" of symbols being processed
+;; during an ELSE compile for fast loading operation ie else-compile-fast-load
+;; and else-store-element use this variable to communicate what the element
+;; type that is being "stored". This is only necessary because the mapatoms
+;; process doesn't allow more that the one argument to the called routine.
+(defvar else-type-of-symbols ?p)
+
+;; This is the marker that tracks the "read" process used by
+;; else-compile-fast-load and else-restore. We use a marker into the restore
+;; file because the 'read' function automatically increments the marker as it
+;; reads each line. Again, the variable is only required to be global because
+;; of the use of 'mapatoms'.
+(defvar else-read-marker nil)
+
+(defconst else-lse-ext "\.lse")
+(defconst else-esl-ext "\.esl")
+
+(defvar else-placeholder-overlay nil
+ "Placeholder overlay is used by the Voice Coder modifications to ELSE.")
+
+;; This is the after change function. Its primary purpose is to act in
+;; situations where the auto-substitute function is active and the change has
+;; occurred in the specified region. It must repeat the change into each of the
+;; auto-substitute "pair"s.
+(defun else-after-change (begin end length)
+ (let ((marker-index)
+ (move-text)
+ (local-begin begin)
+ (local-end end))
+
+ ;; Only duplicate any changes if the change has occurred within the auto-sub
+ ;; area.
+ (setq else-after-var (append (list begin end length
+ (symbol-name this-command))
+ else-after-var))
+ ;; Xemacs changes here
+ (cond (else-in-xemacs
+ (if else-move-change
+ (progn
+ (setq local-begin (marker-position else-move-to-position))
+ (setq local-end (+ local-begin (- end begin)))
+ (goto-char local-begin)
+ (setq move-text (buffer-substring begin end))
+ (delete-region begin end)
+ ;; At this point we need to 'modify' the undo list for the
+ ;; buffer i.e. to allow the user to perform a seamless undo, we
+ ;; have to delete the events that have just occurred e.g. the
+ ;; insert of text into the buffer at the 'wrong' place and the
+ ;; subsequent deleting of that text. The only event we wish to
+ ;; remain in the undo list is the insertion of the text into
+ ;; the 'correct' place in the buffer (which will be
+ ;; accomplished directly after we remove the two mentioned
+ ;; events).
+ (setq buffer-undo-list (cdr (cdr buffer-undo-list)))
+ ;; Now insert the text where it should have originally
+ ;; gone. Note that this is the event that will be recorded in
+ ;; the buffer unto list.
+ (insert move-text)
+ (setq else-move-change nil)
+ )
+ )
+ )
+ )
+
+ (if (and (not undo-in-progress)
+ else-Auto-Sub-Active
+ (>= local-begin (marker-position (car (nth 1 else-Auto-Sub-Marker-List))))
+ (< local-end (marker-position (cdr (nth 1 else-Auto-Sub-Marker-List)))))
+ (progn
+ (save-excursion
+ (if else-sub-active-toggle
+ (progn
+ (setq else-sub-active-toggle nil)
+ )
+ )
+ ;; want to iterate over all of the active markers in the marker
+ ;; list. This starts at the second entry in the marker list.
+ (setq marker-index 2)
+ (while (and (marker-position
+ (car (nth marker-index
+ else-Auto-Sub-Marker-List)))
+ (<= marker-index (car else-Auto-Sub-Marker-List)))
+ (delete-region (marker-position
+ (car (nth marker-index
+ else-Auto-Sub-Marker-List)))
+ (1- (marker-position
+ (cdr (nth marker-index
+ else-Auto-Sub-Marker-List)))))
+ (goto-char (marker-position
+ (car (nth marker-index
+ else-Auto-Sub-Marker-List))))
+ (insert (buffer-substring (marker-position
+ (car (nth 1
+ else-Auto-Sub-Marker-List)))
+ (1- (marker-position
+ (cdr (nth 1
+ else-Auto-Sub-Marker-List))))))
+ (setq marker-index (1+ marker-index))
+ )
+ )
+ )
+ )
+ )
+ )
+
+(defun else-after-token ()
+ "Test if string preceeding point is a valid token."
+ (let ((here (point))
+ (result nil))
+ (save-excursion
+;; (if (else-scan-for-match "\\( \\|\t\\)\\|\\(^\\)" nil t)
+ (setq match-scan (format "\\([^%s]+\\)\\|\\(^\\)"
+ (cdr (assoc else-Valid-Idents-ref
+ Language-Specifics))))
+ (if (else-scan-for-match match-scan nil t)
+ (if (not (= (point) here))
+ (progn
+ ;; We have found a (potential) token string, have to make a
+ ;; small adjustment here for detected white-space. Note that no
+ ;; adjustment required if we matched the beginning of line (^)
+ ;; (that's why I used the \\( groupings)
+ (if (match-string 1)
+ (forward-char)
+ )
+ (if (else-look-up (buffer-substring
+ (point)
+ here) ?t)
+ (progn
+ ;; We have a valid token, so save the start and end of the
+ ;; text that was matched.
+ (setq else-placeholder-start (point))
+ (setq else-placeholder-end here)
+ (setq else-definition-type ?t)
+ ;; No duplication possible....
+ (setq else-please-duplicate nil)
+
+ (setq else-definition-name (buffer-substring
+ (point) here))
+
+ ;; Get the definition while we are here....
+ (setq else-current-definition (else-look-up
+ else-definition-name
+ else-definition-type))
+ (setq result t)
+ )
+ )
+ )
+ )
+ )
+ )
+ result
+ )
+ )
+
+;; These variables are used for diagnostic purposes only. They will eventually
+;; (?) disappear once I am convinced the before and after change code has all
+;; the wrinkles removed.
+(defvar else-before-var nil)
+(defvar else-after-var nil)
+(defvar zero-diff 0)
+(defvar zero-begin 0)
+(defvar zero-end 0)
+
+;; The Placeholder and Token variables are obarrays of considerable
+;; length. Rather than take up space in Emacs memory when ELSE is not active,
+;; I don't bother initialising them until they are required. This routine is
+;; called by the language loading procedures.
+(defun else-check-and-init-globals (language)
+ "If language doesn't exist, create a set of variables for it."
+ (let ((result t))
+ (if (not (assoc language else-Language-Definitions))
+ (progn
+ (setq result nil)
+ (setq Placeholder
+ (make-vector else-Placeholder-Vector-Size 0))
+ (setq Token (make-vector else-Token-Vector-Size 0))
+ (setq Language-Specifics
+ (list (cons else-Language-Name "")
+ (cons else-Punctuation-ref "")
+ (cons else-Punctuation-Length-ref 0)
+ (cons else-Initial-String-ref "")
+ (cons else-Self-Insert-Characters-ref "")
+ (cons else-Self-Insert-Characters-Length-ref 0)
+ (cons else-Valid-Idents-ref "")
+ (cons else-Valid-Idents-Length-ref 0)
+ (cons else-tab-size-ref 4)
+ (cons else-language-version-ref "")))
+ ;; Put the new variable set into the global structure.
+ (setq else-Language-Definitions
+ (cons
+ (cons language
+ (list Placeholder Token Language-Specifics))
+ else-Language-Definitions))
+ )
+ )
+ result
+ )
+ )
+
+;;
+;; Function that runs as part of the before change functions. Its main job is
+;; to determine whether the command is a "self-insert" and if so, whether the
+;; cursor is within a placeholder, if these conditions are true then it must
+;; delete the placeholder before allowing the command to proceed. It also
+;; checks whether the placeholder is part of an auto-substitute pairing and if
+;; so, sets up the appropriate global variables for use by the after change
+;; function.
+(defun else-before-change (begin end)
+ (let ((data (match-data))
+ (is-auto-sub)
+ (this-pos)
+ (this-column)
+ (vert-dup)
+ (valid-search)
+ (action-struct)
+ (marker-index)
+ (sub-marker-counter)
+ (sub-marker-counter-limit))
+ (progn
+ (cond (else-in-xemacs
+ ;; Make sure that the flag is reset i.e. it is possible
+ ;; (but unlikely) that the variable was not cleared for
+ ;; some reason by the after change function. This is just
+ ;; a precaution...
+ (setq else-move-change nil)))
+ (save-excursion
+ ;; Ideally we want to detect any advertised-undo commands at
+ ;; this point so that we don't try and duplicate changes in
+ ;; the after-change function. Unfortunately, command
+ ;; processing has apparently set the "this-command" variable
+ ;; to "t" ie it is useless to detect the change here - we will
+ ;; use the undo-in-progress flag in the after-change-function
+ ;; to handle things - thanks to Stefan Monnier for this tip.
+ (setq else-before-var (append (list begin end
+ (symbol-name this-command))
+ else-before-var))
+ (setq zero-begin (append (list begin end) zero-begin))
+ (if (equal 0 (- end begin))
+ (progn
+ (setq zero-diff (+ 1 zero-diff))
+ (setq zero-begin 0)))
+
+ ;; check if the change is a keystroke i.e. a "self-insert"
+ ;; character/command. We detect this by checking if the length of the
+ ;; keystrokes is 1 e.g. a single keypress will result in a single length
+ ;; key vector from the "this-command-keys-vector" function. This is a
+ ;; "safe" test because any "and" will "short-circuit" on the first
+ ;; "evaluation" that equates to "nil". i.e. the compare-strings won't
+ ;; "happen" unless the length of the key vector is 1.
+ (setq zero-diff (1+ zero-diff))
+
+ ;; Only process changes in a placeholder if the change region is not
+ ;; exactly the boundaries of an existing placeholder i.e. commands such
+ ;; as insert register etc will delineate begin/end as being outside the
+ ;; start/end of a placeholder whereas a simple insert will have a
+ ;; begin/end pairing within these boundaries. Innocuous changes such as
+ ;; text properties on a placeholder will have the begin/end pair
+ ;; matching the else-placeholder-start/else-placeholder-end and so we
+ ;; should(?) ignore them.
+ (if (and (else-in-placeholder)
+ (not (= begin else-placeholder-start))
+ (not (= end else-placeholder-end)))
+ (progn
+ ;; Check if the template definition contains an "oninsert" elisp
+ ;; action - call it if it does.
+ (condition-case err
+ (progn
+ (setq action-struct (get else-current-definition
+ 'else-elisp-action))
+ (if (assoc else-oninsert-key action-struct)
+ (funcall (intern-soft
+ (cdr (assoc else-oninsert-key
+ action-struct))))))
+ (void-function
+ (message "Symbol's function definition is void: %s"
+ (cdr (assoc else-oninsert-key action-struct))))
+ (error
+ (message "%s" (error-message-string err))))
+
+ (setq zero-diff (1+ zero-diff))
+ (setq is-auto-sub (char-equal (get else-current-definition
+ 'else-substitute-ref)
+ ?a))
+ ;; In a placeholder it is either an auto-substitute or
+ ;; not, in either case clear out the substitution
+ ;; markers.
+ (setq sub-marker-counter-limit
+ (car else-Auto-Sub-Marker-List))
+ (setq sub-marker-counter 1)
+ (while (< sub-marker-counter sub-marker-counter-limit)
+ (set-marker (car (nth sub-marker-counter
+ else-Auto-Sub-Marker-List))
+ nil)
+ (set-marker (cdr (nth sub-marker-counter
+ else-Auto-Sub-Marker-List))
+ nil)
+ (setq sub-marker-counter (1+ sub-marker-counter)))
+ ;; The markers aren't "active" yet, must make sure that
+ ;; the secondary markers/placeholders are present!
+ (setq else-Auto-Sub-Active nil)
+ (if is-auto-sub
+ (progn
+ (set-marker (car (nth 1 else-Auto-Sub-Marker-List))
+ else-placeholder-start)
+ (set-marker (cdr (nth 1 else-Auto-Sub-Marker-List))
+ (1+ else-placeholder-end))))
+
+ ;; XEmacs change - once again not guarded because harmless to FSF
+ ;; operation. XEmacs has different behaviour wrt a before-change
+ ;; function altering a buffer. The FSF Emacs seems to perform the
+ ;; change at the position that 'point' is after exiting the
+ ;; before-change-function (despite whatever changes occurred in the
+ ;; function) but XEmacs does not i.e. if you delete X characters
+ ;; then the point at which a self-insert character is placed will
+ ;; be "offset" by that length i.e. it will go into the buffer at
+ ;; the wrong place which is the offset from 'point from the start
+ ;; of the placeholder. So we provide the after change function
+ ;; with an indication of where the change should have occurred...
+ (set-marker else-move-to-position else-placeholder-start)
+ (setq else-move-change t)
+
+ ;; Check if this is an "auto-substitute" placeholder, if so then
+ ;; set a flag and create some markers to where the placeholder
+ ;; substitution is required. Note that the front and back markers
+ ;; are used in later invocations of this function to determine
+ ;; whether the cursor and the action taken should be duplicated in
+ ;; the auto-substitute string.
+ ;;
+ (if is-auto-sub
+ (save-excursion
+ (goto-char else-placeholder-end)
+ ;; Set up all of the after change sub markers. The
+ ;; number is controlled by the number of counts in
+ ;; the placeholder definition. We increment the
+ ;; following limit number because of list contains
+ ;; a counter as the first element.
+ (setq sub-marker-counter-limit
+ (1+
+ (get else-current-definition
+ 'else-substitute-count-ref)))
+ ;; Check whether the total number of markers will
+ ;; be adequate to meet the needs of the
+ ;; saubstitution count - if not then 'grow' the
+ ;; list here as the easiest point to do it.
+ (if (> (1- sub-marker-counter-limit)
+ (- (car else-Auto-Sub-Marker-List) 2))
+ ;; Grow the list by the required number....
+ (progn
+ (let ((count-increase
+ (- sub-marker-counter-limit
+ (- (car else-Auto-Sub-Marker-List)
+ 2)
+ 1)))
+ (while (> count-increase 0)
+ (setq else-Auto-Sub-Marker-List
+ (append else-Auto-Sub-Marker-List
+ (list (cons (make-marker)
+ (make-marker)))))
+ (setq count-increase (1- count-increase)))
+
+ (setcar else-Auto-Sub-Marker-List
+ (length (cdr else-Auto-Sub-Marker-List))))))
+
+ (setq valid-search t)
+ ;; Note that the first pair of markers have
+ ;; already been used to capture the master text
+ ;; area, so start at the second set of pairs.
+ (setq sub-marker-counter 2)
+
+ ;; Save the global placeholder variables because
+ ;; kill-placeholder is used within the following
+ ;; FORMS
+ (let ((current-definition else-current-definition)
+ (please-duplicate else-please-duplicate)
+ (deleted-string else-deleted-string)
+ (definition-type else-definition-type)
+ (definition-name else-definition-name)
+ (placeholder-start else-placeholder-start)
+ (placeholder-end else-placeholder-end)
+ (mandatory-placeholder else-Mandatory-Placeholder))
+ (while (and valid-search
+ (<= sub-marker-counter
+ sub-marker-counter-limit))
+ ;; Find the matching string, arguments mean
+ ;; search to end of buffer and don't error if
+ ;; search fails.
+ (if (search-forward else-definition-name nil t)
+ (progn
+ ;; position back into the placeholder
+ ;; and then kill it (even if it is
+ ;; mandatory).
+ (backward-char)
+ ;; Next call just sets up all of the
+ ;; global variables so that the text can
+ ;; be deleted - don't use a
+ ;; kill-placeholder here because it
+ ;; would destroy the information that is
+ ;; required to be kept.....
+ (else-in-placeholder)
+ (if else-please-duplicate
+ (delete-region else-placeholder-start
+ (+ else-placeholder-end 3))
+ (delete-region else-placeholder-start
+ else-placeholder-end))
+
+ (if (> sub-marker-counter
+ (car else-Auto-Sub-Marker-List))
+ (progn
+ ;; we need to grow the list
+ (error
+ "growth of sub marker list not implemented")
+ )
+ (set-marker (car
+ (nth sub-marker-counter
+ else-Auto-Sub-Marker-List))
+ (point))
+ (set-marker (cdr
+ (nth sub-marker-counter
+ else-Auto-Sub-Marker-List))
+ (1+ (point)))))
+ (setq valid-search nil))
+
+ (setq sub-marker-counter (1+ sub-marker-counter)))
+
+ ;; Restore the global variables.
+ (setq else-current-definition current-definition)
+ (setq else-please-duplicate please-duplicate)
+ (setq else-deleted-string deleted-string)
+ (setq else-definition-type definition-type)
+ (setq else-definition-name definition-name)
+ (setq else-placeholder-start placeholder-start)
+ (setq else-placeholder-end placeholder-end)
+ (setq else-Mandatory-Placeholder mandatory-placeholder))
+
+ ;; This is not legacy code
+ (setq else-Auto-Sub-Active t)
+
+ ;; Set the substitute "toggle" flag. This variable
+ ;; is only used the first time that the
+ ;; placeholder is deleted. It is used in the
+ ;; "after" change function because the begin/end
+ ;; pair is "screwed" up by what is happening here
+ ;; ie it receives a "begin" which is after the
+ ;; "end" and the difference is the difference
+ ;; between the beginning of the placeholder string
+ ;; and the current cursor position within the
+ ;; placeholder.
+ (setq else-sub-active-toggle t)))
+
+ (if else-please-duplicate
+ (delete-region else-placeholder-start
+ (+ else-placeholder-end 3))
+ (delete-region else-placeholder-start else-placeholder-end))
+
+ (setq else-deleted-column (current-column))
+
+ ;; if the placeholder is/was trailed by a duplication request
+ ;; indicator (...) then replicate it not only in the primary
+ ;; location but also in any repeat/auto-substitute locations.
+ (if else-please-duplicate
+ (save-excursion
+ (setq this-pos (point))
+ ;; Work out the duplication requirements only if the
+ ;; placeholder definition is context_dependent i.e. it
+ ;; is not being overridden explicitly in the
+ ;; definition.
+ (setq vert-dup (get else-current-definition
+ 'else-duplication-ref))
+ (if (char-equal vert-dup ?c)
+ (if (not (else-scan-for-match "[^ \t]" nil t))
+ (setq vert-dup ?v)
+ (setq vert-dup ?h)))
+
+ (goto-char this-pos)
+ (else-replicate-placeholder-string vert-dup
+ else-deleted-column
+ else-current-definition)
+ ;; Now lets replicate the auto-sub placeholders - this would
+ ;; be considered to be an unusual event but may be required
+ ;; in the case of duplication of parameters etc of
+ ;; function/procedure calls as might be desired by languages
+ ;; that allow/require a declaration and a definition.
+ (setq marker-index 2)
+ (while (and (marker-position
+ (car (nth marker-index
+ else-Auto-Sub-Marker-List)))
+ (<= marker-index (car
+ else-Auto-Sub-Marker-List)))
+ ;; Position at the start of where the original placeholder
+ ;; was.
+ (setq this-pos (marker-position (car (nth marker-index
+ else-Auto-Sub-Marker-List))))
+
+ ;; Have to calculate the column number for the call to
+ ;; replicate....
+ (goto-char this-pos)
+ (beginning-of-line)
+ (setq this-column (- this-pos (point)))
+ (goto-char this-pos)
+ ;; Now do the replication
+ (else-replicate-placeholder-string vert-dup
+ this-column
+ else-current-definition)
+ (setq marker-index (1+ marker-index))))))
+
+ (progn
+ ;; This is the point where we have decided that we are not in
+ ;; a placeholder, so therefore it is not a situation of
+ ;; deleting any placeholders etc. for an insertion.
+ ;;
+ ;; Check whether auto-substitute should be cancelled (if
+ ;; active).
+ (if else-Auto-Sub-Active
+ (progn
+ ;; OK, need to check whether auto-sub mode should
+ ;; remain active.
+ (if (not
+ (and (>= begin
+ (car (nth 1 else-Auto-Sub-Marker-List)))
+ (<= end
+ (cdr (nth 1 else-Auto-Sub-Marker-List)))))
+ (setq else-Auto-Sub-Active nil))))))
+
+ ;; The 'else' case of this not being a self-insert (basically). This is
+ ;; a real problem because just deleting the placeholder can cause
+ ;; serious problems for some commands i.e. 'erase-buffer after
+ ;; performing a kill-placeholder will crash Emacs! There is insufficient
+ ;; information in the Elisp manual about what you can and cannot do in a
+ ;; before-change-function, so the following code was used extensively
+ ;; (well, it was active for some considerable time :-)) in my edit
+ ;; sessions with no bad side-effects - so it must be OK?
+ (if (else-in-placeholder)
+ ;; There is at least one command, erase-buffer, that doesn't like
+ ;; the contents of the buffer being changed. So, limit the
+ ;; execution of the kill-placeholder command to the situation
+ ;; where it only occurs if the (begin . end) change area is within
+ ;; the limits of the placeholder.
+ (if (and (> begin else-placeholder-start)
+ (< begin else-placeholder-end))
+ ;; There doesn't seem to be any reason to check the 'end
+ ;; variable i.e. commands like insert-register, kill-line etc
+ ;; seem to have only a single variable in the 'begin.
+ (progn
+ (else-kill-placeholder t t t)
+ (set-marker else-move-to-position else-placeholder-start)
+ (setq else-move-change t))))))
+
+ ;; restore the match data
+ (set-match-data data)))
+
+(defun else-check-language-file (path-name)
+ "Check if the file contains a fast load version and verify validity.
+Validity checking entails the date stamps on the .esl file versus the time
+stamp on the .lse file. A warning is issued if the .esl version is younger than
+the .lse version ie the fast load version should be recompiled."
+ (let ((file-name)
+ (split-name)
+ (file-name-with-esl)
+ (file-name-with-lse)
+ (fast-mod-time)
+ (slow-mod-time))
+ ;; Split the path up into path+name and extension.
+ (setq split-name (split-string path-name "\\."))
+ (if (= (length split-name) 2)
+ (progn
+ (setq file-name (car split-name))
+ )
+ ;; Otherwise, no extension available.
+ (setq file-name path-name)
+ )
+ ;; Next check the timestamps of the two versions of the files.
+ (setq file-name-with-esl (concat file-name else-esl-ext))
+ (setq file-name-with-lse (concat file-name else-lse-ext))
+ (if (and (file-exists-p file-name-with-esl)
+ (file-exists-p file-name-with-lse))
+ (progn
+ (setq fast-mod-time
+ (nth 5 (file-attributes file-name-with-esl)))
+ (setq slow-mod-time
+ (nth 5 (file-attributes file-name-with-lse)))
+ (if (or (> (car slow-mod-time) (car fast-mod-time))
+ (and (= (car slow-mod-time) (car fast-mod-time))
+ (> (cadr slow-mod-time) (cadr fast-mod-time))))
+ (message "%s.esl is older than %s.lse"
+ file-name file-name)
+ )
+ )
+ )
+ )
+ )
+
+;; Clean up (delete) all lines that contain placeholders. This would be the
+;; final step after all coding is complete.
+(defun else-cleanup-placeholders ()
+ "Delete every _line_ in the buffer containing a valid placeholder.
+Note the emphasis on _line_, so be careful :-)."
+ (interactive)
+ (let ()
+ (progn
+ (save-excursion
+ (goto-char (point-min))
+ (while (not (= (point) (else-next-placeholder)))
+ (else-kill-placeholder nil t)
+ )
+ )
+ )
+ )
+ )
+
+
+;; Rip thru' the buffer (or narrowed region) and place comment characters
+;; on each line that has a valid placeholder. Use the 'comment-region
+;; function, so end comments will be placed as well.
+(defun else-comment-placeholders ()
+ "Comments out every line in the buffer containing a valid placeholder.
+This function uses the 'comment-region' function to achieve this miracle of
+modern science."
+ (interactive)
+ (let ((region-start)
+ (region-end))
+ (progn
+ (save-excursion
+ (goto-char (point-min))
+ (while (not (= (point) (else-next-placeholder)))
+ (progn
+ (beginning-of-line)
+ (setq region-start (point))
+ (end-of-line)
+ (setq region-end (point))
+ (comment-region region-start region-end)
+ (end-of-line)
+ )
+ )
+ )
+ )
+ )
+ )
+
+;;
+;; "Compile" the language template definitions in the current buffer.
+;; Processes from `point' to the end of the buffer.
+(defun else-compile-buffer (&optional start-at-point-min)
+ "Compile the language template definitions from 'point' to the end."
+ (interactive "P")
+ (let ((command)
+ (err-msg nil)
+ (here (point))
+ ;; User may not like UPPER-CASE in the template file - sigh......
+ (case-fold-search t))
+ (setq err-msg
+ (catch 'compile
+ (if start-at-point-min
+ (goto-char (point-min)))
+ (while (not (= (point) (point-max)))
+ (progn
+ ;;Only look if the line isn't a comment line
+ (if (not (else-scan-for-match else-template-comment nil))
+ (if (else-scan-for-match else-defining-string nil)
+ (progn
+ ;; Get the command, either a DELETE or a DEFINE
+ (setq command (match-string else-defining-command))
+ (cond ((string= command "DELETE")
+ ;; Actions to delete a definition
+ (else-delete-a-definition))
+ ((string= command "DEFINE")
+ ;; Actions to define a definition
+ (else-read-a-definition))
+ ((string= command ";;")
+ (setq command 1))
+ (t
+ ()))))
+ ;; if-else to template comment string search - do nothing
+ ))
+ (forward-line))))
+
+ ;; If there has been an error then leave point at the error,
+ ;; otherwise return the user to the starting point.
+ (if err-msg
+ (progn
+ (message "Aborted - %s" err-msg)
+ nil)
+ (goto-char here)
+ t)))
+
+(defun else-compile-fast-load (language-file-name)
+ "Make an Emacs Lisp loadable file from a standard language template file.
+The resulting file has a .esl extension as opposed to the .lse extension
+of a normal language template file."
+ (interactive "fName of language file:")
+ (let ((file-ext-start)
+ (compiled-file-name)
+ (language-input-buffer)
+ (result nil)
+ (auto-mode-alist nil)
+ (else-lse-ext-search-string (concat "\\" else-lse-ext)))
+
+ ;; Check if the file contains the ELSE file extension.
+ (setq file-ext-start
+ (string-match else-lse-ext-search-string language-file-name))
+ (if (not file-ext-start)
+ ;; Take the easy out here and just tack on the .lse extension.
+ (setq language-file-name (append language-file-name else-lse-ext))
+ )
+ ;; Check if the file exists
+ (if (file-exists-p language-file-name)
+ (progn
+ ;; locate the start of the normal file extension because we have to
+ ;; construct a file name using the new file extension.
+ (setq file-ext-start
+ (string-match else-lse-ext-search-string language-file-name))
+
+ ;; Copy the entire language file name to the place where the
+ ;; compiled version of the name will be created.
+ (setq compiled-file-name (substring language-file-name 0))
+ ;; create the compiled version
+ (store-substring compiled-file-name file-ext-start else-esl-ext)
+
+ (save-excursion
+ ;; Read the language template into a buffer and "compile" it.
+ (setq language-input-buffer
+ (find-file-noselect language-file-name))
+ (set-buffer language-input-buffer)
+ (setq result (else-compile-buffer))
+ (if result
+ (progn
+ ;; Dump the language to the file
+ (else-dump-language compiled-file-name)
+ )
+ (message "Failed to compile %s" language-file-name)
+ )
+ ;; Clean up the input buffer.
+ (kill-buffer language-input-buffer)
+ )
+ )
+ (message "File %s doesn't exist." language-file-name)
+ )
+ )
+ )
+
+;;
+;; Delete either a "LANGUAGE", "PLACEHOLDER" or "TOKEN" definition.
+;; Called upon detection of the "DELETE" token in the template source file.
+;;
+(defun else-delete-a-definition ()
+ (let ((obarray-name nil)
+ (array-type nil)
+ (language-name "")
+ (current-language else-Current-Language)
+ (object-name)
+ (defining-type))
+ ;; Get the 'type' of thing being deleted ie LANGUAGE, PLACEHOLDER or TOKEN
+ (setq defining-type (match-string else-defining-type))
+ (cond ((string= defining-type "PLACEHOLDER")
+ (setq array-type ?p))
+ ((string= defining-type "TOKEN")
+ (setq array-type ?t))
+ ((string= defining-type "LANGUAGE")
+ (else-delete-language-definition))
+ )
+ (if array-type
+ (progn
+ ;;
+ ;; Get the name of the item being deleted first then move on and get
+ ;; the target language database to perform the operation upon.
+ ;;
+ (setq object-name
+ (else-strip-quotes (match-string else-defining-name)))
+ (forward-line)
+ (if (else-scan-for-match else-body-string nil)
+ (progn
+ (setq language-name
+ (else-strip-quotes (match-string else-body-command-2)))
+ (if language-name
+ (progn
+ (if (else-establish-language language-name)
+ (progn
+ (cond ((char-equal array-type ?p)
+ (setq obarray-name Placeholder)
+ )
+ ((char-equal array-type ?t)
+ (setq obarray-name Token)
+ )
+ )
+ (if obarray-name
+ (unintern (upcase object-name) obarray-name)
+ )
+ )
+ (message "This language (%s) has not been defined!"
+ language-name)
+ )
+ ;; restore the 'original' language i.e. might
+ ;; have template language enabled for a .lse
+ ;; file that contains definitions for some other
+ ;; language - so compiling a definition
+ ;; shouldn't destroy the current language
+ ;; settings for the buffer.
+ (else-establish-language current-language)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+
+;; Unintern or "Delete" an entry in `obarray'. This function is used as an
+;; argument to the mapatoms command.
+(defun else-delete-entry (s)
+ (let ()
+ (if (not (unintern s))
+ (message "Can't delete from obarray!")
+ )
+ )
+ )
+
+;;
+;; Delete a language definition from the Global Template definitions.
+;; Called when the sequence "DELETE LANGUAGE" has been parsed in the
+;; language template definition file.
+;;
+(defun else-delete-language-definition ()
+ (let ((language-name "")
+ (language-assoc)
+ (current-language else-Current-Language))
+ (progn
+ (setq language-name
+ (else-strip-quotes (match-string else-defining-name)))
+ (if (else-establish-language language-name)
+ (progn
+ (mapatoms (lambda (s)
+ (if (not (unintern s Placeholder))
+ (message "Can't delete from Placeholder")
+ )
+ )
+ Placeholder
+ )
+ (mapatoms (lambda (s)
+ (if (not (unintern s Token))
+ (message "Can't delete from Token")
+ )
+ )
+ Token
+ )
+ (setq language-assoc
+ (assoc language-name else-Language-Definitions))
+ (if language-assoc
+ (progn
+ ;;
+ ;; The 'delete' command doesn't seem to work, so I will
+ ;; adopt a strategy of "emptying" the language entry
+ ;; Unless I apply logic to "re-use" the slot, then
+ ;; we will waste the memory allocated to the vectors
+ ;; but at the moment I don't care.
+ ;;
+ (setq else-Language-Definitions
+ (delete (assoc language-name else-Language-Definitions)
+ else-Language-Definitions))
+ )
+ )
+ )
+ )
+ ;; restore the 'original' language i.e. might have template
+ ;; language enabled for a .lse file that contains definitions
+ ;; for some other language - so compiling a definition shouldn't
+ ;; destroy the current language settings for the buffer.
+ (else-establish-language current-language)
+ )
+ )
+ )
+
+;;
+;; Delete or "Kill" the placeholder in which `point' resides. The 'force' option
+;; is added because it is possible for else-mode to want to kill a placeholder
+;; and it really means it wants to - this situation arises when creating new
+;; language templates and the second /LANGUAGE="{language_name}" has been
+;; defined as a AUTO-SUBSTITUTE - in this case the else-before-change function
+;; really does want to kill the second occurrence but we really do want to keep
+;; the definition as a mandatory just in case the user doesn't want to define
+;; this placeholder type (language_name).
+;;
+(defun else-delete-placeholder (&optional leave-spacing force dont-kill-empty-lines)
+ "Delete the placeholder at `point'. Clean up syntactically."
+ (interactive "i\nP")
+ (let ((separator)
+ (separator-region-end)
+ (had-left-space nil)
+ (had-right-space nil)
+ (here)
+ (search-limit)
+ (string-index)
+ (new-separator-search))
+
+ (catch 'problem
+ (if (not else-mode)
+ (progn
+ (error "ELSE mode not enabled.")
+ (throw 'problem nil)
+ )
+ )
+
+ ;; Check if we are in a valid placeholder and also that the detected
+ ;; placeholder is not mandatory (the else-Mandatory-Placeholder flag is
+ ;; set as a side effect of the call to else-in-placeholder).
+ (if (else-in-placeholder)
+ (if (or (not else-Mandatory-Placeholder) force)
+ (progn
+ ;; Make sure we keep a copy of the text of the
+ ;; placeholder being deleted - this is mainly because
+ ;; of the symbol-name of the definition doesn't
+ ;; reflect the same character casing of the text being
+ ;; deleted.
+ (setq else-deleted-string (buffer-substring
+ else-placeholder-start
+ else-placeholder-end))
+
+ (goto-char else-placeholder-end)
+
+ (if else-please-duplicate
+ (delete-region else-placeholder-start (+ (point) 3))
+ (delete-region else-placeholder-start (point))
+ )
+
+ ;; Pause here a moment and check what "spacing" surrounded the
+ ;; deleted placeholder.
+ (if (char-or-string-p (preceding-char))
+ (setq had-left-space
+ (char-equal (preceding-char) ?\ ))
+ (setq had-left-space nil)
+ )
+
+ (if (char-or-string-p (following-char))
+ (setq had-right-space
+ (char-equal (following-char) ?\ ))
+ (setq had-right-space nil)
+ )
+
+ ;; Process a placeholder that maintains a "separator" string
+ (setq separator (get else-current-definition 'else-separator-ref))
+ (if (> (length separator) 0)
+ (progn
+ (setq separator-region-end (point))
+ ;; Set a limit as the beginning of the previous line, this
+ ;; is a worst case situation.
+ (forward-line -1)
+ (setq search-limit (point))
+ (goto-char separator-region-end)
+
+ ;; Note that some major modes provide trimming of trailing
+ ;; spaces on file-save! So, any template separators may
+ ;; have one or more trailing spaces stripped off in the
+ ;; buffer (if they appear at a line and the file was saved
+ ;; and then re-edited i.e. the separator won't get
+ ;; matched! So the following code looks for the separator
+ ;; in it's entirety, then if not found it trims off
+ ;; trailing spaces and attempts to do a regexp match for
+ ;; the separator.
+
+ (if (search-backward separator search-limit t)
+ (delete-region (point) separator-region-end)
+ ;; not found
+ (progn
+ ;; check for special case mentioned above i.e. if
+ ;; there is a trailing space in the separator, has it
+ ;; been deleted accidently?
+ (if (char-equal
+ (aref separator (1- (length separator))) ?\ )
+ ;; there is at least one trailing space, so make
+ ;; up a new search string. Might as well make it a
+ ;; regexp.
+ (progn
+ (setq string-index (1- (length separator)))
+ (while (and (< 0 string-index)
+ (char-equal
+ (aref separator string-index) ?\ ))
+ (setq string-index (1- string-index))
+ )
+ ;; Now make a regexp which is the left over
+ ;; separator character(s) plus " +" at the end.
+ (setq new-separator-search
+ (make-string (+ 3 string-index) ?\ ))
+ ;; Copy the separator character(s) over.
+ (while (not (= -1 string-index))
+ (aset new-separator-search string-index
+ (aref separator string-index))
+ (setq string-index (1- string-index))
+ )
+ ;; Now append the regexp for a series of spaces.
+ (aset new-separator-search
+ (1- (length new-separator-search))
+ ?*)
+ (aset new-separator-search
+ (- (length new-separator-search) 2)
+ ?\ )
+ ;; Now try the search.
+ (if (re-search-backward
+ new-separator-search search-limit t)
+ ;; found
+ (delete-region (point) separator-region-end)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ (setq here (point))
+
+ ;; If this leaves the line blank, then delete the entire line
+ (end-of-line)
+ (if (and (not (else-scan-for-match "[^ \t]" nil t))
+ (not dont-kill-empty-lines))
+ (progn
+ (beginning-of-line)
+ (kill-line)
+ )
+ ;; Line is not blank
+ (progn
+ (goto-char here)
+ ;; If there was a space before and after the placeholder
+ ;; then "clean-up" by deleting one more space under
+ ;; point. Groan.... only if there is more than one space!
+ (if (and (not leave-spacing) had-right-space had-left-space
+ (char-equal (preceding-char) ?\ )
+ (char-equal (following-char) ?\ ))
+ (delete-char 1)
+ )
+ ;; Finally, if it is a "punctuation" character of the
+ ;; language then make sure there is no preceding space. But
+ ;; if it's not at the start of a line (and the leave-spacing
+ ;; hasn't been requested) (exceptions... exceptions...
+ ;; *sigh*)
+ (if (not (= (current-column) 0))
+ (if (and (not leave-spacing)
+ (aref Language-Punctuation-Characters-Vector
+ (following-char)))
+ (while (char-equal (preceding-char) ?\ )
+ (delete-char -1)
+ )
+ )
+ )
+ )
+ )
+ )
+ (error "Can't delete - mandatory entry required")
+ )
+ )
+ )
+ )
+ )
+
+
+;;
+;; Display the list of possible matches for the expand-a-word function, it is
+;; not called unless there is more than one possible match
+;;
+(defun else-display-menu (possible-matches &optional momentary-only)
+ "Display menu of possible choices. Doubles as prompt display as well - yuk."
+ (let ((my-buffer)
+ (start-window (selected-window))
+ (menu-string ""))
+ (save-window-excursion
+ (save-excursion
+ ;; Process all of the possible matches into a list of strings
+ ;; appropriate for display to the user.
+ (dolist (match-element possible-matches)
+ (setq menu-string (concat menu-string
+ (else-display-menu-element match-element))))
+
+ ;; Sometimes we end up with an extraneous carriage return at
+ ;; the end of the menu list - this causes a blank line in the
+ ;; menu display. Get rid of it.
+ (if (= (elt menu-string (1- (length menu-string))) ?\n)
+ (aset menu-string (1- (length menu-string)) ?\ ))
+ ;; Set the selection item to nothing
+ (setq else-selected-text nil)
+
+ ;; Create and point to the appropriate buffer i.e. if a momentary
+ ;; display then use a separate buffer to that used by the menu selection
+ ;; process.
+ (if momentary-only
+ (progn
+ (setq my-buffer (get-buffer-create " *ELSE Placeholder Prompt*"))
+ (set-buffer my-buffer)
+ )
+ ;; Otherwise it is a menu display of possible choices, so create a
+ ;; temporary buffer and display the data.
+ (setq my-buffer (get-buffer-create " *ELSE Menu List*"))
+ (set-buffer my-buffer)
+ (if (and else-set-lineno (featurep 'setnu))
+ ;; Don't have to worry about "standard" minor mode behaviour of
+ ;; each call "toggling" the mode as this mode allows a positive
+ ;; argument to indicate that the mode should be turned on.
+ (setnu-mode 1)))
+
+ (erase-buffer)
+
+ ;; Am now pointing into the appropriate buffer so insert the data for
+ ;; display.
+ (setq truncate-lines t)
+ (insert menu-string)
+
+ ;; Now position the cursor appropriately, size the window to fit the
+ ;; buffer to be displayed and then display it.
+ (goto-char (point-min))
+ (split-window (selected-window))
+ (set-window-buffer start-window my-buffer)
+ ;; Finally, size the window to match the size of the buffer i.e. no
+ ;; point in displaying a window that is unnecessarily large.
+ (shrink-window-if-larger-than-buffer start-window)
+ (select-window start-window)
+ (setq major-mode 'else-Display)
+ (use-local-map else-menu-mode-map)
+ (setq mode-name "ELSE mode")
+ (if momentary-only
+ (sit-for else-prompt-time)
+ (recursive-edit)
+ )
+ )
+ )
+ )
+ )
+
+(defun else-display-menu-element (body-element)
+ "Given a definition body element, extract the appropriate
+information for inclusion in a menu display and format it
+appropriately. Return the resultant string."
+ (let ((description nil)
+ (element-text)
+ (current-type)
+ (result ""))
+
+ (setq element-text (elt body-element else-body-text-ref))
+ (setq current-type (elt body-element else-body-type-ref))
+ (if current-type
+ (progn
+ (setq description
+ (else-get-description element-text current-type))
+ (cond ((char-equal current-type ?p)
+ (setq result (concat result
+ (format "{%s}" element-text))))
+ ((char-equal current-type ?t)
+ (setq result (concat result
+ (format "\"%s\"" element-text))))
+ )
+ (if description
+ (setq result (concat result (format " - %s\n" description)))
+ (setq result (concat result "\n"))
+ )
+ )
+ (setq result (concat result
+ (format "\"%s\"\n" element-text)))
+ )
+ result
+ )
+ )
+
+(defun else-dump-language (compiled-file-name)
+ "Dump the current buffer language template to the named file.
+Note that the file name parameter must have been already vetted to make sure
+it complies with the else naming conventions ie .esl"
+ (let ((language-output-buffer))
+ ;; The language definition should be in the local copies of Placeholder,
+ ;; Token and Language-Specifics. So we can take that and write it out to
+ ;; the language compilation file.
+ (save-excursion
+ (setq language-output-buffer
+ (find-file-noselect compiled-file-name t))
+ (set-buffer language-output-buffer)
+ (setq else-read-marker (point-marker))
+ )
+
+ ;; Ok, all set to write the data to the buffer. Write the language specific
+ ;; information and then each element of the Placeholder and Token obarrays.
+ (print Language-Specifics else-read-marker)
+ (setq else-type-of-symbols ?p)
+ (mapatoms 'else-store-element Placeholder)
+ (setq else-type-of-symbols ?t)
+ (mapatoms 'else-store-element Token)
+
+ (save-excursion
+ (set-buffer language-output-buffer)
+ (save-buffer)
+ )
+ ;; Clean up the output buffer.
+ (kill-buffer language-output-buffer)
+ )
+ )
+
+;;
+;; Make sure that all key-bindings that bind to the expansion command are
+;; echoed in the menu selection keymap ie the user doesn't have to move his
+;; fingers from the command that caused a menu pick list to be displayed.
+;;
+(defun else-enable-dups (map command-to-search-out replacement-command)
+ (let (abc)
+ (setq abc (where-is-internal command-to-search-out))
+ (while abc
+ (progn
+ (define-key map (car abc) replacement-command)
+ (setq abc (cdr abc))
+ )
+ )
+ )
+ )
+
+;;
+;; Set the local buffer variables to the appropriate language definition
+;; templates.
+(defun else-establish-language (language-name)
+ "Set language template set 'language-name as the current template
+set for this buffer."
+ (let ((language-assoc)
+ (result nil))
+ (setq language-assoc
+ (cdr (assoc language-name else-Language-Definitions)))
+ (if language-assoc
+ (progn
+ (setq Placeholder (car language-assoc))
+ (setq Token (car (cdr language-assoc)))
+ (setq Language-Specifics (car (cdr (cdr language-assoc))))
+ (setq else-Current-Language language-name)
+ (setq result t)
+ )
+ )
+ result
+ )
+ )
+
+(defun else-expand-item-at-overlay (item)
+ "Expand the object (placeholder or token) 'item at the location of the
+else-placeholder-overlay. This defun is designed to be called by an external
+entity with a selection from a menu that was constructed using
+else-get-menu-entries. It must work in conjunction with the use of the Overlay
+denoted by else-placeholder-overlay."
+ (let ((this-definition nil)
+ (origin nil))
+ ;; Protect against inadvertant use
+ (catch 'problem
+ (if (not else-mode)
+ (progn
+ (error "ELSE mode not enabled.")
+ (throw 'problem nil)
+ )
+ )
+ (if (overlayp else-placeholder-overlay)
+ (progn
+ (goto-char (1+ (overlay-start else-placeholder-overlay)))
+ (setq origin (point))
+ ;; 'process' the selected menu entry - note the expectation that any
+ ;; item entered to this defun must be encoded using the format that
+ ;; else-get-menu-entries imposes.
+ (setq else-selected-text (else-extract-item item))
+
+ ;; see if the item is a placeholder or token. This is made easier
+ ;; because the menu encoding adds {}'s to placeholders and leaves
+ ;; tokens and substitution strings alone!
+ (if (char-equal (elt item 0) ?\{)
+ ;; placeholder
+ (progn
+ (setq this-definition (else-look-up else-selected-text ?p))
+ (if this-definition
+ ;; It's a valid placeholder
+ (else-process-definition this-definition ?p)))
+ ;; must be either a token or a straight string substitution
+ (setq this-definition (else-look-up else-selected-text ?t))
+ (if this-definition
+ (else-process-definition this-definition ?t)
+ ;; Not a placeholder or a token so it must be text to substitute
+ (else-substitute else-selected-text nil)))
+ ;; Now position the cursor intelligently
+ (goto-char origin)
+ (else-next-placeholder)
+ )
+ ;; There is no overlay defined
+ )
+ )
+ )
+ )
+
+;;
+;; Function name is a misnomer, this routine is the general start point for
+;; expanding either a placeholder or a token.
+;;
+(defun else-expand-placeholder ()
+ "Expand the placeholder or token located at `point'."
+ (interactive)
+ (let ((here (point)))
+ (catch 'problem
+ (if (not else-mode)
+ (progn
+ (error "ELSE mode not enabled.")
+ (throw 'problem nil)
+ )
+ )
+
+ ;; Reset the definition type and then work out if there is a
+ ;; valid definition to expand - setting this variables as a side
+ ;; effect.
+ (setq else-definition-type nil)
+
+ (if (else-in-placeholder)
+ (progn
+ ;; Yup, detected a valid placeholder, so just skip
+ ;; straight down and process it.
+ )
+ ;; Else - check if it is as a token.
+ (if (else-after-token)
+ (progn
+ ;; yes, it is a token
+ )
+ )
+ )
+ ;; O.K. If it's a placeholder or a token then process it.
+ (if else-definition-type
+ (progn
+ (if (else-process-definition else-current-definition
+ else-definition-type)
+ (progn
+ ;; A valid definition was processed, so position back to
+ ;; the start of it and proceed to the next placeholder.
+ (goto-char else-placeholder-start)
+ (else-next-placeholder)
+ )
+ )
+ )
+ (progn
+ ;; Not a valid placeholder or a token string. Check to see what
+ ;; behaviour is required. The following code dealing with
+ ;; expand-or-move flag and else-direction flag was added to make ELSE
+ ;; more usable with VoiceCoder. the test for interactiveness is needed
+ ;; because the case no valid placeholder can be found in the
+ ;; search-direction results in a crash (endless loop). This situation
+ ;; is quite likely if you use speech recognition and try to expand a
+ ;; token.
+ (if (and else-move-and-execute (interactive-p))
+ ;; User must desire a movement and then an expansion i.e. the next
+ ;; placeholder can be "seen" and an expansion is desired there.
+ (progn
+ (if else-direction
+ (else-next-placeholder)
+ (else-previous-placeholder)
+ )
+ (else-expand-placeholder)
+ )
+ ;; otherwise default behaviour is to print an error message to the
+ ;; user. This is voice coding slanted: sometimes when called as-if
+ ;; interactive from abbreviations, an error destroys the contents of
+ ;; before-change-functions. I don't know exactly why and where, but
+ ;; this is the solution:
+ (if else-move-and-execute
+ (message "Not a valid placeholder or token.")
+ (goto-char here)
+ (error "Not a valid placeholder or token."))
+ )
+ )
+ )
+ )
+ )
+ )
+
+;;
+;; These routines provide the 'extract' feature of ELSE
+;;
+(defun else-extract-all ()
+ "Extract all placeholders and tokens definitions for the enabled language
+template."
+ (interactive)
+ (let ((current-language else-Current-Language)
+ (sorted-names))
+ ;; Allow a bit of flexibility here, if the user is extracting in a buffer
+ ;; that has language defined then operate on that language, otherwise
+ ;; prompt the user for a language name and then operate on that language
+ ;; definition. Do also if the user is editing an LSE file i.e. template
+ ;; would be the language enabled - which you don't want to extract from
+ ;; :-).
+ (if (else-extract-chk-language)
+ (progn
+
+ ;; Extract the language definition
+ (insert (concat "DELETE LANGUAGE \"" else-Current-Language
+ "\" -"))
+ (newline)
+ (insert (concat "DEFINE LANGUAGE \"" else-Current-Language
+ "\" -"))
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert (concat "/INITIAL_STRING=\""
+ (cdr (assoc else-Initial-String-ref Language-Specifics))
+ "\" -"))
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert (concat "/PUNCTUATION_CHARACTERS=\""
+ (cdr (assoc else-Punctuation-ref Language-Specifics))
+ "\" -"))
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert (concat "/SELF_INSERT_CHARACTERS=\""
+ (cdr (assoc else-Self-Insert-Characters-ref
+ Language-Specifics))
+ "\" -"))
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert (concat "/VALID_IDENTIFIER_CHARACTERS=\""
+ (cdr (assoc else-Valid-Idents-ref
+ Language-Specifics))
+ "\" -"))
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert (concat "/INDENT_SIZE=\""
+ (number-to-string
+ (cdr (assoc else-tab-size-ref
+ Language-Specifics)))
+ "\" -"))
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert (concat "/VERSION=\""
+ (cdr (assoc else-language-version-ref
+ Language-Specifics))
+ "\" -"))
+ (newline)
+ (newline)
+ (insert "END DEFINE")
+ (newline)
+ (newline)
+ ;; Extract all the placeholder and token definitions. Do
+ ;; this by getting a alphabetically sorted list of the
+ ;; placeholder/token names and then processing each of the
+ ;; definitions individually
+ (setq sorted-names (else-return-sorted-list Placeholder))
+ (mapc '(lambda (element-name)
+ (else-extract-a-placeholder
+ (intern-soft (upcase element-name)
+ Placeholder))) sorted-names)
+
+ (setq sorted-names (else-return-sorted-list Token))
+ (mapc '(lambda (element-name)
+ (else-extract-a-token
+ (intern-soft (upcase element-name)
+ Token))) sorted-names)
+
+ ;; Restore the original language (assuming there was one)
+ (if current-language
+ (else-establish-language current-language)
+ )
+ )
+ )
+ )
+ )
+
+;;
+;; Extract an individual placeholder definition. (non-interactive form - see
+;; else-extract-placeholder).
+;;
+(defun else-extract-a-placeholder (placeholder-definition)
+ (let ((selected-definition placeholder-definition)
+ (name)
+ (temp)
+ (tmp)
+ (function-name)
+ (body)
+ (lang-indent-size (cdr (assoc else-tab-size-ref Language-Specifics))))
+
+ (setq name (get selected-definition 'else-original-name))
+ (insert "DELETE PLACEHOLDER ")
+ (if (string-match " " name)
+ (insert (concat "\"" name "\" -"))
+ (insert (concat name " -")))
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert (concat "/LANGUAGE=\"" else-Current-Language "\" -"))
+ (newline)
+ (insert "DEFINE PLACEHOLDER ")
+ (if (string-match " " name)
+ (insert (concat "\"" name "\" -"))
+ (insert (concat name " -")))
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert (concat "/LANGUAGE=\"" else-Current-Language "\" -"))
+ (newline)
+ (indent-to else-Extract-Column)
+ ;; Check to see if the placeholder is a forward reference.
+ (setq temp (get selected-definition 'else-placeholder-ref))
+ (if (car temp)
+ (progn
+ (insert "/PLACEHOLDER=")
+ (insert (concat "\""
+ (car (cdr temp))
+ "\"")))
+ ;; Not a forward reference, so continue with the rest of the information.
+ (progn
+ (setq temp (get selected-definition 'else-substitute-ref))
+ (cond ((char-equal temp ?n)
+ (insert "/NOAUTO_SUBSTITUTE -"))
+ ((char-equal temp ?a)
+ (insert "/AUTO_SUBSTITUTE -")
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert "/SUBSTITUTE_COUNT=")
+ (insert (number-to-string
+ (get selected-definition 'else-substitute-count-ref)))
+ (insert " - "))
+ (t
+ (message "invalid substitute value")))
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert "/DESCRIPTION=")
+ (insert (concat "\"" (get selected-definition 'else-description-ref)) "\"")
+ (setq temp (get selected-definition 'else-duplication-ref))
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert "/DUPLICATION=")
+ (cond ((char-equal temp ?c)
+ (insert "CONTEXT_DEPENDENT -"))
+ ((char-equal temp ?v)
+ (insert "VERTICAL -"))
+ ((char-equal temp ?h)
+ (insert "HORIZONTAL -"))
+ (t
+ (message "Illegal duplication type detected")))
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert (concat "/SEPARATOR=" "\""
+ (get selected-definition 'else-separator-ref)
+ "\" -"))
+ (setq temp (get selected-definition 'else-type-ref))
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert "/TYPE=")
+ (cond ((char-equal temp ?m)
+ (insert "MENU -"))
+ ((char-equal temp ?t)
+ (insert "TERMINAL -"))
+ ((char-equal temp ?n)
+ (insert "NONTERMINAL -"))
+ (t
+ (message "Illegal service detected")))
+ (else-extract-runcode-component)
+ (setq body (get selected-definition 'else-body-ref))
+ (newline)
+ (indent-to else-Extract-Column)
+ (while (car body)
+ (progn
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert "\"")
+ (insert (make-string
+ (* (nth else-body-indent-ref (car body))
+ lang-indent-size)
+ ?\ ))
+ (insert (concat (nth else-body-text-ref (car body)) "\""))
+ (setq temp (nth else-body-type-ref (car body)))
+ (if temp
+ (cond ((char-equal temp ?p)
+ (insert "/PLACEHOLDER"))
+ ((char-equal temp ?t)
+ (insert "/TOKEN"))
+ (t
+ (message "Illegal body text type detected"))))
+ (setq body (cdr body))))))
+ (newline)
+ (newline)
+ (insert "END DEFINE")
+ (newline)
+ (newline)))
+
+;;
+;; Extract an individual token definition. (non-interactive form - see
+;; else-extract-token).
+;;
+(defun else-extract-a-token (token-definition)
+ (let ((selected-definition token-definition)
+ (temp)
+ (body)
+ (name))
+ (setq name (get selected-definition 'else-original-name))
+ (insert "DELETE TOKEN ")
+ (insert (concat name " -"))
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert (concat "/LANGUAGE=\"" else-Current-Language "\" -"))
+ (newline)
+ (insert "DEFINE TOKEN ")
+ (insert (concat name " -"))
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert (concat "/LANGUAGE=\"" else-Current-Language "\" -"))
+ (setq temp (get selected-definition 'else-placeholder-ref))
+ (if (car temp)
+ (progn
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert "/PLACEHOLDER=")
+ (insert (car (cdr temp))))
+ (progn
+ (setq temp (get selected-definition 'else-description-ref))
+ (if temp
+ (progn
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert "/DESCRIPTION=")
+ (insert (concat "\""
+ (get selected-definition
+ 'else-description-ref) "\""))))))
+ (else-extract-runcode-component)
+ (setq body (get selected-definition 'else-body-ref))
+ (newline)
+ (indent-to else-Extract-Column)
+ (while (car body)
+ (progn
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert (concat "\""
+ (nth else-body-text-ref (car body)) "\"")))
+ (setq body (cdr body)))
+ (newline)
+ (newline)
+ (insert "END DEFINE")
+ (newline)
+ (newline)))
+
+;; This routine assumes that it has been called after a regular expression match
+;; that indicates a line from the body of a definition has been found
+;; ie. \".*\". The entry for the body form can be of the form " text " with an
+;; optional trailer(s) of /TOKEN or /PLACEHOLDER. If the text is meant for
+;; substitution i.e. it is not a menu or terminal entry prompt, then we wish to
+;; also record indentation information. The algorithm that calculates the number
+;; of indents for each line makes an assumption that the first line that is
+;; indented establishes a "base" indent level and any subsequent lines have
+;; their spacing compared with this count. Therefore, this routine (since it
+;; acts on a single line at a time) must take an argument of any current indent
+;; level information that may be in force and conversely, provide any indent
+;; information that it "discovers" i.e. if there is not indent level currently
+;; in force then if the current line contains indent information, that
+;; information must be returned to the caller.
+;;
+;; Further processing is made easier if there are three elements in each 'body'
+;; entry, so start the definition off with nil for all three elements and then
+;; replace them as needed. The order is /PLACEHOLDER or /TOKEN, indentation and
+;; then "any text". It assumes that the match-data from the "body" search string
+;; is still valid!
+;;
+;; 28-Jun-2002: Found a problem when attempting to define bodies that are purely
+;; textual in nature and the user doesn't want the indentation rules to be
+;; used i.e. definition of a file header with text lines that are heavily
+;; indented. Take the (obvious?) approach and use some special character ('@' in
+;; this case to denote 'hard' spaces.
+;;
+(defun else-extract-body (indent-level-size)
+ (let ((local-list (list nil 0 nil t))
+ (this-line nil)
+ (this-indent-size)
+ (return-size indent-level-size))
+ (progn
+ ;; Extract the text and place it into a local variable for further
+ ;; manipulation and testing.
+ (setq this-line (else-strip-quotes
+ (match-string else-body-text-1)))
+ ;; Search the line for the first occurrence of non-whitespace, this is the
+ ;; current indent value. Make sure that the match data is preserved
+ ;; because we use a regular expression scan here!
+ (save-match-data
+ (setq this-indent-size (string-match "\\S-" this-line))
+ ;; Allow for the case of an empty line i.e. ""
+ (if (not this-indent-size)
+ (setq this-indent-size 0)))
+ ;; If there is an indent, then calculate it as a multiple of the global
+ ;; value 'indent-level-size
+ (if (> this-indent-size 0)
+ (progn
+ ;; First, make sure we strip out the white i.e. we don't want to
+ ;; copy it through, so copy through from the first non-whitespace to
+ ;; the end.
+ (setq this-line (substring this-line this-indent-size))
+ ;; Calculate the indentation as a multiple of the "base" value but
+ ;; allow for the case where the base value hasn't been established
+ ;; yet! Note that this calculation also assumes that if the
+ ;; indentation is greater than a "multiple" of the base value then
+ ;; an assumption is made that the user made a mistake and is
+ ;; requesting the next multiple boundary i.e. the base may be 3
+ ;; spaces and a line is indented to space 5 - this means that 6 was
+ ;; intended.
+ (if (> indent-level-size 0)
+ (progn
+ (if (> (% this-indent-size indent-level-size) 0)
+ (setcar (nthcdr else-body-indent-ref local-list)
+ (1+ (/ this-indent-size indent-level-size)))
+ (setcar (nthcdr else-body-indent-ref local-list)
+ (/ this-indent-size indent-level-size))))
+ ;; else this value is now the base indent size
+ (setcar (nthcdr else-body-indent-ref local-list) 1)
+ (setq return-size this-indent-size)))
+ ;; either no indentation (in which case leave at the default level) or
+ ;; the definition may contain 'hard' space characters i.e. '@'. Convert
+ ;; all of these to real spaces.
+ (progn
+ ;; This is only a possibility if the first character(s) are '@'
+ ;; i.e. there is no need to place 'hard spaces' after any non-white
+ ;; space.
+ (if (and (not (= (length this-line) 0))
+ (or (string= (substring this-line 0 1) "@")
+ (and (> (length this-line) 1)
+ (string= (substring this-line 0 2) "\\@"))))
+ (progn
+ ;; protect 'real' @'s the tradional way by preceding
+ ;; them with a '\' character - so just strip off that
+ ;; single character and proceed
+ (if (string= (substring this-line 0 2) "\\@")
+ (setq this-line (substring this-line 1 (length this-line)))
+ ;; else the case of @'s being used to designate hard
+ ;; spaces, so strip the @'s and convert them to
+ ;; space characters in this-line.
+ (let (number-ats)
+ ;; Not necessary to test the result - can only get
+ ;; here if there are leading @'s
+ (string-match "@+" this-line)
+ (setq this-line
+ (replace-match (make-string
+ (length (match-string 0 this-line)) ?\ )
+ t t
+ this-line))))))))
+
+ ;; Place the text into the last element of the list.
+ (setcar (nthcdr else-body-text-ref local-list) this-line)
+
+ ;;
+ ;; Now extract any trailing modifiers ie /PLACEHOLDER or /TOKEN
+ ;;
+ (setq this-line (match-string else-body-text-2))
+ (if this-line
+ (cond ((string= this-line "/PLACEHOLDER")
+ (setcar (nthcdr else-body-type-ref local-list) ?p))
+ ((string= this-line "/TOKEN")
+ (setcar (nthcdr else-body-type-ref local-list) ?t))
+ (t
+ (message "Haven't covered this option yet!"))))
+ (setq this-line (match-string else-body-text-3))
+ (if this-line
+ (cond ((string= this-line "/NOFOLLOW")
+ (setcar (nthcdr else-body-menu-follow-on-ref local-list) nil))
+ ((string= this-line "/FOLLOW")
+ ;; this is the redundant case given the initialisation of
+ ;; 'local-list.
+ (setcar (nthcdr else-body-menu-follow-on-ref local-list) t))
+ (t
+ (message "Haven't covered this option yet!")))))
+ ;; Now return what we have "discovered".
+ (cons return-size local-list)))
+
+(defun else-extract-chk-language ()
+ "Check and change the current language for extraction commands."
+ (let ((result t))
+ ;; Originally tried anding this test with the current language being
+ ;; 'template' but that leads to some inconsistencies. Seems to make sense
+ ;; that the rule is: if the current buffer is an LSE file then use the
+ ;; language that can be calculated from the file name.
+ (if (string-match (concat "\\" else-lse-ext) (buffer-name))
+ ;; Case where the user is editing an LSE buffer/file, so calculate
+ ;; the desired language based upon the name of the file/buffer
+ (let ((file-name-comps (split-string (buffer-name) "\\.")))
+ ;; Check if the file is of the form <lang>-cust.lse
+ (if (string-match "-cust" (car file-name-comps))
+ ;; Yes, it is a custom LSE file, so split further
+ (progn
+ (setq file-name-comps (split-string
+ (car file-name-comps) "-cust"))
+ )
+ )
+ ;; At this point, the CAR of file-name-comps should be the
+ ;; language name.
+ (setq result (else-establish-language (car file-name-comps)))
+ (if (not result)
+ (error "Language %s is not loaded" (car file-name-comps))
+ )
+ )
+ )
+ result
+ )
+ )
+
+;;
+;; Extract the "duplication" information from the template definition. Assumes
+;; that the match-data information is valid!
+;;
+(defun else-extract-duplication-info ()
+ (let ((this-line))
+ (setq this-line
+ (else-strip-quotes (match-string else-body-command-2)))
+ (cond ((string= this-line "CONTEXT_DEPENDENT")
+ ?c)
+ ((string= this-line "VERTICAL")
+ ?v)
+ ((string= this-line "HORIZONTAL")
+ ?h)
+ (t
+ (throw 'compile "illegal duplication type"))
+ )
+ )
+ )
+
+;;
+;; Interactive command to extract an individual placeholder definition.
+;;
+(defun else-extract-placeholder ()
+ "Extract the definition of a placeholder into the buffer at point."
+ (interactive)
+ (let ((selected-definition)
+ (current-language else-Current-Language)
+ (name)
+ (temp completion-ignore-case))
+ ;; Allow a bit of flexibility here, if the user is extracting in a buffer
+ ;; that has language defined then operate on that language, otherwise
+ ;; prompt the user for a language name and then operate on that language
+ ;; definition.
+ (if (else-extract-chk-language)
+ (progn
+ (setq completion-ignore-case t)
+ (setq name
+ (completing-read "Placeholder Name: " Placeholder))
+ (setq name (upcase name))
+ (setq selected-definition (else-look-up name ?p))
+ (if selected-definition
+ (else-extract-a-placeholder selected-definition)
+ (message "Placeholder \`%s\` doesn't exist" name)
+ )
+ (setq completion-ignore-case temp)
+ ;; Restore the original language (assuming there was one)
+ (if current-language
+ (else-establish-language current-language)
+ )
+ )
+ )
+ )
+ )
+
+(defun else-extract-runcode-component ()
+ "Extract the run_code components - uses variables declared in caller
+defun."
+ (let ((temp)
+ (tmp)
+ (processing-function))
+ ;; Do any /RUN_CODE attributes.
+ (setq temp (copy-alist (get
+ selected-definition 'else-elisp-action)))
+ ;; If there are run-time encodings then have to handle the fact that one or
+ ;; more phases have the same function pointer.
+ (while temp
+ (setq tmp (pop temp))
+ (newline)
+ (indent-to else-Extract-Column)
+ (insert (format "/RUN_CODE=%s%s"
+ (cdr tmp)
+ (car tmp)))
+ (setq processing-function (cdr tmp))
+ ;; Now recurse through the other functions (if any)
+ (let ((local-copy (copy-alist temp)))
+ (while local-copy
+ (setq tmp (pop local-copy))
+ (if (equal processing-function (cdr tmp))
+ (progn
+ (insert (car tmp))
+ (setq temp
+ (assq-delete-all (car tmp) temp)))))))))
+
+;;
+;; Interactive command to extract and individual token definition.
+;;
+(defun else-extract-token ()
+ "Extract the definition of a token into the buffer at point."
+ (interactive)
+ (let ((selected-definition)
+ (temp completion-ignore-case)
+ (name)
+ (current-language else-Current-Language))
+ ;; Allow a bit of flexibility here, if the user is extracting in a buffer
+ ;; that has language defined then operate on that language, otherwise
+ ;; prompt the user for a language name and then operate on that language
+ ;; definition.
+ (if (else-extract-chk-language)
+ (progn
+ (setq completion-ignore-case t)
+ (setq name
+ (completing-read "Token Name: " Token))
+ (setq name (upcase name))
+ (setq selected-definition (else-look-up name ?t))
+ (if selected-definition
+ (else-extract-a-token selected-definition)
+ (message "Token \`%s\` doesn't exist" name)
+ )
+ (setq completion-ignore-case temp)
+ ;; Restore the original language (assuming there was one)
+ (if current-language
+ (else-establish-language current-language)
+ )
+ )
+ )
+ )
+ )
+
+
+;;
+;; Extract the "type" information of a placeholder ie it is either a MENU,
+;; TERMINAL or NONTERMINAL definition.
+;;
+(defun else-extract-type-info ()
+ "Parse the /TYPE attribute of the definition"
+ (let ((this-match))
+ (setq this-match (else-strip-quotes (match-string else-body-command-2)))
+ (cond ((string= this-match "MENU")
+ ?m)
+ ((string= this-match "TERMINAL")
+ ?t)
+ ((string= this-match "NONTERMINAL")
+ ?n)
+ (t (throw 'compile "illegal TYPE value")))
+ )
+ )
+;;
+;; Get the "body" of a definition. This is a list of "strings".
+;;
+(defun else-get-body (element)
+ "Extract the 'body' of the definition."
+ (let ()
+ (get element 'else-body-ref)
+ )
+ )
+
+;;
+;; Extract the descriptive text ie /DESCRIPTION="...."
+;;
+(defun else-get-description (name type)
+ "Extract the /DESCRIPTION attribute"
+ (let ((place-def (else-look-up name type)))
+ (if place-def
+ (get place-def 'else-description-ref)
+ )
+ )
+ )
+
+
+;;
+;; Get a definition from either the Placeholder or Token definition array
+;;
+(defun else-get-entry (name-string type)
+ "Get a definition from either the Placeholder or Token definition set"
+ (let ((obarray-name nil))
+ (cond ((char-equal type ?t) (setq obarray-name Token))
+ ((char-equal type ?p) (setq obarray-name Placeholder))
+ )
+ (if obarray-name
+ (intern name-string obarray-name)
+ )
+ )
+ )
+
+(defun else-get-menu-entries (element)
+ "Create a list from the menu elements in this placeholder. Note that if
+sub-elements are defined with menu elements, then there are options to follow or
+not follow individual elements in the menu list - but these options can be
+overriden by the 'else-follow-menus and 'else-nofollow-menus flags! By doing
+this we avoid menus that lead to other menus ad infinitum - very boring :-)."
+ (let ((the-list (else-get-body element))
+ (temp-list)
+ (this-element)
+ (this-def)
+ (ref-type)
+ (this-element-type)
+ (new-list))
+ (setq temp-list the-list)
+ (while (> (length temp-list) 0)
+ (setq this-element (car temp-list))
+ (setq temp-list (cdr temp-list))
+ ;; This is a bit weird, but basically we want to put the current element
+ ;; into the new list that will be returned. The only exception to this is
+ ;; if the entry is itself an menu, in which case the values of that item
+ ;; will be substituted (depending upon /follow/nofollow and
+ ;; else-follow-menus settings). All items will be prepended and that way
+ ;; if we have to remove an element it will be easy.
+ (setq new-list (append (cons this-element '()) new-list))
+ ;; Check if the element is a placeholder and if so, if it is a menu
+ ;; itself.
+ (setq this-element-type (elt this-element else-body-type-ref))
+ (if (and this-element-type
+ (char-equal this-element-type ?p))
+ (progn
+ (setq this-def (else-look-up
+ (elt this-element else-body-text-ref)
+ ?p))
+ ;; guard against errors...
+ (if this-def
+ (progn
+ (setq ref-type (get this-def 'else-type-ref))
+ ;; If the element
+ (if (and (equal ref-type ?m)
+ (not else-nofollow-menus)
+ (or else-follow-menus
+ (elt this-element else-body-menu-follow-on-ref)))
+ ;; There is a menu reference, so check if the placeholder
+ ;; being referenced is also a menu. If it is then replace
+ ;; this element with the elements from the referenced
+ ;; placeholder.
+ (progn
+ ;; Must remove the element at the head of the list as it
+ ;; is being replaced by this list.
+ (setq new-list (cdr new-list))
+ (setq new-list (append (else-get-body this-def)
+ new-list))
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ (nreverse new-list)
+ )
+ )
+
+(defun else-in-placeholder ()
+ "Test if `point' is within a placeholder. Validity of text string is checked
+ against the placeholder definition arrays. If it is a placeholder
+ then set up several global (buffer local) variables to save effort
+ elsewhere."
+ (let ((here (point))
+ (result nil)
+ (start-position)
+ (end-position)
+ (stop-point)
+ (stop-flag))
+ (save-excursion
+ ;; Start by determining if invoked in a token or
+ ;; placeholder. Placeholder's are defined as being enclosed by
+ ;; either a [] or {} pair. This is more complicated than it
+ ;; first appears because you have to make sure that any
+ ;; "placeholder" indicators actually enclose `point' ie don't
+ ;; find a placeholder earlier in the same line etc. Also,
+ ;; placeholders may have embedded spaces, so again, more
+ ;; complications. Search backward for the first occurrence of
+ ;; either '[', '{', whitespace or beginning of line. Things are
+ ;; made really messy because it is possible to have point within
+ ;; a placeholder that also contains another placeholder eg
+ ;; [[abstract] tagged]. So, we perform the scan character by
+ ;; character and use a "counting" system to record the "depth".
+ ;;
+ ;; Then I discovered another complication what about the case:
+ ;; [{discriminant_simple_name}... =>]
+ ;; here we have to make sure which is the "greater" placeholder
+ (end-of-line)
+ (setq stop-point (point))
+ (beginning-of-line)
+ (setq stop-flag nil)
+ (while (and (< (point) here) (not stop-flag))
+ (progn
+ (if (re-search-forward "[{[]" here t)
+ (progn
+ (backward-char)
+ (setq start-position (point))
+ (if (not (= (else-match-brace stop-point) start-position))
+ (progn
+ (setq end-position (point))
+ (if (and (< start-position here)
+ (< here end-position))
+ (if (else-look-up (buffer-substring
+ (+ start-position 1)
+ end-position) ?p)
+ (progn
+ (setq else-placeholder-start start-position)
+ (setq else-placeholder-end (1+
+ end-position))
+ (setq else-definition-type ?p)
+
+ (setq else-definition-name (buffer-substring
+ (1+ start-position)
+ end-position))
+ ;; record the definition for any
+ ;; calling routine to use.
+ (setq else-current-definition
+ (else-look-up else-definition-name ?p))
+ (if (char-equal (following-char) ?})
+ (setq else-Mandatory-Placeholder t)
+ (setq else-Mandatory-Placeholder nil)
+ )
+ ;; Determine if the placeholder is
+ ;; repeating
+ (goto-char else-placeholder-end)
+ (setq else-please-duplicate
+ (looking-at (regexp-quote "...")))
+ (setq stop-flag t)
+ (setq result t)
+ )
+ (goto-char (1+ start-position))
+ )
+ (goto-char (1+ start-position))
+ )
+ )
+ (goto-char (1+ start-position))
+ )
+ )
+ (setq stop-flag t)
+ )
+ )
+ )
+ )
+ result
+ )
+ )
+
+(defun else-initialise-symbol (the-definition)
+ "Initialise a placeholder/token symbol with default values."
+ (put the-definition 'else-placeholder-ref '(nil nil))
+ (put the-definition 'else-type-ref ?p)
+ (put the-definition 'else-separator-ref "")
+ (put the-definition 'else-substitute-ref ?n)
+ (put the-definition 'else-duplication-ref ?c)
+ (put the-definition 'else-topic-ref nil)
+ (put the-definition 'else-description-ref "")
+ (put the-definition 'else-body-ref nil)
+ (put the-definition 'else-substitute-count-ref 1)
+ (put the-definition 'else-original-name "")
+ (put the-definition 'else-elisp-action '()))
+
+(defun else-kill-placeholder (&optional leave-spacing force dont-kill-empty-lines)
+ "Kill the current placeholder. Wrapper for else-delete-placeholder, calls the
+lower level defun continuously in cases where the placeholder is defined as an
+auto-substitute placeholder."
+ (interactive "i\nP")
+ (let ((current-location (point))
+ (loop-counter)
+ (is-auto-sub)
+ (here)
+ (stop-loop))
+ ;; Verify we are with a placeholder.
+ (if (else-in-placeholder)
+ ;; Only proceed if the conditions are right.....
+ (if (or (not else-Mandatory-Placeholder) force)
+ (progn
+ ;; If the definition is an "auto-substitute" then we have to
+ ;; find the matching occurrences and delete them also.....
+ (setq is-auto-sub (char-equal
+ (get else-current-definition
+ 'else-substitute-ref)
+ ?a))
+ (if is-auto-sub
+ (progn
+ (setq loop-counter (get else-current-definition
+ 'else-substitute-count-ref))
+ (setq stop-loop nil)
+ (while (and (not stop-loop)
+ (> loop-counter 0))
+ (if (search-forward else-definition-name nil t)
+ (progn
+ ;; position back into the placeholder and then
+ ;; kill it (even if it is mandatory).
+ (backward-char)
+ ;; Next call just sets up all of the global
+ ;; variables so that the text can be deleted -
+ ;; don't use a kill-placeholder here because
+ ;; it would destroy the information that is
+ ;; required to be kept.....
+ (if (else-in-placeholder)
+ (progn
+ (else-delete-placeholder leave-spacing
+ force
+ dont-kill-empty-lines)
+ (setq loop-counter (1- loop-counter))
+ )
+ )
+ )
+ ;; There are no more occurrences of the placeholder
+ ;; name so stop the search.
+ (setq stop-loop t)
+ )
+ )
+ )
+ )
+ ;; Now locate back into the original placeholder and
+ ;; delete it - this returns all global variables to
+ ;; their original state as the same time.
+ (goto-char current-location)
+ (else-in-placeholder)
+ (else-delete-placeholder leave-spacing
+ force
+ dont-kill-empty-lines)
+ ;; Check to see whether we should auto-position to the
+ ;; next placeholder or not. This is mainly useful for
+ ;; the VR folks so it is a customisable flag.
+ (if (and else-kill-proceed-to-next-placeholder (interactive-p))
+ (if else-only-proceed-within-window
+ (progn
+ (setq here (point))
+ (else-move-n-placeholders 1)
+ ;; Only move to the new placeholder if it is
+ ;; visible in the current window i.e. we don't
+ ;; want the user to become disorientated by a
+ ;; large jump.
+ (if (not (pos-visible-in-window-p))
+ (goto-char here)
+ )
+ )
+ ;; otherwise just default to move to the next placeholder.
+ (else-next-placeholder 1)
+ )
+ )
+ )
+ (error "Can't delete - mandatory entry required")
+ )
+ ;; Failed to delete because not in a placeholder - check if desired
+ ;; behaviour is to find the next(previous) placeholder and kill that
+ ;; instance.
+ (if (and else-move-and-execute (interactive-p))
+ ;; User must desire to kill the next placeholder. So save them
+ ;; the trouble of moving and killing as two separate actions.
+ (progn
+ (if else-direction
+ (else-next-placeholder)
+ (else-previous-placeholder)
+ )
+ (else-kill-placeholder)
+ )
+ )
+ )
+ )
+ )
+
+;;
+;; Load a template definition file and "compile" it.
+;;
+(defun else-load-template ()
+ "Load a language definition file and compile it."
+ (let ((lang-def-buffer)
+ (language-file-name)
+ (result nil)
+ (language-name)
+ (found-template-name nil)
+ (auto-mode-alist nil)
+ (template-file-loaded nil))
+ (progn
+ (catch 'quit-loading
+ ;; It is possible for the user to have an auto-mode-alist
+ ;; entry for files of .lse type that will enable else-mode and
+ ;; load the language templates for .lse files - this causes a
+ ;; mix-up in the Placeholder/Token definitions if this
+ ;; happens. So temporarily disable the entry if it exists in the
+ ;; auto-mode-alist when we are auto-loading .lse files -
+ ;; re-enable it at the end of this function. Note that this is
+ ;; done using the "let" definition for auto-mode-list above.
+
+ ;; Extract the mode-name and use that as the default template file
+ ;; name
+ (setq language-name mode-name)
+ ;; Mode name "may" have spaces, modify them to '-' i.e. Visual
+ ;; Basic becomes Visual-Basic.
+ (while (string-match " " language-name)
+ (setq language-name (replace-match "-" t nil language-name))
+ )
+ (setq language-file-name (else-locate-language-file language-name))
+ (if (not language-file-name)
+ (progn
+ ;;
+ ;; The file doesn't exist, so maybe its a case of the file
+ ;; attribute not reflecting the language type. So ask the user.
+ ;;
+ (setq language-name
+ (read-from-minibuffer
+ "Enter the language name (no file extensions, please): "))
+ (if (cdr (assoc language-name else-Language-Definitions))
+ (progn
+ ;; The language is already loaded, so set the local buffer
+ ;; language name and discontinue processing.
+ (setq else-Current-Language language-name)
+ (setq result t)
+ (throw 'quit-loading t)
+ )
+ ;; Otherwise, check if a file of that name exists.
+ (setq language-file-name (else-locate-language-file language-name))
+ )
+ )
+ )
+ ;; At this point we have either skipped early (throw to 'quit-loading)
+ ;; because we already have the language loaded for another buffer or we
+ ;; have either found the file or not.
+ (if language-file-name
+ ;; Load the definition file and compile it
+ (progn
+ (save-excursion
+ ;; Guard against deleting a file that already is loaded into the
+ ;; current edit session. This 'flag' is used to determine
+ ;; whether kill-buffer is called or not before defun
+ ;; exit.
+ (setq template-file-loaded
+ (else-is-template-file-present language-file-name))
+ (setq lang-def-buffer
+ (find-file-noselect language-file-name))
+ (set-buffer lang-def-buffer)
+ ;; Make sure we are at the beginning of the buffer. This is done
+ ;; because there may be packages such as session.el active.
+ (goto-char (point-min))
+ ;; Have to make a choice based on what type of file we are
+ ;; dealing with.
+ (if (string-match else-esl-ext language-file-name)
+ (setq result (else-restore language-name))
+ (setq result (else-compile-buffer))
+
+ )
+ ;; Only delete the buffer if we had to load it explicitly,
+ ;; otherwise leave it alone.
+ (if (and result (not template-file-loaded))
+ ;; Only want to clean up when it succeeded, otherwise the
+ ;; user probably wants to see the error line.
+ (kill-buffer lang-def-buffer)
+ )
+ ;; Now load any customisation files. This works by changing the
+ ;; name to the form of <language-name>-cust.lse and then
+ ;; searches first the local directory and then the load path.
+ (setq language-file-name (else-locate-language-file
+ (concat language-name "-cust.lse")
+ t))
+ (if language-file-name
+ (progn
+ (setq template-file-loaded
+ (else-is-template-file-present language-file-name))
+ (setq lang-def-buffer
+ (find-file-noselect language-file-name))
+ (set-buffer lang-def-buffer)
+
+ ;; Make sure we are at the beginning of the buffer. This
+ ;; is done because there may be packages such as
+ ;; session.el active.
+ (goto-char (point-min))
+
+ ;; compile the customisation buffer, for the moment, just
+ ;; ignore the return of the compilation ie it doesn't
+ ;; matter at the moment.
+ (if (not (else-compile-buffer))
+ (message "Compile of custom file %s failed."
+ language-file-name)
+ )
+ (if (not template-file-loaded)
+ (kill-buffer lang-def-buffer)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ (if result
+ (progn
+ ;; It is possible that the 'language-name' is actually an
+ ;; entered file name and isn't actually the name of the
+ ;; language template loaded. If this is the case, then the
+ ;; entered language name may be radically case different
+ ;; from the actual language name as defined in the
+ ;; template file i.e. TEMPLATE versus template. So make
+ ;; the basic assumption that there will be only one
+ ;; language name, doesn't matter what the casing is.
+ (if (not (cdr (assoc language-name
+ else-Language-Definitions)))
+ (progn
+ ;; Look for it
+ (assoc-default language-name
+ else-Language-Definitions
+ 'else-test-key)
+ (setq language-name found-template-name)
+ )
+ )
+ (setq else-Current-Language language-name)
+ )
+ )
+ result
+ )
+ )
+ )
+
+(defun else-test-key (element-car key)
+ "Used by else-load-template to locate a language template set."
+ (let (index)
+ (setq index (string-match (upcase element-car)
+ (upcase key)))
+
+ ;; Return the results
+ (if (and (= index 0) (= (length element-car) (length key)))
+ (setq found-template-name element-car)
+ )
+ )
+ )
+
+
+
+(defun else-locate-language-file (name &optional check-local-dir-first)
+ "Search the load-path looking for a language definition file.
+Precedence is given to `fast-load' versions ie .esl."
+ (let ((load-point nil))
+ (progn
+ (if (or (string-match (concat "\\" else-lse-ext) name)
+ (string-match (concat "\\" else-esl-ext) name))
+ ;; OK, has the extension name present, so use that as the search
+ ;; locus.
+ (progn
+ (setq load-point (else-search-load-path name
+ check-local-dir-first))
+ (if (string-match (concat "\\" else-esl-ext) name)
+ (else-check-language-file load-point)
+ )
+ )
+ ;; The name wasn't supplied with an extension, so try fast load first
+ ;; and then slow load last.
+ (setq load-point (else-search-load-path (concat name else-esl-ext)
+ check-local-dir-first))
+ (if (not load-point)
+ (setq load-point (else-search-load-path (concat name
+ else-lse-ext)
+ check-local-dir-first))
+ (else-check-language-file load-point)
+ )
+ )
+ load-point
+ )
+ )
+ )
+
+(defun else-look-up (name-string type &optional ignore-forward-refs)
+ "Look-up the definition of a placeholder/token called NAME-STRING.
+'ignore-forward-refs allows functions like 'else-kill-placeholder to
+stop the forwarding referrals i.e. we wish to kill what is there not
+what might have been there :-)."
+ (let ((obarray-name nil)
+ definition)
+ (cond ((char-equal type ?t) (setq obarray-name Token))
+ ((char-equal type ?p) (setq obarray-name Placeholder))
+ )
+ (if obarray-name
+ (progn
+ (setq definition
+ (intern-soft (upcase name-string) obarray-name))
+ ;; Now check to see if it is a "forward" reference
+ (if (and (not ignore-forward-refs)
+ (char-equal type ?p)
+ (car (get definition 'else-placeholder-ref)))
+ ;; there is a forward reference
+ (else-look-up (car
+ (cdr
+ (get definition 'else-placeholder-ref)))
+ ?p)
+ definition
+ )
+ )
+ (message "Look-up error, type not defined for \`%s\`" name-string)
+ )
+ )
+ )
+
+(defun else-match-brace (&optional limit)
+ (interactive)
+ (let ((close-brace)
+ (open-brace)
+ (match-character)
+ (search-back)
+ (search-string)
+ (stop-flag)
+ (total-count 1)
+ (current-pos (point)))
+ (setq match-character (following-char))
+ (cond ((char-equal match-character ?\})
+ (setq search-back t)
+ (setq open-brace ?\{))
+ ((char-equal match-character ?\])
+ (setq search-back t)
+ (setq open-brace ?\[))
+ ((char-equal match-character ?\))
+ (setq search-back t)
+ (setq open-brace ?\())
+ ((char-equal match-character ?\{)
+ (setq search-back nil)
+ (setq close-brace ?\}))
+ ((char-equal match-character ?\[)
+ (setq search-back nil)
+ (setq close-brace ?\]))
+ ((char-equal match-character ?\()
+ (setq search-back nil)
+ (setq close-brace ?\)))
+ (t (message "Not on a valid brace character"))
+ )
+ (if search-back ; looking for opening brace
+ (progn
+ (setq close-brace match-character)
+ (setq stop-flag nil)
+ (while (and (not (= total-count 0)) (not stop-flag))
+ (setq search-string
+ (concat "["
+ (char-to-string close-brace)
+ (char-to-string open-brace)
+ "]"))
+ (if (re-search-backward search-string limit t)
+ (if (char-equal (following-char) open-brace)
+ (setq total-count (- total-count 1))
+ (setq total-count (+ total-count 1))
+ )
+ (progn
+ (if (not limit)
+ (message "Match search failed!")
+ )
+ (goto-char current-pos)
+ (setq stop-flag t)
+ )
+ )
+ )
+ )
+ (progn ;; Else case, ie looking for a closing brace
+ (setq open-brace match-character)
+ ;; Don't want to include the character we are on when searching starts
+ ;; so move forward one character position.
+ (forward-char)
+ (setq stop-flag nil)
+ (while (and (not (= total-count 0)) (not stop-flag))
+ (setq search-string
+ (concat "["
+ (char-to-string close-brace)
+ (char-to-string open-brace)
+ "]"))
+ (if (re-search-forward search-string limit t)
+ (if (char-equal (preceding-char) close-brace)
+ (setq total-count (- total-count 1))
+ (setq total-count (+ total-count 1))
+ )
+ (progn
+ (if (not limit)
+ (message "Match search failed!")
+ )
+ (goto-char current-pos)
+ (setq stop-flag t)
+ )
+ )
+ )
+ (if (char-equal (preceding-char) close-brace)
+ (backward-char)
+ )
+ )
+ )
+ (point)
+ )
+ )
+
+
+;;
+;; Block out forward and backward char motion.
+;;
+(defun else-menu-block-movement ()
+ ;; [Documentation]
+ (interactive)
+ (let ()
+ )
+ )
+
+;;
+;; Next line in the menu, wraps when moving past last line
+;;
+(defun else-menu-previous-line ()
+ ;; [Documentation]
+ (interactive)
+ (let ()
+ (progn
+ (if (not (= (point) (point-min)))
+ (progn
+ (backward-char)
+ (beginning-of-line)
+ )
+ (progn
+ (goto-char (1- (point-max)))
+ (beginning-of-line)
+ )
+ )
+ )
+ )
+ )
+
+;;
+;; Quit the menu pick list processing.
+;;
+(defun else-menu-quit ()
+ "Quit from the menu pick list."
+ (interactive)
+ (let ()
+ (setq else-selected-text nil)
+ (exit-recursive-edit)
+ )
+ )
+
+;;
+;; Next line in the menu, wraps when moving past last line
+;;
+(defun else-menu-next-line (&optional n)
+ ;; [Documentation]
+ (interactive "p")
+ (let ((count (or n 1)))
+ (progn
+ (while (> count 0)
+ (end-of-line)
+ (if (not (= (point) (1- (point-max))))
+ (forward-char)
+ (goto-char (point-min))
+ )
+ (setq count (1- count))
+ )
+ )
+ )
+ )
+
+(defun else-extract-item (menu-text)
+ "Extract the menu data from a menu line item. Each menu item is
+encoded with extraneous information for display to the user i.e. {}'s,
+description text etc"
+ (let ((result "")
+ (start-char))
+ (save-match-data
+ ;; Get the first character in the line - this will determine
+ ;; what type of information is to be extracted i.e. a
+ ;; placeholder will have a '{' character, a token or direct text
+ ;; substitution will have a quote character
+ (setq start-char (elt menu-text 0))
+ (cond ((char-equal start-char ?\")
+ ;; Find the last occurrence of a " character.....
+ (string-match "\".*\"+" menu-text 0)
+ (setq result (substring menu-text 1
+ (1- (match-end 0)))))
+ ((char-equal start-char ?{)
+ ;; The menu item is a placeholder, so select text between
+ ;; {}'s
+ (setq result (substring menu-text 1 (string-match "}" menu-text))))
+ (t
+ (setq result (substring menu-text 1 (1- (length menu-text)))))
+ )
+ result
+ )
+ )
+ )
+
+;;
+;; Select the pick item at `point'.
+;;
+(defun else-menu-select ()
+ "Select the menu pick item at `point'."
+ (interactive)
+ (let ((start-pos))
+ (save-excursion
+ (beginning-of-line)
+ (setq start-pos (point))
+ (end-of-line)
+ (setq else-selected-text (else-extract-item
+ (buffer-substring start-pos
+ (point))))
+ (message "%s" (buffer-substring start-pos
+ (point)))
+ )
+ (exit-recursive-edit)
+ )
+ )
+
+(defun else-mode (&optional arg)
+ "Invoke ELSE mode for the current buffer.
+Keybindings:
+\\{else-menu-mode-map}"
+ (interactive)
+ (let ((language-assoc nil)
+ (name)
+ (did-it-work t))
+ (progn
+ (setq else-mode
+ (if (null arg)
+ (not else-mode)
+ (> (prefix-numeric-value arg) 0)
+ ))
+ (if else-mode
+ (progn
+ ;; Make sure that the Xemacs variables are established. This code is
+ ;; not guarded - it doesn't hurt FSF Emacs.
+ (if (not (markerp else-move-to-position))
+ (setq else-move-to-position (make-marker))
+ )
+ ;; Make sure the flag used by the after-change function is reset
+ ;; (should never be set at this point anyway).
+ (setq else-move-change nil)
+
+ (setq else-Auto-Sub-Active nil)
+ ;; Initialise the auto substitute marker list. The marker in this
+ ;; list are set to nowhere when they are not active. The structure
+ ;; of the list is (n (f . b) ...) where n is the number of marker
+ ;; pairs and (f . b) is a marker pair where f is the front marker
+ ;; and b is the back marker. This list can grow as required, but
+ ;; will set it to a value that should be reasonable for most
+ ;; applications.
+ (if (not else-Auto-Sub-Marker-List)
+ (setq else-Auto-Sub-Marker-List
+ (list 6
+ (cons (make-marker) (make-marker))
+ (cons (make-marker) (make-marker))
+ (cons (make-marker) (make-marker))
+ (cons (make-marker) (make-marker))
+ (cons (make-marker) (make-marker))
+ (cons (make-marker) (make-marker))))
+ )
+
+ ;; Check if a language is loaded for the buffer
+ (if else-Current-Language
+ (progn
+ (setq name else-Current-Language)
+ (setq language-assoc (cdr (assoc name
+ else-Language-Definitions)))
+ )
+ ;; Possible that the language is already loaded for another
+ ;; buffer so check using the mode-name.
+ (setq language-assoc (cdr (assoc mode-name
+ else-Language-Definitions)))
+ )
+ (setq did-it-work
+ (catch 'foo
+ (if (not language-assoc)
+ (progn
+ (if (else-load-template)
+ (progn
+ (setq name else-Current-Language)
+ (setq language-assoc
+ (cdr
+ (assoc name else-Language-Definitions)))
+ )
+ ;; It didn't work, so bail out
+ (throw 'foo nil)
+ )
+ )
+ ;; Yes, the language is already loaded so make
+ ;; sure we set the following variable!
+ (setq else-Current-Language mode-name)
+ )
+ (setq Placeholder (car language-assoc))
+ (setq Token (car (cdr language-assoc)))
+ (setq Language-Specifics (car (cdr (cdr language-assoc))))
+ (else-setup-change-hooks)
+
+ (if (= (buffer-size) 0)
+ (progn
+ (insert (cdr (assoc else-Initial-String-ref
+ Language-Specifics)))
+ (goto-char 0)
+ (else-next-placeholder)
+ )
+ )
+ ;; Add ELSE to the status bar.
+ (or (assq 'else-mode minor-mode-alist)
+ (setq minor-mode-alist
+ (cons '(else-mode " ELSE") minor-mode-alist)))
+ ;; Set the "self-insert" character array for the buffer
+ ;; ie. else-before-change checks whether a command is a
+ ;; "self-insert" character using the language
+ ;; attributes. We do this to maintain compatibility with
+ ;; Emacs 19.X (note, Elisp change after 19.29 means that
+ ;; only 19.29 -> will work).
+ (else-set-self-insert-vector)
+ ;; Set the result to t, ie we have successfully found
+ ;; a language template.
+ t
+ )
+ )
+ (if (not did-it-work)
+ ;; Things didn't work, so make sure that the mode is not
+ ;; falsely enabled.
+ (setq else-mode (not else-mode))
+ ;; Otherwise, make sure some simple commands are set up in the
+ ;; ELSE menu keymap.
+ (progn
+ (else-enable-dups else-menu-mode-map
+ 'else-expand-placeholder 'else-menu-select)
+ (else-enable-dups else-menu-mode-map
+ 'next-line 'else-menu-next-line)
+ (else-enable-dups else-menu-mode-map
+ 'previous-line 'else-menu-previous-line)
+ (else-enable-dups else-menu-mode-map 'forward-char 'undefined)
+ (else-enable-dups else-menu-mode-map 'backward-char 'undefined)
+
+ ;; Now setup the minor mode map. Note the 'or' will
+ ;; "short-circuit" if the first form evaluates to 'true'.
+ (or (assq 'else-mode minor-mode-map-alist)
+ (setq minor-mode-map-alist
+ (cons (cons 'else-mode else-mode-key-map)
+ minor-mode-map-alist)))
+ )
+ )
+ )
+ ;;
+ ;; Else the mode has just been toggled off so clean up on things.
+ ;;
+ (else-mode-clean-up)
+ )
+ ;; Return the result to the caller
+ did-it-work
+ )
+ )
+ )
+
+;;
+;; Do a clean up. Consists of deleting buffer local variables and removing
+;; functions from various change hooks.
+;;
+(defun else-mode-clean-up ()
+ (let ((sub-length))
+ ;; Set the auto sub marker list to point to nowhere
+ (if else-Auto-Sub-Marker-List
+ (progn
+ (setq sub-length (car else-Auto-Sub-Marker-List))
+ (while (> sub-length 0)
+ (set-marker (car (nth sub-length else-Auto-Sub-Marker-List))
+ nil)
+ (set-marker (cdr (nth sub-length else-Auto-Sub-Marker-List))
+ nil)
+ (setq sub-length (1- sub-length))
+ )
+ )
+ )
+
+ (setq else-Auto-Sub-Active nil)
+ (kill-local-variable 'else-Auto-Sub-Active)
+ (kill-local-variable 'else-Auto-Sub-Marker-List)
+ (kill-local-variable 'else-Current-Language)
+ (kill-local-variable 'else-mode)
+ (kill-local-variable 'Placeholder)
+ (kill-local-variable 'Token)
+ (kill-local-variable 'Language-Specifics)
+ (kill-local-variable 'else-Current-Language)
+
+ (remove-hook 'before-change-functions
+ 'else-before-change
+ t)
+ (remove-hook 'after-change-functions
+ 'else-after-change
+ t)
+
+ )
+ )
+
+
+(defun else-move-n-placeholders (&optional arg)
+ "Move forward or backward (determined by 'else-direction) 'n placeholders."
+ (interactive "p")
+ (if else-direction
+ (else-next-placeholder arg)
+ (else-previous-placeholder arg)
+ )
+ )
+
+;;
+;; Position `point' in the next available placeholder.
+;;
+(defun else-next-placeholder (&optional n)
+ "Position `point' in the next available placeholder."
+ (interactive "p")
+ (let ((origin (point))
+ (no-more nil)
+ (target-pos)
+ (target-count)
+ (count (or n 1)))
+
+ (catch 'problem
+ (if (not else-mode)
+ (progn
+ (error "ELSE mode not enabled.")
+ (throw 'problem nil)
+ )
+ )
+
+ (setq target-count count)
+ ;; Now move forward "n" placeholders. Will stop at the last one found if
+ ;; there are less than "n". Note that we use else-placeholder-start and
+ ;; else-placeholder-end in this routine.
+ (while (and (not no-more) (> count 0))
+ (if (re-search-forward "[[{]" nil t)
+ (progn
+ (if (else-scan-for-match "[]}]" nil)
+ (progn
+ (backward-char 2)
+ (if (else-in-placeholder)
+ (setq count (1- count))
+ (forward-char 2)
+ )
+ )
+ )
+ )
+ (setq no-more t)
+ )
+ )
+ ;; User may have asked to go forward more placeholders than exist, so
+ ;; either stop when the requested count is reached or position to the last
+ ;; one located. If we matched all of the requested placeholders then count
+ ;; will be 0, if we ran out of placeholders but still managed to find at
+ ;; least one (as manifested by (not (= count target-count)) then position
+ ;; point to the last placeholder found.
+ (if (or (= count 0) (not (= count target-count)))
+ ;; position mid-way in the placeholder
+ (setq target-pos (+ else-placeholder-start
+ (/ (- else-placeholder-end else-placeholder-start)
+ 2)))
+ (setq target-pos origin)
+ )
+ (goto-char target-pos)
+ ;; If found a new placeholder to go to, set the overlay onto it
+ (if (and else-experimental-code-flag
+ (not (equal origin target-pos)))
+ (else-set-overlay-here)
+ )
+ ;; Callers expect to be told the whether the function succeeded
+ ;; or not by testing whether point has moved - not a very good
+ ;; idea at all!
+ target-pos
+ )
+ )
+ )
+
+;;
+;; Move `point' to the previous placeholder.
+;;
+(defun else-previous-placeholder (&optional n)
+ "Move `point' to any previously available placeholder."
+ (interactive "p")
+ (let ((origin (point))
+ (no-more nil)
+ (target-pos)
+ (target-count)
+ (count (or n 1)))
+
+ (catch 'problem
+ (if (not else-mode)
+ (progn
+ (error "ELSE mode not enabled.")
+ (throw 'problem nil)
+ )
+ )
+
+ (setq target-count count)
+ ;; This bit of code makes sure that we get out of any "current"
+ ;; placeholder i.e. otherwise we won't move.
+ (if (else-in-placeholder)
+ (progn
+ ;; Find the beginning of a placeholder string
+ (else-scan-for-match "[[{]" nil t)
+ ;; step back onto the actual character of the placeholder in
+ ;; preparation for the next backward search.
+ (if (> (point) (+ (point-min) 2))
+ (backward-char 2)
+ )
+ )
+ )
+ ;; Now position to the count'th placeholder
+ (while (and (> count 0) (not no-more))
+ ;; Locate the start of a brace or bracket and then test if it is a
+ ;; placeholder. Continue this process until either a valid placeholder
+ ;; has been found or the search has hit up against the beginning of
+ ;; buffer
+ (if (re-search-backward "[[{]" nil t)
+ (progn
+ (forward-char 1)
+ ;; Test if in a valid placeholder.
+ (if (else-in-placeholder)
+ (setq count (1- count))
+ )
+ ;; always go back one character to make sure we are not still in
+ ;; the placeholder.
+ (backward-char 1)
+ )
+ ;; search has failed, so we must be up against the beginning of buffer.
+ (setq no-more t)
+ )
+ )
+ ;; User may have asked to go backward for more placeholder than exist, so
+ ;; either stop when the count is reached or position to the last one
+ ;; located. If we matched all of the requested placeholders then count
+ ;; will be 0, if we ran out of placeholders but still managed to find at
+ ;; least one (as manifested by (not (= count target-count)) then position
+ ;; point to the last placeholder found.
+ (if (or (= count 0) (not (= count target-count)))
+ (setq target-pos (+ else-placeholder-start
+ (/ (- else-placeholder-end
+ else-placeholder-start) 2)))
+ (setq target-pos origin)
+ )
+ (goto-char target-pos)
+
+ ;; If found a new placeholder to go to, set the overlay onto it
+ (if (and else-experimental-code-flag
+ (not (equal origin target-pos)))
+ (else-set-overlay-here)
+ )
+ )
+ )
+ )
+
+
+
+;;
+;; This routine is called to process the placeholder/token depending upon
+;; the definition of the element.
+;;
+(defun else-process-definition (element def-type)
+ (let ((body-list)
+ (service-type)
+ (selected-element)
+ (result t)
+ (selected-type)
+ (dummy)
+ (placeholder-reference)
+ (place-name)
+ (action-struct (get element 'else-elisp-action)))
+ ;; Check for /BEFORE processing - note the protection against an elisp
+ ;; function that is not defined.
+ (condition-case err
+ (if (assoc else-before-key action-struct)
+ (funcall (intern-soft (cdr (assoc else-before-key
+ action-struct)))))
+ (void-function
+ (message "Symbol's function definition is void: %s"
+ (cdr (assoc else-before-key action-struct))))
+ (error
+ (message "%s" (error-message-string err))))
+
+ (if (char-equal def-type ?p)
+ (progn
+ (setq service-type (get element 'else-type-ref))
+ (cond ((char-equal service-type ?m)
+ (progn
+ (setq dummy (else-get-menu-entries element))
+ ;; Display the menu choices to the user
+ (else-display-menu dummy)
+
+ ;; Now have to search out which entry in the menu body of
+ ;; the definition. The interesting aspect of this is that we
+ ;; have a list consisting of 'body elements' i.e. a list of
+ ;; data and the text of the selected item. However, the text
+ ;; is just one of the elements in a 'body element' object. So
+ ;; the code has to search the list of body elements looking
+ ;; for an element that contains the selected textual string.
+ (if else-selected-text
+ (progn
+ (setq body-list dummy)
+ (while (not (string=
+ else-selected-text
+ (nth else-body-text-ref
+ (car body-list))))
+ (setq body-list (cdr body-list)))
+ (setq selected-type (nth else-body-type-ref
+ (car body-list)))
+ ;; if its a /placeholder or /token then look-up
+ ;; otherwise it must be a text substitution.
+ (if selected-type
+ (setq selected-element
+ (else-look-up else-selected-text
+ selected-type))
+ (setq selected-element nil))
+ (if selected-element
+ (setq result (else-process-definition
+ selected-element
+ (nth else-body-type-ref
+ (car body-list))))
+ (else-substitute else-selected-text nil)))
+ ;;
+ ;; Else no menu element selected (User quit or
+ ;; something)
+ ;;
+ (setq result nil))))
+ ((char-equal service-type ?n)
+ (else-substitute element def-type))
+ ((char-equal service-type ?t)
+ ;; Display the prompt string to the user
+ (else-display-menu (else-get-body element) t)
+ (setq result nil))))
+ ;; else case, the definition must be a token. There are two
+ ;; possibilities here, the token may be just referencing a
+ ;; placeholder or it may contain "self-insert" lines of text.
+ (setq placeholder-reference (get element 'else-placeholder-ref))
+ ;; Check if there is a forward reference to a placeholder
+ (if (car (cdr placeholder-reference))
+ (progn
+ (setq place-name (car (cdr placeholder-reference)))
+ (if (else-look-up place-name ?p)
+ (else-process-definition (else-look-up place-name ?p) ?p)))
+ ;; else there is not a forward reference, so process the
+ ;; 'body' of element
+ (else-substitute element def-type)))
+ (if result
+ ;; Check for /BEFORE processing
+ (condition-case err
+ (if (assoc else-after-key action-struct)
+ (funcall (intern-soft (cdr (assoc else-after-key
+ action-struct)))))
+ (void-function
+ (message "Symbol's function definition is void: %s"
+ (cdr (assoc else-after-key action-struct))))
+ (error
+ (message "%s" (error-message-string err)))))
+ result))
+
+;;
+;; This routines reads a placeholder/token definition from the current buffer,
+;; it assumes that the match-data contains a successful result of searching
+;; for a definition command sequence.
+;;
+(defun else-read-a-definition ()
+ (let ((definition-type nil)
+ (definition-complete nil)
+ (definition-name)
+ (this-line)
+ (this-definition nil)
+ (already-exists nil)
+ (language-name "")
+ (current-language else-Current-Language)
+ (defining-type)
+ (original-name "")
+ (action-struct '())
+ (elisp-function-name)
+ (body-text-info (cons 0 nil)))
+
+ ;; Get the definition type ie either PLACEHOLDER, TOKEN or LANGUAGE
+ (setq defining-type (match-string else-defining-type))
+ (cond ((string= defining-type "PLACEHOLDER")
+ (setq definition-type ?p))
+ ((string= defining-type "TOKEN")
+ (setq definition-type ?t))
+ ((string= defining-type "LANGUAGE")
+ (else-read-language-definition))
+ (t
+ ;; Note this error will never be thrown as the string
+ ;; matching precludes catching errors in this line...
+ (throw 'compile "illegal definition type")))
+ (if definition-type
+ (progn
+ ;;
+ ;; Grab the definition name then move on
+ ;;
+ (setq original-name
+ (else-strip-quotes (match-string else-defining-name)))
+ (setq definition-name (upcase original-name))
+ ;;
+ ;; Must extract the "Language" for which the definition is being made
+ ;; so extract the Language name and set the appropriate variables
+ ;; prior to any other operations
+ (forward-line)
+ (if (else-scan-for-match else-body-string nil)
+ (progn
+ (setq this-line (match-string else-body-command-1))
+ (if (string= this-line "/LANGUAGE=")
+ (progn
+ (setq language-name
+ (else-strip-quotes
+ (match-string else-body-command-2)))
+ (if (else-establish-language language-name)
+ (progn
+ (if (else-look-up definition-name definition-type)
+ ;; The definition already exists, but also have
+ ;; to checked if 'deleted'
+ (if (else-look-up definition-name
+ definition-type)
+ (progn
+ (message "\`%s\` already exists!"
+ definition-name)
+ (setq already-exists t)
+ )
+ )
+ )
+ )
+ (message "Language definition \`%s\` doesn't exist!"
+ language-name)
+ ;; Want to stop the processing at this point,
+ ;; so use already-exists
+ (setq already-exists t)
+ )
+ )
+ )
+ )
+ )
+ (if (not already-exists)
+ (progn
+ ;; Get an entry in the appropriate obarray for the definition
+ (setq this-definition (else-get-entry
+ definition-name definition-type))
+
+ ;; Now process the "body" of the template definition - before
+ ;; doing though, create the data structure that will hold the
+ ;; various members of a definition etc - these will have
+ ;; "default" values and that way if a user decides not to
+ ;; specify something there will be no "errors" later on.
+ (else-initialise-symbol this-definition)
+
+ ;; save the original-name
+ (put this-definition 'else-original-name original-name)
+
+ (forward-line)
+ (while (and (not definition-complete)
+ (not (= (point) (point-max))))
+ (progn
+ (if (else-scan-for-match else-body-string nil)
+ (progn
+ (cond
+ ((setq this-line (match-string else-body-command-1))
+ ;; Have a line of the form /[...]=, so process it.
+ (cond ((string= this-line "/DUPLICATION=")
+ (put this-definition 'else-duplication-ref
+ (else-extract-duplication-info)))
+
+ ((string= this-line "/SEPARATOR=")
+ (put this-definition 'else-separator-ref
+ (else-strip-quotes
+ (match-string else-body-command-2))))
+
+ ((string= this-line "/DESCRIPTION=")
+ (put this-definition 'else-description-ref
+ (else-strip-quotes
+ (match-string else-body-command-2))))
+
+ ((string= this-line "/TYPE=")
+ (put this-definition 'else-type-ref
+ (else-extract-type-info)))
+
+ ((string= this-line "/PLACEHOLDER=")
+ (put this-definition 'else-placeholder-ref
+ (list t (else-strip-quotes
+ (match-string else-body-command-2)))))
+
+ ((string= this-line "/SUBSTITUTE_COUNT=")
+ (put this-definition 'else-substitute-count-ref
+ (string-to-number
+ (else-strip-quotes
+ (match-string else-body-command-2))))
+ (if (equal (get this-definition
+ 'else-substitute-count-ref) 0)
+ (throw
+ 'compile "illegal value for substitute count")
+ ))
+ ((string= this-line "/RUN_CODE=")
+ (setq elisp-function-name
+ (format "%s" (match-string
+ else-body-command-2)))
+ (setq this-line (match-string
+ else-body-command-3))
+ ;; Now do a series of if statements based
+ ;; upon the options - they may all be set
+ (if (string-match else-before-key this-line)
+ (push (cons else-before-key
+ elisp-function-name)
+ action-struct))
+ (if (string-match else-after-key this-line)
+ (push (cons else-after-key
+ elisp-function-name)
+ action-struct))
+ (if (string-match else-oninsert-key this-line)
+ (push (cons else-oninsert-key
+ elisp-function-name)
+ action-struct)))))
+ ((setq this-line (match-string else-body-command-4))
+ (cond ((string= this-line "/NOAUTO_SUBSTITUTE -")
+ (put this-definition 'else-substitute-ref ?n))
+ ((string= this-line "/AUTO_SUBSTITUTE -")
+ (put this-definition 'else-substitute-ref ?a))
+ ))
+ ((setq this-line (match-string else-body-text-1))
+ (setq body-text-info
+ (else-extract-body (car body-text-info)))
+ (put this-definition 'else-body-ref
+ (cons (cdr body-text-info)
+ (get this-definition 'else-body-ref))))
+ ((setq this-line (match-string else-body-end))
+ (setq definition-complete t)))))
+ (forward-line))) ; Go to the start of the next line.
+
+ ;; Definition is now complete - the action-struct hasn't been
+ ;; put into the definition as yet though, so do that now.
+ (put this-definition 'else-elisp-action
+ (reverse (copy-alist action-struct)))
+
+ ;; reverse the body list
+ (if (get this-definition 'else-body-ref)
+ (put this-definition 'else-body-ref
+ (reverse (get this-definition 'else-body-ref))))))
+
+ ;; restore the 'original' language i.e. might have template language
+ ;; enabled for a .lse file that contains definitions for some other
+ ;; language - so compiling a definition shouldn't destroy the
+ ;; current language settings for the buffer.
+ (else-establish-language current-language)
+ )
+ )
+ )
+ )
+
+
+;;
+;; Read or process the language definition of a template language.
+;;
+(defun else-read-language-definition ()
+ "Parse a language definition statement."
+ (let ((language-name "")
+ (current-language else-Current-Language)
+ (definition-complete nil)
+ (this-line)
+ (tab-size-specified nil))
+ (progn
+ (setq language-name
+ (else-strip-quotes (match-string else-defining-name)))
+ ;; Check if there is a set of existing definitions for this
+ ;; language, if not then create a blank set of variables.
+ (if (else-check-and-init-globals language-name)
+ (message "Language %s exists, assuming attribute modification"
+ language-name)
+ )
+
+ ;; The caller may be defining an entirely new language definition or
+ ;; just modifying attributes of a current definition. In both cases we
+ ;; will modify the attributes of the language definition that
+ ;; was set by the previous call. This allows the overriding of
+ ;; attributes such as indentation setting in the users
+ ;; customisation file.
+ (else-establish-language language-name)
+
+ (forward-line)
+ (while (and (not definition-complete)
+ (not (= (point) (point-max))))
+ (progn
+ (if (else-scan-for-match else-body-string nil)
+ (progn
+ (setq this-line (match-string else-body-command-1))
+ (if this-line
+ (cond ((string= this-line "/INITIAL_STRING=")
+ (setcdr (assoc else-Initial-String-ref
+ Language-Specifics)
+ (else-strip-quotes
+ (match-string else-body-command-2))))
+ ((string= this-line "/PUNCTUATION_CHARACTERS=")
+ (setcdr (assoc else-Punctuation-ref
+ Language-Specifics)
+ (else-strip-quotes
+ (match-string else-body-command-2)))
+ (setcdr (assoc else-Punctuation-Length-ref
+ Language-Specifics)
+ (length (cdr (assoc else-Punctuation-ref
+ Language-Specifics)))))
+ ((string= this-line "/SELF_INSERT_CHARACTERS=")
+ (setcdr (assoc else-Self-Insert-Characters-ref
+ Language-Specifics)
+ (else-strip-quotes
+ (match-string else-body-command-2)))
+ (setcdr (assoc else-Self-Insert-Characters-Length-ref
+ Language-Specifics)
+ (length (cdr (assoc else-Self-Insert-Characters-ref
+ Language-Specifics)))))
+ ((string= this-line
+ "/VALID_IDENTIFIER_CHARACTERS=")
+ (setcdr (assoc else-Valid-Idents-ref
+ Language-Specifics)
+ (else-strip-quotes
+ (match-string else-body-command-2)))
+ (setcdr (assoc else-Valid-Idents-Length-ref
+ Language-Specifics)
+ (length (cdr (assoc else-Valid-Idents-ref
+ Language-Specifics)))))
+ ((string= this-line
+ "/INDENT_SIZE=")
+ ;; Expect a numerical value here.
+ (setcdr (assoc else-tab-size-ref
+ Language-Specifics)
+ (string-to-number
+ (else-strip-quotes
+ (match-string
+ else-body-command-2))))
+ (setq tab-size-specified t))
+ ((string= this-line
+ "/VERSION=")
+ (setcdr (assoc else-language-version-ref
+ Language-Specifics)
+ (else-strip-quotes
+ (match-string else-body-command-2))))
+ (t
+ (throw 'compile
+ "language specifier not recognised"))
+ )
+ ;; The else case, there is either an error or its the
+ ;; language definition end command, which is tested
+ ;; purely by something being in else-body-end slot
+ ;; of the match-data.
+ (if (match-string else-body-end)
+ (progn
+ (setq definition-complete t)
+ ;; Check to see if a /INDENT_SIZE attribute
+ ;; was specified or not, issue a warning
+ ;; message if not
+ (if (not tab-size-specified)
+ (message "/INDENT_SIZE not specified assuming %s spaces"
+ (cdr (assoc else-tab-size-ref
+ Language-Specifics)))
+ )
+ )
+ (throw 'compile "Unknown Error")
+ )
+ )
+ )
+ )
+ )
+ (forward-line) ; Go to the start of the next line.
+ )
+ ;; restore the 'original' language i.e. might have template
+ ;; language enabled for a .lse file that contains definitions
+ ;; for some other language - so compiling a definition shouldn't
+ ;; destroy the current language settings for the buffer.
+ (else-establish-language current-language)
+ )
+ )
+ )
+
+;; This routine is called after the process has defined a definition which
+;; should replace the placeholder/token being replaced. It assumes that the
+;; string being expanded has been deleted and placed into the
+;; else-deleted-string variable.
+;;
+;; Add some basic code here that makes sure Context_dependent work better!
+;; ie
+;; if <<there is nothing else preceeding the placeholder>> AND
+;; <<we can locate a separator string immediately preceeding>> then
+;; Vertical substitution is appropriate
+;; else
+;; Perform Horizontal substitution
+;; end if
+;;
+(defun else-replicate-placeholder-string (duplication-type
+ indent-column
+ element-def)
+ (let ((separator-type)
+ (newline-at-start)
+ (cur-column indent-column))
+ (progn
+ ;; Extract the separator string, test whether it contains a ^M
+ ;; at the beginning and then split it across any embedded ^M's
+ ;; to create a list of separator texts - I imagine this later
+ ;; case will almost never happen?
+ (setq separator-type (get element-def 'else-separator-ref))
+
+ ;; Test for leading newline
+
+ (if (> (length separator-type) 0)
+ (setq newline-at-start (char-equal (aref separator-type 0) ?\r))
+ (setq newline-at-start nil)
+ )
+
+ (cond ((char-equal duplication-type ?v)
+ ;; (setq separator-type (get element-def 'else-separator-ref))
+ (if (> (length separator-type) 0)
+ (progn
+ ;; Now split the string around any embedded
+ ;; newlines - this effectively deletes any leading
+ ;; newline character.
+ (setq separator-type (split-string separator-type
+ (string ?\r)))
+ (if newline-at-start
+ (progn
+ (newline)
+ )
+ )
+
+ (while separator-type
+ (insert (car separator-type))
+ (setq separator-type (cdr separator-type))
+ (if separator-type
+ (newline)
+ )
+ )
+ )
+ )
+ (newline)
+ (indent-to cur-column)
+ (insert (concat "[" else-definition-name "]"))
+ (insert "...")
+ )
+ ((char-equal duplication-type ?h)
+ (if separator-type
+ (progn
+ (insert separator-type)
+ (insert (concat "[" else-definition-name "]"))
+ (insert "...")
+ )
+ )
+ )
+ ;; This case 'can't' happen because the duplication
+ ;; requirements are a pre-requisite for this defun.
+ ((char-equal duplication-type ?c)
+ (message "Invalid duplication in else-replicate-placeholder-string")
+ )
+ )
+ )
+ )
+ )
+
+(defun else-restore (language-name)
+ "Read the Emacs Lisp objects that represent a pre-compiled language definition."
+ (let ((this-definition)
+ (entire)
+ (read-type)
+ (obarray-name)
+ (continue t)
+ (result t))
+ (progn
+ (save-excursion
+ (setq else-read-marker (point-marker))
+ )
+ (condition-case nil
+ (progn
+ (else-check-and-init-globals language-name)
+ (setq Language-Specifics (read else-read-marker))
+ (while continue
+ (setq entire (read else-read-marker))
+ (if entire
+ (progn
+ (setq read-type (nth 1 entire))
+ (cond ((char-equal read-type ?p)
+ ;; Actions for a placeholder
+ (setq obarray-name Placeholder))
+ ((char-equal read-type ?t)
+ ;; Actions for a token
+ (setq obarray-name Token))
+ (t
+ (setq result nil))
+ )
+ (unintern (car entire) obarray-name)
+ (setq this-definition (else-get-entry (car entire) read-type))
+ (setplist this-definition (nth 2 entire))
+ )
+ )
+ )
+ )
+ (end-of-file nil)
+ )
+ result
+ )
+ )
+ )
+
+(defun else-return-sorted-list (this-obarray)
+ "Extract all of the names from the obarray, sort them alphabetically
+and return them as a list."
+ (let ((sorted-list)
+ (case-fold-search nil))
+ ;; Put all of the names into a list
+ (mapatoms '(lambda (obarray-element)
+ (push (get obarray-element 'else-original-name)
+ sorted-list)) this-obarray)
+
+ ;; Now sort the list alphabetically
+ ;;(setq sorted-list (sort sorted-list 'string<))
+ (setq sorted-list
+ (sort sorted-list
+ (lambda (left right)
+ (< (compare-strings left 0 nil
+ right 0 nil
+ else-ignore-case-in-name-sorts)
+ 0))))))
+
+;;
+;; Generalised search routine that provides access to either regular searches
+;; or regular expression searches either forward or backward of `point' but
+;; ultimately search limited to the current line.
+;;
+(defun else-scan-for-match (match-string regexp &optional direction-reverse)
+ (let ((current-position) (search-limit))
+
+ ;;
+ ;; Find the limit of the search based upon whether it is in the
+ ;; forward (default or reverse direction and provide it as a limit
+ ;; for the search. Note that if the search is successful then point
+ ;; is positioned after the end of the word that has been matched.
+ ;;
+ (setq current-position (point))
+ (if direction-reverse
+ (beginning-of-line)
+ (end-of-line)
+ )
+ (setq search-limit (point))
+ (goto-char current-position)
+ (if regexp
+ (if direction-reverse
+ (search-backward match-string search-limit t)
+ (search-forward match-string search-limit t)
+ )
+ (if direction-reverse
+ (re-search-backward match-string search-limit t)
+ (re-search-forward match-string search-limit t)
+ )
+ )
+ )
+ )
+
+(defun else-search-load-path (name &optional check-local-dir-first)
+ "Search load path for file 'name', returns path plus name.
+If 'check-local-dir-first' is t then it will check for the file in the
+'current' directory prior to searching the load path."
+ (let ((search-path load-path)
+ (found nil)
+ (this-attempt))
+ (progn
+ (if check-local-dir-first
+ (progn
+ (setq this-attempt (expand-file-name
+ (concat "./" name)))
+ (setq found (file-exists-p this-attempt))
+ )
+ )
+ (while (and search-path
+ (not found))
+ (setq this-attempt (expand-file-name
+ (concat (car search-path)
+ "/"
+ name)))
+ (setq found (file-exists-p this-attempt))
+ (setq search-path (cdr search-path))
+ )
+ (if found
+ this-attempt
+ nil
+ )
+ )
+ )
+ )
+
+(defun else-set-overlay-here ()
+ "If there is an active overlay then send the menu choices string to
+the hook function."
+ (let ((definition-type nil)
+ (possible-choices nil)
+ (menu-string ""))
+ (if (overlayp else-placeholder-overlay)
+ ;; The overlay already exists, so just move it
+ (move-overlay else-placeholder-overlay
+ (1+ else-placeholder-start)
+ (1- else-placeholder-end))
+ ;; else create the overlay and associate the face to it
+ (setq else-placeholder-overlay
+ (make-overlay (1+ else-placeholder-start)
+ (1- else-placeholder-end)))
+ (overlay-put else-placeholder-overlay
+ 'face 'else-placeholder-face)
+ )
+ ;; Now check if the placeholder is a menu item, if so then load up
+ ;; the menu information and call the VoiceCoder hook.
+ (setq definition-type (get else-current-definition
+ 'else-type-ref))
+ (setq possible-choices nil)
+ (if (char-equal definition-type ?m)
+ ;; It is a menu, so get all of the possible choices and then
+ ;; send them to the functions that have registered on the
+ ;; hook.
+ (progn
+ (setq possible-choices (else-get-menu-entries
+ else-current-definition))
+ (dolist (match-element possible-choices)
+ (setq menu-string
+ (concat menu-string
+ (else-display-menu-element match-element)))))
+ ;; the else is an empty menu string i.e. if the placeholder
+ ;; isn't a menu then send a blank string to the hook functions
+ )
+ (run-hook-with-args 'else-menu-display-functions
+ menu-string)
+ )
+ )
+
+(defun else-set-self-insert-vector ()
+ "Initialise else-before-change character look-up vectors."
+ (let ((local-string)
+ (local-string-length)
+ (index-value))
+ ;; Create a vector of 256 character code length - will this cause problems
+ ;; with "other language" programming?
+ (setq Language-Self-Insert-Characters-Vector
+ (make-vector else-character-vector-length nil))
+ (setq Language-Valid-Identifier-Characters-Vector
+ (make-vector else-character-vector-length nil))
+ (setq Language-Punctuation-Characters-Vector
+ (make-vector else-character-vector-length nil))
+ (setq local-string (cdr (assoc else-Valid-Idents-ref
+ Language-Specifics)))
+ (setq local-string-length (cdr (assoc else-Valid-Idents-Length-ref
+ Language-Specifics)))
+ (while (> local-string-length 0)
+ (setq local-string-length (1- local-string-length))
+ (setq index-value (aref local-string local-string-length))
+ (aset Language-Valid-Identifier-Characters-Vector
+ index-value
+ t)
+ )
+
+ (setq local-string (cdr (assoc else-Self-Insert-Characters-ref
+ Language-Specifics)))
+ (setq local-string-length (cdr (assoc else-Self-Insert-Characters-Length-ref
+ Language-Specifics)))
+ (while (> local-string-length 0)
+ (setq local-string-length (1- local-string-length))
+ (setq index-value (aref local-string local-string-length))
+ (aset Language-Self-Insert-Characters-Vector
+ index-value
+ t)
+ )
+
+ (setq local-string (cdr (assoc else-Punctuation-ref
+ Language-Specifics)))
+ (setq local-string-length (cdr (assoc else-Punctuation-Length-ref
+ Language-Specifics)))
+ (while (> local-string-length 0)
+ (setq local-string-length (1- local-string-length))
+ (setq index-value (aref local-string local-string-length))
+ (aset Language-Punctuation-Characters-Vector
+ index-value
+ t)
+ )
+ )
+ )
+
+;; Set up the before and after change functions and add them to the
+;; appropriate change hooks. Note that the standard change hooks must be made
+;; "local" to the buffer so as not to interfere with buffers that don't have
+;; ELSE mode enabled.
+(defun else-setup-change-hooks ()
+ (let ()
+ (make-local-hook 'after-change-functions)
+ (make-local-hook 'before-change-functions)
+ (add-hook 'before-change-functions
+ 'else-before-change
+ t
+ t)
+ (add-hook 'after-change-functions
+ 'else-after-change
+ nil
+ t)
+
+ (setq else-before-var nil)
+ (setq else-after-var nil)
+ )
+ )
+
+(defun else-show-placeholder-names ()
+ "Display names of all of the Placeholders in the current language template
+set, sort them alphabetically and display them in a temporary buffer."
+ (interactive)
+ (let ((placeholder-list)
+ (desc)
+ (forward-ref)
+ (element)
+ (placeholder-length 0)
+ (list-index)
+ (output-format))
+ (if (not else-mode)
+ (progn
+ (error "ELSE mode not enabled for this buffer."))
+ (with-output-to-temp-buffer "*Available Placeholders*"
+ ;; Put all of the placeholder names into an alphabetically sorted list
+ (setq placeholder-list (else-return-sorted-list Placeholder))
+
+ ;; Nice to have good formatting for the output - determine the
+ ;; longest placeholder name and incorporate the length into the format
+ ;; string. Start with a "default" length of the column header
+ (setq list-index 0)
+ (setq placeholder-length (length "Placeholder"))
+ (while (< list-index (length placeholder-list))
+ (if (> (length (nth list-index placeholder-list)) placeholder-length)
+ (setq placeholder-length
+ (length (nth list-index placeholder-list)))
+ )
+ (setq list-index (+ 1 list-index)))
+
+ (setq output-format (concat "%" (number-to-string placeholder-length)
+ "s %s" ))
+ ;; Now insert them into the buffer at point? Attempt some nice
+ ;; formatting at the same time
+ (princ (format (concat "%" (number-to-string placeholder-length)
+ "s %s ******")
+ "****** Placeholders for"
+ else-Current-Language))
+ (terpri)
+ (terpri)
+ (princ (format output-format "Placeholder" "Description"))
+ ;; newline to output buffer
+ (terpri)
+ (while placeholder-list
+ ;; Get the element as it is used multiple times
+ (setq element (else-look-up (car placeholder-list) ?p))
+
+ ;; Get the description
+ (setq desc (get element 'else-description-ref))
+
+ ;; The placeholder may not have a description because it references
+ ;; a placeholder, so take appropriate action in that
+ ;; situation.
+ (setq forward-ref (get element 'else-placeholder-ref))
+
+ (if (and (string= desc "") (car forward-ref))
+ ;; It is a forward reference, so derive the description
+ ;; from that placeholder
+ (setq desc (get (else-look-up (car (cdr forward-ref)) ?p)
+ 'else-description-ref)))
+ ;; Now format the output string
+ (princ (format output-format (car placeholder-list) desc))
+ (terpri)
+ (setq placeholder-list (cdr placeholder-list)))))))
+
+(defun else-show-token-names ()
+ "Display names of all of the Tokens in the current language template
+set, sort them alphabetically and display them in a temporary buffer."
+ (interactive)
+ (let ((token-list)
+ (desc)
+ (forward-ref)
+ (element)
+ (token-length 0)
+ (list-index)
+ (output-format))
+ (if (not else-mode)
+ (progn
+ (error "ELSE mode not enabled for this buffer."))
+ (with-output-to-temp-buffer "*Available Tokens*"
+ ;; Put all of the token names into an alphabetically sorted list
+ (setq token-list (else-return-sorted-list Token))
+
+ ;; Nice to have good formatting for the output - determine the
+ ;; longest token name and incorporate the length into the format
+ ;; string. Start with a "default" length of the column header
+ (setq list-index 0)
+ (setq token-length (length "Token"))
+ (while (< list-index (length token-list))
+ (if (> (length (nth list-index token-list)) token-length)
+ (setq token-length (length (nth list-index token-list)))
+ )
+ (setq list-index (+ 1 list-index)))
+
+ (setq output-format (concat "%" (number-to-string token-length)
+ "s %s" ))
+ ;; Now insert them into the buffer at point? Attempt some nice
+ ;; formatting at the same time
+ (princ (format (concat "%" (number-to-string token-length)
+ "s %s ******")
+ "****** Tokens for"
+ else-Current-Language))
+ (terpri)
+ (terpri)
+ (princ (format output-format "Token" "Description"))
+ ;; newline to output buffer
+ (terpri)
+ (while token-list
+ ;; Get the element as it is used multiple times
+ (setq element (else-look-up (car token-list) ?t))
+
+ ;; Get the description
+ (setq desc (get element 'else-description-ref))
+
+ ;; The token may not have a description because it references
+ ;; a placeholder, so take appropriate action in that
+ ;; situation.
+ (setq forward-ref (get element 'else-placeholder-ref))
+
+ (if (and (string= desc "") (car forward-ref))
+ ;; It is a forward reference, so derive the description
+ ;; from that placeholder
+ (setq desc (get (else-look-up (car (cdr forward-ref)) ?p)
+ 'else-description-ref)))
+ ;; Now format the output string
+ (princ (format output-format (car token-list) desc))
+ (terpri)
+ (setq token-list (cdr token-list)))))))
+
+(defun else-store-element (s-symbol)
+ "Called by mapatom to save the symbol to a file.
+The file is indicated by 'else-read-marker'"
+ (let ((this-definition)
+ (property-list)
+ (entire))
+ (progn
+ (setq this-definition s-symbol)
+ (setq property-list (symbol-plist this-definition))
+ (setq entire (list (symbol-name this-definition)
+ else-type-of-symbols
+ property-list))
+ (print entire else-read-marker)
+ )
+ )
+ )
+
+
+;;
+;; If ARG contains enclosing quotes, then strip them off.
+;;
+(defun else-strip-quotes (arg)
+ (let ()
+ (if (string= (substring arg 0 1) "\"")
+ (substring arg 1 (1- (length arg)))
+ arg
+ )
+ )
+ )
+
+;; Called to provide a textual substitution of the current token or
+;; placeholder with either a single line of text (because it was
+;; selected from a menu) or the body of a placeholder.
+;; element - either a string or a symbol
+;; defn-type - token or placeholder type of the element being replaced.
+(defun else-substitute (element defn-type)
+ "[text]"
+ (let ((lang-indent-size (cdr (assoc else-tab-size-ref Language-Specifics)))
+ (adjust-factor 0)
+ (duplication-direction 0)
+ (text-to-insert "")
+ (cur-column 0)
+ (here))
+ (condition-case nil
+ (progn
+ ;; Now process each line to be inserted. First though, turn off
+ ;; processing by the before/after change hook functions by ELSE.
+ (remove-hook 'before-change-functions 'else-before-change t)
+ (remove-hook 'after-change-functions 'else-after-change t)
+
+ ;; Grab a copy of the string that is about to be deleted - we may
+ ;; use it later on, so here is a convenient place to take a copy.
+ (setq else-deleted-string (buffer-substring
+ else-placeholder-start
+ else-placeholder-end))
+
+ ;; Delete the element that we are replacing - in both cases
+ ;; we expect the else-placeholder-start/end variables to be
+ ;; setup - this is a precondition of entry to this
+ ;; defun. Note also that the definition type
+ ;; i.e. placeholder or token of what is being deleted is not
+ ;; necessarily the argument value of defn-type to this defun
+ ;; i.e. at this point we may have followed several levels of
+ ;; "indirection" to arrive at an actual point of
+ ;; substitution. So depend on a global variable for the
+ ;; element type of what we are deleting
+ ;; (else-definition-type).
+ (delete-region else-placeholder-start else-placeholder-end)
+ (if (char-equal else-definition-type ?p)
+ (progn
+ (if else-please-duplicate
+ (progn
+ (delete-char 3)
+ ;; What is the context of the duplication?
+ ;; i.e. if there is only whitespace prior to the
+ ;; placeholder then the duplication context is
+ ;; vertical, otherwise it is horizontal - the
+ ;; only way this can be overridden is if the
+ ;; placeholder definition contains something
+ ;; other than CONTEXT_DEPENDENT. So test for
+ ;; this first.
+ ;; If it is context dependent, then work out
+ ;; what the context is otherwise just assume the
+ ;; value in the definition.
+ (setq duplication-direction (get else-current-definition
+ 'else-duplication-ref))
+ (if (char-equal duplication-direction ?c)
+ (progn
+ ;; Make sure the search doesn't change point
+ (setq here (point))
+ (if (not (else-scan-for-match "[^ \t]" nil t))
+ (setq duplication-direction ?v)
+ (setq duplication-direction ?h)
+ )
+ (goto-char here)
+ )
+ )
+ )
+ )
+ )
+ ;;
+ )
+ (setq else-deleted-column (current-column))
+
+ ;; Now take action based upon the target substitution. What
+ ;; we want here is to have a list of text line(s) to
+ ;; insert. In the case of defun argument element being a
+ ;; placeholder, then we need to extract all of the body text
+ ;; into a list, when the defun argument is a single line
+ ;; (line from a menu selection) then place that into the
+ ;; same list element - this way we can process both cases
+ ;; using the same code. Note that the resultant list, no
+ ;; matter where the source came from has to contain elements
+ ;; that have the same structure as each line of the body of
+ ;; a placeholder.
+ (if (symbolp element)
+ (setq text-to-insert (get element 'else-body-ref))
+ ;; object must be a string, so construct a standard single
+ ;; line entry for the list i.e. it should have a structure
+ ;; as defined in else-extract-body. This is easy because
+ ;; we know that the element is a string for direct
+ ;; insertion, so it is not a /PLACEHOLDER or /TOKEN, has a
+ ;; zero level indent and the line is the string text.
+ (setq text-to-insert (list (list nil 0 element)))
+ )
+
+ (setq cur-column (current-column))
+ (while text-to-insert
+ (progn
+ ;; Insert the correct number of spaces for the
+ ;; indentation of the line.
+ (insert (make-string
+ (* (nth else-body-indent-ref (car text-to-insert))
+ lang-indent-size)
+ ?\ ))
+ (insert (nth else-body-text-ref (car text-to-insert)))
+
+ ;; Now check for more lines of text to be inserted.
+ (setq text-to-insert (cdr text-to-insert))
+ (if text-to-insert
+ (progn
+ (newline)
+ (indent-to cur-column)
+ )
+ )
+ )
+ )
+ )
+ (error nil)) ;; end of the condition-case
+ (add-hook 'before-change-functions 'else-before-change t t)
+ (add-hook 'after-change-functions 'else-after-change nil t)
+ ;; If the item just expanded was a placeholder and it should be
+ ;; replicated then do it.
+ (if (and (char-equal else-definition-type ?p) else-please-duplicate)
+ (else-replicate-placeholder-string duplication-direction
+ else-deleted-column
+ else-current-definition)
+ )
+ )
+ )
+
+(defun else-summary ()
+ (interactive)
+ (let ()
+ (progn
+ (message "s-elect, q-uit, n-ext line, p-revious line")
+ )
+ )
+ )
+
+(defun else-toggle-direction ()
+ "Toggle the value of the direction flag 'else-direction."
+ (interactive)
+ (setq else-direction (not else-direction))
+ )
+
+
+(defun else-uncomment-placeholders ()
+ "Remove any comment prefixes from lines containing valid placeholders.
+This function reverses the effects of else-comment-placeholders."
+ (interactive)
+ (let ((region-start)
+ (region-end))
+ (progn
+ (save-excursion
+ (goto-char (point-min))
+ (while (not (= (point) (else-next-placeholder)))
+ (progn
+ (beginning-of-line)
+ (if (looking-at (regexp-quote comment-start))
+ (progn
+ (setq region-start (point))
+ (end-of-line)
+ (setq region-end (point))
+ (uncomment-region region-start region-end)
+ )
+ )
+ (end-of-line)
+ )
+ )
+ )
+ )
+ )
+ )
+
+(defun else-find-template (template-name obarray-name)
+ "Try completion for template-name in obarray-name."
+ (let ((succeeded t)
+ (matched-string)
+ (match-data)
+ (is-completions-displayed))
+ (progn
+ ;; Make sure that any existing completions display is deleted.
+ (setq is-completions-displayed
+ (get-buffer-window "*Completions*" 'visible))
+ (if is-completions-displayed
+ (progn
+ (save-excursion
+ (delete-window is-completions-displayed)
+ )
+ )
+ )
+ (setq matched-string (upcase template-name))
+ (setq match-data (try-completion
+ matched-string
+ obarray-name))
+ (cond ((or (equal match-data t)
+ (equal match-data nil))
+ ;; Actions for an exact match
+ (setq succeeded nil)
+ )
+ (t
+ ;; All else i.e. there is "longest" possible string
+ (if (equal (length match-data)
+ (length matched-string))
+ (progn
+ ;; The two match, so therefore we have matched up
+ ;; until the unique portion but still not finished
+ ;; the completion i.e. there is more than one
+ ;; possible completion.
+ (with-output-to-temp-buffer "*Completions*"
+ (display-completion-list
+ (all-completions matched-string Placeholder)
+ )
+ )
+ (setq succeeded nil)
+ )
+ (progn
+ (setq match-data (downcase match-data))
+ (insert match-data)
+ )
+ )
+ )
+ )
+ succeeded
+ )
+ )
+ )
+
+(defun else-insert-placeholder ()
+ "Given a string, lookup the template in the current language. When found,
+insert the string at point."
+ (interactive)
+ (let ((here (point))
+ (stop-location)
+ (matched-string))
+ (progn
+ (beginning-of-line)
+ (setq stop-location (point))
+ (goto-char here)
+ ;; Look backwards for either a "{" or a "[" character.
+ (if (re-search-backward "[{[]" stop-location t)
+ (progn
+ (forward-char)
+ (setq matched-string (buffer-substring (point) here))
+ (delete-region (point) here)
+ (if (not (else-find-template matched-string Placeholder))
+ (progn
+ (insert matched-string)
+ (goto-char here)
+ )
+ )
+ )
+ (progn
+ ;; This is the else case. Assume that a token is desired.
+ (forward-word -1)
+ (setq matched-string (buffer-substring (point) here))
+ (delete-region (point) here)
+ (if (not (else-find-template matched-string Token))
+ (progn
+ (insert matched-string)
+ (goto-char here)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+
+(defun else-is-template-file-present (language-file-name)
+ "Search the list of all buffers checking whether the file that each
+visits is the target file - return t if there is a match."
+ (let ((local-list (buffer-list))
+ (result nil)
+ this-buffer
+ (abs-file-name (expand-file-name language-file-name)))
+ ;; Search the list until empty or a match is found
+ (while (and local-list (not result))
+
+ (setq this-buffer (car local-list))
+ (setq local-list (cdr local-list))
+
+ (setq result (string= abs-file-name (buffer-file-name this-buffer)))
+ )
+ result
+ )
+ )
+
+(defun else-wrap-region (begin end)
+ "'wrap' a region of code with a placeholder definition.
+The marked region will be moved into the first placeholder in the
+second line of the placeholder being used."
+ (interactive "r")
+ (let ((template-name)
+ (text-being-wrapped (buffer-substring begin end))
+ (start-region)
+ (end-region))
+ (if (not else-mode)
+ (error "Must have a language loaded to run this function.")
+ (setq template-name
+ (completing-read "Placeholder: " Placeholder))
+ (delete-region begin end)
+ (newline)
+ (forward-line -1)
+ (indent-for-tab-command)
+ (setq start-region (point-marker))
+ (insert (concat "{" template-name "}"))
+ (else-previous-placeholder)
+ (else-expand-placeholder)
+ (goto-char start-region)
+ (beginning-of-line)
+ (forward-line)
+ (else-next-placeholder)
+ (insert text-being-wrapped)
+ (setq end-region (point-marker))
+ (indent-region start-region end-region nil)
+ )
+ )
+ )
+
+
+(defgroup ELSE nil
+ "Custom variables for Emacs Language Sensitive Editor"
+ :tag "Emacs LSE"
+ :prefix "else"
+ :group 'tools)
+
+(defcustom else-prompt-time 3
+ "Prompter Screen display time in seconds"
+ :type 'integer
+ :group 'ELSE)
+
+(defcustom else-kill-proceed-to-next-placeholder nil
+ "Should else-kill-placeholder goto next placeholder after a kill or not"
+ :type 'boolean
+ :group 'ELSE)
+
+(defcustom else-set-lineno nil
+ "Turn line numbering in the Menu buffer on or off. Requires setnu.el."
+ :type 'boolean
+ :group 'ELSE)
+
+(defcustom else-move-and-execute nil
+ "If set, then if a command fails then a movement-<execute> pair is assumed
+where <execute> is the requested operation and the movement is determined by the
+else-direction flag - note that the 'command' is currently restricted to expand
+and kill operations only."
+ :type 'boolean
+ :group 'ELSE)
+
+(defcustom else-direction t
+ "If expand-or-move is enabled, this flag determines the direction of movement
+ on - next placeholder
+ off - previous placeholder"
+ :type 'boolean
+ :group 'ELSE)
+
+(defcustom else-only-proceed-within-window t
+ "Move after a kill only if the next placeholder is visible in the current window.
+This flag controls jumps when they are part of a composite action by ELSE
+i.e. in kill-placeholder, if the kill-proceed flags is set then this flag
+allows the move to the next placeholder only if it is visible in the current
+window."
+ :type 'boolean
+ :group 'ELSE)
+
+(defcustom else-follow-menus nil
+ "If true then menu definitions are 'followed' or expanded until no sub-entry
+menu is found and all are combined into a single menu selection
+display at the 'top level'. If nil, then menu's are not expanded and
+the user has to traverse sub-menu entries (useful when combining
+menu's leads to huge menu selections)."
+ :type 'boolean
+ :group 'ELSE)
+
+(defcustom else-nofollow-menus nil
+ "If true then menu definitions are *not* 'followed'. If nil,
+'else-follow-menus and then /NOFOLLOW or /FOLLOW attributes are tested to
+determine the behaviour of menu displays. If set to t then this flag has
+precedence over all other settings dealing with this bechaviour."
+ :type 'boolean
+ :group 'ELSE)
+
+(make-variable-buffer-local 'else-follow-menus)
+(make-variable-buffer-local 'else-nofollow-menus)
+
+(defcustom else-experimental-code-flag nil
+ "Protect experimental regions of the code. Leave set to nil unless you are sure
+you can live with the consequences. Current behaviour being protected by the flag
+is:
+1. Creating an overlay for the last placeholder visited by else-next-placeholder
+and else-previous-placeholder - this is code for VoiceCoder requirements."
+ :type 'boolean
+ :group 'ELSE)
+
+(defface else-placeholder-face
+ '((((type tty) (class color)) (:foreground "green"))
+ (((class grayscale) (background light)) (:foreground "DimGray" :italic t))
+ (((class grayscale) (background dark)) (:foreground "LightGray" :italic t))
+ (((class color) (background light)) (:foreground "RosyBrown"))
+ (((class color) (background dark)) (:foreground "LightSalmon"))
+ (t (:italic t)))
+ "ELSE mode face used for placeholder strings."
+ :group 'ELSE)
+
+(defcustom else-menu-display-functions nil
+ "A hook by which functions communicate their interest in menu
+selections when ELSE moves into a placeholder that is a menu
+placeholder."
+ :type '(repeat (cons string symbol))
+ :group 'ELSE)
+
+(defcustom else-ignore-case-in-name-sorts t
+ "Ignore case (t) in sorting token names for display using
+else-show-token-names"
+ :type 'boolean
+ :group 'ELSE)
+
+;; make a unique copy for this buffer
+(make-variable-buffer-local 'else-placeholder-overlay)
+
+(provide 'else-mode)
+
+;;; elsemode.el ends here
+;; LocalWords: elsemode Milliken dosuser peterm msg esl lse setq progn concat
+;; LocalWords: keymaps keymap eg ada lang keypress obarray mapatom nthcdr alist
+;; LocalWords: NOAUTOSUBSTITUTE da mapatoms se sl utils obarrays thru Ok defun
+;; LocalWords: fName Unintern cdr assoc NOAUTO NOLIST Placeholder's lineno VR
+;; LocalWords: regexp cust Keybindings dir ARG uit revious placeholders struct
+;; LocalWords: VoiceCoder count'th barfing XEmacs cond xemacs fns Monnier wrt
+;; LocalWords: setnu
diff --git a/app-emacs/else-mode/files/else.info b/app-emacs/else-mode/files/else.info
new file mode 100644
index 0000000..4fdc14b
--- /dev/null
+++ b/app-emacs/else-mode/files/else.info
@@ -0,0 +1,3215 @@
+This is else, produced by makeinfo version 4.2 from else.texi.
+
+ This file documents the Emacs Language Sensitive Editor (ELSE) minor
+mode.
+
+ This version is edition 1.5 of the ELSE User Manual. It corresponds
+to ELSE Version 1.20
+
+ Copyright (C) 1999 - 2003 Peter Milliken
+
+ Permission is granted to make and distribute verbatim copies of this
+manual provided the copyright notice and this permission notice are
+preserved on all copies.
+
+ Permission is granted to copy and distribute modified versions of
+this manual under the conditions for verbatim copying, provided also
+that the sections entitled "Copying" and "GNU General Public License"
+are included exactly as in the original, and provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+ Permission is granted to copy and distribute translations of this
+manual into another language, under the above conditions for modified
+versions, except that this permission notice may be stated in a
+translation approved by the Free Software Foundation.
+
+INFO-DIR-SECTION Editors
+START-INFO-DIR-ENTRY
+* ELSE: (else). Emacs Language Sensitive Editor mode.
+END-INFO-DIR-ENTRY
+
+
+File: else, Node: Top, Next: Introduction, Prev: (dir), Up: (dir)
+
+ This Info file contains edition 1.5 of the ELSE Users Manual,
+corresponding to Version 1.20 of the Elisp file else-mode.el.
+
+* Menu:
+
+* Introduction::
+* Overview::
+* Installation Instructions::
+* Default Keybindings::
+* Command Summary::
+* Using ELSE::
+* Creating and Modifying Templates::
+* Custom Variables::
+* Technical Notes::
+* Compatibility::
+* Notes for VR Coding::
+* Template Availability::
+* Tutorial::
+* Concept Index::
+
+ --- The Detailed Node Listing ---
+
+Overview of ELSE
+
+* Typographical Conventions:: Definitions of special characters used.
+* Definitions:: Definitions of special terminology.
+
+Using ELSE
+
+* Invoking ELSE:: How to start it up and what you get.
+* Navigating::
+* Expanding Placeholders:: How to expand Placeholders.
+* Expanding Tokens:: How to expand Tokens.
+* Deleting Placeholders::
+* Preparing for Compilation::
+* Disabling ELSE:: Sometimes you just don't want ELSE to be active.
+
+Creating and Modifying Templates
+
+* Syntactic Conventions::
+* Customising An Existing Template Language::
+* Extracting Placeholders or Tokens::
+* Create a New Language:: How to create a new language template
+* Definition of the Template Structure::
+* Example of Creating A New Language Template::
+
+Customising An Existing Template Language
+
+* Extracting Placeholders or Tokens:: How to extract a placeholder or token
+
+Creating a New Language
+
+* Language Definition Template::
+* Overriding Language Attributes::
+
+Language Definition Template
+
+* Language Identification::
+* Initial String::
+* Punctuation characters::
+* Self Insert Characters::
+* Valid Identifier Characters::
+* Indentation Size::
+* Template Version::
+
+Definition of the Template Structure
+
+* Placeholders::
+* Tokens::
+* Hooking Elisp Code into ELSE Templates::
+
+Placeholder Definition
+
+* Delete Placeholder Statement::
+* Language Specifier::
+* Define Placeholder Statement::
+* Auto Text Substitute::
+* Description Specifier::
+* Duplication Specifier::
+* Separator Specification::
+* Type Specifier::
+* Template Body::
+* Placeholder Cross-Referencing::
+* End Define Command::
+
+Technical Notes
+
+* Useful ELSE Defuns::
+* Editing Template Files::
+* ELSE and Hooks::
+* Building the Language Template File Name::
+
+ELSE and Hooks
+
+* Building the Language Template File Name::
+
+Tutorial
+
+* Abbreviation Coding::
+* Whole Language Coding::
+
+
+File: else, Node: Introduction, Next: Overview, Prev: Top, Up: Top
+
+Introduction
+************
+
+ These days a number of packages exist for Emacs that provide what
+users think of as "templates" or "skeletons" or code "abbreviations".
+When they first go in search of something to help generate code they
+are thinking of something that will allow the generation of common code
+constructs (usually control structures or file/function headers) with a
+small number of keystrokes (similar to the Emacs abbreviation
+facility). For instance, a user might be interested in a package that
+generates an "if" statement, they envisage such as package generally
+working like an abbreviation i.e. "if<some Emacs command/key sequence>"
+which then leaves a tailored "if" construct in their buffer, where they
+can then "fill in the blank" or missing portions of the code.
+
+ ELSE (Emacs Language Sensitive Editor) provides this functionality
+via what is called "tokens" (*note Expanding Tokens::) plus much more.
+The following example shows the use of a token definition taken from
+the C language templates, this definition generates an "if" construct.
+The key-stroke sequence to generate this command (assumes installation
+of ELSE has been achieved) is `ifC-c / e' with the following result in
+the buffer:
+
+ if ({expression}) {
+ {statement}...
+ }
+ [elsif_part]...
+ [else_part]
+
+After the expansion, the cursor is automatically positioned within the
+first placeholder (`{expression}' and the user can just start typing the
+condition expression, ELSE will automatically delete the placeholder
+text and replace it with the typed information.
+
+ ELSE takes what I will term a "whole language" approach to helping
+generate code. Not only does it provide code "abbreviations" but it
+also provides facilities that allow generation of a code file from
+initial empty buffer to completed file - all without having to leave
+the template system. Indeed, it is possible to code a typical language
+file without having to manually type a single language keyword or
+construct. This "whole language" approach utilises what is termed
+"placeholders" (*note Expanding Placeholders::). Given a sufficiently
+detailed language template file (one that closely mirrors the EBNF (1)
+for the language, for instance), then it is possible to achieve this
+goal.
+
+ A brief tutorial is offered (*note Tutorial::) showing the use of
+both placeholders and tokens.
+
+ Most people, when they start to explore language sensitive editing,
+start out by looking for a system that allows them to specify language
+"templates" -- a facility that will allow them to type in an
+abbreviation which is then somehow expanded to the full language
+construct i.e. `if' is expanded to the full syntax of the particular
+language if statement. This is as far as they typically envisage a
+templating package to work. ELSE provides this basic functionality via
+what is termed "tokens". But ELSE goes much further than this, it
+provides a system that allows the mimicking of the entire language
+syntax i.e. it offers not only expansion of abbreviations but also
+allows menu choices and the provision of information messages to the
+user -- all within the syntax of an ASCII readable language definition
+file. The structure of the language definition file is described fully
+in the reference portions of this manual (*Note Creating and Modifying
+Templates::).
+
+ You might be asking the question - how is ELSE different from any of
+the other template packages available for Emacs? ELSE differs from
+other packages that aim to achieve the same goals in several ways:
+ 1. ELSE language template definitions are specified using a purely
+ ASCII, textural syntax with no attempt at making them look
+ ELisp-like. At least one user has seen this as a disadvantage
+ though :-). To be fair, his argument was that why should he have
+ to learn yet another "language" when if the template definitions
+ could be defined using Elisp style syntax? There is no easy answer
+ for this. As the author, I (obviously) thought that staying away
+ from Elisp like syntax would be a benefit to a user i.e. they
+ don't have to learn Elisp to use ELSE! At first glance, ELisp is
+ not an easy language to pick up with its nested brackets etc -
+ miss one and you are history! :-).
+
+ 2. ELSE language definition syntax conforms with a commercially
+ available Editor(2).
+
+ 3. The user interface for using ELSE is completely visual i.e. other
+ template/skeleton packages use an interface of questions/answers
+ and have invisible "markers" to points of interest in the syntax
+ generated. Thus their interface is not easy to use (once you
+ embark into a Q&A session you are stuck with completing it - many
+ such sessions require you to know the full extent of your code
+ before you embark on it! e.g. how many case statements will be
+ used in a switch statement and exactly what are the cases in which
+ the program should take action? If you need further information to
+ answer any of the questions then there is no way to just
+ "interrupt" the season, switch to another buffer and look up the
+ required information -- so you are either forced to continue on as
+ best you can or abandon the Q&A session entirely). ELSE's
+ placeholders or "markers" persist across edit sessions because
+ they are actual text in the buffer, other template/skeleton
+ packages use Emacs markers which are lost when the edit session
+ for that file is ended.
+
+ 4. ELSE offers features that are missing in other packages e.g. the
+ ability to have text automatically repeated as you type at a
+ single place in multiple places within the language syntax i.e.
+ function names can be repeated at the end of the function body as
+ the name is typed by the user at the start of the body(3). It is
+ possible to create flexible templates for commonly used language
+ constructs using this feature i.e. coding for loops in C often
+ have a similar, repetitive "pattern", using this feature of ELSE,
+ typing can be kept to a minimum as the variable name is repeated
+ in multiple places e.g.
+
+ for (no_items = 0; no_items < 100; no_items++)
+
+ is a very common construct - the auto-substitute feature of ELSE
+ could allow the user to create the above code pattern such that
+ the variable "no_items" was automatically repeated in two places
+ as the first instance was typed by the user.
+
+ 5. ELSE language definitions can model the original language syntax
+ either as loosely or closely as the template definition maintainer
+ desires using a menu system that provides choices that follow
+ language syntax branching. Thus a user can see what code syntax is
+ possible at different points in the file without necessarily
+ having to be an expert in the language in which the code is being
+ generated. This means that ELSE can be a aid to beginning
+ programmers as they learn the language in which they are
+ generating code.
+
+ 6. ELSE offers a more "dynamic" interface than other similar
+ packages. The user can "extract" and modify language template
+ definitions "on the fly" whilst in an Emacs edit session. These
+ changes can be either temporary i.e. last for the current edit
+ session only or can be saved for future use in later sessions. In
+ fact, ELSE is so dynamic that you can actually extract the contents
+ of the entire language template set for the current edit session
+ and save that for later (re)use.
+
+ 7. And lastly (but not least :-)), ELSE is extensively documented.
+ Documentation for competitive packages are only just starting to
+ emerge, use of those packages have thus been limited to those few
+ who were prepared to invest the time to read Elisp and a few
+ scattered examples to learn how to use the packages. ELSE template
+ definition syntax and documentation hopefully allows even users
+ who are not interested in programming in Elisp to enjoy the fruits
+ of language sensitive editing quickly and (relatively) easily.
+
+
+ ---------- Footnotes ----------
+
+ (1) Extended Backus-Naur Form is a mechanism used by computer
+scientists to describe the syntax of a computer language i.e. check
+section A.13 of Kernighan and Ritchie's "White book" on the C language
+
+ (2) well, it is as close as my memory allowed when I moved from
+using DEC LSE and creating a mimic of it -- users have reported very
+minor syntactical differences that are easily catered for by editing
+the template file
+
+ (3) this is mandatory for some languages, also some project coding
+standards demand a repetition of information that is found at the head
+of construct to be repeated at the end of the construct i.e. copying
+the expression portion of an if statement into a comment at the end of
+the if structure
+
+
+File: else, Node: Overview, Next: Installation Instructions, Prev: Introduction, Up: Top
+
+Overview of ELSE
+****************
+
+ ELSE is an implementation of a minor mode for Emacs that provides
+language sensitive editing capability to the currently enabled major
+mode (for the current buffer) of Emacs. It is aimed fairly and squarely
+at providing support to programmers for input of program text but as
+you will see it can be easily customised for any task that involves
+repetitious input of common textual sequences.
+
+ Use of ELSE will improve programmer productivity by reducing the
+amount of time to enter the program/text in the first instance and in
+the second instance, it will cut-down on time consuming errors due to
+typing mistakes i.e. syntax errors that are usually found by the
+compiler during the compile - edit cycle e.g. missing ;'s become a
+thing of the past.
+
+ The aim of ELSE is to reduce programming to an exercise of "filling
+in the blanks", hence the use of the term "template" language. Language
+constructs are the templates and the variable, procedure and function
+names are the "blanks".
+
+ There are a number of ways of implementing so called "language
+sensitive editing" (lse) in an editor. The most common approaches seen
+in many editors that offer this feature take a very "primitive" form
+where the programmer is left feeling that he/she could just as easily
+do without e.g., many implementations offer the following behaviour:
+
+ 1. offer macros that would fill in some of the language syntax by
+ straight generation of a portion of the chosen language statement
+ leaving the user to position the cursor manually to where variable
+ entry is required and manual deletion of (optional) portions of
+ the syntax that are not required; or
+
+ 2. through a series of question/answer sessions, where at the end of
+ the sequence, the language statement is deemed "complete" and is
+ entered into the text buffer.
+
+ These approaches tend to feel fairly "intrusive" to the programmer
+and are generally awkward to use. In addition, they offer little or no
+help to the novice in possible selections of syntax.
+
+ The approach to Language Sensitive Editing offered here for Emacs is
+modelled after a feature found in a editor offered by Digital Equipment
+Corporation(1) called LSE. This approach to the problem does not suffer
+from any of the usual awkwardness associated with typical lse
+implementations. It provides a natural framework for the programmer
+where the work is limited to menu selections and "filling in the
+blanks" e.g., a typical "template" (*note Definitions::) in ELSE looks
+like:
+
+ [context_clause]...
+ package {program_unit_name} is
+ {basic_declarative_item}...
+ [private_part]
+ end [program_unit_name];
+
+This is the template for a `package' specification in Ada. Each of the
+textual strings inclosed by `{}''s or `[]''s are language
+"placeholders" (*note Definitions::) that offer further expansion
+possibilities through either menu selection, text substitution or
+language prompts e.g., if the placeholder `[context_clause]' is
+"expanded" then the contents of the buffer will become:
+
+ with {library_unit_name}...; [use_clause]
+ [context_clause]...
+ package {program_unit_name} is
+ {basic_declarative_item}...
+ [private_part]
+ end [program_unit_name];
+
+Observe that the placeholder `[context_clause]...' has been expanded
+and replaced with the two lines:
+
+
+ with {library_unit_name}...; [use_clause]
+ [context_clause]...
+
+Upon expansion, ELSE replaced the placeholder `context_clause' with its
+definition, namely the text `with {library_unit_name}...;
+[use_clause]'. It detected that the placeholder was to be repeated (the
+trailing ...) and thus duplicated the placeholder being expanded onto
+the next line.
+
+ After the expansion, the cursor will be automatically re-positioned
+between the first set of `{}''s. The user then has options of further
+expansion or performing straight text entry, if the text entry option
+is exercised then the text within and including the `{}''s is
+automatically deleted by the minor mode and replaced by the entered
+text i.e. no awkward "killing" or "deleting" of text is required, the
+minor mode recognises a valid(2) placeholder and responds appropriately
+e.g.,
+
+
+ with TEXT_IO, [library_unit_name]...; [use_clause]...
+
+Note that the user has only typed the text `TEXT_IO', the `,' and the
+repetition of the (optional) syntax/placeholder
+`[library_unit_name]...' was automatically supplied by the minor mode
+functionality. Just as `conveniently', if the programmer decides that a
+second `library_unit_name' is not required then the placeholder can be
+deleted (`else-expand-placeholder' (`C-c / e')) using a single command
+with the following to result:
+
+
+ with TEXT_IO; [use_clause]...
+
+Note that ELSE has performed appropriate "housekeeping" and that the
+`,' has been automatically deleted as nolonger required and the `;'
+character is flush against the package name (TEXT_IO). Similarly, the
+`[use_clause]' placeholder can be expanded upon or deleted.
+
+ The preceeding examples have shown how ELSE offers language sensitive
+editing via the "placeholder" mechanism. Another mechanism offered by
+ELSE for quick generation of language syntax is via the expansion of
+"token's". A token is usually used where no placeholders are available
+i.e. the programmer has deleted all placeholders but wants to add
+further code to a particular section. He/She has the option of either
+typing in a placeholder, such as, `{statement}'... or if a simple
+construct is all that is needed, then he/she can type in a token and
+perform expansion upon it. A "token" is an abbreviated string that has
+been defined in the language templates to be expanded to a full
+construct e.g.
+
+ Code before entry with the ``token'' inserted at the desired point:
+
+ Value1 := 10;
+ Value2 := 20;
+
+ if <---- require an ``if'' statement here
+
+ Value3 := Value1 * Value2;
+
+ Code after token is expanded:
+
+ Value1 := 10;
+ Value2 := 20;
+
+ if {condition} then
+ {statement}...
+ [elsif_part]
+ [else_part]
+ end if;
+
+ Value3 := Value1 * Value2;
+
+ In the previous example, the abbreviation "if" is a token defined in
+the Ada language templates which is defined to expand to an "if
+statement" template.
+
+* Menu:
+
+* Typographical Conventions:: Definitions of special characters used.
+* Definitions:: Definitions of special terminology.
+
+ ---------- Footnotes ----------
+
+ (1) DEC has been purchased by Compaq, which has in turn been
+purchased by Hewlett-Packard, but the product lines lives on AFAIK
+
+ (2) valid placeholder or token strings are defined as a string that
+exists as a definition in the currently enabled language definitions
+
+
+File: else, Node: Typographical Conventions, Next: Definitions, Prev: Overview, Up: Overview
+
+Typographical Conventions
+=========================
+
+ ELSE uses the following typographical conventions:
+
+ 1. Curly braces `{}''s -- denote a mandatory entry e.g. `with
+ {library_unit_name}', the language requires that a package name be
+ supplied. Mandatory entries cannot be deleted (using the
+ `else-kill-placeholder' (`C-c / k') command, that is), the user is
+ warned by a error message in the command line of the editor.
+
+ 2. Square braces `[]''s -- denote an optional entry e.g.
+ `[context_clause]' can be either deleted or `expanded'.
+
+ 3. 3 Dots ... -- denote the fact that the preceeding (or `attached')
+ placeholder will be `automatically' repeated by the minor mode
+ functionality when the user performs any actions other than the
+ `else-kill-placeholder' (`C-c / k') command.
+
+ 4. ==> -- denotes the results of an "expansion" of either a
+ placeholder or token e.g.
+ [context_clause]... ==> with {library_unit_name}...; [use_clause]
+
+
+File: else, Node: Definitions, Prev: Typographical Conventions, Up: Overview
+
+Definitions
+===========
+
+ The following terminology is used in this manual:
+
+ 1. `placeholder' -- Term used to denote a textual string that is
+ recognisable or "defined" in the currently selected `language'
+ mode. The string is enclosed by either `[]''s or `{}''s (*note
+ Typographical Conventions::).
+
+ 2. `token' -- A (usually short) textual string that has been
+ "defined" in the currently active language template. It can be
+ expanded to provide a language template. This is (usually) used as
+ a shorthand way of inserting a particular language construct.
+ Tokens are textual strings which are not enclosed by `[]''s or
+ `{}''s.
+
+ 3. `expand' or `expansion' -- Denotes the execution of the command
+ `else-expand-placeholder'.
+
+
+File: else, Node: Installation Instructions, Next: Default Keybindings, Prev: Overview, Up: Top
+
+Installation Instructions
+*************************
+
+ To install ELSE, copy the Emacs Lisp file `else-mode.el' anywhere
+into the load path of your installation of Emacs (I use the `site-lisp'
+directory). Place the following command into your .emacs file:
+ (require 'else-mode)
+
+ ELSE also optionally supports the use of a support package called
+setnu.el (mirrored/available from the same place that you copied
+else-mode.el). This package is written by Kyle E. Jones and provides
+line numbering support (if enabled - *Note Custom Variables::.) to the
+display of menu choices. This feature is available so that individuals
+using voice coding systems can easily pick the desired menu choice. The
+setnu.el package should be copied to the same spot as else-mode.el.
+
+ It is recommended, but not necessary, that you install the ELSE info
+documentation. ELSE documentation consists of a TexInfo file
+(else.texi), an info file (else.info) and a PDF file (else.pdf). Copy
+the info file (else.info) into the Emacs Info directory and add the
+following line to the `dir' file that can be found in the Emacs info
+directory:
+
+ * ELSE: (else.info). Emacs Language Sensitive Editor.
+
+ ELSE comes with a number of template definition files (*note
+Template Availability::). Place the desired template definition files
+anywhere in the Emacs `load-path' (the site-lisp directory is fine).
+
+
+File: else, Node: Default Keybindings, Next: Command Summary, Prev: Installation Instructions, Up: Top
+
+Default Keybindings
+*******************
+
+ Following the recommendations of the Elisp manual regarding minor
+modes, ELSE provides a minor-mode map i.e. a map that is active only
+when the minor mode is active, that binds the four main commands of
+ELSE as follows:
+ 1. else-expand-placeholder - `C-c / e'
+
+ 2. else-next-placeholder - `C-c / n'
+
+ 3. else-previous-placeholder - `C-c / p'
+
+ 4. else-kill-placeholder - `C-c / k'
+
+ Some lessor used commands and their bindings are:
+ 1. else-comment-placeholders - `C-c / c'
+
+ 2. else-uncomment-placeholders - `C-c / u'
+
+ 3. else-insert-placeholder - `C-c / i'
+
+ Note that these bindings are purely provided to conform with the
+conventions for such things as specified in the Emacs Lisp manual. My
+personal preference is to bind the main four commands to `F3 - F6'. A
+'quirk' of the operation of ELSE that is worth mentioning is that when
+selecting items from the menu display, the command
+`else-expand-placeholder' can also be used to select an item i.e. first
+instance of the command over a placeholder will bring up a menu of
+choices and then a second press of the keybinding will provide a
+selection request - this provides faster and convenient selection for
+the user at times e.g. a commonly selected menu option can be a quick as
+`F3'/`F3' (assuming the desired option is the first entry in the menu
+-- if it isn't then "customise" that placeholder definition and swap the
+order of menu item!).
+
+ For the convenience of novice/beginning Emacs programmers, here are
+the key definitions that I use (place them in your .emacs or emacs.el
+file -- whichever one you use):
+
+ (global-set-key [f3] 'else-expand-placeholder)
+ (global-set-key [f4] 'else-next-placeholder)
+ (global-set-key [f5] 'else-previous-placeholder)
+ (global-set-key [f6] 'else-kill-placeholder)
+
+ A further "nice to have" in your .emacs file is to have else-mode
+turned on automatically for each file that you edit. An example of how
+to turn on ELSE for c-mode (C source files) is:
+
+ (add-hook 'c-mode-hook
+ (lambda ()
+ ;; this is shown as a lambda so you can add further interesting
+ ;; minor mode definitions here.
+ (else-mode)))
+
+ Refer to the Emacs manual for further information on major mode
+hooks, when and how they are run to achieve customisation of an edit
+environment.
+
+
+File: else, Node: Command Summary, Next: Using ELSE, Prev: Default Keybindings, Up: Top
+
+Command Summary
+***************
+
+ The following user commands are provided by ELSE.
+
+ - Command: else-mode
+ Toggles the minor mode for the current buffer. If the buffer is
+ empty then it inserts the "initial_string".
+
+ - Command: else-expand-placeholder
+ If the cursor is positioned within a "placeholder" (*note
+ Definitions::) then the placeholder is expanded (1) according to
+ the rules for the definition of that placeholder name. If the
+ command is executed with the cursor immediately positioned after a
+ valid token then the rules defined for that token are used in the
+ expansion.
+
+ - Command: else-next-placeholder
+ Moves the cursor to the next valid placeholder in the current
+ buffer.
+
+ - Command: else-previous-placeholder
+ Moves the cursor to the previous valid placeholder in the current
+ buffer.
+
+ - Command: else-kill-placeholder
+ Kills or deletes the placeholder in which the cursor is currently
+ positioned. Note that a numeric argument `C-u' will force a kill
+ even when the placeholder is mandatory.
+
+ - Interactive Command: else-cleanup-placeholders
+ Command to delete every placeholder remaining in the current
+ buffer. Mandatory and optional placeholders are all deleted using
+ the else-kill-placeholder command.
+
+ - Command: else-comment-placeholders
+ Uses the comment syntax for the currently defined major mode to
+ "comment out" any placeholders in the source file that have not
+ been expanded or deleted. This command is useful for when a
+ compilation is desired but coding is not yet deemed complete ie
+ there are still placeholders in the buffer.
+
+ - Command: else-compile-buffer
+ Command to "compile" the language definitions found at `point' to
+ the end of the buffer. When supplied with a numeric argument
+ (`C-u') will compile definitions from the beginning of the current
+ buffer.
+
+ - Command: else-compile-fast-load
+ Command to generate a "fast" load version of a language template
+ file. A version of the language template file is created using the
+ Emacs Lisp"read" syntax. When ELSE attempts to load a new language
+ definition file it will first look for a "fast load" version of
+ the file. Please note that this command is a "hold-over" from the
+ days when PC's were very slow, this command probably should not be
+ used as it will be removed from future versions of ELSE.
+
+ - Interactive command: else-extract-all
+ Extract all of the placeholders, tokens and the language
+ definition for the current language into the current buffer at
+ `point'.
+
+ - Interactive command: else-extract-placeholder placeholder
+ Prompts the user for a valid placeholder name and then extracts
+ the placeholder definition into the current buffer (*note
+ Customising An Existing Template Language::).
+
+ - Interactive command: else-extract-token token
+ Prompts the user for a valid token name and then extracts the
+ token definition into the current buffer (*note Customising An
+ Existing Template Language::).
+
+ - Interactive Command: else-insert-placeholder
+ Command to insert a placeholder string at point into the current
+ buffer. It expects some leading characters of the placeholder
+ prior to point at the time the command is invoked (these character
+ must be preceeded by a "{" or "[" character). It will use this
+ abbreviation to perform auto-completion on the placeholders loaded
+ for the current language template file. If there are more than one
+ possibilities, then the command will provide auto-completion of the
+ unique portion of the placeholder and then stop, a second
+ invocation will split the window and display a list of possible
+ completions. This second window must be deleted manually (in the
+ current version - a future release will probably fix this problem).
+
+ - Interactive Command: else-move-n-placeholders
+ Command to move to the "next" placeholder where "next" is
+ controlled by the `else-direction' custom variable i.e. if
+ `else-direction' is on then this command will invoked the
+ `else-next-placeholder' (`C-c / n') command, if the
+ `else-direction' flag is off then it will invoke the
+ `else-previous-placeholder' (`C-c / p'). This command was added
+ for "usability" for VR Programming, it helps reduce the number of
+ voice commands required to use ELSE.
+
+ - Interactive Command: else-show-token-names
+ Display names of all of the Tokens in the current language
+ template set, sort them alphabetically and display them in a
+ temporary buffer.
+
+ - Interactive Command: else-show-placeholder-names Display names of
+ all of
+ the Placeholders in the current language template set, sort them
+ alphabetically and display them in a temporary buffer.
+
+ - Interactive Command: else-toggle-direction
+ Command to toggle the custom variable `else-direction'.
+
+ - Command: else-uncomment-placeholders
+ This command will go through the current buffer looking for
+ placeholders that have been "commented out" using the comment
+ syntax of the current major mode. The language comment syntax will
+ be removed.
+
+ - Interactive Command: else-wrap-region
+ "Wrap" a template around a region of code. Mark the region to be
+ enclosed by the template and then run this command, it will prompt
+ for the placeholder name.
+
+ ---------- Footnotes ----------
+
+ (1) Note that if the placeholder text within the `{}''s or `[]''s is
+not defined then the command will not recognise the placeholder string,
+this is a common error when the user has manually (mis-)typed a
+placeholder and can't work out why ELSE won't expand it.
+
+
+File: else, Node: Using ELSE, Next: Creating and Modifying Templates, Prev: Command Summary, Up: Top
+
+Using ELSE
+**********
+
+ ELSE has been implemented as a minor mode of Emacs. This means that
+each buffer within Emacs may have it own set of language templates
+enabled, the only limit is the system resources that is running the
+editor. So, Emacs may have multiple language definitions loaded at any
+one time i.e. the user may be interfacing an Ada program to a C program
+and so editing an Ada module in one buffer and a C file in another
+buffer, ELSE could be enabled for both buffers and they will each have
+the appropriate set of language templates enabled. The following
+sections detail how to start up ELSE and use it in the course of normal
+code entry.
+
+* Menu:
+
+* Invoking ELSE:: How to start it up and what you get.
+* Navigating::
+* Expanding Placeholders:: How to expand Placeholders.
+* Expanding Tokens:: How to expand Tokens.
+* Deleting Placeholders::
+* Preparing for Compilation::
+* Disabling ELSE:: Sometimes you just don't want ELSE to be active.
+
+
+File: else, Node: Invoking ELSE, Next: Navigating, Prev: Using ELSE, Up: Using ELSE
+
+Invoking ELSE
+=============
+
+ ELSE has been implemented as a minor mode of Emacs, it determines
+which language specification to load either from the buffer's major
+mode or, if it can't locate an appropriate template file name (*note
+Building the Language Template File Name::), then it will prompt the
+user to enter the template name. For example, if the major mode for the
+current buffer is "C", then the major mode name will be "C" and ELSE
+will attempt to load the "C" template file using the name "C.lse"
+(*note Building the Language Template File Name::). Note that ELSE will
+first check if the template file for the major mode is already loaded,
+if not then it will search (*note Building the Language Template File
+Name::) for the file, if it can't find the file then it will prompt the
+user to enter a file name.
+
+ After loading the language template file, ELSE will then search for a
+"customisation" file for that particular language. The name of this
+file is of the form <language_name>-cust.lse i.e. in the case of
+loading a template file for the C language it would look for a
+customisation file called C-cust.lse located anywhere in the load path.
+Refer to *note Customising An Existing Template Language:: for more
+information on this feature.
+
+ To invoke ELSE use the command `else-mode'. If the current buffer is
+empty then ELSE will insert the "initial_string" for the language
+(*note Creating and Modifying Templates::) and position the cursor
+within the placeholder(1).
+
+ ---------- Footnotes ----------
+
+ (1) The four primary else commands (else-expand-placeholder,
+else-next/previous-placeholder and else-kill-placeholder) each check
+whether else-mode is enabled and will invoke it automatically if not set
+
+
+File: else, Node: Navigating, Next: Expanding Placeholders, Prev: Invoking ELSE, Up: Using ELSE
+
+Navigating Using ELSE
+=====================
+
+ Use the `else-next-placeholder' (`C-c / n') and
+`else-previous-placeholder' (`C-c / p') commands to navigate forwards
+and backwards through the buffer being edited. These commands will
+locate the next/previous valid placeholder and move point into the
+middle of the placeholder text. Each command can take a numeric
+argument, if the desired number of placeholders are not available, then
+point will be positioned to the last/first placeholder in the buffer.
+
+
+File: else, Node: Expanding Placeholders, Next: Expanding Tokens, Prev: Navigating, Up: Using ELSE
+
+Expanding Placeholders
+======================
+
+ Placeholders are expanded by positioning the cursor between the
+`{}''s or `[]''s and executing the `else-expand-placeholder' (`C-c /
+e') command. If the placeholder string is a valid placeholder then ELSE
+will provide one of the following responses:
+
+ 1. Replace the placeholder with a lower level language construct e.g.
+ [context_clause] ==> with {library_unit_name}...; [use_clause]
+
+ 2. Provide a choice of possible lower level language constructs via a
+ menu selection scheme e.g.
+ [type_declaration] ==> full_type_declaration
+ incomplete_type_declaration
+ private_type_declaration
+ private_extension_declaration
+
+ 3. Provide a prompt to the user that this is the lowest possible
+ expansion and that the user must type in a replacement string i.e.
+ expansion of the Ada placeholder `{expression}' will display the
+ prompt:
+ Enter an Ada expression as defined in section 4.4 of the LRM,
+ for example:
+ 4.0, Pi, (1 .. 10 => 0), Integer'Last, Sine(X), not Destroyed
+ Color'(Blue), 2*Line_count, -4.0 + A, B**2 - 4.0*A*C
+
+ If a placeholder is followed by ellipses (...) then ELSE will
+reproduce the placeholder automatically as the user either expands or
+types into a placeholder. The placeholder may be replicated in either
+the horizontal (same line) or vertical direction. The direction of
+replication (*note Duplication Specifier::) is determined in the
+definition of the placeholder.
+
+
+File: else, Node: Expanding Tokens, Next: Deleting Placeholders, Prev: Expanding Placeholders, Up: Using ELSE
+
+Expanding Tokens
+================
+
+ Tokens can best be thought of as a handy abbreviation for a
+placeholder that can be expanded e.g. the token "if", when expanded,
+gives the language construct for the if statement (example taken from
+the C language templates but this is a very common token definition)
+i.e.
+
+ if ==> if ({expression})
+ {
+ {statement}...
+ }
+ [else statement]
+
+ Tokens are most commonly used when the main portion of the code has
+been entered and the programmer/user is in the compile/fix-up cycle
+i.e. the placeholders have been removed from the source file to make it
+compilable but the programmer needs to add further statements. The
+options available at this point depends on the scope of the change
+required, if a major piece of code needs to be added then it is usually
+best to manually type in a placeholder that can be used as a good
+starting point e.g. [statement]... is a pretty common definition in
+almost any language definition template.
+
+
+File: else, Node: Deleting Placeholders, Next: Preparing for Compilation, Prev: Expanding Tokens, Up: Using ELSE
+
+Deleting Placeholders
+=====================
+
+ Use the command `else-kill-placeholder' (`C-c / k') to delete a
+placeholder located under point. Note that if the placeholder is a
+mandatory entry (enclosed by `{}''s rather than `[]''s) then ELSE will
+issue an error message and ring the bell.
+
+ To delete all placeholders in a buffer, use the command
+`else-cleanup-placeholders'. This command will start at the beginning of
+the buffer and delete every placeholder (mandatory or optional)
+contained in the buffer. This is a convenient method of performing a
+"final" clean-up after completing the coding of an program file.
+
+
+File: else, Node: Preparing for Compilation, Next: Disabling ELSE, Prev: Deleting Placeholders, Up: Using ELSE
+
+Preparing for Compilation
+=========================
+
+ Often a user will wish to compile the current buffer even though
+code entry has not been completed. Two commands are provided for
+convenience during this phase of coding:
+
+ 1. `else-comment-placeholders' -- Comment all lines that contain
+ placeholders, this uses the comment syntax defined by the current
+ major mode. It uses the Emacs `comment-region' command to
+ accomplish this process (1)
+
+ 2. `else-uncomment-placeholders' -- Uncomment all placeholders in the
+ current buffer. This command is provided to reverse the effects of
+ the `else-comment-placeholders' command and return the buffer to a
+ state ready for more code entry by the user.
+
+ ---------- Footnotes ----------
+
+ (1) you definitely want to do this because the typical compiler won't
+compile ELSE placeholder templates! But it is a "nice to have" because
+you might not have finished writing code and thus don't want to lose
+all of your placeholders. By using `else-uncomment-placeholders' you
+can quickly reverse the effect and start coding again.
+
+
+File: else, Node: Disabling ELSE, Prev: Preparing for Compilation, Up: Using ELSE
+
+Disabling ELSE
+==============
+
+ To disable ELSE just type the command `else-mode' to toggle ELSE
+off. Note that any template language definitions that have been loaded
+will remain loaded into Emacs memory. To explicitly delete a set of
+language definitions the user must either stop and re-start the Emacs
+session or use a DELETE LANGUAGE specifier (*note Language
+Identification::) which must be "compiled" by ELSE using the command
+`else-compile-buffer' (*note Command Summary::).
+
+
+File: else, Node: Creating and Modifying Templates, Next: Custom Variables, Prev: Using ELSE, Up: Top
+
+Creating and Modifying Templates
+********************************
+
+ This section covers the details of how to create and modify language
+template definitions. The aim is to give the user a basic
+understanding, which when coupled with looking at real template
+definitions, will allow the creation of new language templates and the
+customisation of existing template definitions.
+
+ Commands that are used in this activity are:
+
+ 1. `else-compile-buffer' -- "compiles" ELSE template definitions from
+ point until the end of the current buffer. When supplied with a
+ numeric argument (`C-u'), will compile from the beginning of the
+ current buffer.
+
+ 2. `else-extract-all' -- will "extract" the definition of the entire
+ enabled language definition file into the current buffer at point.
+
+ 3. `else-extract-placeholder'(1) -- extract the template definition
+ of a placeholder into the current buffer at point. The command will
+ prompt the user for the name of the placeholder to extract.
+
+ 4. `else-extract-token' -- extract the template definition of a token
+ into the current buffer at point. The command will prompt the user
+ for the name of the token to extract.
+
+* Menu:
+
+* Syntactic Conventions::
+* Customising An Existing Template Language::
+* Extracting Placeholders or Tokens::
+* Create a New Language:: How to create a new language template
+* Definition of the Template Structure::
+* Example of Creating A New Language Template::
+
+ ---------- Footnotes ----------
+
+ (1) These commands provide "auto-completion" for the convenience of
+the user
+
+
+File: else, Node: Syntactic Conventions, Next: Customising An Existing Template Language, Prev: Creating and Modifying Templates, Up: Creating and Modifying Templates
+
+Syntactic Conventions for Template Definitions
+==============================================
+
+ General syntactic conventions used in a language template file:
+
+ 1. Template definitions are not case sensitive i.e. a placeholder
+ definition for If_Statement is the same as a definition for
+ IF_STATEMENT. Also the current version of ELSE expects all
+ "standard" template definition strings (such as DEFINE, LANGUAGE
+ etc) to be upper case. I don't really see any reason to fix this
+ up, it would just slow down the regular expression searching when
+ the template file is loaded. The only exception to the case
+ sensitivity rule is that the language name is case sensitive i.e.
+ if you are defining a new definition for Emacs-Lisp and call it
+ EMACS-LISP then you will get an error message to the effect that
+ language Emacs-Lisp doesn't exist!
+
+ 2. Enclose text strings that contain embedded spaces with quotes.
+
+ 3. Enclose _text strings_ to the right of an equal (=) sign in
+ quotes, this rule does not apply to "standard" values such as
+ `NONTERMINAL, TERMINAL, MENU' etc.
+
+
+File: else, Node: Customising An Existing Template Language, Next: Extracting Placeholders or Tokens, Prev: Syntactic Conventions, Up: Creating and Modifying Templates
+
+Customising An Existing Template Language
+=========================================
+
+ Probably the first thing you will want to do after the initial
+exploration of using ELSE is to start to customise the templates for
+your own environment and use. Experience will show that only a small
+number of templates require customisation and then it will largely
+depend upon the "phase" in your code entry i.e. you might find yourself
+coding a section that has a large number of `case' constructs and not
+so many `if' constructs, so rather than have to pass over the `if'
+construct in a menu to get to the `case' construct continually, just
+customise the "statement" placeholder so that the `case' construct
+occurs before the `if' construct i.e.
+
+ Before:
+ DELETE PLACEHOLDER STATEMENT -
+ /LANGUAGE="Ada" -
+ DEFINE PLACEHOLDER STATEMENT -
+ /LANGUAGE="Ada" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "null_statement"/PLACEHOLDER
+ "if_statement"/PLACEHOLDER
+ "case_statement"/PLACEHOLDER
+ "loop_statement"/PLACEHOLDER
+ "block_statement"/PLACEHOLDER
+ "accept_statement"/PLACEHOLDER
+ .
+ .
+ .
+
+ END DEFINE
+
+ After:
+ DELETE PLACEHOLDER STATEMENT -
+ /LANGUAGE="Ada" -
+ DEFINE PLACEHOLDER STATEMENT -
+ /LANGUAGE="Ada" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "case_statement"/PLACEHOLDER
+ "if_statement"/PLACEHOLDER
+ "null_statement"/PLACEHOLDER
+ "loop_statement"/PLACEHOLDER
+ "block_statement"/PLACEHOLDER
+ "accept_statement"/PLACEHOLDER
+ .
+ .
+ .
+
+ END DEFINE
+
+ To achieve the above change you would perform the following sequence:
+
+ 1. Extract the definition for STATEMENT using the command
+ `else-extract-placeholder' and supplying STATEMENT as the argument;
+
+ 2. Edit the definition by swapping the "if_statement" and
+ "case_statement" lines and moving the "null_statement" below the
+ "if_statement" line;
+
+ 3. "compile" the new definition by positioning point at the beginning
+ of the `DELETE PLACEHOLDER' line and running the command
+ `else-compile-buffer'.
+
+ Note that you can accomplish the above in any buffer in your Emacs
+session. The change will only exist for that edit session unless you
+either save the changed template definition (either into the main
+language template file or the language custom file).
+
+ Note also that the language templates are held as a `global'
+variable within the Emacs session, so any changes you make to the
+template definitions in one buffer will be in effect for every other
+buffer that has ELSE mode enabled and that particular set of language
+templates selected.
+
+ Other reasons for the desire to perform customisation of a set of
+language templates also exist. One such is the establishment of a
+"global" set of common templates across a number of users (usually to
+help enforce project coding standards). In this case, each user may
+want to provide their own customisations but make sure that they don't
+impinge on other users. For this reason, ELSE searches and loads a
+"customisation" language file immediately after loading the primary
+language file i.e. loading a language file comprises two steps, the
+loading of the <language>.lse file and then the searching and loading
+of a customisation file <language>-cust.lse. The customisation file may
+be located anywhere in the Emacs load path i.e. it doesn't have to be
+in the same directory as the primary template file and can be used to
+not only provide new template definitions but also provide "overrides"
+for definitions in the "global" language template file. In this manner,
+we can achieve several goals:
+
+ 1. distribution of a standard language template file which remains
+ constant; and
+
+ 2. allow projects and groups to use the same template file.
+
+ and yet still provide the facility to have individual template
+characteristics. An example of this is the first release of ELSE
+contained language template files that contained file and function
+headers that had been customised for previous projects and coding
+standards that I had worked on. These definitions went out in the
+original distribution as an example of how people could produce such
+things but neglected the very real problem of providing a central
+repository for a standard set of templates for a particular language.
+The current language template file distribution have these definitions
+extracted from the main template file and <language>-cust.lse files are
+provided with these definitions in them. These definitions can then be
+readily edited for the particular project the user is working on
+without incurring incompatibilities with the central distribution.
+
+ The main feature of the ELSE definition language that allows these
+customisations to work is the sequence of a template definition where
+the placeholder/token is first DELETE'd and then DEFINE'd (*note Delete
+Placeholder Statement:: and *Note Define Placeholder Statement::). This
+means that any existing template definition is wiped and then
+completely redefined for the current edit session.
+
+* Menu:
+
+* Extracting Placeholders or Tokens:: How to extract a placeholder or token
+
+
+File: else, Node: Extracting Placeholders or Tokens, Next: Create a New Language, Prev: Customising An Existing Template Language, Up: Creating and Modifying Templates
+
+Extracting Placeholders or Tokens
+=================================
+
+ To customise a set of language template definitions you can either
+edit the original definition file to make the change permanently or, if
+you are after just a temporary change to a definition, you can
+`extract' the definition into the current buffer, make your change and
+then recompile the definition into the current editing session.
+
+ The commands to access the currently loaded language definitions are
+`else-extract-all', `else-extract-placeholder' or `else-extract-token'.
+The latter two commands will extract an individual definition of the
+type indicated whereas the first command will extract the entire
+definition. The process of "extraction" will leave the desired
+definition in the current buffer at `point'. Note that definition name
+completion is available when typing in the name of the definition to
+extract. Once the modifications have been made then the definition can
+be re-compiled into ELSE using the command `else-compile-buffer' (*Note
+Command Summary::.
+
+ These changes go into effect at a global level i.e. if there are
+multiple buffers loaded with the same language template then they all
+see the same change.
+
+
+File: else, Node: Create a New Language, Next: Definition of the Template Structure, Prev: Extracting Placeholders or Tokens, Up: Creating and Modifying Templates
+
+Creating a New Language
+=======================
+
+ A language template file is best started from a set of EBNF for the
+target language. The structure of the language definitions take the
+form of the classical inverted tree structure commonly found in
+computer science literature i.e. portion of the Ada language template
+structure looks like:
+
+ initial string
+ |
+ ---------------------------------------------------------------
+ | | | |
+ library_unit_declaration library_unit_body separate_body ...
+ . | .
+ . --------------------- .
+ . | | .
+ subprogram_body package_body
+
+ Here the placeholder definitions of `subprogram_body' and
+`package_body' expand directly to the language constructs and the user
+is then taken to the top of the tree again for the "lower level"
+definitions.
+
+ Each template file starts out with a "language definition" template
+(*note Language Definition Template::) (the root of the tree) and then
+proceeds into the individual branches using placeholder and token
+definitions. Each element of the template syntax is defined and
+explained in the following sections.
+
+* Menu:
+
+* Language Definition Template::
+* Overriding Language Attributes::
+
+
+File: else, Node: Language Definition Template, Next: Overriding Language Attributes, Prev: Create a New Language, Up: Create a New Language
+
+Language Definition Template
+----------------------------
+
+ The language definition template is (note that the valid identifier
+characters are shown here as split across two lines for documentation
+purposes, this should not be done in a language definition file)(1):
+
+ 1 DELETE LANGUAGE "Ada" -
+ 2 DEFINE LANGUAGE "Ada" -
+ 3 /INITIAL_STRING="{compilation_unit}..." -
+ 4 /PUNCTUATION_CHARACTERS=",|;"
+ 5 /SELF_INSERT_CHARACTERS=" `~!@#$%^&*(),.<>/?;:'[]{}=\-+|""
+ 6 /VALID_IDENTIFIER_CHARACTERS="abcdefghijklmnopqrstuvwxyzABCDEF \
+ GHIJKLMNOPQRSTUVWXYZ_0123456789-"
+ 7 /INDENT_SIZE=2 -
+ 8 /VERSION=1.7
+
+ END DEFINE
+
+
+ Example Language Definition
+
+
+* Menu:
+
+* Language Identification::
+* Initial String::
+* Punctuation characters::
+* Self Insert Characters::
+* Valid Identifier Characters::
+* Indentation Size::
+* Template Version::
+
+ ---------- Footnotes ----------
+
+ (1) Line numbers are added to aid in the referencing in later
+sections
+
+
+File: else, Node: Language Identification, Next: Initial String, Prev: Language Definition Template, Up: Language Definition Template
+
+Language Identification
+.......................
+
+ `Lineno 1 - 2' -- Any given Emacs session can have multiple source
+files loaded, each with their own set of language templates i.e. the
+user could be editing a C source file, a C++ source file and an Ada
+source, ELSE could be turned on for each buffer. So, language
+definition files need a mechanism to uniquely identify the language to
+which the definition will be applied. A language definition file always
+starts out with the same two lines, the `DELETE LANGUAGE {language
+name}'(1) and `DEFINE LANGUAGE {language name}'. Because each ELSE
+session is customisable, each template definition construct (`LANGUAGE',
+`PLACEHOLDER' and `TOKEN') includes a `DELETE' and `DEFINE' command
+pair. By using a convention of `DELETE' and then `DEFINE' we ensure
+that the definition being "replaced" or changed will be deleted and
+then defined anew. Thus to define a new language the following two
+lines are:
+
+ DELETE LANGUAGE "XXX" -
+ DEFINE LANGUAGE "XXX" -
+
+ This deletes a complete language definition called "XXX" (and all of
+its associated placeholder and token definitions) and then commences
+defining a new language called "XXX".
+
+ ---------- Footnotes ----------
+
+ (1) Note that language name is case sensitive i.e. Ada and ADA are
+two different language names
+
+
+File: else, Node: Initial String, Next: Punctuation characters, Prev: Language Identification, Up: Language Definition Template
+
+Initial String
+..............
+
+ `Lineno 3' -- The specifier `/INITIAL_STRING' defines the textual
+string to be inserted on the condition that the buffer in which ELSE is
+being turned on is empty. When ELSE mode is enabled for a buffer it
+will make sure the appropriate set of language definitions are loaded
+and then check if the buffer is empty, if the buffer is empty then the
+text string defined by this specifier will be inserted into the buffer.
+This text string is usually the template that appears at the top of the
+language definition tree i.e. `{compilation_unit}'.
+
+
+File: else, Node: Punctuation characters, Next: Self Insert Characters, Prev: Initial String, Up: Language Definition Template
+
+Punctuation characters
+......................
+
+ `Lineno 4' -- The specifier `/PUNCTUATION_CHARACTERS' defines the
+punctuation characters for the language being defined. This affects how
+the "housekeeping" efforts of ELSE work. It helps the code determine
+where whitespace should or should not occur. e.g. when deleting the
+optional placeholder for the parameters of the following procedure
+specification:
+
+ procedure TEST [formal_part];
+
+ then we want the following:
+ procedure TEST;
+ rather than:
+ procedure TEST ;
+ In this example, the function `else-kill-placeholder' (`C-c / k')
+command noticed that the `;' character is defined as a punctuation
+character by the Ada Language Definition and thus it should ensure that
+no whitespace exists between the punctuation character and the
+preceeding function name.
+
+
+File: else, Node: Self Insert Characters, Next: Valid Identifier Characters, Prev: Punctuation characters, Up: Language Definition Template
+
+Self Insert Characters
+......................
+
+ `Lineno 5' -- When the user inserts keystrokes into an ELSE enabled
+buffer the code has to check if the cursor is within an placeholder, if
+it is then the desired behaviour is for ELSE to automatically delete
+the placeholder and replace it with the keypresses that are coming from
+the keyboard. The strings defined by `/SELF_INSERT_CHARACTERS' and
+`/VALID_IDENTIFIER_CHARACTERS' are both used for this purpose.
+
+
+File: else, Node: Valid Identifier Characters, Next: Indentation Size, Prev: Self Insert Characters, Up: Language Definition Template
+
+Valid Identifier Characters
+...........................
+
+ `Lineno 6' -- This attribute is used during token searches to allow
+ELSE to correctly identify the text string that the user may be
+attempting to expand. When the user runs `else-expand-placeholder'
+(`C-c / e') ELSE "compiles" the string specified by the
+/VALID_IDENTIFIER_CHARACTERS attribute into the following Elisp regular
+expression:
+
+ [^%s+]
+
+ where the "%s" is replaced by the text string
+/VALID_IDENTIFIER_CHARACTERS. This regular expression means "search for
+any character which is not in the range of characters". The entire
+string between "point" (current cursor location) and the character
+found by this search is taken to be the text of the token the user is
+requesting an expansion for.
+
+ Since this search uses Emacs regular expression syntax, care needs
+to be exercised in the text actually placed in the
+/VALID_IDENTIFIER_CHARACTERS attribute. If the user wishes to alter
+this attribute, they are advised to become familiar with Emacs regular
+expression syntax prior to attempting any changes.
+
+ As an example, the following situation is put -- the user wants to
+modify a set of language templates so that they can use a token
+consisting of the character sequence "?:" (the "C" ternary operator
+could be generated this way). Just creating a token with a name of "?:"
+will not work as the two characters will not be part of the
+/VALID_IDENTIFIER_CHARACTERS set and therefore attempting to "expand"
+the string "?:" would fail to find a valid string to search the token
+database with.
+
+ So the logical first cut by the unwary would be to add these
+characters at the end of the existing string attribute for
+/VALID_IDENTIFIER_CHARACTERS thusly:
+
+ /VALID_IDENTIFIER_CHARACTERS="abcdefghijklmnopqrstuvwxyzABCDEF \
+ GHIJKLMNOPQRSTUVWXYZ_0123456789-?:"
+
+ However, since this string is used as a regular expression, the
+character sequence "9-?" will be interpreted as "all characters in the
+range from 9 to ?" rather than as the user intended i.e. the individual
+characters "9", "-", "?" and ":". The "correct" place to add the
+sequence "?:" would be anywhere in the string _other than_ at the end
+of the /VALID_IDENTIFIER_CHARACTERS string i.e. this would be the
+correct method of implementing this change:
+
+ /VALID_IDENTIFIER_CHARACTERS="abcdefghijklmnopqrstuvwxyzABCDEF \
+ GHIJKLMNOPQRSTUVWXYZ_0123456789?:-"
+
+ In fact, it might be better for template maintainers to make the
+treatment of /VALID_IDENTIFIER_CHARACTERS more "obvious" by using
+something like this:
+
+ /VALID_IDENTIFIER_CHARACTERS="a-zA-Z_0-9-"
+
+ If a "user" was faced with modifying this, they might be tempted to
+read further?
+
+
+File: else, Node: Indentation Size, Next: Template Version, Prev: Valid Identifier Characters, Up: Language Definition Template
+
+Indentation Size
+................
+
+ `Lineno 7' -- The line
+ /INDENT_SIZE=2 -
+
+ allows customisation of the identation of the code generated using
+ELSE. This attribute allows the user to specify the indentation of each
+line of the template. It provides a single point for the user to change
+the indentation of the code generated by ELSE (previous versions of
+ELSE did not contain this feature and thus, if your coding standard
+required indention differently to that specified by the standard base
+template, then you would have to edit the entire template file and
+change all indented lines to the level required by your coding
+standard).
+
+ As ELSE loads and scans the template definition file it determines a
+"normalised" value for the indentation of each line within each
+definition by making the first line that shows an indentation (leading
+space(s)) from the first line of the definition. If subsequent lines
+show indentation which is greater that the "normalised" value then it
+is assigned a further multiple of the INDENT_SIZE. This continues for
+the scanning of the definition and the indentation of each line is
+stored by ELSE. When ELSE is asked to insert the text lines for a
+definition then it multiples each indentation value by the value
+specified by INDENT_SIZE i.e. as an example, the text definition of a
+switch statement might be:
+
+ "switch ({expression}) {"
+ " [case_part]..."
+ " [default_part]"
+ "}"
+
+ Here we see at line 2 that we have an indentation of 3 spaces --
+this value is calculated as a value of indentation of 1 times the value
+contained in INDENT_SIZE. When line 3 is scanned, ELSE notes that it is
+further indented and assigns a value of 2 to that line. When line 4 is
+scanned ELSE notes that it has no indentation compared with line 1 and
+is assigned an indentation level of 0 to that line.
+
+ When ELSE inserts this definition, it will take the indentation
+value of each line (0 for lines 1 and 4, 1 for line 2, 2 for line 3)
+and insert the number of spaces determined by the indentation level
+multipled by the value of INDENT_SIZE. Thus line 0 would be inserted
+with no extra spaces, line 1 would have 2 spaces inserted, line 3 would
+have 4 spaces inserted and line 4 would have 0 spaces inserted e.g.
+
+ switch ({expression}) {
+ [case_part]...
+ [default_part]
+ }
+
+ To change the indentation of lines in ELSE, all the user has to do
+is change the value of /INDENT_SIZE and "recompile" the language
+template definition file.
+
+ Note that if there is no indentation size specified then a default
+value of 4 will be assumed. ELSE will produce a message when compiling
+a language that contains no indentation size attribute specifier.
+
+ Where the user might want to override the spacing of templates as
+they are scanned by ELSE i.e. textual headers for functions/files might
+be an example. ELSE has the facility of allowing "hard" spaces to be
+inserted at the beginning of each line of a definition. These hard
+spaces are indicated by a '@' character i.e.
+
+ DELETE PLACEHOLDER MODULE_LEVEL_COMMENTS -
+ /LANGUAGE="C" -
+ DEFINE PLACEHOLDER MODULE_LEVEL_COMMENTS -
+ /LANGUAGE="C" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "/* ===[ {module} ]=============================================//"
+ ""
+ "@Description: {text}"
+ ""
+ "@Revisions:"
+ ""
+ "@@REV DATE BY DESCRIPTION"
+ "@------ --------- --- ---------------------------------//"
+ ""
+ "@--------------------------------------------------------------//"
+ ""
+ "@@This item is the property of ResMed Ltd, and contains confid//"
+ "@@secret information. It may not be transfered from the custod//"
+ "@@ResMed except as authorised in writing by an officer of ResM//"
+ "@@item nor the information it contains may be used, transfered//"
+ "@@published, or disclosed, in whole or in part, and directly o//"
+ "@@except as expressly authorised by an officer of ResMed, purs//"
+ "@@agreement."
+ ""
+ "@@Copyright (c) 2002 ResMed Ltd. All rights reserved."
+ "@==============================================================//"
+ ""
+
+ END DEFINE
+
+
+File: else, Node: Template Version, Prev: Indentation Size, Up: Language Definition Template
+
+Template Version
+................
+
+ `Lineno 8' -- The line
+ /VERSION=1.7 -
+
+ indicates what version this particular language template file is.
+This is a better solution to placing version labels in the comments
+portion of language template files as if a user decides to "extract"
+the entire language set then any comment headers are lost -- this
+attribute allows people to see what version of the template file was
+used as the base when the language template set was compiled.
+
+
+File: else, Node: Overriding Language Attributes, Prev: Language Definition Template, Up: Create a New Language
+
+Overriding Language Attributes
+------------------------------
+
+ You can "override" any of the attributes of a language (attributes
+have been described above) by providing a single `DEFINE LANGUAGE'
+statement without the (normally) preceding `DELETE LANGUAGE' statement.
+Just include the attribute that you wish to "override" and the new
+value will take effect when you "compile" the new language definition.
+Currently this feature of ELSE is only really useful for the
+`/INDENT_SIZE' attribute i.e. the baseline language file may define a
+value that is not appropriate for your project so you can redefine it
+to some other value by placing a `DEFINE LANGUAGE' statement in the
+<lang>-cust.lse file. For example, the following will re-define the
+indentation size of C Language template definitions to be 4 spaces:
+
+
+ DEFINE LANGUAGE C -
+ /INDENT_SIZE=4 -
+
+ END DEFINE
+
+ When ELSE meets such a situation it will issue a "warning" message
+i.e. "Language XXX exists, assuming attribute modification".
+
+
+File: else, Node: Definition of the Template Structure, Next: Example of Creating A New Language Template, Prev: Create a New Language, Up: Creating and Modifying Templates
+
+Definition of the Template Structure
+====================================
+
+ The remainder of the language definition file may contain a mixture
+of placeholder and token definitions. The order in which they appear is
+not important as no attempts are made at cross checking definitions and
+their use whilst the language definition file is being loaded. Perhaps
+one day there will be an explicit command to aid template developers to
+check for "holes" by performing a consistency check.
+
+* Menu:
+
+* Placeholders::
+* Tokens::
+* Hooking Elisp Code into ELSE Templates::
+
+
+File: else, Node: Placeholders, Next: Tokens, Prev: Definition of the Template Structure, Up: Definition of the Template Structure
+
+Placeholder Definition
+----------------------
+
+ A typical placeholder definition is shown below. Note that the line
+numbers are added as an aid in the following sections that explain each
+portion of this structure. Each section will reference the appropriate
+section by use of a line number. Texinfo doesn't seem to offer
+appropriate x-referencing in this area, so each section will just
+mention `Lineno: X'.
+
+ 1 DELETE PLACEHOLDER IF_STATEMENT -
+ 2 /LANGUAGE="Ada" -
+ 3 DEFINE PLACEHOLDER IF_STATEMENT -
+ 4 /LANGUAGE="Ada" -
+ 5 /NOAUTO_SUBSTITUTE -
+ 6 /SUBSTITUTE_COUNT=2 -
+ 7 /DESCRIPTION="" -
+ 8 /DUPLICATION=CONTEXT_DEPENDENT -
+ 9 /SEPARATOR="" -
+ 10 /TYPE=NONTERMINAL
+ 11
+ 12 "if {condition} then"
+ 13 " {statement}..."
+ 14 "[elsif_part]"
+ 15 "[else_part]"
+ 16 "end if;"
+ 17
+ 18 END DEFINE
+
+ The following sections explain each construct used in this
+definition.
+
+* Menu:
+
+* Delete Placeholder Statement::
+* Language Specifier::
+* Define Placeholder Statement::
+* Auto Text Substitute::
+* Description Specifier::
+* Duplication Specifier::
+* Separator Specification::
+* Type Specifier::
+* Template Body::
+* Placeholder Cross-Referencing::
+* End Define Command::
+
+
+File: else, Node: Delete Placeholder Statement, Next: Language Specifier, Prev: Placeholders, Up: Placeholders
+
+Delete Placeholder Statement
+............................
+
+ `Lineno 1' -- This statement tells ELSE to delete a placeholder
+called `IF_STATEMENT' from the language template definitions for the
+language "Ada" (as defined in the next line -- *note Language
+Specifier::). The placeholder name may be any combination of
+characters between the range of SPC to ~. If the name contains one or
+more spaces, then it must be wholly enclosed by quotation marks.
+
+
+File: else, Node: Language Specifier, Next: Define Placeholder Statement, Prev: Delete Placeholder Statement, Up: Placeholders
+
+Language Specifier
+..................
+
+ `Lineno 2 & 4' -- The language specifier `/LANGUAGE="Ada"' defines
+the particular language set to which the preceeding template command
+applies. This line must follow the commands `DEFINE PLACEHOLDER' or
+`DELETE PLACEHOLDER'.
+
+
+File: else, Node: Define Placeholder Statement, Next: Auto Text Substitute, Prev: Language Specifier, Up: Placeholders
+
+Define Placeholder Statement
+............................
+
+ `Lineno 3' -- This statement tells ELSE to define a placeholder
+called `IF_STATEMENT' from the language definition identifier in the
+next line (*note Language Specifier::). The placeholder name may be any
+legal combination of the following characters:
+
+ `A-Z 0-9_'
+
+ If the name contains embedded spaces then it must be enclosed by
+quotation marks.
+
+
+File: else, Node: Auto Text Substitute, Next: Description Specifier, Prev: Define Placeholder Statement, Up: Placeholders
+
+Auto Text Substitute
+....................
+
+ `Lineno 5 --- Lineno 6' -- The attribute on Lineno 5 has two possible
+values: `/AUTO_SUBSTITUTE' or `/NOAUTO_SUBSTITUTE'. It works in
+conjunction with count specified by the attribute on Lineno 6. This
+attribute exists because it is quite common in many languages (or
+coding styles) to repeat a text string multiple times within a language
+construct e.g. in Ada the package name (`designator') is an optional
+entry at the end of the package body:
+
+ 1 package body {designator} is
+ 2 {declarative_item}...
+ 3 [begin_package_body]
+ 4 end [designator];
+
+ In the above example, it would be desirable if the second occurrence
+of the "designator" string, shown at lineno 4, could be replaced with
+the text of the first "designator" string (lineno 1) as the user types
+it into the buffer. To achieve this behaviour in ELSE, the definition
+of the "designator" placeholder would have the auto-substitute
+attribute set and the substitution count attribute set as follows:
+
+ DELETE PLACEHOLDER DESIGNATOR -
+ /LANGUAGE="Ada" -
+ DEFINE PLACEHOLDER DESIGNATOR -
+ /LANGUAGE="Ada" -
+ /AUTO_SUBSTITUTE -
+ /SUBSTITUTE_COUNT=2 -
+ .
+ .
+ .
+
+ END DEFINE
+
+ The general behaviour of ELSE is that whenever the user starts to
+enter text whilst positioned within a placeholder, ELSE will examine
+the auto-substitute attribute for that placeholder and if it is set to
+`AUTO_SUBSTITUTE' it will then search forward in the buffer looking for
+`SUBSTITUTE_COUNT' matches of the placeholder string. Each matching
+portion of the buffer is tagged using Emacs markers, then as the user
+types in the text string at the first placeholder, the same text
+(including backspaces etc) is repeated at each of the subsequent
+matching sites. The duplication of changes to the subsequent textual
+areas continues until the user makes a change to the buffer that is
+outside the area of the original placeholder. Once such a change occurs
+then all auto-substitution makers are erased.
+
+ The default value for the `/SUBSTITUTE_COUNT' attribute is 1 i.e.
+there will be one other place to perform a substitution.
+
+ The following example shows an interesting example of the use of the
+auto-substitute feature in the C language to create a "custom"
+placeholder definition for the for loop i.e. it is quite common to have
+a for loop where the count variable is repeated at three different
+points in the same line. By defining a special placeholder name with an
+auto-substitute count set appropriately then we can save some typing
+i.e.
+
+ DELETE TOKEN FOR -
+ /LANGUAGE="C" -
+ DEFINE TOKEN FOR -
+ /LANGUAGE="C" -
+ /DESCRIPTION="conditional, repeated statement execution"
+
+ "for ({loop_var} = [0]; {loop_var} [<] {value}; {loop_var}[++])"
+ "{"
+ " {statement}..."
+ "}"
+
+ END DEFINE
+
+ DELETE PLACEHOLDER LOOP_VAR -
+ /LANGUAGE="C" -
+ DEFINE PLACEHOLDER LOOP_VAR -
+ /LANGUAGE="C" -
+ /AUTO_SUBSTITUTE -
+ /SUBSTITUTE_COUNT=2 -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Enter a variable name."
+
+ END DEFINE
+
+ Here, the "loop_var" placeholder is defined to auto-substitute with
+2 further occurrences. As the user types into the first occurrence of
+the placeholder then that text will be repeated twice more.
+
+ Note that if the placeholder definition specifies a repeat count but
+that number of matches cannot be found at run-time then only the
+placeholders that were matched will have the substitution performed.
+
+ Another thing to note about this example, is that it shows a for
+loop definition with some "common" options i.e. the initial value is
+defined as a placeholder with a value of `0' when expanded, the loop
+test is defined with a default of '<' and the loop counter is defined
+with a default value of increment i.e. `++'. Since all three of these
+items are defined as placeholders, the user has the option of
+navigating between them and either selecting the default value or
+typing in a new value.
+
+
+File: else, Node: Description Specifier, Next: Duplication Specifier, Prev: Auto Text Substitute, Up: Placeholders
+
+Description Specifier
+.....................
+
+ `Lineno 7' -- This specifier defines a text string which will appear
+with the placeholder if it is referenced from a menu item. This acts as
+a one line help string for the user in menu displays. An empty
+description is defined by """".
+
+
+File: else, Node: Duplication Specifier, Next: Separator Specification, Prev: Description Specifier, Up: Placeholders
+
+Duplication Specifier
+.....................
+
+ `Lineno 8' -- This specifier is used to define how the template will
+be duplicated if the ellipses are found after the placeholder text in
+the buffer i.e. `[statement]...' tells ELSE to keep repeating the
+placeholder `[statement]' whenever the user expands (or types into) it.
+The possible values are:
+
+ 1. VERTICAL -- the placeholder is duplicated vertically onto the next
+ line.
+
+ 2. HORIZONTAL -- the placeholder is duplicated on the same line to
+ the right of the placeholder being expanded.
+
+ 3. CONTEXT_DEPENDENT -- means the placeholder will be duplicated in
+ either the vertical or horizontal direction. Some simple rules are
+ applied in this case, if the placeholder is alone on the line then
+ it is duplicated vertically, if there is text on the same line
+ before the placeholder then it will be duplicated in the
+ horizontal e.g.
+
+ [statement]... ==> if {condition} then
+ {statement}...
+ [elsif_part]
+ [else_part]
+ end if;
+ [statement]...
+
+
+ Example of Vertical Duplication
+
+
+
+
+ when {discrete_choice}... => ==> when RED | [discrete_choice]... =>
+
+
+ Example of Horizontal Duplication
+
+
+File: else, Node: Separator Specification, Next: Type Specifier, Prev: Duplication Specifier, Up: Placeholders
+
+Separator Specification
+.......................
+
+ `Lineno 9' -- The specifier `/SEPARATOR' is used to indicate the
+characters that should be inserted automatically when the placeholder is
+duplicated e.g. Ada uses the `|' character as a logical `or' symbol when
+multiple conditions are applicable in a case statement, so when each
+occurrence of the placeholder is expanded then ELSE automatically
+inserts the character(s) defined by this specifier as part of the
+placeholder duplication e.g. the placeholder definition for
+"discrete_choice" is:
+
+ DELETE PLACEHOLDER DISCRETE_CHOICE -
+ /LANGUAGE="Ada" -
+ DEFINE PLACEHOLDER DISCRETE_CHOICE -
+ /LANGUAGE="Ada" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR=" | "
+ /TYPE=MENU
+
+ "expression"/PLACEHOLDER
+ "discrete_range"/PLACEHOLDER
+ "others"
+
+ END DEFINE
+
+ and the expansion would be:
+
+ when {discrete_choice}... => ==> when RED | [discrete_choice]... =>
+
+ Note that the separator characters, `" | "' were automatically
+inserted before the placeholder was repeated. ELSE also uses the
+character(s) defined by the `/SEPARATOR' specifier when killing an
+unwanted placeholder e.g.
+
+ when RED | [discrete_choice]... => ==> when RED =>
+
+
+File: else, Node: Type Specifier, Next: Template Body, Prev: Separator Specification, Up: Placeholders
+
+Type Specifier
+..............
+
+ `Lineno 10' -- The specifier `/TYPE' informs ELSE how to treat the
+expansion of the placeholder. This specifier can have three possible
+values:
+
+ 1. TERMINAL -- This is the "end of the line", no further expansions
+ are defined and the text string(s) held in the body of the
+ definition are to be used as a prompter to the user e.g. with the
+ following definition for "identifier" placeholder
+
+ DELETE PLACEHOLDER IDENTIFIER -
+ /LANGUAGE="Ada" -
+ DEFINE PLACEHOLDER IDENTIFIER -
+ /LANGUAGE="Ada" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION="" -
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=TERMINAL
+
+ "Any Ada identifier will do"
+
+ END DEFINE
+
+ An expansion of this placeholder will provide the prompt of `Any
+ Ada identifier will do' to the user. The prompt is displayed for a
+ customisable period (*note Custom Variables::) in seconds and then
+ erased from the screen. Note that is the user performs any entry
+ during the display of the prompt string then the prompt buffer
+ will be terminated immediately and the user input actioned.
+
+ 2. NONTERMINAL -- informs ELSE that the body of the placeholder
+ definition contains one or more text strings which should be used
+ to replace the placeholder ie. the following definition will
+ provide this expansion
+ [context_clause] ==> with {library_unit_name}...; [use_clause]
+
+ DELETE PLACEHOLDER CONTEXT_CLAUSE -
+ /LANGUAGE="Ada" -
+ DEFINE PLACEHOLDER CONTEXT_CLAUSE -
+ /LANGUAGE="Ada" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "with {unit_simple_name}...; [use_clause]"
+
+ END DEFINE
+
+ 3. MENU -- informs ELSE that the body of the placeholder definition
+ contains a menu selection that must be presented to the user for
+ resolution i.e. the following definition will present a menu of
+ choices for the `statement' placeholder:
+
+ DELETE PLACEHOLDER STATEMENT -
+ /LANGUAGE="Ada" -
+ DEFINE PLACEHOLDER STATEMENT -
+ /LANGUAGE="Ada" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=MENU -
+
+ "assignment_statement"/PLACEHOLDER
+ "if_statement"/PLACEHOLDER
+ "case_statement"/PLACEHOLDER
+ "loop_statement"/PLACEHOLDER
+ "block_statement"/PLACEHOLDER
+ .
+ .
+ .
+ "select_statement"/PLACEHOLDER
+
+ END DEFINE
+
+
+File: else, Node: Template Body, Next: Placeholder Cross-Referencing, Prev: Type Specifier, Up: Placeholders
+
+Template Body
+.............
+
+ `Lineno 12 - 16' -- The "body" of the template definition may
+contain one or more text strings. These text strings will be used by
+ELSE according to the setting of the `/TYPE' specifier (*note Type
+Specifier:: for examples).
+
+ When the placeholder body is a menu then each text line may contain
+optional keywords. These keywords are:
+
+ 1. `/PLACEHOLDER' -- informs ELSE that the preceding text is the name
+ of a placeholder.
+
+ 2. `/TOKEN' -- informs ELSE that the preceding text is the name of a
+ token.
+
+ 3. `/FOLLOW' -- informs ELSE that if the line item is a placeholder,
+ that is itself a menu, then incorporate the entries of that
+ definition into the menu display(1). The default for a line item
+ in a menu template definition is `FOLLOW' and so this attribute
+ may be omitted. To explicitly override this behavour for
+ individual instances use the `/NOFOLLOW' option as documented
+ below.
+
+ 4. `/NOFOLLOW' -- informs ELSE that even though the line item is a
+ placeholder, that is itself a menu, do not "follow" the definition
+ by incorporating the entries of that definition into the menu
+ display. Note that this option can be globally overriden by the
+ `'else-follow-menus' and `'else-nofollow-menus' flags (*Note
+ Custom Variables::.)
+
+ For example, the `FULL_TYPE_DECLARATION' placeholder in the Ada
+language templates has a body of:
+
+ "type {identifier} [known_discriminant_part] is {type_definition};"
+ "task_type_declaration"/PLACEHOLDER
+ "protected_type_declaration"/PLACEHOLDER
+
+ This body tells ELSE that if the user selects the first line, then
+perform a direct text substitution, if one of the other two lines are
+selected then ELSE is being told that they refer to a further
+placeholder and will be treated according to the `/TYPE' specifier of
+that placeholder i.e. the indicated placeholder will be expanded. See
+also *Note Indentation Size::, for further information on applying
+"hard" spaces to the beginning of a line of text in the body.
+
+ An example of the use of the `FOLLOW' and `NOFOLLOW' is taken from
+the Emacs-Lisp template file for the definition of the `STATEMENT'
+placeholder(2):
+
+ "let_statement"/PLACEHOLDER
+ "if_statement"/PLACEHOLDER
+ .
+ .
+ .
+ "property-list-stmt"/PLACEHOLDER
+ "symbols"/PLACEHOLDER/NOFOLLOW
+ "sequences"/PLACEHOLDER/NOFOLLOW
+ .
+ .
+
+ Here the placeholder `property-list-stmt' is a menu which in turn has
+multiple entries/options. If `else-follow-menus' is `nil', then ELSE
+will "follow" the menu definitions for `property-list-stmt' and include
+its items in the menu display, however, because `symbols' is followed by
+`/NOFOLLOW' then its definitions will not be included in the primary
+menu dispolay i.e. if the user wishes to select one of the options in
+the `symbols' placeholder then they must explicity select the `symbols'
+entry to be presented with the possible options at that level.
+
+ ---------- Footnotes ----------
+
+ (1) This is default behaviour for ELSE
+
+ (2) The entry for `property-list-stmt' has been modified for the
+purposes of this example
+
+
+File: else, Node: Placeholder Cross-Referencing, Next: End Define Command, Prev: Template Body, Up: Placeholders
+
+Placeholder Cross-Referencing
+.............................
+
+ Finally, the "body" of a placeholder definition may contain some or
+none of the above attributes and purely reference another existing
+placeholder i.e.
+
+ DELETE PLACEHOLDER XYZ -
+ /LANGUAGE="ABC"
+ DEFINE PLACEHOLDER XYZ -
+ /LANGUAGE="ABC"
+ /PLACEHOLDER=DEF
+
+ END DEFINE
+
+ Here we have a placeholder called "XYZ" which will automatically use
+the definition of the placeholder "DEF" when it is referenced or
+invoked by the ELSE routines. This can be extremely useful in
+situations such as the following where the EBNF for a language might
+specify two forms of "identifier" which you wish to ideally make the
+same w.r.t ELSE behaviour e.g. when the user enters a string for
+`subprogram_identifier' ELSE should perform an auto-substitution on the
+following `defining_identifier' placeholder.
+
+ procedure {subprogram_identifier} is
+ ...
+ end [defining_identifier];
+
+ We may not want to necessarily change the template definition to
+generate:
+
+ procedure {defining_identifier} is
+ ...
+ end [defining_identifier];
+
+ and then have to define a placeholder definition for
+`defining_identifier' that includes auto-substitution behaviour,
+because `defining_identifier' may appear somewhere else as a
+"singleton". The ideal would be to have a placeholder definition for
+`subprogram_identifier' that defined auto-substitute behaviour but also
+referred to the definition of `defining_identifier' for its basic
+behaviour i.e. if we use the following definition then when the user
+types in a `subprogram_identifier' placeholder ELSE will search for a
+matching `defining_identifier' placeholder and perform
+auto-substitution there:
+
+ DELETE PLACEHOLDER SUBPROGRAM_IDENTIFIER -
+ /LANGUAGE="ABC"
+ DEFINE PLACEHOLDER SUBPROGRAM_IDENTIFIER -
+ /LANGUAGE="ABC"
+ /AUTO_SUBSTITUTE -
+ /PLACEHOLDER=DEFINING_IDENTIFIER
+
+ END DEFINE
+
+
+File: else, Node: End Define Command, Prev: Placeholder Cross-Referencing, Up: Placeholders
+
+End Define Command
+..................
+
+ `Lineno 18' -- The `END DEFINE' specifier informs ELSE that the end
+of a placeholder or token definition has occurred.
+
+
+File: else, Node: Tokens, Next: Hooking Elisp Code into ELSE Templates, Prev: Placeholders, Up: Definition of the Template Structure
+
+Token Definition
+----------------
+
+ There are only two forms to the definition of a Token, they are both
+shown below. These two definitions show two different ways of
+specifying the same thing. In the first instance, the definition is
+using an existing placeholder definition and just referring to it as
+the action to perform on expansion. The second form shows a textual
+substitution form which acts in the same manner as a `NONTERMINAL'
+placeholder (*note Type Specifier::).
+ DELETE TOKEN IF - DELETE TOKEN IF -
+ /LANGUAGE="Ada" - /LANGUAGE="Ada" -
+ DEFINE TOKEN IF - DEFINE TOKEN IF -
+ /LANGUAGE="Ada" - /LANGUAGE="Ada" -
+ /PLACEHOLDER=IF_STATEMENT
+ "if {condition} then"
+ END DEFINE " {statement}..."
+ "[elsif_part]"
+ "[else_part]"
+ "end if;"
+ END DEFINE
+
+ The `DELETE' and `DEFINE' lines follow the same rules as for the
+equivalent placeholder specifiers (*note Delete Placeholder
+Statement::) and (*note Define Placeholder Statement::. Similarly for
+the `LANGUAGE' specifier (*note Language Specifier::.
+
+ The greatest strength of the token definition is that it provides
+convenient "abbreviations" for the user i.e. the user doesn't have to
+type out the full placeholder name and enclose it in braces. Tokens
+provide the facility of a convenient stand alone string which can be
+expanded into some other entity, either another placeholder definition
+or as a textual string. Note that token definitions do not provide
+"non-terminal" and "menu" facilities like the placeholder definition
+however, this is off-set by the ability of the token definition to
+refer to a placeholder definition which does provide these facilities.
+
+ Of special note, ELSE searches the appropriate definition array
+based upon the context of the string being expanded i.e. if the string
+is enclosed in `{}''s or `[]''s then it will search the placeholder
+array, if the string is "free-standing" then ELSE will search the token
+array. Thus, template definition names do not have to be unique between
+placeholders definitions and token definitions e.g. you could have a
+placeholder definition called "if" and a token definition called "if"
+without having any conflict.
+
+
+File: else, Node: Hooking Elisp Code into ELSE Templates, Prev: Tokens, Up: Definition of the Template Structure
+
+Hooking Elisp Code into ELSE Templates
+--------------------------------------
+
+ On rare occasions it might be useful to associate some Elisp code
+with ELSE templating activities. This can be "linked" to both
+placeholder and token definitions using the same syntax (the following
+examples show usage with placeholder definitions but the same syntax
+applies equally to token definitions). The syntax is:
+
+
+ /RUN_CODE=<elisp-defun><phase>
+
+ where "elisp-defun" is the name of a Elisp defun and "phase" is the
+"phase" of operation during which ELSE will call the defun. The
+currently(1) defined "phases" are:
+
+ * /BEFORE -- Call `elisp-defun' "before" the placeholder/token is
+ expanded (invoked during execution of `else-expand-placeholder'
+ (`C-c / e'));
+
+ * /AFTER - Call `elisp-defun' "after" the placeholder/token has been
+ expanded (invoked during execution of `else-expand-placeholder'
+ (`C-c / e'));
+
+ * /ONINSERT -- Call `elisp-defun' when a "self-insert" character is
+ typed with point in the placeholder (this phase option is
+ meaningless for tokens).
+
+
+ A definition (placeholder or token) may have multiple `/RUN_CODE'
+lines indicating a separate elisp-defun to call for each line. Each
+`/RUN_CODE' line may have only one elisp-defun but can have multiple
+phase indicators i.e. the following example would have "elisp-test-dfn"
+called during both the `/BEFORE' and `/AFTER' phases of the expansion.
+
+ DELETE PLACEHOLDER XXXX -
+ /LANGUAGE="yyy" -
+ DEFINE PLACEHOLDER XXXX -
+ /LANGUAGE="yyy" -
+ .
+ .
+ /RUN_CODE=else-test-dfn/BEFORE/AFTER
+ .
+
+ END DEFINE
+
+ A more concrete example is shown using a definition found in the
+ELSE template language itself (Template.lse). The definition for
+placeholder "nonterminal|terminal_placeholder" is (partially shown for
+brevity):
+
+ DELETE PLACEHOLDER nonterminal|terminal_placeholder -
+ /LANGUAGE="Template" -
+ DEFINE PLACEHOLDER nonterminal|terminal_placeholder -
+ /LANGUAGE="Template" -
+ .
+ .
+
+ " /{substitute}"
+ " [substitute_count]"
+ " /DESCRIPTION={descriptive_text} -"
+ .
+ .
+
+ END DEFINE
+
+ The "{substitute}" placeholder is a menu that leads to either
+`/NOAUTO_SUBSTITUTE' or `/AUTO_SUBSTITUTE' -- however, if the user
+selects `/NOAUTO_SUBSTITUTE' then they have to manually delete the
+redundant placeholder "[substitute_count]". A possible solution (this
+can be solved with slightly different ELSE template definitions, BTW)
+is to use the `/RUN_CODE' attribute and accompany it with an
+appropriate elisp defun. In this scenario, the definition of
+"substitute" changes from:
+
+ DELETE PLACEHOLDER SUBSTITUTE -
+ /LANGUAGE="Template" -
+ DEFINE PLACEHOLDER SUBSTITUTE -
+ /LANGUAGE="Template" -
+ .
+ .
+ /TYPE=MENU -
+
+ "NOAUTO_SUBSTITUTE -"
+ "AUTO_SUBSTITUTE -"
+
+ END DEFINE
+
+ to this (incorporating the run-time attribute):
+
+ DELETE PLACEHOLDER SUBSTITUTE -
+ /LANGUAGE="Template" -
+ DEFINE PLACEHOLDER SUBSTITUTE -
+ /LANGUAGE="Template" -
+ .
+ .
+ /RUN_CODE=process-substitute/AFTER
+ /TYPE=MENU -
+
+ "NOAUTO_SUBSTITUTE -"
+ "AUTO_SUBSTITUTE -"
+
+ END DEFINE
+
+ and the user "compiles" the following elisp defun into their edit
+session (place in a convenient .el file that gets loaded, your .emacs
+file or whatever):
+
+ (defun process-substitute ()
+ "Determine whether the next placeholder after a [substitute] should
+ be deleted or left intact - could make this more 'robust' by testing
+ whether the placeholder is a [substitute_count] before deleting......"
+ (let ()
+ (if (else-scan-for-match "/NOAUTO_SUBSTITUTE" nil t)
+ (progn
+ (else-next-placeholder)
+ (else-delete-placeholder)))))
+
+ Now when "`{substitute}'" is expanded, the Elisp defun
+`process-substitute' is run "after" the expansion and decides whether
+the "`[substitute_count]'" placeholder remains or not depending upon
+which option the user selected.
+
+ Note that this example relies on "published" ELSE defuns
+(`else-next-placeholder' and `else-delete-placeholder') and an
+"unpublished" defun `else-scan-for-match'. The later is used to scan the
+text before point (search limited to the beginning of the line in this
+case) and look for the text `/NOAUTO_SUBSTITUTE' -- if it is found then
+the "`[substitute_count]'" is not wanted and is deleted.
+
+ ---------- Footnotes ----------
+
+ (1) Other possibilties are /ON_ENTRY and /ON_EXIT i.e. calling
+defuns as ELSE moves point into or out of a placeholder -- if there is
+demand for these "phases" I will implement them
+
+
+File: else, Node: Example of Creating A New Language Template, Prev: Definition of the Template Structure, Up: Creating and Modifying Templates
+
+Example of Creating A New Language Template
+===========================================
+
+ Use of ELSE shines for "verbose", structured languages such as Ada,
+Modula-2, Pascal etc and performs not so well for what I will call
+unstructured "minimalist" languages such as C and C++. Obviously, the
+aim in the definition of languages such as Modula-2, Pascal etc was to
+provide code that was more readable and therefore easier to check and
+maintain. Languages such as C and C++ were designed (C++, due to its
+desire to be backward compatible with C) for minimal code entry effort
+which results in code with minimal readability and therefore
+maintainability.
+
+ When creating language templates it is important to keep in mind
+that there is a point where the trade-off of template availability
+versus user effort is reached i.e. even for "verbose" languages, I
+would not recommend providing templates for the "expression" construct.
+It is easier to just provide a prompt string at this point rather than
+to follow the path that the language syntax lays out, because at this
+stage the user is only required to type in something like `A = B' or
+something equally simple. Remember the aim of ELSE is to reduce
+keystrokes and improve productivity, so providing templates that allow
+the user to select from the many permutations that lead from a typical
+language "expression" syntax is not warranted either on your part of
+template design or on the users part of code entry.
+
+ If you are faced with developing a set of language templates then
+there are two possible courses of action. You can either establish a
+bare minimum of constructs that will suit your needs i.e. template
+definitions for the common language constructs such as "statement", "if
+statement", "case statement", "procedure or function statement" etc or
+you can go the "whole hog" and provide a "complete" set of templates
+right down to definitions for common library calls etc.
+
+ One of the benefits of the "bare minimum" approach is that you can
+cater for the large portion of code entry with only a couple of hours
+work to develop the template definitions. Whereas if you opt for the
+"whole hog" approach then it may involve quite a few hours work.
+Creation of language template definitions is a very manual, mechanical
+task and is not always easy since you are usually working from a
+specification for the language such as a set syntax diagrams. Such
+syntax diagrams are rarely suitable for straight incorporation into a
+set of language template definitions. There is usually a fair amount of
+manually going through the syntax looking for simplifications etc.
+
+ If you are going for the complete approach then you are advised to
+start from a set of EBNF syntax diagrams for the language. To relieve
+the amount of work required for this approach, I have written a program
+that helps enormously in the effort of going from the EBNF to the
+language definition file. This program is available upon request, just
+email me and I will send you the latest copy (its comes in binary form
+because I am too embarrassed to release it, it was my very first effort
+at using both literate programming and C++ :-), perhaps one day I will
+re-do it based upon experiences learnt). The program is available for
+Win95 platforms only.
+
+ The following attempts to provide some definition of the EBNF
+structure and examples with accompanying language template definitions.
+EBNF syntax diagrams are useful because they can be used to determine
+when a particular construct should be optional, mandatory, whether it
+should auto-repeat and whether there are any "punctuation" strings
+required.
+
+ It was somewhat difficult to run down a definition of EBNF syntax,
+hopefully the following is accurate, please provide corrections if I am
+wrong :-).
+
+ In EBNF the following rules apply:
+ 1. Square brackets enclose optional items, thus the two following
+ rules are equivalent.
+ return_statement ::= return [expression];
+ return_statement ::= return; | return expression;
+
+ 2. Curly braces enclose a repeated item. The item may appear zero or
+ more times, the repetitions occur from left to right as with an
+ equivalent left-recursive rule. Thus the two following rules are
+ equivalent:
+ term ::= factor {multiplying_operator factor}
+ term ::= factor | term multiplying_operator factor
+
+ 3. A vertical line separates alternative items unless it occurs
+ immediately after an opening curly bracket, in which case it
+ stands for itself:
+ constraint ::= scalar_constraint | composite_constraint
+ discrete_choice_list ::= discrete_choice {| discrete_choice}
+
+ 4. Items that repeat are enclosed within braces, any character that
+ appears after the opening curly brace defines a "separator" string
+ ie. a string that appears between each occurrence of the repeating
+ construct (refer to example in previous item)
+
+ It is important to note in the following examples, that the keywords
+of the language being converted are copied verbatim into the language
+template definition, any other text is converted to either a mandatory
+or optional placeholder depending on how the EBNF defines their usage.
+Examples that illustrate these points are shown below. The EBNF
+construct is shown first followed by the equivalent ELSE template
+definition.
+
+
+ return_statement ::= return [expression];
+
+ DELETE PLACEHOLDER RETURN_STATEMENT -
+ /LANGUAGE="Ada" -
+ DEFINE PLACEHOLDER RETURN_STATEMENT -
+ /LANGUAGE="Ada" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "return [expression];"
+
+ END DEFINE
+
+ sequence_of_statements ::= statement {statement}
+
+ DELETE PLACEHOLDER SEQUENCE_OF_STATEMENTS -
+ /LANGUAGE="Ada" -
+ DEFINE PLACEHOLDER SEQUENCE_OF_STATEMENTS -
+ /LANGUAGE="Ada" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=VERTICAL -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "{statement}..."
+
+ END DEFINE
+ This example shows the definition of an item that appears zero or
+more time, because a typical language syntax demands at least one
+occurrence of a `statement' the EBNF shows a single instance (the
+mandatory single instance) followed by the instance enclosed in curly
+braces which is specified as repeating "zero or more times". Thus we
+"code" the template definition as single item enclosed by curly braces
+(which in ELSE means a mandatory entry). Remember that the ... denote
+auto-repeat, so when the placeholder is repeated it will be enclosed by
+square brackets and will thus be an optional entry. Thus we achieve the
+original intent of the ENBF.
+
+ In practice, you would not define the construct
+`sequence_of_statements' as it appears by itself and is used in other
+constructs such as:
+ if_statement ::= if condition then
+ sequence_of_statements
+ {elsif condition then
+ sequence_of_statements}
+ [else
+ sequence_of_statements]
+ end if;
+ So rather than define the language template such that the user is
+forced to expand `sequence_of_statements', we perform a "substitution"
+ourselves so that our `if' construct looks like:
+ if_statement ::= if condition then
+ statement {statement}
+ {elsif condition then
+ statement {statement}}
+ [else
+ statement {statement}]
+ end if;
+ Which would lead us to a language template of:
+
+ DELETE PLACEHOLDER IF_STATEMENT -
+ /LANGUAGE="Ada" -
+ DEFINE PLACEHOLDER IF_STATEMENT -
+ /LANGUAGE="Ada" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "if {condition} then"
+ " {statement}..."
+ "[elsif_part]..."
+ "[else_part]"
+ "end if;"
+
+ END DEFINE
+ This step also shows the `elsif' and `else' portion being modified
+for incorporation into the template language. Placeholders may not span
+lines, so any EBNF construct that does so must be reduced to a
+placeholder that can be produced on one line. The syntax for the `if'
+statement is a good example of this having to be done. The following
+shows the equivalent EBNF and language templates for these structures:
+ DELETE PLACEHOLDER ELSIF_PART -
+ elsif_part ::= /LANGUAGE="Ada" -
+ elsif condition then DEFINE PLACEHOLDER ELSIF_PART -
+ statement {statement} /LANGUAGE="Ada" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "elsif {condition} then"
+ " {statement}..."
+
+ END DEFINE
+
+ DELETE PLACEHOLDER ELSE_PART -
+ else_part ::= /LANGUAGE="Ada" -
+ else DEFINE PLACEHOLDER ELSE_PART -
+ statement {statement} /LANGUAGE="Ada" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=CONTEXT_DEPENDENT -
+ /SEPARATOR="" -
+ /TYPE=NONTERMINAL -
+
+ "else"
+ " {statement}..."
+
+ END Define
+
+ The following is an example of syntax that repeats with a separator
+string present. The construct is the (partial) Ada syntax for an object
+declaration. Just to provide the context, the (partial) EBNF is shown
+first.
+
+ object_declaration ::=
+ defining_identifier_list : [aliased] [constant] subtype_indication [:= \
+ expression];
+
+ defining_identifier_list ::=
+ defining_identifier {, defining_identifier}
+
+ Here, `defining_identifier_list' is defined as a
+`defining_identifier' that must occur one or more times and is separated
+by the string ", " when it does repeat. Thus, this EBNF leads to:
+
+ DELETE PLACEHOLDER DEFINING_IDENTIFIER -
+ /LANGUAGE="Ada" -
+ DEFINE PLACEHOLDER DEFINING_IDENTIFIER -
+ /LANGUAGE="Ada" -
+ /NOAUTO_SUBSTITUTE -
+ /DESCRIPTION=""
+ /DUPLICATION=HORIZONTAL -
+ /SEPARATOR=", " -
+ /TYPE=TERMINAL -
+
+ "Type in a valid Ada identifier"
+
+ END DEFINE
+
+ Here we can see the /SEPARATOR attribute be used, duplication is set
+for the horizontal direction and the placeholder is defined as a
+TERMINAL placeholder with an appropriate prompt message.
+
+
+File: else, Node: Custom Variables, Next: Technical Notes, Prev: Creating and Modifying Templates, Up: Top
+
+Custom Variables
+****************
+
+ ELSE has a small (but growing) number of custom variables, these are
+available through the Customisation Groups under the customisation
+group `Programming - Tools - Emacs LSE'. These variables are (listed
+alphabetically):
+
+ - Custom Variable: else-direction
+ This variable determines which direction the command
+ `else-move-n-placeholders' will attempt i.e. if the variable is
+ "on" then the command `else-next-placeholder' (`C-c / n') will be
+ used, if the variable is "off" then the command
+ `else-previous-placeholder' (`C-c / p') will be used. The default
+ for this variable is 't' (on).
+
+ - Custom Variable: else-follow-menus
+ If true (`t') then menu definitions are 'followed' or expanded
+ until no sub-entry menu is found and all are combined into a
+ single menu selection display at the 'top level'. If `nil', then
+ menu's are not expanded and the user has to traverse sub-menu
+ entries (useful when combining menu's leads to huge menu
+ selections).
+
+ Setting this flag to `t' will explicitly override the settings of
+ individual template definitions that use the `/NOFOLLOW' attribute
+ (*Note Template Body::.)
+
+ The default for this variable is `nil' (off) as the default
+ behaviour of ELSE is to "follow" menu definitions unless
+ explicityly told not to by the `/NOFOLLOW' attribute.
+
+ This variable may be overriden by the setting of
+ `'else-nofollow-menus' to `t'.
+
+ This flag is a buffer-local variable so individual buffers can
+ have individual settings.
+
+ This also means that setting the variable through the Emacs
+ Customisation menu will set the global value for the variable but
+ not actually affect the setting of any "current" buffers that are
+ using this variable. Only "new" buffers will inherit the new value
+ set via the customisation menu.
+
+ See the Emacs manual for instructions on changing a variable from
+ the command line (Evaluating Emacs-Lisp Expressions).
+
+ - Custom Variable: else-ignore-case-in-name-sorts
+ Used by ELSE when sorting output (else-extract-all,
+ else-show-token-names, else-show-placeholder-names ) into
+ alphabetical order. A value of `t' will ignore case when sorting
+ the names i.e.
+
+ PASS
+ print
+ RETURN
+
+ A value of `nil' will produce a sorted list that is case sensitive
+ i.e.
+
+ PASS
+ RETURN
+ .
+ .
+ print
+
+ The default for this variable is `t' (ignore case).
+
+ - Custom Variable: else-kill-proceed-to-next-placeholder
+ This is a "usability" variable that controls the behaviour of the
+ command `else-kill-placeholder' (`C-c / k') after it has executed.
+ If this variable is set (on) then ELSE will attempt to perform a
+ `else-next-placeholder' (`C-c / n') after successfully killing a
+ placeholder. If the variable is "off" then the cursor will remain
+ at the point at which the kill command was executed. The default is
+ `nil' (off).
+
+ - Custom Variable: else-move-and-execute
+ Another "usability" variable. If this variable is "on" then after
+ either an expansion or kill request (`else-expand-placeholder'
+ (`C-c / e') or `else-kill-placeholder' (`C-c / k')) which has
+ failed, then a "movement" (either a "next" or "previous"
+ placeholder - direction is dependent upon the setting of the
+ `else-direction' flag) command is executed and the original
+ operation (expand or kill) will be attempted again at the new
+ placeholder(1). The default for this variable is `nil' (off).
+
+ - Custom Variable: else-nofollow-menus
+ If true (`t') then menu definitions are not 'followed' -- when
+ `t', this variable takes precedence over the setting of
+ `'else-follow-menus' and any `/FOLLOW' or `/NOFOLLOW' attibutes of
+ the template definition. If `nil', then the variable becomes
+ "inactive" and determination of menu "follow" or not is determined
+ based upon the settings of `'else-follow-menus' and thence the
+ `/NOFOLLOW' and `/FOLLOW' attributes in that order.
+
+ The default for this variable is `nil' (off).
+
+ This flag is a buffer-local variable so individual buffers can
+ have individual settings.
+
+ This also means that setting the variable through the Emacs
+ Customisation menu will set the global value for the variable but
+ not actually affect the setting of any "current" buffers that are
+ using this variable. Only "new" buffers will inherit the new value
+ set via the customisation menu.
+
+ See the Emacs manual for instructions on changing a variable from
+ the command line (Evaluating Emacs-Lisp Expressions).
+
+ - Custom Variable: else-only-proceed-within-window
+ This flag is used only if the
+ else-kill-proceed-to-next-placeholder flag is set. The movement to
+ the next placeholder will only occur if the placeholder is visible
+ in the current window. If this flag is off then the movement will
+ proceed (possibly) causing visual disorientation to the user when
+ the screen display jumps. The default for this variable is 't'
+ (on).
+
+ - Custom Variable: else-prompt-time
+ This variable supplies the time which a prompt string to the user
+ is displayed for a TERMINAL placeholder (*note Type Specifier::).
+ The default is 3 seconds.
+
+ - Custom Variable: else-set-lineno
+ Controls the display of line numbers in the menu display window.
+ The default for this variable is `nil' (off).
+
+ ---------- Footnotes ----------
+
+ (1) this behaviour was added specifically for VR Coding and helps
+reduce the number of voice commands required to achieve a specific
+objective
+
+
+File: else, Node: Technical Notes, Next: Compatibility, Prev: Custom Variables, Up: Top
+
+Technical Notes
+***************
+
+ This chapter provides some "technical" information that doesn't fall
+into any particular category for inclusion in previous chapters. The
+information offered covers:
+ 1. "useful" variables/functions that are contained within
+ else-mode.el. This is a brief description of the some of the
+ variables/functions that an individual might want to access/call
+ from outside of ELSE to perform various tasks. This list is
+ probably not exhaustive but hopefully helpful. (1)
+
+ 2. Editing Template Files
+
+ 3. Hooks used in ELSE.
+
+ 4. How ELSE determines the file name of a language template.
+
+ 5. How to speed up load times of templates on a slow computer.
+
+* Menu:
+
+* Useful ELSE Defuns::
+* Editing Template Files::
+* ELSE and Hooks::
+* Building the Language Template File Name::
+
+ ---------- Footnotes ----------
+
+ (1) Customisable variables and interactive defuns are documented
+elsewhere in this manual, the variables/functions mentioned here are
+for "internal" use and should be used with discretion
+
+
+File: else, Node: Useful ELSE Defuns, Next: Editing Template Files, Prev: Technical Notes, Up: Technical Notes
+
+Useful ELSE Defuns
+==================
+
+ Description of some useful Defuns that ELSE contains that users can
+access (they are non-interactive) from their own elisp Defuns to
+perform useful actions.
+
+ - apropos: else-after-token
+ Return `t' if point is situated immediately after a valid token
+ string for the language definition in force for that buffer.
+
+ - apropos: else-in-placeholder
+ Returns `t' if point is within a valid placeholder for the language
+ definition in force for that buffer. See also
+ else-placeholder-start and else-placeholder-end.
+
+ - apropos: else-dump-language
+ Dump the current buffer language template to the named file. Note
+ that the file name parameter must have been already vetted to make
+ sure it complies with the else naming conventions i.e. .esl
+
+ - apropos: else-establish-language language-name
+ Set language template set 'language-name as the current template
+ set for this buffer.
+
+ - apropos: else-look-up name-string &optional ignore-forward-refs
+ Look-up the definition of a placeholder/token called 'name-string.
+ 'ignore-forward-refs allows functions like
+ `'else-kill-placeholder' to stop the forwarding referrals i.e. we
+ wish to kill what is there not what might have been there
+
+ - apropos: else-placeholder-start
+ Position in the buffer of the start of the last placeholder
+ detected/found (see else-in-placeholder).
+
+ - apropos: else-placeholder-end
+ Position in the buffer of the end of the last placeholder
+ detected/found (see else-in-placeholder).
+
+
+File: else, Node: Editing Template Files, Next: ELSE and Hooks, Prev: Useful ELSE Defuns, Up: Technical Notes
+
+Editing Template Files
+======================
+
+ ELSE comes with a template definition language file for creating and
+maintaining language template files. It is called template.lse. When
+editing template definition files you can have ELSE enabled for the
+buffer and it will load the template.lse definitions. However, when
+performing common ELSE functions (common to editing a language template
+file that is) it will perform in terms of the language of the buffer
+contents rather than the ELSE template language itself i.e. if you are
+editing C.lse and wish to perform an extraction of a current C language
+definition then you can run `else-extract-placeholder' and it will look
+in the C language definitions for the requested definition rather than
+the template definitions. Likewise, when compiling the current buffer
+the definitions will go into the C language definitions rather than the
+ELSE language template definitions. The only exception to this rule is
+the commands that are obviously relevant to editing a language
+definition file in its own language i.e. `else-expand-placeholder' will
+still be expecting to expand placeholders and tokens that below to the
+TEMPLATE definitions rather than the C definitions.
+
+
+File: else, Node: ELSE and Hooks, Next: Building the Language Template File Name, Prev: Editing Template Files, Up: Technical Notes
+
+ELSE and Hooks
+==============
+
+ Probably the most single significant feature that sets ELSE above
+any other equivalent templating system for Emacs is the ability to
+generate portions of text that can be easily located (placeholders) and
+to which the cursor can be positioned (*note Navigating Using ELSE:
+Navigating.). Once there, then typing by the user will cause the
+automatic deletion of the placeholder and the insertion of the typed
+text. This functionality is achieved by ELSE "hooking" into the before
+and after change hooks of Emacs. Here it can monitor what is happening
+in the changes to the buffer and take appropriate action (such as the
+deletion of a placeholder when `self-insert' text is typed or the
+duplication of typed text when the placeholder has identifier and
+auto-substitute situation (*note Auto Text Substitute::)).
+
+* Menu:
+
+* Building the Language Template File Name::
+
+
+File: else, Node: Building the Language Template File Name, Prev: ELSE and Hooks, Up: Technical Notes
+
+Building the Language Template File Name
+========================================
+
+ When ELSE mode is invoked for a buffer it will read the name of the
+major mode currently in effect and append the file extension ".lse" and
+attempt to load a file by that name using the 'load-path'. Note that
+this function is case sensitive i.e. if the major mode for the buffer
+is `C' then a file name of `C.lse' will be constructed and searched.
+Similarly, if the major mode is Emacs-Lisp then ELSE will construct a
+file name of 'Emacs-Lisp.lse'.
+
+ If the constructed file name cannot be located in the `load-path'
+then the user will be prompted for a file name.
+
+
+File: else, Node: Compatibility, Next: Notes for VR Coding, Prev: Technical Notes, Up: Top
+
+Compatibility
+*************
+
+ ELSE is definitely known not to be compatible with versions of Emacs
+prior to Emacs 20.X. Emacs Lisp introduced a change at 19.29 that I
+took advantage of and then Emacs 20.X introduced the use of custom
+variables which are also used in ELSE.
+
+
+File: else, Node: Notes for VR Coding, Next: Template Availability, Prev: Compatibility, Up: Top
+
+Notes for Voice Recognition Coding
+**********************************
+
+ It is recommended that people using Emacs and ELSE for programming
+using Voice Recognition tools should set the following custom variables
+(*note Custom Variables::).
+
+ 1. `else-kill-proceed-to-next-placeholder'
+
+ 2. `else-set-lineno'
+
+ 3. `else-move-and-execute'
+
+ 4. `else-only-proceed-within-window'
+
+ Having these variables set result in a minimum of voice commands to
+navigate and input code using ELSE. Refer to demonstration videos using
+ELSE, that Hans van Dam has kindly produced, at
+<http://home.hetnet.nl/~vandamhans/index.htm>
+
+
+File: else, Node: Template Availability, Next: Tutorial, Prev: Notes for VR Coding, Up: Top
+
+Language Template Availability
+******************************
+
+ The following list indicates what language templates are currently
+available from <http://www.zipworld.com.au/~peterm>. For further (and a
+growing list) of other language templates, kindly made available by
+Douglas Harter refer to <http://mywebpages.comcast.net/dharter46>.
+Douglas currently has template files for Basic, Bliss, Bourne Shell, C
+Shell, COBOL, DEC DCL, Fortran90, Fortran, PASCAL, Perl and the list is
+growing.
+ 1. Ada83 -- must be renamed to Ada.lse prior to use. Has seen some
+ extensive use in a programming environment so should be quite
+ "usable"(1)
+
+ 2. Ada95 -- must be renamed to Ada.lse to be used. Usability index is
+ moderate, I used these templates for about 6 months of coding,
+ some obvious paths have not been fine tuned.
+
+ 3. ELSE Template Language (template.lse). Quite usable - use these
+ templates to create ELSE language definition templates.
+
+ 4. LaTeX -- Usable but extremely small sub-set - I don't do
+ documentation this way anymore - the world is succumbing to
+ MS-Word :-(.
+
+ 5. Emacs-Lisp -- Usable not terrifically extensive.
+
+ 6. C -- Usable.
+
+ 7. Python -- Usable.
+
+ 8. C++ -- Not very Usable. Some work is being done by Stephen Leake.
+
+ 9. Java -- Not very Usable. Nobody is working with this template set
+ to my knowledge.
+
+ ---------- Footnotes ----------
+
+ (1) Language template files have what I would term a "usability"
+index as far as ELSE is concerned. The more extensively they are used
+in programming the more "fine tuning" has been done to the template
+definitions and thus they become more "usable" by the programmer.
+Template files that have been freshly translated from the EBNF of a
+language have a low usability index and should be regarded by beginners
+with extreme caution.
+
+
+File: else, Node: Tutorial, Next: Concept Index, Prev: Template Availability, Up: Top
+
+Tutorial
+********
+
+ This tutorial assumes that you have followed the installation
+instructions and have downloaded the C language templates (`C.lse' and
+`C-cust.lse'), these files represent the base C language template files
+(`C.lse') and the customisation templates that I use for my C
+programming (`C-cust.lse'). For the tutorial to be as shown, it is
+important that these two files are used, otherwise the code samples
+shown may not be accurate.
+
+ The tutorial uses the C language templates, as C is probably the
+most recognised language (everybody has at some time or another been
+exposed to some form of C syntax, using any of the other languages for
+which ELSE templates are available might not have such a wide
+recognition factor).
+
+* Menu:
+
+* Abbreviation Coding::
+* Whole Language Coding::
+
+
+File: else, Node: Abbreviation Coding, Next: Whole Language Coding, Prev: Tutorial, Up: Tutorial
+
+Using ELSE for Abbreviation Coding
+==================================
+
+ If you are in a "maintenance" type role i.e. working with modifying
+or fixing existing code files, or perhaps you are completely new to
+ELSE, then you might be more interested in the "abbreviation" powers of
+ELSE.
+
+ In these kind of coding situations, you are more likely to wish to
+just add a couple of lines of code rather than write completely new
+code from scratch. In the case of just adding several lines, then it is
+convenient to have some quick and easy way to generate a common code
+construct. You could type a placeholder directly into the buffer and
+then expand it but this is somewhat laborious and is not necessarily
+true to the underlying aim of ELSE, which is to reduce typing. To meet
+these needs, ELSE offers something called "tokens". Tokens are a
+template definition that takes a minimal number of characters and turns
+them into some desired construct using the expand command (`C-c / e').
+Most of the common language constructs available to ELSE should have
+the common constructs available as tokens as well as placeholders i.e.
+one such common construct is the "if statement". To generate an if
+construct at point in the buffer, just perform the following key
+sequence:
+
+ `ifC-c / e'
+
+ and you will have the following if construct appear:
+
+ if ({expression}) {
+ {statement}...
+ }
+ [elsif_part]...
+ [else_part]
+
+ Again, the cursor will be automatically positioned into the first
+placeholder and options similar to that explained in the previous
+section (*Note Whole Language Coding::).
+
+ Another example of a simple, but common construct is the humble
+comment statement. In `C-cust.lse' there is a token that allows quick
+and easy comment generation. Type the following anywhere in the buffer:
+
+ `cC-c / e'
+
+ and you should see the text:
+ /* {text} */
+
+ The cursor will be positioned within the "text" placeholder and the
+user can start typing the comment immediately.
+
+
+File: else, Node: Whole Language Coding, Prev: Abbreviation Coding, Up: Tutorial
+
+Using ELSE for Whole Language Coding
+====================================
+
+ Open a new file, "example.c". When the new file is created, enable
+ELSE for the buffer using `M-x else-mode'. You should see the following
+in the buffer:
+
+ {compilation_unit}
+
+ The cursor should be positioned within the placeholder shown. This
+is a top level language construct that should lead to all of the
+possible paths to create a complete C language file. Expand the
+placeholder by executing `C-c / e', which should result in the buffer
+containing:
+
+ [module_level_comments]
+ [#include]...
+
+ {translation_unit}...
+
+ Again, the cursor will be positioned in the first placeholder
+(`module_level_comments') of the expansion. Perform another expansion
+(`C-c / e') and this placeholder will be replaced by the following text:
+
+ /* ===[ {module} ]=========================================================
+
+ Description:
+
+ {text}
+
+ Revisions:
+
+ REV DATE BY DESCRIPTION
+ ------ --------- --- --------------------------------------------
+
+ -------------------------------------------------------------------------
+ This item is the property of GTECH Corporation, Providence,
+ Rhode Island, and contains confidential and trade secret information.
+ It may not be transfered from the custody or control of GTECH except
+ as authorized in writing by an officer of GTECH. Neither this item
+ nor the information it contains may be used, transfered, reproduced,
+ published, or disclosed, in whole or in part, and directly or
+ indirectly, except as expressly authorized by an officer of GTECH,
+ pursuant to written agreement.
+
+ Copyright (c) 1996 GTECH Corporation. All rights reserved.
+ ========================================================================*/
+
+ The cursor will now be the next available placeholder (`module'). If
+this placeholder is expanded (`C-c / e'), then the user will receive a
+prompt screen with the following text:
+
+ Enter the name of the module i.e. gs_lib.c
+
+ This text will be visible for approximately 3 seconds (ELSE prompt
+time - a customisable variable). This indicates to the user that there
+is no further expansions available from the templates. The prompt
+string itself offers informative text meant to help the user provide
+the required information. The fact that the placeholder is a
+"mandatory" placeholder (*note Typographical Conventions::) means that
+the user must provide a value i.e. the placeholder cannot be deleted or
+killed because the syntactic conventions require an entry to be made at
+this point.
+
+ Type in the text, `example.c' -- the placeholder will be deleted
+automatically when the first letter is typed by the user.
+
+ Now navigate to the placeholder `include_files' using repeated next
+placeholder commands (`C-c / n'). Expand the placeholder (`C-c / e') and
+you will be presented with a menu screen showing two possible choices
+(as shown below):
+
+ #include <{file_name}>
+ #include "{file_name}"
+
+ Select the first option by pressing the letter `s' on the keyboard
+(selection can also be achieved by re-executing the expansion command
+`C-c / e' -- this is a convenience option for individuals who may map
+the ELSE expand command to a more convenient key sequence i.e. I have
+the else-expand-placeholder command mapped to <F3> - by allowing this
+behaviour, the user doesn't have to move fingers to achieve menu
+selection.
+
+ Enter the text `stdio.h', the buffer should now contain (excluding
+the file header that we have already developed in the interest of
+saving space):
+
+ #include <stdio.h>
+ [#include]...
+
+ Note that the `#include' placeholder has been automatically repeated
+(repetition of the placeholder is achieved by the inclusion of the
+ellipses (...) at the end of the placeholder. This allows multiple
+constructs to be easily repeated i.e. ELSE does the repetition -- it
+would be extremely tedious if the user was forced to type in each
+placeholder by hand.
+
+ Navigate to the next placeholder and delete it using `C-c / k', this
+will delete the text of the second instance of the `#include'
+placeholder, including the braces and ellipses.
+
+ Now navigate to the "translation_unit" placeholder and expand it,
+you will be presented with a menu consisting of the following choices:
+
+ function_definition
+ declaration
+
+ Select the first possibility (`function_definition') to receive the
+following text in the buffer:
+
+ [declaration_specifiers] {declarator}
+ [declaration]...
+ {
+ [declaration]...
+ [statement]...
+ }
+
+ You can navigate backwards (`C=c /p') and forwards through these
+placeholders, expansion will lead to either prompt strings, menu
+choices or simple text substitutions, depending upon the language
+template definition for that placeholder. From these simple
+placeholders an entire language file can be constructed. Since ELSE
+generates all of the "house-keeping" characters such as opening and
+closing braces, semi-colons that end the line etc, when it comes time
+to compile this file, then the compiler should report a very much
+reduced number of syntactic errors that if the file had been entered by
+more traditional methods.
+
+ Hopefully this tutorial has given you some small taste for the power
+of ELSE and has whetted your appetite to learn more. Any questions
+about the contents of this manual, using ELSE or creating/modifying new
+templates then just contact me at the email address on the front page
+of this manual, or, if that doesn't work, then you can reach me through
+the gnu.emacs.help newsgroup, I monitor that group on all work days of
+the week (Australian time that is).
+
+
+File: else, Node: Concept Index, Prev: Tutorial, Up: Top
+
+Concept Index
+*************
+
+* Menu:
+
+* abbrev: Definitions.
+* abbreviation: Definitions.
+* expand <1>: Expanding Placeholders.
+* expand: Definitions.
+* expanding: Expanding Placeholders.
+* expansion of: Expanding Placeholders.
+* Installation: Installation Instructions.
+* invoke, invoking: Invoking ELSE.
+* navigate: Navigating.
+* navigating: Navigating.
+* placeholder: Definitions.
+* token: Definitions.
+
+
+
+Tag Table:
+Node: Top1209
+Node: Introduction3670
+Ref: Introduction-Footnote-111906
+Ref: Introduction-Footnote-212111
+Ref: Introduction-Footnote-312335
+Node: Overview12634
+Ref: Overview-Footnote-119314
+Ref: Overview-Footnote-219446
+Node: Typographical Conventions19587
+Node: Definitions20682
+Node: Installation Instructions21537
+Node: Default Keybindings23029
+Node: Command Summary25533
+Ref: Command Summary-Footnote-131123
+Node: Using ELSE31389
+Node: Invoking ELSE32502
+Ref: Invoking ELSE-Footnote-134125
+Node: Navigating34332
+Node: Expanding Placeholders34942
+Node: Expanding Tokens36656
+Node: Deleting Placeholders37792
+Node: Preparing for Compilation38536
+Ref: Preparing for Compilation-Footnote-139420
+Node: Disabling ELSE39758
+Node: Creating and Modifying Templates40332
+Ref: Creating and Modifying Templates-Footnote-141960
+Node: Syntactic Conventions42041
+Node: Customising An Existing Template Language43344
+Node: Extracting Placeholders or Tokens49015
+Node: Create a New Language50404
+Node: Language Definition Template52114
+Ref: Language Definition Template-Footnote-153267
+Node: Language Identification53342
+Ref: Language Identification-Footnote-154709
+Node: Initial String54809
+Node: Punctuation characters55522
+Node: Self Insert Characters56494
+Node: Valid Identifier Characters57103
+Node: Indentation Size60036
+Node: Template Version64610
+Node: Overriding Language Attributes65197
+Node: Definition of the Template Structure66338
+Node: Placeholders67086
+Node: Delete Placeholder Statement68529
+Node: Language Specifier69103
+Node: Define Placeholder Statement69506
+Node: Auto Text Substitute70048
+Node: Description Specifier74397
+Node: Duplication Specifier74804
+Node: Separator Specification76300
+Node: Type Specifier77755
+Node: Template Body80788
+Ref: Template Body-Footnote-183993
+Ref: Template Body-Footnote-284036
+Node: Placeholder Cross-Referencing84130
+Node: End Define Command86249
+Node: Tokens86509
+Node: Hooking Elisp Code into ELSE Templates89159
+Ref: Hooking Elisp Code into ELSE Templates-Footnote-193915
+Node: Example of Creating A New Language Template94101
+Node: Custom Variables105862
+Ref: Custom Variables-Footnote-1111589
+Node: Technical Notes111736
+Ref: Technical Notes-Footnote-1112698
+Node: Useful ELSE Defuns112890
+Node: Editing Template Files114587
+Node: ELSE and Hooks115927
+Node: Building the Language Template File Name116966
+Node: Compatibility117728
+Node: Notes for VR Coding118102
+Node: Template Availability118826
+Ref: Template Availability-Footnote-1120339
+Node: Tutorial120774
+Node: Abbreviation Coding121671
+Node: Whole Language Coding123794
+Node: Concept Index129699
+
+End Tag Table
diff --git a/app-emacs/else-mode/files/setnu.el b/app-emacs/else-mode/files/setnu.el
new file mode 100644
index 0000000..65660e8
--- /dev/null
+++ b/app-emacs/else-mode/files/setnu.el
@@ -0,0 +1,448 @@
+;;; vi-style line number mode for Emacs
+;;; (requires Emacs 19.29 or later, or XEmacs 19.11 or later)
+;;; Copyright (C) 1994, 1995, 1997 Kyle E. Jones
+;;;
+;;; 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.
+;;;
+;;; A copy of the GNU General Public License can be obtained from this
+;;; program's author (send electronic mail to kyle@uunet.uu.net) or from
+;;; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
+;;; 02139, USA.
+;;;
+;;; Send bug reports to kyle@wonderworks.com
+;;
+;; M-x setnu-mode toggles the line number mode on and off.
+;;
+;; turn-on-setnu-mode is useful for adding to a major-mode hook
+;; variable.
+;; Example:
+;; (add-hook 'text-mode-hook 'turn-on-setnu-mode)
+;; to automatically turn on line numbering when enterting text-mode."
+
+(provide 'setnu)
+
+(defconst setnu-running-under-xemacs
+ (or (string-match "XEmacs" emacs-version)
+ (string-match "Lucid" emacs-version)))
+
+(defconst setnu-mode-version "1.05"
+ "Version number for this release of setnu-mode.")
+
+(defvar setnu-mode nil
+ "Non-nil if setnu-mode is active in the current buffer.")
+(make-variable-buffer-local 'setnu-mode)
+
+(defvar setnu-start-extent nil
+ "First extent of a chain of extents used by setnu-mode.
+Each line has its own extent. Each line extent has a
+`setnu-next-extent' property that points to the next extent in
+the chain, which is the extent for the next line in the buffer.
+There is also a `setnu-prev-extent' that points at the previous
+extent in the chain. To distinguish them from other extents the
+setnu-mode extents all have a non-nil `setnu' property.")
+(make-variable-buffer-local 'setnu-start-extent)
+
+(defvar setnu-glyph-obarray (make-vector 401 0)
+ "Obarray of symbols whose values are line number glyphs.
+Each symbol name is the string represnetation of a number, perhaps
+passed with spaces. The value of the symbol is a glyph that can
+be made the begin glyph of an extent to display as a line number.")
+
+(defvar setnu-begin-glyph-property (if (fboundp 'extent-property)
+ 'begin-glyph
+ 'before-string)
+ "Property name to use to set the begin glyph of an extent.")
+
+(defvar setnu-line-number-format (if setnu-running-under-xemacs "%4d" "%4d ")
+ "String suitable for `format' that will generate a line number string.
+`format' will be called with this string and one other argument
+which will be an integer, the line number.")
+
+(defvar setnu-line-number-face 'bold
+ "*Face used to display the line numbers.
+Currently this works for XEmacs 19.12 and later versions only.")
+
+(defun setnu-mode (&optional arg)
+ "Toggle setnu-mode.
+With prefix argument, turn setnu-mode on if argument is positive.
+When setnu-mode is enabled, a line number will appear at the left
+margin of each line."
+ (interactive "P")
+ (let ((oldmode (not (not setnu-mode)))
+ (inhibit-quit t))
+ (setq setnu-mode (or (and arg (> (prefix-numeric-value arg) 0))
+ (and (null arg) (null setnu-mode))))
+ (if (not (eq oldmode setnu-mode))
+ (if setnu-mode
+ (setnu-mode-on)
+ (setnu-mode-off)))))
+
+(defun turn-on-setnu-mode ()
+ "Turn on setnu-mode.
+Useful for adding to a major-mode hook variable.
+Example:
+ (add-hook 'text-mode-hook 'turn-on-setnu-mode)
+to automatically turn on line numbering when enterting text-mode."
+ (setnu-mode 1))
+
+;;; Internal functions
+
+;;; The program is written using XEmacs terminology,
+;;; e.g. extents, glyphs, etc. Functions are defined to twist
+;;; the FSF Emacs overlay API into the XEmacs model.
+
+(defconst setnu-running-under-xemacs
+ (or (string-match "XEmacs" emacs-version)
+ (string-match "Lucid" emacs-version)))
+
+(if setnu-running-under-xemacs
+ (fset 'setnu-make-extent 'make-extent)
+ (fset 'setnu-make-extent 'make-overlay))
+
+(if setnu-running-under-xemacs
+ (fset 'setnu-delete-extent 'delete-extent)
+ (fset 'setnu-delete-extent 'delete-overlay))
+
+(if setnu-running-under-xemacs
+ (fset 'setnu-extent-property 'extent-property)
+ (fset 'setnu-extent-property 'overlay-get))
+
+(if setnu-running-under-xemacs
+ (fset 'setnu-set-extent-property 'set-extent-property)
+ (fset 'setnu-set-extent-property 'overlay-put))
+
+(if setnu-running-under-xemacs
+ (fset 'setnu-set-extent-endpoints 'set-extent-endpoints)
+ (fset 'setnu-set-extent-endpoints 'move-overlay))
+
+(if setnu-running-under-xemacs
+ (fset 'setnu-extent-end-position 'extent-end-position)
+ (fset 'setnu-extent-end-position 'overlay-end))
+
+(if setnu-running-under-xemacs
+ (fset 'setnu-extent-start-position 'extent-start-position)
+ (fset 'setnu-extent-start-position 'overlay-start))
+
+(if setnu-running-under-xemacs
+ (defun setnu-set-extent-begin-glyph (e g)
+ (set-extent-begin-glyph e g 'outside-margin))
+ (defun setnu-set-extent-begin-glyph (e g)
+ (overlay-put e setnu-begin-glyph-property g)))
+
+(fset 'setnu-make-glyph (if setnu-running-under-xemacs 'make-glyph 'identity))
+
+(cond ((and setnu-running-under-xemacs (fboundp 'set-glyph-face))
+ (fset 'setnu-set-glyph-face 'set-glyph-face))
+ (setnu-running-under-xemacs
+ (fset 'setnu-set-glyph-face 'ignore))
+ (t ; FSF Emacs
+ (defun setnu-set-glyph-face (g face)
+ (put-text-property 0 (length g) 'face face g))))
+
+(defun setnu-mode-off ()
+ "Internal shutdown of setnu-mode.
+Deletes the extents associated with setnu-mode."
+ (if (and setnu-running-under-xemacs
+ (fboundp 'remove-specifier))
+ (remove-specifier left-margin-width (current-buffer)))
+ (if setnu-start-extent
+ (let (e ee)
+ (setq e setnu-start-extent)
+ (while e
+ (setq ee e)
+ (setq e (setnu-extent-property e 'setnu-next-extent))
+ (setnu-delete-extent ee))
+ (setq setnu-start-extent nil))))
+
+(defun setnu-mode-on ()
+ "Internal startup of setnu-mode.
+Sets up the extents associated with setnu-mode."
+ (if (and setnu-running-under-xemacs
+ (fboundp 'set-specifier))
+ (set-specifier left-margin-width 6 (current-buffer)))
+ (let ((done nil)
+ (curr-e nil)
+ (n 1)
+ (match-data (match-data))
+ e start numstr)
+ (unwind-protect
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (setq start (point))
+ (while (not done)
+ (setq done (null (search-forward "\n" nil 0)))
+ (setq e (setnu-make-setnu-extent start (point)))
+ (if (null setnu-start-extent)
+ (setq setnu-start-extent e
+ curr-e e)
+ (setnu-set-extent-property curr-e 'setnu-next-extent e)
+ (setnu-set-extent-property e 'setnu-prev-extent curr-e)
+ (setq curr-e e))
+ (setq numstr (format setnu-line-number-format n))
+ (setnu-set-extent-property e 'line-number numstr)
+ (setnu-set-extent-begin-glyph e (setnu-number-glyph numstr))
+ (setq n (1+ n)
+ start (point)))))
+ (store-match-data match-data))))
+
+(defun setnu-before-change-function (start end)
+ "Before change function for setnu-mode.
+Notices when a delete is about to delete some lines and adjusts
+the line number extents accordingly."
+ (if (or (not setnu-mode) (= start end))
+ () ;; not in setnu-mode or this is an insertion
+ (let ((inhibit-quit t)
+ (start-e nil)
+ (match-data (match-data))
+ end-e saved-next e ee)
+ (unwind-protect
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char start)
+ (if (search-forward "\n" end t)
+ (progn
+ (setq start-e (setnu-extent-at-create start nil)
+ saved-next (setnu-extent-property
+ start-e
+ 'setnu-next-extent))
+ (setq end-e (setnu-extent-at-create end nil))
+ (setnu-set-extent-endpoints
+ start-e
+ (setnu-extent-start-position start-e)
+ (setnu-extent-end-position end-e))
+ (setnu-set-extent-property
+ start-e 'setnu-next-extent
+ (setnu-extent-property end-e 'setnu-next-extent))))
+ (if start-e
+ (progn
+ (setq e (setnu-extent-property start-e 'setnu-next-extent)
+ ee saved-next)
+ (while (and e (setnu-extent-property e 'setnu-next-extent))
+ (setq e (setnu-extent-property e 'setnu-next-extent)
+ ee (setnu-extent-property ee 'setnu-next-extent)))
+ (while (and e (not (eq ee start-e)))
+ (setnu-set-extent-begin-glyph
+ e (setnu-extent-property ee setnu-begin-glyph-property))
+ (setnu-set-extent-property
+ e 'line-number (setnu-extent-property ee 'line-number))
+ (setq e (setnu-extent-property e 'setnu-prev-extent)
+ ee (setnu-extent-property ee 'setnu-prev-extent)))
+ (setq end-e (setnu-extent-property start-e
+ 'setnu-next-extent))
+ (and end-e
+ (setnu-set-extent-property end-e
+ 'setnu-prev-extent
+ start-e))
+ (setq e saved-next)
+ (while (not (eq e end-e))
+ (setq ee e
+ e (setnu-extent-property e 'setnu-next-extent))
+ (setnu-delete-extent ee))))))
+ (store-match-data match-data)))))
+
+(defun setnu-after-change-function (start end length)
+ "After change function for setnu-mode.
+Notices when an insert has added some lines and adjusts
+the line number extents accordingly."
+ (if (or (not setnu-mode) (= start end))
+ () ; not in setnu-mode or this is a deletion
+ (let ((inhibit-quit t)
+ (ee nil)
+ (match-data (match-data))
+ (new-lines 0)
+ start-e e saved-end saved-next n numstr)
+ (unwind-protect
+ (save-excursion
+ (save-restriction
+ (widen)
+ (setq start-e (setnu-extent-at-create start nil))
+ (if (< (setnu-extent-end-position start-e) (point))
+ ;; bogus! insertion didn't put the text into
+ ;; the extent because,
+ ;; a. the extent was zero length or
+ ;; b. this is FSF Emacs which means chars
+ ;; inserted at the end position of an extent
+ ;; are not inserted into the extent.
+ (setnu-set-extent-endpoints
+ start-e
+ (setnu-extent-start-position start-e)
+ end))
+ (setq saved-next (setnu-extent-property start-e
+ 'setnu-next-extent)
+ saved-end (setnu-extent-end-position start-e)
+ e start-e)
+ (goto-char start)
+ (while (search-forward "\n" end 0)
+ (setnu-set-extent-endpoints e
+ (setnu-extent-start-position e)
+ (point))
+ (setq ee (setnu-make-setnu-extent (point) (point)))
+ (setnu-set-extent-property e 'setnu-next-extent ee)
+ (setnu-set-extent-property ee 'setnu-prev-extent e)
+ (setq e ee new-lines (1+ new-lines)))
+ (if ee
+ (progn
+ (setnu-set-extent-endpoints
+ e (setnu-extent-start-position e) saved-end)
+ (setnu-set-extent-property e 'setnu-next-extent saved-next)
+ (and saved-next
+ (setnu-set-extent-property
+ saved-next 'setnu-prev-extent e))
+ (setq e (setnu-extent-property start-e 'setnu-next-extent)
+ ee saved-next)
+ (while ee
+ (setnu-set-extent-begin-glyph
+ e (setnu-extent-property ee setnu-begin-glyph-property))
+ (setnu-set-extent-property
+ e 'line-number (setnu-extent-property ee 'line-number))
+ (setq e (setnu-extent-property e 'setnu-next-extent)
+ ee (setnu-extent-property ee 'setnu-next-extent)))
+ (setq n (1+ (string-to-int
+ (setnu-extent-property
+ (setnu-extent-property e 'setnu-prev-extent)
+ 'line-number))))
+ (while e
+ (setq numstr (format setnu-line-number-format n))
+ (setnu-set-extent-property e 'line-number numstr)
+ (setnu-set-extent-begin-glyph
+ e (setnu-number-glyph numstr))
+ (setq e (setnu-extent-property e 'setnu-next-extent)
+ n (1+ n)))))))
+ (store-match-data match-data)))))
+
+(defun setnu-number-glyph (number-string)
+ (let ((sym (intern number-string setnu-glyph-obarray)))
+ (if (boundp sym)
+ (symbol-value sym)
+ (let ((g (setnu-make-glyph number-string)))
+ (set sym g)
+ (setnu-set-glyph-face g setnu-line-number-face)
+ g ))))
+
+(defun setnu-make-setnu-extent (beg end)
+ "Create an extent and set some properties that all setnu extents have."
+ (let ((e (setnu-make-extent beg end)))
+ (setnu-set-extent-property e 'setnu t)
+;; (setnu-set-extent-property e 'begin-glyph-layout 'outside-margin)
+ (setnu-set-extent-property e 'detachable nil)
+ (setnu-set-extent-property e 'evaporate nil)
+ e ))
+
+(cond ((fboundp 'overlays-in) ;; expect to see this in 19.30
+ (defun setnu-extent-at (pos buf)
+ "Finds the setnu extent at the position POS in the buffer BUF."
+ (catch 'done
+ (save-excursion
+ (and buf (set-buffer buf))
+ (let ((o-list (overlays-in pos (1+ pos))))
+ (while o-list
+ (if (overlay-get (car o-list) 'setnu)
+ (throw 'done (car o-list)))
+ (setq o-list (cdr o-list)))
+ nil )))))
+ ((fboundp 'overlays-at)
+ (defun setnu-extent-at (pos buf)
+ "Finds the setnu extent at the position POS in the buffer BUF."
+ (catch 'done
+ (save-excursion
+ (and buf (set-buffer buf))
+ (let ((o-list (overlays-at pos)) o-lists)
+ ;; search what overlays-at returns first. for all
+ ;; but zero length extents this will return the
+ ;; extent we want.
+ (while o-list
+ (if (overlay-get (car o-list) 'setnu)
+ (throw 'done (car o-list)))
+ (setq o-list (cdr o-list)))
+ ;; No luck. Search the lists returned by
+ ;; overlay-lists. Use overlays-recenter so we only
+ ;; have to search the `before' lobe of the return
+ ;; value.
+ (overlay-recenter (1- pos))
+ (setq o-lists (overlay-lists))
+ (setq o-list (cdr o-lists))
+ (while o-list
+ (if (and (overlay-get (car o-list) 'setnu)
+ (or (and (= pos (overlay-start (car o-list)))
+ (= pos (overlay-end (car o-list))))
+ (and (>= pos (overlay-start (car o-list)))
+ (< pos (overlay-end (car o-list))))))
+ (throw 'done (car o-list)))
+ (setq o-list (cdr o-list)))
+ nil )))))
+ ((fboundp 'map-extents)
+ (defun setnu-extent-at (pos buf)
+ "Finds the setnu extent at the position POS in the buffer BUF."
+ (map-extents (function (lambda (e maparg)
+ (if (setnu-extent-property e 'setnu)
+ e
+ nil)))
+ buf pos pos)))
+ (t (error "can't find overlays-in, overlays-at, or map-extents!")))
+
+(defun setnu-extent-at-create (pos buf)
+ "Like `setnu-extent-at' except if an extent isn't found, then
+it is created based on where the extent failed to be found."
+ (let ((e (setnu-extent-at pos buf)) ee beg numstr)
+ (if e
+ e
+ ;; no extent found so one must be created.
+ (save-excursion
+ (goto-char pos)
+ (beginning-of-line)
+ (setq e (setnu-extent-at (point) buf))
+ (cond (e
+ ;; found one. extend it to cover this whole line.
+ ;; this takes care of zero length extents that
+ ;; might exist at bob or eob that can't be
+ ;; inserted into.
+ (setq beg (point))
+ (forward-line 1)
+ (setnu-set-extent-endpoints e beg (point))
+ e )
+ ((bobp)
+ ;; we are at bob and there's no extent.
+ ;;
+ ;; this is because the extent that was there got
+ ;; detached because all the text in the buffer was
+ ;; deleted. so we create a new extent and make it
+ ;; contain the whole buffer, since there can be no
+ ;; other attached extents.
+ (setq e (setnu-make-setnu-extent (point-min) (point-max))
+ numstr (format setnu-line-number-format 1))
+ (setnu-set-extent-property e 'line-number numstr)
+ (setnu-set-extent-begin-glyph e (setnu-number-glyph numstr))
+ (setq setnu-start-extent e)
+ e )
+ (t
+ ;; we must be at eob and there's no extent.
+ ;;
+ ;; this is because the extent that was there
+ ;; shrank to zero length and was detached. create
+ ;; a new extent that contains all text from point
+ ;; to pos.
+ (setq e (setnu-make-setnu-extent (point) pos))
+ (setq ee (setnu-extent-at (1- (point)) buf))
+ (setnu-set-extent-property e 'setnu-prev-extent ee)
+ (setnu-set-extent-property ee 'setnu-next-extent e)
+ (setq numstr
+ (format setnu-line-number-format
+ (1+ (string-to-int
+ (setnu-extent-property ee 'line-number)))))
+ (setnu-set-extent-property e 'line-number numstr)
+ (setnu-set-extent-begin-glyph e (setnu-number-glyph numstr))
+ e ))))))
+
+(add-hook 'before-change-functions 'setnu-before-change-function)
+(add-hook 'after-change-functions 'setnu-after-change-function)