Commits

Vasil Vangelovski  committed 502caa5

added nxhtml mode

  • Participants
  • Parent commits a21b79b

Comments (0)

Files changed (517)

File ac-comphist.dat

-(nil)
+((("yas/define-snippets" .
+   [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1])
+  ("django-html-mumamo" .
+   [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2])
+  ("html-mode-map" .
+   [0 0 0 0 0 0 0 0 0 1 0 0 0])
+  ("nil" .
+   [1 0 0])
+  ("django-mode" .
+   [0 0 0 0 0 0 0 1 0 0 0])))

File emacs-starter-kit/places

 ;;; -*- coding: utf-8 -*-
 
-(("/Users/vasilvangelovski/.emacs.d/nxhtml/related/django.el" . 2759))
+(("/Users/vasilvangelovski/.emacs.d/init.el" . 1256))
           
           )
 
+;; nxhtml
+(load "~/.emacs.d/nxhtml/autostart.el")
+(yas/define-snippets 'nxhtml-mode nil 'html-mode)
+
 
 ;; yasnippet additional snippets
 

File nxhtml/README.txt

+To install nXhtml put this in your .emacs:
+
+   (load "YOUR-PATH-TO/nxhtml/autostart.el")
+
+where autostart.el is the file in the same directory as this
+readme.txt file.
+
+Note 1: If you are using Emacs+EmacsW32 then nXhtml is already
+        installed.
+
+Note 2: If you are using Emacs 22 then you need to install nXml
+        separately. (It is included in Emacs 23.)
+
+Note 3: You may optionally also byte compile nXhtml from the nXhtml
+        menu (recommended).
+
+
+
+Files that are now in Emacs' development (CVS/Bazaar) repository
+================================================================
+
+Some files that were previously distributed with nXhtml are now in
+Emacs' development repository.  Distributing them also with nXhtml is
+a bad idea since that can lead to that the wrong file is loaded.  They
+are therefore not distributed with nXhtml anymore.
+
+Instead you can (if you do not have the files in your Emacs) in many
+cases use the version from the repository.  To do that you can
+currently start from
+
+  http://cvs.savannah.gnu.org/viewvc/emacs/emacs/lisp/
+
+Files you can download and use this way are for example
+
+  js.el (JavaScript, formerly called espresso.el)
+  htmlfontify.el
+
+If you do that I suggest that you put these files in a special
+directory and add that to load-path in your .emacs and make that
+adding to load-path depend on your Emacs version so that they will not
+be loaded when you have upgraded your Emacs.
+
+Note that if you want to use nxml-mode (and it is not in your Emacs)
+you should not download it from Emacs' development directory. Instead go to
+
+  http://www.thaiopensource.com/download/

File nxhtml/alts/find-recursive-orig.el

+;; find-recursive.el -- Find files recursively into a directory
+;;
+;; Copyright (C) 2001 Ovidiu Predescu
+;;
+;; Author: Ovidiu Predescu <ovidiu@cup.hp.com>
+;; Date: March 26, 2001
+;;
+;; 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
+;; of the License, or (at your option) any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program; if not, write to the Free Software
+;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;;
+;; Setup: put this file in your Lisp path and add the following line in
+;; your .emacs:
+;;
+;; (require 'find-recursive)
+;;
+
+(require 'cl)
+
+(defcustom find-recursive-exclude-files '(".*.class$" ".*~$" ".*.elc$")
+  "List of regular expressions of files to be excluded when recursively searching for files."
+  :type '(repeat (string :tag "File regexp")))
+
+(defun find-file-recursively (file-regexp directory)
+  (interactive "sFile name to search for recursively: \nDIn directory: ")
+  (let ((directory (if (equal (substring directory -1) "/")
+                       directory
+                     (concat directory "/")))
+        (matches
+         (find-recursive-filter-out
+          find-recursive-exclude-files
+          (find-recursive-directory-relative-files directory "" file-regexp))))
+    (cond ((eq (length matches) 0) (message "No file(s) found!"))
+           ((eq (length matches) 1)
+            (find-file (concat directory (car matches))))
+           (t
+            (run-with-timer 0.001 nil
+                            (lambda ()
+                              (dispatch-event
+                               (make-event 'key-press '(key tab)))))
+            (let ((file (completing-read "Choose file: "
+                                           (mapcar 'list matches)
+                                           nil t)))
+                (if (or (eq file nil) (equal file ""))
+                    (message "No file selected.")
+                  (find-file (concat directory file))))))))
+
+(defun find-recursive-directory-relative-files (directory
+                                          relative-directory
+                                          file-regexp)
+  (let* ((full-dir (concat directory "/" relative-directory))
+         (matches
+          (mapcar
+           (function (lambda (x)
+                       (concat relative-directory x)))
+           (find-recursive-filter-out '(nil)
+                                (directory-files full-dir nil
+                                                 file-regexp nil t))))
+         (inner
+          (mapcar
+           (function
+            (lambda (dir)
+              (find-recursive-directory-relative-files directory
+                                                 (concat relative-directory
+                                                         dir "/")
+                                                 file-regexp)))
+           (find-recursive-filter-out '(nil "\\." "\\.\\.")
+                                (directory-files full-dir nil ".*"
+                                                 nil 'directories)))))
+    (mapcar (function (lambda (dir) (setq matches (append matches dir))))
+            inner)
+    matches))
+
+(defun find-recursive-filter-out (remove-list list)
+  "Remove all the elements in *remove-list* from *list*"
+  (if (eq list nil)
+      nil
+    (let ((elem (car list))
+          (rest (cdr list)))
+      (if (some
+           (lambda (regexp)
+             (if (or (eq elem nil) (eq regexp nil))
+                 nil
+               (not (eq (string-match regexp elem) nil))))
+           remove-list)
+          (find-recursive-filter-out remove-list rest)
+        (cons elem (find-recursive-filter-out remove-list rest))))))
+
+(defvar find-recursive-running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))
+
+(if find-recursive-running-xemacs
+    nil
+  (defadvice directory-files (after
+                              directory-files-xemacs
+                              (dirname &optional full match nosort files-only)
+                              activate)
+    "Add an additional argument, FILES-ONLY to the list of arguments
+for GNU Emacs. If the symbol is t, then only the files in the
+directory will be returned. If FILES-ONLY is nil, then both files and
+directories are selected. If FILES-ONLY is not nil and not t, then
+only sundirectories are returned."
+    (setq ad-return-value
+          (cond ((null files-only) ad-return-value)
+                ((eq files-only t)
+                 (find-recursive-remove-if (lambda (f)
+                                             (file-directory-p
+                                              (concat dirname "/" f)))
+                                           ad-return-value))
+                (t
+                 (find-recursive-remove-if (lambda (f)
+                                             (not (file-directory-p
+                                                   (concat dirname "/" f))))
+                                           ad-return-value)))))
+
+  (defun find-recursive-remove-if (func list)
+    "Removes all elements satisfying FUNC from LIST."
+    (let ((result nil))
+      (while list
+        (if (not (funcall func (car list)))
+            (setq result (cons (car list) result)))
+        (setq list (cdr list)))
+      (nreverse result))))
+
+(global-set-key [(control x) (meta f)] 'find-file-recursively)
+
+(provide 'find-recursive)

File nxhtml/alts/javascript-mozlab.el

+;;; javascript.el --- Major mode for editing JavaScript source text
+
+;; Copyright (C) 2006 Karl Landström
+
+;; Author: Karl Landström <kland@comhem.se>
+;; Maintainer: Karl Landström <kland@comhem.se>
+;; Version: 2.0 Beta 8
+;; Date: 2006-12-26
+;; Keywords: languages, oop
+
+;; This file 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 file 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:
+;;
+;; The main features of this JavaScript mode are syntactic
+;; highlighting (enabled with `font-lock-mode' or
+;; `global-font-lock-mode'), automatic indentation and filling of
+;; comments.
+;;
+;; This package has (only) been tested with GNU Emacs 21.4 (the latest
+;; stable release).
+;;
+;; Installation:
+;;
+;; Put this file in a directory where Emacs can find it (`C-h v
+;; load-path' for more info). Then add the following lines to your
+;; Emacs initialization file:
+;; 
+;;    (add-to-list 'auto-mode-alist '("\\.js\\'" . javascript-mode))
+;;    (autoload 'javascript-mode "javascript" nil t)
+;;    
+;; General Remarks:
+;; 
+;; This mode assumes that block comments are not nested inside block
+;; comments and that strings do not contain line breaks.
+;; 
+;; Exported names start with "javascript-" whereas private names start
+;; with "js-".
+;; 
+;; Changes:
+;;
+;; See javascript.el.changelog.
+
+;;; Code:
+
+(require 'cc-mode)
+(require 'font-lock)
+(require 'newcomment)
+
+(defgroup javascript nil 
+  "Customization variables for `javascript-mode'."
+  :tag "JavaScript"
+  :group 'languages)
+
+(defcustom javascript-indent-level 4
+  "Number of spaces for each indentation step."
+  :type 'integer
+  :group 'javascript)
+
+(defcustom javascript-auto-indent-flag t
+  "Automatic indentation with punctuation characters. If non-nil, the
+current line is indented when certain punctuations are inserted."
+  :type 'boolean
+  :group 'javascript)
+
+
+;; --- Keymap ---
+
+(defvar javascript-mode-map nil 
+  "Keymap used in JavaScript mode.")
+
+(unless javascript-mode-map 
+  (setq javascript-mode-map (make-sparse-keymap)))
+
+(when javascript-auto-indent-flag
+  (mapc (lambda (key) 
+	  (define-key javascript-mode-map key 'javascript-insert-and-indent))
+	'("{" "}" "(" ")" ":" ";" ",")))
+
+(defun javascript-insert-and-indent (key)
+  "Run command bound to key and indent current line. Runs the command
+bound to KEY in the global keymap and indents the current line."
+  (interactive (list (this-command-keys)))
+  (call-interactively (lookup-key (current-global-map) key))
+  (indent-according-to-mode))
+
+
+;; --- Syntax Table And Parsing ---
+
+(defvar javascript-mode-syntax-table
+  (let ((table (make-syntax-table)))
+    (c-populate-syntax-table table)
+
+    ;; The syntax class of underscore should really be `symbol' ("_")
+    ;; but that makes matching of tokens much more complex as e.g.
+    ;; "\\<xyz\\>" matches part of e.g. "_xyz" and "xyz_abc". Defines
+    ;; it as word constituent for now.
+    (modify-syntax-entry ?_ "w" table)
+
+    table)
+  "Syntax table used in JavaScript mode.")
+
+
+(defun js-re-search-forward-inner (regexp &optional bound count)
+  "Auxiliary function for `js-re-search-forward'."
+  (let ((parse)
+        (saved-point (point-min)))
+    (while (> count 0)
+      (re-search-forward regexp bound)
+      (setq parse (parse-partial-sexp saved-point (point)))
+      (cond ((nth 3 parse)
+             (re-search-forward 
+              (concat "\\([^\\]\\|^\\)" (string (nth 3 parse))) 
+              (save-excursion (end-of-line) (point)) t))
+            ((nth 7 parse)
+             (forward-line))
+            ((or (nth 4 parse)
+                 (and (eq (char-before) ?\/) (eq (char-after) ?\*)))
+             (re-search-forward "\\*/"))
+            (t
+             (setq count (1- count))))
+      (setq saved-point (point))))
+  (point))
+
+
+(defun js-re-search-forward (regexp &optional bound noerror count)
+  "Search forward but ignore strings and comments. Invokes
+`re-search-forward' but treats the buffer as if strings and
+comments have been removed."
+  (let ((saved-point (point))
+        (search-expr 
+         (cond ((null count)
+                '(js-re-search-forward-inner regexp bound 1))
+               ((< count 0)
+                '(js-re-search-backward-inner regexp bound (- count)))
+               ((> count 0)
+                '(js-re-search-forward-inner regexp bound count)))))
+    (condition-case err
+        (eval search-expr)
+      (search-failed
+       (goto-char saved-point)
+       (unless noerror
+         (error (error-message-string err)))))))
+
+
+(defun js-re-search-backward-inner (regexp &optional bound count)
+  "Auxiliary function for `js-re-search-backward'."
+  (let ((parse)
+        (saved-point (point-min)))
+    (while (> count 0)
+      (re-search-backward regexp bound)
+      (when (and (> (point) (point-min))
+                 (save-excursion (backward-char) (looking-at "/[/*]")))
+        (forward-char))
+      (setq parse (parse-partial-sexp saved-point (point)))
+      (cond ((nth 3 parse)
+             (re-search-backward
+              (concat "\\([^\\]\\|^\\)" (string (nth 3 parse))) 
+              (save-excursion (beginning-of-line) (point)) t))
+            ((nth 7 parse) 
+             (goto-char (nth 8 parse)))
+            ((or (nth 4 parse)
+                 (and (eq (char-before) ?/) (eq (char-after) ?*)))
+             (re-search-backward "/\\*"))
+            (t
+             (setq count (1- count))))))
+  (point))
+
+
+(defun js-re-search-backward (regexp &optional bound noerror count)
+  "Search backward but ignore strings and comments. Invokes
+`re-search-backward' but treats the buffer as if strings and
+comments have been removed."
+  (let ((saved-point (point))
+        (search-expr 
+         (cond ((null count)
+                '(js-re-search-backward-inner regexp bound 1))
+               ((< count 0)
+                '(js-re-search-forward-inner regexp bound (- count)))
+               ((> count 0)
+                '(js-re-search-backward-inner regexp bound count)))))
+    (condition-case err
+        (eval search-expr)
+      (search-failed
+       (goto-char saved-point)
+       (unless noerror
+         (error (error-message-string err)))))))
+
+
+(defun js-continued-var-decl-list-p ()
+  "Return non-nil if point is inside a continued variable declaration
+list."
+  (interactive)
+  (let ((start (save-excursion (js-re-search-backward "\\<var\\>" nil t))))
+    (and start
+	 (save-excursion (re-search-backward "\n" start t))
+	 (not (save-excursion 
+		(js-re-search-backward 
+		 ";\\|[^, \t][ \t]*\\(/[/*]\\|$\\)" start t))))))
+
+
+;; --- Font Lock ---
+
+(defun js-inside-param-list-p ()
+  "Return non-nil if point is inside a function parameter list."
+  (condition-case err
+      (save-excursion
+	(up-list -1)
+	(and (looking-at "(")
+	     (progn (backward-word 1)
+		    (or (looking-at "function")
+			(progn (backward-word 1) (looking-at "function"))))))
+    (error nil)))
+
+
+(defconst js-function-heading-1-re 
+  "^[ \t]*function[ \t]+\\(\\w+\\)"
+  "Regular expression matching the start of a function header.")
+
+(defconst js-function-heading-2-re 
+  "^[ \t]*\\(\\w+\\)[ \t]*:[ \t]*function\\>"
+  "Regular expression matching the start of a function entry in
+  an associative array.")
+
+(defconst js-keyword-re
+  (regexp-opt '("abstract" "break" "case" "catch" "class" "const"
+                "continue" "debugger" "default" "delete" "do" "else" 
+                "enum" "export" "extends" "final" "finally" "for" 
+                "function" "goto" "if" "implements" "import" "in" 
+                "instanceof" "interface" "native" "new" "package" 
+                "private" "protected" "public" "return" "static" 
+                "super" "switch" "synchronized" "this" "throw" 
+                "throws" "transient" "try" "typeof" "var" "void" 
+                "volatile" "while" "with"
+                "let") 'words)
+  "Regular expression matching any JavaScript keyword.")
+
+(defconst js-basic-type-re
+  (regexp-opt '("boolean" "byte" "char" "double" "float" "int" "long"
+                "short" "void") 'words)
+  "Regular expression matching any predefined type in JavaScript.")
+
+(defconst js-constant-re
+  (regexp-opt '("false" "null" "true") 'words)
+  "Regular expression matching any future reserved words in JavaScript.")
+
+
+(defconst js-font-lock-keywords-1
+  (list 
+   "\\<import\\>" 
+   (list js-function-heading-1-re 1 font-lock-function-name-face)
+   (list js-function-heading-2-re 1 font-lock-function-name-face)
+   (list "[=(][ \t]*\\(/.*?[^\\]/\\w*\\)" 1 font-lock-string-face))
+  "Level one font lock.")
+
+(defconst js-font-lock-keywords-2
+  (append js-font-lock-keywords-1
+          (list (list js-keyword-re 1 font-lock-keyword-face)
+                (cons js-basic-type-re font-lock-type-face)
+                (cons js-constant-re font-lock-constant-face)))
+  "Level two font lock.")
+
+
+;; Limitations with variable declarations: There seems to be no
+;; sensible way to highlight variables occuring after an initialized
+;; variable in a variable list. For instance, in
+;;
+;;    var x, y = f(a, b), z
+;;
+;; z will not be highlighted.
+
+(defconst js-font-lock-keywords-3
+  (append 
+   js-font-lock-keywords-2
+   (list 
+
+    ;; variable declarations
+    (list
+     (concat "\\<\\(const\\|var\\)\\>\\|" js-basic-type-re)
+     (list "\\(\\w+\\)[ \t]*\\([=;].*\\|,\\|/[/*]\\|$\\)"
+	   nil
+	   nil
+	   '(1 font-lock-variable-name-face)))
+
+    ;; continued variable declaration list
+    (list
+     (concat "^[ \t]*\\w+[ \t]*\\([,;=]\\|/[/*]\\|$\\)")
+     (list "\\(\\w+\\)[ \t]*\\([=;].*\\|,\\|/[/*]\\|$\\)"
+	   '(if (save-excursion (backward-char) (js-continued-var-decl-list-p))
+		(backward-word 1) 
+	      (end-of-line))
+	   '(end-of-line)
+	   '(1 font-lock-variable-name-face)))
+
+    ;; formal parameters
+    (list
+     (concat "\\<function\\>\\([ \t]+\\w+\\)?[ \t]*([ \t]*\\w")
+     (list "\\(\\w+\\)\\([ \t]*).*\\)?"
+	   '(backward-char)
+	   '(end-of-line)
+	   '(1 font-lock-variable-name-face)))
+    
+    ;; continued formal parameter list
+    (list
+     (concat "^[ \t]*\\w+[ \t]*[,)]")
+     (list "\\w+"
+	   '(if (save-excursion (backward-char) (js-inside-param-list-p))
+		(backward-word 1) 
+	      (end-of-line))
+	   '(end-of-line)
+	   '(0 font-lock-variable-name-face)))))
+  "Level three font lock.")
+
+(defconst js-font-lock-keywords
+  '(js-font-lock-keywords-3 js-font-lock-keywords-1 js-font-lock-keywords-2
+                            js-font-lock-keywords-3)
+  "See `font-lock-keywords'.")
+
+
+;; --- Indentation ---
+
+(defconst js-possibly-braceless-keyword-re
+  (regexp-opt
+   '("catch" "do" "else" "finally" "for" "if" "try" "while" "with" "let")
+   'words)
+  "Regular expression matching keywords that are optionally
+  followed by an opening brace.")
+
+(defconst js-indent-operator-re
+  (concat "[-+*/%<>=&^|?:.]\\([^-+*/]\\|$\\)\\|"
+          (regexp-opt '("in" "instanceof") 'words))
+  "Regular expression matching operators that affect indentation
+  of continued expressions.")
+
+
+(defun js-looking-at-operator-p ()
+  "Return non-nil if text after point is an operator (that is not
+a comma)."
+  (save-match-data
+    (and (looking-at js-indent-operator-re)
+         (or (not (looking-at ":"))
+             (save-excursion
+               (and (js-re-search-backward "[?:{]\\|\\<case\\>" nil t)
+                    (looking-at "?")))))))
+
+
+(defun js-continued-expression-p ()
+  "Returns non-nil if the current line continues an expression."
+  (save-excursion
+    (back-to-indentation)
+    (or (js-looking-at-operator-p)
+        (and (js-re-search-backward "\n" nil t)
+	     (progn 
+	       (skip-chars-backward " \t")
+	       (backward-char)
+	       (and (> (point) (point-min))
+                    (save-excursion (backward-char) (not (looking-at "[/*]/")))
+                    (js-looking-at-operator-p)
+		    (and (progn (backward-char)
+				(not (looking-at "++\\|--\\|/[/*]"))))))))))
+
+
+(defun js-end-of-do-while-loop-p ()
+  "Returns non-nil if word after point is `while' of a do-while
+statement, else returns nil. A braceless do-while statement
+spanning several lines requires that the start of the loop is
+indented to the same column as the current line."
+  (interactive)
+  (save-excursion
+    (save-match-data
+      (when (looking-at "\\s-*\\<while\\>")
+	(if (save-excursion 
+	      (skip-chars-backward "[ \t\n]*}")
+	      (looking-at "[ \t\n]*}"))
+	    (save-excursion 
+	      (backward-list) (backward-word 1) (looking-at "\\<do\\>"))
+	  (js-re-search-backward "\\<do\\>" (point-at-bol) t)
+	  (or (looking-at "\\<do\\>")
+	      (let ((saved-indent (current-indentation)))
+		(while (and (js-re-search-backward "^[ \t]*\\<" nil t)
+			    (/= (current-indentation) saved-indent)))
+		(and (looking-at "[ \t]*\\<do\\>")
+		     (not (js-re-search-forward 
+			   "\\<while\\>" (point-at-eol) t))
+		     (= (current-indentation) saved-indent)))))))))
+
+
+(defun js-ctrl-statement-indentation ()
+  "Returns the proper indentation of the current line if it
+starts the body of a control statement without braces, else
+returns nil."
+  (save-excursion
+    (back-to-indentation)
+    (when (save-excursion
+            (and (not (looking-at "[{]"))
+                 (progn
+                   (js-re-search-backward "[[:graph:]]" nil t)
+                   (forward-char)
+                   (when (= (char-before) ?\)) (backward-list))
+                   (skip-syntax-backward " ")
+                   (skip-syntax-backward "w")
+                   (looking-at js-possibly-braceless-keyword-re))
+                 (not (js-end-of-do-while-loop-p))))
+      (save-excursion
+        (goto-char (match-beginning 0))
+        (+ (current-indentation) javascript-indent-level)))))
+
+
+(defun js-proper-indentation (parse-status)
+  "Return the proper indentation for the current line."
+  (save-excursion
+    (back-to-indentation)
+    (let ((ctrl-stmt-indent (js-ctrl-statement-indentation))
+          (same-indent-p (looking-at "[]})]\\|\\<case\\>\\|\\<default\\>"))
+          (continued-expr-p (js-continued-expression-p)))
+      (cond (ctrl-stmt-indent)
+	    ((js-continued-var-decl-list-p)
+	     (js-re-search-backward "\\<var\\>" nil t)
+	     (+ (current-indentation) javascript-indent-level))
+            ((nth 1 parse-status)
+             (goto-char (nth 1 parse-status))
+             (if (looking-at "[({[][ \t]*\\(/[/*]\\|$\\)")
+                 (progn
+                   (skip-syntax-backward " ")
+                   (when (= (char-before) ?\)) (backward-list))
+                   (back-to-indentation)
+                   (cond (same-indent-p
+                          (current-column))
+                         (continued-expr-p
+                          (+ (current-column) (* 2 javascript-indent-level)))
+                         (t
+                          (+ (current-column) javascript-indent-level))))
+               (unless same-indent-p
+                 (forward-char)
+                 (skip-chars-forward " \t"))
+               (current-column)))
+	    (continued-expr-p javascript-indent-level)
+            (t 0)))))
+
+
+(defun javascript-indent-line ()
+  "Indent the current line as JavaScript source text."
+  (interactive)
+  (let ((parse-status 
+         (save-excursion (parse-partial-sexp (point-min) (point-at-bol))))
+        (offset (- (current-column) (current-indentation))))
+    (when (not (nth 8 parse-status))
+      (indent-line-to (js-proper-indentation parse-status))
+      (when (> offset 0) (forward-char offset)))))
+
+
+;; --- Filling ---
+
+;; FIXME: It should be possible to use the more sofisticated function
+;; `c-fill-paragraph' in `cc-cmds.el' instead. However, just setting
+;; `fill-paragraph-function' to `c-fill-paragraph' does not work;
+;; inside `c-fill-paragraph', `fill-paragraph-function' evaluates to
+;; nil!?
+
+(defun js-backward-paragraph ()
+  "Move backward to start of paragraph. Postcondition: Point is at
+beginning of buffer or the previous line contains only whitespace."
+  (forward-line -1)
+  (while (not (or (bobp) (looking-at "^[ \t]*$")))
+    (forward-line -1))
+  (when (not (bobp)) (forward-line 1)))
+
+
+(defun js-forward-paragraph ()
+  "Move forward to end of paragraph. Postcondition: Point is at
+end of buffer or the next line contains only whitespace."
+  (forward-line 1)
+  (while (not (or (eobp) (looking-at "^[ \t]*$")))
+    (forward-line 1))
+  (when (not (eobp)) (backward-char 1)))
+ 
+
+(defun js-fill-block-comment-paragraph (parse-status justify)
+  "Fill current paragraph as a block comment. PARSE-STATUS is the
+result of `parse-partial-regexp' from beginning of buffer to
+point. JUSTIFY has the same meaning as in `fill-paragraph'."
+  (let ((offset (save-excursion 
+                  (goto-char (nth 8 parse-status)) (current-indentation))))
+    (save-excursion
+      (save-restriction
+        (narrow-to-region (save-excursion 
+                            (goto-char (nth 8 parse-status)) (point-at-bol))
+                          (save-excursion 
+			    (goto-char (nth 8 parse-status))
+			    (re-search-forward "*/")))
+        (narrow-to-region (save-excursion 
+                            (js-backward-paragraph)
+                            (when (looking-at "^[ \t]*$") (forward-line 1))
+                            (point))
+                          (save-excursion 
+                            (js-forward-paragraph) 
+                            (when (looking-at "^[ \t]*$") (backward-char))
+                            (point)))
+        (goto-char (point-min))
+        (while (not (eobp))
+          (delete-horizontal-space)
+          (forward-line 1))
+        (let ((fill-column (- fill-column offset))
+              (fill-paragraph-function nil))
+          (fill-paragraph justify))
+
+        ;; In Emacs 21.4 as opposed to CVS Emacs 22,
+        ;; `fill-paragraph' seems toadd a newline at the end of the
+        ;; paragraph. Remove it!
+        (goto-char (point-max))
+        (when (looking-at "^$") (backward-delete-char 1))
+
+        (goto-char (point-min))
+        (while (not (eobp))
+          (indent-to offset)
+          (forward-line 1))))))
+
+
+(defun js-sline-comment-par-start ()
+  "Return point at the beginning of the line where the current
+single-line comment paragraph starts."
+  (save-excursion
+    (beginning-of-line)
+    (while (and (not (bobp)) 
+                (looking-at "^[ \t]*//[ \t]*[[:graph:]]"))
+      (forward-line -1))
+    (unless (bobp) (forward-line 1))
+    (point)))
+
+
+(defun js-sline-comment-par-end ()
+  "Return point at end of current single-line comment paragraph."
+  (save-excursion
+    (beginning-of-line)
+    (while (and (not (eobp)) 
+                (looking-at "^[ \t]*//[ \t]*[[:graph:]]"))
+      (forward-line 1))
+    (unless (bobp) (backward-char))
+    (point)))
+
+
+(defun js-sline-comment-offset (line)
+  "Return the column at the start of the current single-line
+comment paragraph."
+  (save-excursion 
+    (goto-line line)
+    (re-search-forward "//" (point-at-eol))
+    (goto-char (match-beginning 0))
+    (current-column)))
+
+
+(defun js-sline-comment-text-offset (line)
+  "Return the column at the start of the text of the current
+single-line comment paragraph."
+  (save-excursion
+    (goto-line line)
+    (re-search-forward "//[ \t]*" (point-at-eol))
+    (current-column)))
+
+
+(defun js-at-empty-sline-comment-p ()
+  "Return non-nil if inside an empty single-line comment."
+  (and (save-excursion
+         (beginning-of-line)
+         (not (looking-at "^.*//.*[[:graph:]]")))
+       (save-excursion
+         (re-search-backward "//" (point-at-bol) t))))
+
+         
+(defun js-fill-sline-comments (parse-status justify)
+  "Fill current paragraph as a sequence of single-line comments.
+PARSE-STATUS is the result of `parse-partial-regexp' from
+beginning of buffer to point. JUSTIFY has the same meaning as in
+`fill-paragraph'."
+  (when (not (js-at-empty-sline-comment-p))
+    (let* ((start (js-sline-comment-par-start))
+           (start-line (1+ (count-lines (point-min) start)))
+           (end (js-sline-comment-par-end))
+           (offset (js-sline-comment-offset start-line))
+           (text-offset (js-sline-comment-text-offset start-line)))
+      (save-excursion
+        (save-restriction
+          (narrow-to-region start end)
+          (goto-char (point-min))
+          (while (re-search-forward "^[ \t]*//[ \t]*" nil t)
+            (replace-match "")
+            (forward-line 1))
+          (let ((fill-paragraph-function nil)
+                (fill-column (- fill-column text-offset)))
+            (fill-paragraph justify))
+
+          ;; In Emacs 21.4 as opposed to CVS Emacs 22,
+          ;; `fill-paragraph' seems toadd a newline at the end of the
+          ;; paragraph. Remove it!
+          (goto-char (point-max))
+          (when (looking-at "^$") (backward-delete-char 1))
+
+          (goto-char (point-min))
+          (while (not (eobp))
+            (indent-to offset)
+            (insert "//")
+            (indent-to text-offset)
+            (forward-line 1)))))))
+  
+
+(defun js-trailing-comment-p (parse-status)
+  "Return non-nil if inside a trailing comment. PARSE-STATUS is
+the result of `parse-partial-regexp' from beginning of buffer to
+point."
+  (save-excursion 
+    (when (nth 4 parse-status)
+      (goto-char (nth 8 parse-status))
+      (skip-chars-backward " \t")
+      (not (bolp)))))
+
+
+(defun js-block-comment-p (parse-status)
+  "Return non-nil if inside a block comment. PARSE-STATUS is the
+result of `parse-partial-regexp' from beginning of buffer to
+point."
+  (save-excursion 
+    (save-match-data
+      (when (nth 4 parse-status)
+        (goto-char (nth 8 parse-status))
+        (looking-at "/\\*")))))
+
+
+(defun javascript-fill-paragraph (&optional justify)
+  "If inside a comment, fill the current comment paragraph.
+Trailing comments are ignored."
+  (interactive)
+  (let ((parse-status (parse-partial-sexp (point-min) (point))))
+    (when (and (nth 4 parse-status) 
+               (not (js-trailing-comment-p parse-status)))
+      (if (js-block-comment-p parse-status)
+          (js-fill-block-comment-paragraph parse-status justify)
+        (js-fill-sline-comments parse-status justify))))
+  t)
+
+
+;; --- Imenu ---
+
+(defconst js-imenu-generic-expression 
+  (list
+   (list
+    nil 
+    "function\\s-+\\(\\w+\\)\\s-*("
+    1))
+  "Regular expression matching top level procedures. Used by imenu.")
+
+
+;; --- Main Function ---
+
+;;;###autoload
+(defun javascript-mode ()
+  "Major mode for editing JavaScript source text.
+
+Key bindings:
+
+\\{javascript-mode-map}"
+  (interactive)
+  (kill-all-local-variables)
+
+  (use-local-map javascript-mode-map)
+  (set-syntax-table javascript-mode-syntax-table)
+  (set (make-local-variable 'indent-line-function) 'javascript-indent-line)
+  (set (make-local-variable 'font-lock-defaults) (list js-font-lock-keywords))
+
+  (set (make-local-variable 'parse-sexp-ignore-comments) t) 
+
+  ;; Comments
+  (setq comment-start "// ")
+  (setq comment-end "")
+  (set (make-local-variable 'fill-paragraph-function) 
+       'javascript-fill-paragraph)
+
+  ;; Make c-mark-function work
+  (setq c-nonsymbol-token-regexp "!=\\|%=\\|&[&=]\\|\\*[/=]\\|\\+[+=]\\|-[=-]\\|/[*/=]\\|<\\(?:<=\\|[<=]\\)\\|==\\|>\\(?:>\\(?:>=\\|[=>]\\)\\|[=>]\\)\\|\\^=\\||[=|]\\|[]!%&(-,./:-?[{-~^-]"
+        c-stmt-delim-chars "^;{}?:"
+        c-syntactic-ws-end "[ \n	
+
+        c-syntactic-eol "\\(\\s \\|/\\*\\([^*\n
+]\\|\\*[^/\n
+]\\)*\\*/\\)*\\(\\(/\\*\\([^*\n
+]\\|\\*[^/\n
+]\\)*\\|\\\\\\)?$\\|//\\)")
+
+  ;; Imenu
+  (setq imenu-case-fold-search nil)
+  (set (make-local-variable 'imenu-generic-expression)
+       js-imenu-generic-expression)
+
+  (setq major-mode 'javascript-mode)
+  (setq mode-name "JavaScript")
+  (run-hooks 'javascript-mode-hook))
+
+
+(provide 'javascript-mode)
+;;; javascript.el ends here

File nxhtml/alts/smarty-mode-vdebout.el

+;;; smarty-mode.el --- major mode for editing Smarty templates
+
+;; Author:       Vincent DEBOUT <deboutv@free.fr>
+;; Maintainer:	Vincent DEBOUT <deboutv@free.fr>
+;; Keywords:	languages smarty templates
+;; WWW:		http://deboutv.free.fr/lisp/smarty/
+
+;;; License
+
+;; 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
+;; of the License, or (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; if not, write to the Free Software
+;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+;;; History
+
+;; $Log: smarty-mode.el,v $
+;; Revision 1.6  2006/12/16 19:54:26  vincent
+;; Update release version
+;;
+;; Revision 1.5  2006/12/16 19:53:00  vincent
+;; Fix bug #15
+;;
+;; Revision 1.4  2006/12/16 14:59:46  vincent
+;; Fix bugs for release
+;;
+;; Revision 1.3  2006/11/19 12:29:53  vincent
+;; Fix highlight bug, add templates
+;;
+;; Revision 1.2  2006/11/12 11:44:18  vincent
+;; First release commit
+;;
+
+(defconst smarty-version "0.0.4"
+  "Smarty Mode version number.")
+
+(defconst smarty-time-stamp "2006-12-16"
+  "Smarty Mode time stamp for last update.")
+
+(require 'font-lock)
+(require 'cc-mode)
+(require 'custom)
+(require 'etags)
+(eval-when-compile
+(require 'regexp-opt))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Customization
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defgroup smarty nil
+  "Customizations for Smarty mode."
+  :prefix "smarty-"
+  :group 'languages)
+
+(defgroup smarty-mode nil
+  "Customizations for Smarty mode."
+  :group 'smarty)
+
+(defcustom smarty-electric-mode t
+  "*Non-nil enables electrification (automatic template generation).
+If nil, template generators can still be invoked through key bindings and
+menu.  Is indicated in the modeline by \"/e\" after the mode name and can be
+toggled by `\\[smarty-electric-mode]'."
+  :type 'boolean
+  :group 'smarty-mode)
+
+(defcustom smarty-stutter-mode t
+  "*Non-nil enables stuttering.
+Is indicated in the modeline by \"/s\" after the mode name and can be toggled
+by `\\[smarty-stutter-mode]'."
+  :type 'boolean
+  :group 'smarty-mode)
+
+(defgroup smarty-menu nil
+  "Customizations for menues."
+  :group 'smarty)
+
+(defcustom smarty-source-file-menu t
+  "*Non-nil means add a menu of all source files in current directory."
+  :type 'boolean
+  :group 'smarty-menu)
+
+(defgroup smarty-highlight nil
+  "Customizations for highlight."
+  :group 'smarty)
+
+(defcustom smarty-highlight-plugin-functions t
+  "*Non-nil means highlight the plugin functions in the buffer."
+  :type 'boolean
+  :group 'smarty-highlight)
+
+(defgroup smarty-template nil
+  "Customizations for templates."
+  :group 'smarty)
+
+(defgroup smarty-header nil
+  "Customizations for header template."
+  :group 'smarty-template)
+
+(defcustom smarty-file-header ""
+  "*String or file to insert as file header.
+If the string specifies an existing file name, the contents of the file is
+inserted, otherwise the string itself is inserted as file header.
+Type `C-j' for newlines.
+If the header contains RCS keywords, they may be written as <RCS>Keyword<RCS>
+if the header needs to be version controlled.
+
+The following keywords for template generation are supported:
+  <filename>    : replaced by the name of the buffer
+  <author>      : replaced by the user name and email address
+                  \(`user-full-name',`mail-host-address', `user-mail-address')
+  <login>       : replaced by user login name (`user-login-name')
+  <company>     : replaced by contents of option `smarty-company-name'
+  <date>        : replaced by the current date
+  <year>        : replaced by the current year
+  <copyright>   : replaced by copyright string (`smarty-copyright-string')
+  <cursor>      : final cursor position."
+  :type 'string
+  :group 'smarty-header)
+
+(defcustom smarty-file-footer ""
+  "*String or file to insert as file footer.
+If the string specifies an existing file name, the contents of the file is
+inserted, otherwise the string itself is inserted as file footer (i.e. at
+the end of the file).
+Type `C-j' for newlines.
+The same keywords as in option `smarty-file-header' can be used."
+  :type 'string
+  :group 'smarty-header)
+
+(defcustom smarty-company-name ""
+  "*Name of company to insert in file header.
+See option `smarty-file-header'."
+  :type 'string
+  :group 'smarty-header)
+
+(defcustom smarty-copyright-string ""
+  "*Copyright string to insert in file header.
+Can be multi-line string (type `C-j' for newline) and contain other file
+header keywords (see option `smarty-file-header')."
+  :type 'string
+  :group 'smarty-header)
+
+(defcustom smarty-date-format "%Y-%m-%d"
+  "*Specifies the date format to use in the header.
+This string is passed as argument to the command `format-time-string'.
+For more information on format strings, see the documentation for the
+`format-time-string' command (C-h f `format-time-string')."
+  :type 'string
+  :group 'smarty-header)
+
+(defcustom smarty-modify-date-prefix-string ""
+  "*Prefix string of modification date in Smarty file header.
+If actualization of the modification date is called (menu,
+`\\[smarty-template-modify]'), this string is searched and the rest
+of the line replaced by the current date."
+  :type 'string
+  :group 'smarty-header)
+
+(defcustom smarty-modify-date-on-saving nil
+  "*Non-nil means update the modification date when the buffer is saved.
+Calls function `\\[smarty-template-modify]').
+
+NOTE: Activate the new setting in a Smarty buffer by using the menu entry
+      \"Activate Options\"."
+  :type 'boolean
+  :group 'smarty-header)
+
+(defgroup smarty-misc nil
+  "Miscellaneous customizations."
+  :group 'smarty)
+
+(defcustom smarty-left-delimiter "{"
+  "Left escaping delimiter."
+  :type 'string
+  :group 'smarty-misc)
+
+(defcustom smarty-right-delimiter "}"
+  "Right escaping delimiter."
+  :type 'string
+  :group 'smarty-misc)
+
+(defcustom smarty-intelligent-tab t
+  "*Non-nil means `TAB' does indentation, word completion and tab insertion.
+That is, if preceding character is part of a word then complete word,
+else if not at beginning of line then insert tab,
+else if last command was a `TAB' or `RET' then dedent one step,
+else indent current line (i.e. `TAB' is bound to `smarty-electric-tab').
+If nil, TAB always indents current line (i.e. `TAB' is bound to
+`indent-according-to-mode').
+
+NOTE: Activate the new setting in a Smarty buffer by using the menu entry
+      \"Activate Options\"."
+  :type 'boolean
+  :group 'smarty-misc)
+
+(defcustom smarty-word-completion-in-minibuffer t
+  "*Non-nil enables word completion in minibuffer (for template prompts).
+
+NOTE: Activate the new setting by restarting Emacs."
+  :type 'boolean
+  :group 'smarty-misc)
+
+(defcustom smarty-word-completion-case-sensitive nil
+  "*Non-nil means word completion using `TAB' is case sensitive.
+That is, `TAB' completes words that start with the same letters and case.
+Otherwise, case is ignored."
+  :type 'boolean
+  :group 'smarty-misc)
+
+;; Functions
+
+(defun smarty-customize ()
+  "Call the customize function with `smarty' as argument."
+  (interactive)
+  (customize-browse 'smarty))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Variables
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar smarty-menu-max-size 20
+  "*Specifies the maximum size of a menu before splitting it into submenues.")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Menu tools functions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun smarty-menu-split (list title)
+  "Split menu LIST into several submenues, if number of
+elements > `smarty-menu-max-size'."
+  (if (> (length list) smarty-menu-max-size)
+      (let ((remain list)
+	    (result '())
+	    (sublist '())
+	    (menuno 1)
+	    (i 0))
+	(while remain
+	  (setq sublist (cons (car remain) sublist))
+	  (setq remain (cdr remain))
+	  (setq i (+ i 1))
+	  (if (= i smarty-menu-max-size)
+	      (progn
+		(setq result (cons (cons (format "%s %s" title menuno)
+					 (nreverse sublist)) result))
+		(setq i 0)
+		(setq menuno (+ menuno 1))
+		(setq sublist '()))))
+	(and sublist
+	     (setq result (cons (cons (format "%s %s" title menuno)
+				      (nreverse sublist)) result)))
+	(nreverse result))
+    list))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Source file menu
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar smarty-sources-menu nil)
+
+;; Create the source menu
+(defun smarty-add-source-files-menu ()
+  "Scan directory for all Smarty source files and generate menu.
+The directory of the current source file is scanned."
+  (interactive)
+  (message "Scanning directory for source files ...")
+  (let ((newmap (current-local-map))
+	(file-list (smarty-get-source-files))
+	menu-list found)
+    ;; Create list for menu
+    (setq found nil)
+    (while file-list
+      (setq found t)
+      (setq menu-list (cons (vector (car file-list)
+				   (list 'find-file (car file-list)) t)
+			   menu-list))
+      (setq file-list (cdr file-list)))
+    (setq menu-list (smarty-menu-split menu-list "Sources"))
+    (when found (setq menu-list (cons "--" menu-list)))
+    (setq menu-list (cons ["*Rescan*" smarty-add-source-files-menu t] menu-list))
+    (setq menu-list (cons "Sources" menu-list))
+    ;; Create menu
+    (easy-menu-add menu-list)
+    (easy-menu-define smarty-sources-menu newmap
+		      "Smarty source files menu" menu-list))
+  (message ""))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Smarty menu
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun smarty-create-mode-menu ()
+  "Create Smarty Mode menu."
+  `("Smarty"
+    ("Templates"
+     ("Built-in Functions"
+      ["capture" smarty-template-capture t]
+      ["config_load" smarty-template-config-load t]
+      ["else" smarty-template-else t]
+      ["elseif" smarty-template-elseif t]
+      ["foreach" smarty-template-foreach t]
+      ["foreachelse" smarty-template-foreachelse t]
+      ["if" smarty-template-if t]
+      ["include" smarty-template-include t]
+      ["include_php" smarty-template-include-php t]
+      ["insert" smarty-template-insert t]
+      ["ldelim" smarty-template-ldelim t]
+      ["literal" smarty-template-literal t]
+      ["php" smarty-template-php t]
+      ["rdelim" smarty-template-rdelim t]
+      ["section" smarty-template-section t]
+      ["sectionelse" smarty-template-sectionelse t]
+      ["strip" smarty-template-strip t])
+     ("Custom Functions"
+      ["assign" smarty-template-assign t]
+      ["counter" smarty-template-counter t]
+      ["cycle" smarty-template-cycle t]
+      ["debug" smarty-template-debug t]
+      ["eval" smarty-template-eval t]
+      ["fetch"  smarty-template-fetch t]
+      ["html_checkboxes" smarty-template-html-checkboxes t]
+      ["html_image" smarty-template-html-image t]
+      ["html_options" smarty-template-html-options t]
+      ["html_radios" smarty-template-html-radios t]
+      ["html_select_date" smarty-template-html-select-date t]
+      ["html_select_time" smarty-template-html-select-time t]
+      ["html_table" smarty-template-html-table t]
+      ["mailto" smarty-template-mailto t]
+      ["math" smarty-template-math t]
+      ["popup" smarty-template-popup t]
+      ["popup_init" smarty-template-popup-init t]
+      ["textformat" smarty-template-textformat t])
+     ("Variable Modifiers"
+      ["capitalize" smarty-template-capitalize t]
+      ["cat" smarty-template-cat t]
+      ["count_characters" smarty-template-count-characters t]
+      ["count_paragraphs" smarty-template-count-paragraphs t]
+      ["count_sentences" smarty-template-count-sentences t]
+      ["count_words" smarty-template-count-words t]
+      ["date_format" smarty-template-date-format t]
+      ["default" smarty-template-default t]
+      ["escape" smarty-template-escape t]
+      ["indent" smarty-template-indent t]
+      ["lower" smarty-template-lower t]
+      ["nl2br" smarty-template-nl2br t]
+      ["regex_replace" smarty-template-regex-replace t]
+      ["replace" smarty-template-replace t]
+      ["spacify" smarty-template-spacify t]
+      ["string_format" smarty-template-string-format t]
+      ["strip" smarty-template-vstrip t]
+      ["strip_tags" smarty-template-strip-tags t]
+      ["truncate" smarty-template-truncate t]
+      ["upper" smarty-template-upper t]
+      ["wordwrap" smarty-template-wordwrap t])
+     ("Plugins (Functions)"
+      ("SmartyFormtool"
+       ["formtool_checkall" smarty-template-formtool-checkall t]
+       ["formtool_copy" smarty-template-formtool-copy t]
+       ["formtool_count_chars" smarty-template-formtool-count-chars t]
+       ["formtool_init" smarty-template-formtool-init t]
+       ["formtool_move" smarty-template-formtool-move t]
+       ["formtool_moveall" smarty-template-formtool-moveall t]
+       ["formtool_movedown" smarty-template-formtool-movedown t]
+       ["formtool_moveup" smarty-template-formtool-moveup t]
+       ["formtool_remove" smarty-template-formtool-remove t]
+       ["formtool_rename" smarty-template-formtool-rename t]
+       ["formtool_save" smarty-template-formtool-save t]
+       ["formtool_selectall" smarty-template-formtool-selectall t])
+      ("SmartyPaginate"
+       ["paginate_first" smarty-template-paginate-first t]
+       ["paginate_last" smarty-template-paginate-last t]
+       ["paginate_middle" smarty-template-paginate-middle t]
+       ["paginate_next" smarty-template-paginate-next t]
+       ["paginate_prev" smarty-template-paginate-prev t])
+      ("SmartyValidate"
+       ["validate" smarty-template-validate t]))
+     ("Plugins (Variable Modifiers)"
+      ("AlternativeDateModifierPlugin"
+       ["date_format2" smarty-template-date-formatto t])
+      ("B2Smilies"
+       ["B2Smilies" smarty-template-btosmilies t])
+      ("BBCodePlugin"
+       ["bbcode2html" smarty-template-bbcodetohtml t])
+      )
+     "--"
+     ["Insert Header" smarty-template-header t]
+     ["Insert Footer" smarty-template-footer t]
+     ["Insert Date" smarty-template-insert-date t]
+     ["Modify Date" smarty-template-modify t])
+    "--"
+    ["Show Messages" smarty-show-messages :keys "C-c M-m"]
+    ["Smarty Mode Documentation" smarty-doc-mode :keys "C-c C-h"]
+    ["Version" smarty-version :keys "C-c C-v"]
+    "--"
+    ("Options"
+     ("Mode"
+      ["Electric Mode"
+       (progn (customize-set-variable 'smarty-electric-mode
+				      (not smarty-electric-mode))
+	      (smarty-mode-line-update))
+       :style toggle :selected smarty-electric-mode :keys "C-c C-m C-e"]
+      ["Stutter Mode"
+       (progn (customize-set-variable 'smarty-stutter-mode
+				      (not smarty-stutter-mode))
+	      (smarty-mode-line-update))
+       :style toggle :selected smarty-stutter-mode :keys "C-c C-m C-s"]
+      "--"
+      ["Customize Group..." (customize-group 'smarty-mode) t])
+     ("Menu"
+      ["Source Menu"
+       (customize-set-variable 'smarty-source-file-menu
+			       (not smarty-source-file-menu))
+       :style toggle :selected smarty-source-file-menu]
+      "--"
+      ["Customize Group..." (customize-group 'smarty-menu) t])
+     ("Highlight"
+      ["Highlight plugin functions"