[Top] | [Contents] | [Index] | [ ? ] |
1. Introduction | ||
2. Installation | ||
3. Customization | ||
4. Menus | ||
5. Stuttering | ||
6. Templates | ||
7. Bugs, Help | ||
Index | ||
Customizations variables Index | ||
Functions Index | ||
Stuttering Index | ||
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Smarty-Mode is a mode allowing easy edit of Smarty templates: highlight, templates, navigation into source files...
Features (new features in bold) :
This manual describes Smarty Mode version 0.0.1.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.1 Requirements | ||
2.2 Download | ||
2.3 Installation | ||
2.4 Invoke Smarty-Mode | ||
Installation | ||
---|---|---|
2.3.1 Installation | ||
2.3.2 Update |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Smarty Mode is a XEmacs major mode that needs the following software/packages:
Before continuing, you must be sure to have all this packages installed.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Two internet address to download Smarty Mode :
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.3.1 Installation | ||
2.3.2 Update |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To install Smarty Mode you need to choose an installation directory (for example `/usr/local/share/lisp' or `c:\lisp'). The administrator must have the write rights on this directory.
With your favorite unzip software, unzip the archive in the installation directory.
Example:
cd /usr/local/share/lisp tar zxvf smarty-0.0.1.tar.gz |
Now you have a `smarty' directory in the installation directory. This directory contains 2 files `smarty-mode.el' and `smarty-mode.elc' and another directory `docs' containing the documentation.
You need to configure XEmacs. open you initialization file `init.el' (open the file or start XEmacs then choose the Options menu and Edit Init File). Add the following lines (the installation directory in this example is `/usr/local/share/lisp') :
(setq load-path (append (list "/usr/local/share/lisp/") load-path)) (autoload 'smarty-mode "smarty-mode" "Smarty Mode" t) |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The update is easy. You need to unzip the archive in the installation directory to remove the old release.
Example:
cd /usr/local/share/lisp rm -rf smarty tar zxvf smarty-0.0.1.tar.gz |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You have two possibilities to invoke the Smarty Mode.
M-x smarty-mode
(setq auto-mode-alist (append '(("\\.tpl$" . smarty-mode)) auto-mode-alist)) |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This chapter describes the differents parameters and functions that you can change to customize Smarty Mode. To do that, open a Smarty file, click on the Smarty menu and choose Options then Browse Options....
3.1 Parameters | ||
3.2 Functions | ||
Paramètres | ||
---|---|---|
3.1.1 Mode | ||
3.1.2 Menu | ||
3.1.3 Templates | ||
3.1.4 Miscellaneous | ||
Fonctions | ||
3.2.1 Mode |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.1.1 Mode | ||
3.1.2 Menu | ||
3.1.3 Templates | ||
3.1.4 Miscellaneous |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Smarty Mode has 2 modes allowing to simplify the writing of Smarty templates. You can enable/disable each mode individually.
Type: boolean
Default value: `t'
Description: If `t'; enable automatic generation of template.
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
Default value: `t'
Description: If `t'; enable the stuttering. Is indicated in
the modeline by "/s" after the mode name and can be toggled by `smarty-stutter-mode'.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Smarty Mode has also 2 menus tha you can enable/disable. The menus Index and Sources are specific to each Smarty files opened.
Type: boolean
Default value: `t'
Description: If `t'; the Sources menu is enabled. This
menu contains the list of Smarty file located in the current directory. The Sources menu scans
the directory when a file is opened.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.1.3.1 Header |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Type: string
Default value: `""'
Description: 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.
The follonwing keywords are supported:
<filename>: replaced by
the file name.
<author>: replaced by the user name and email address.
<login>:
replaced by `user-login-name'.
<company>: replaced by `smarty-company-name' content.
<date>:
replaced by the current date.
<year>: replaced by the current year.
<copyright>: replaced by
`smarty-copyright-string' content.
<cursor>: final cursor position.
Type: string
Default value: `""'
Description: String or file to insert as file footer.
See `smarty-file-header'
Type: string
Default value: `""'
Description: Name of the company to insert in file header.
Type: string
Default value: `""'
Description: Coryright string to insert in file header.
Type: string
Default value: `"%Y-%m-%d"'
Description: Date format.
Type: string
Default value: `""'
Description: Prefix string of
modification date in Smarty file header.
Type: bool
Default value: `nil'
Description: If `t'; update the modification date
when the buffer is saved.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Type: string
Default value: `""'
Description: Left escaping delimiter for Smarty templates.
Type: string
Default value: `""'
Description: Right escaping delimiter for Smarty templates.
Type: bool
Default value: `t'
Description: If `t'; TAB does indentation; completion and
insert tabulations. If `nil'; TAB does only indentation.
Type: bool
Default value: `t'
Description: If `t'; enable completion in the
minibuffer.
Type: bool
Default value: `nil'
Description: If `t'; completion is case
sensitive.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.2.1 Mode |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Menu: Smarty -> Options -> Mode -> Electric Mode
Keybinding: C-c C-m C-e
Description: This functions is used to enable/disable the electric mode.
Menu: Smarty -> Options -> Mode -> Stutter Mode
Keybinding: C-c C-m C-s
Description: This function is used to enable/disable the stutter mode.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
There are 2 menus: Smarty and Sources. All theses menus can be accessed from the menubar or from the right click. This chapter describes each menus.
4.1 Smarty | ||
4.2 Sources |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This is the main menu of Smarty Mode. It allows an easy access to the main features of the Smarty Mode: Templates (see Templates) and Options (see Customization).
This menu contains also 3 functions that are discussed in the next part.
4.1.1 Functions |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Menu: Smarty -> Show Messages
Keybinding: C-c M-m
Description: This function opens the *Messages* buffer to display previous error messages.
Menu: Smarty -> Smarty Mode Documentation
Keybinding: C-c C-h
Description: This function opens the *Help* buffer and prints in it the Smarty Mode documentation.
Menu: Smarty -> Version
Keybinding: C-c C-v
Description: This function displays in the minibuffer the current Smarty Mode version with the timestamp.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The Sources menu shows the Smarty files in the current directory. If you add or delete a file in the current directory, you need to refresh the menu.
4.2.1 Customization | ||
4.2.2 Functions |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Type: boolean
Default value: `t'
Description: If `t'; the Sources menu is enabled. This
menu contains the list of Smarty file located in the current directory. The Sources menu scans
the directory when a file is opened.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Menu: Sources -> *Rescan*
Keybinding: C-c C-s C-u
Description: This function is used to refresh the Sources menu.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The stutter mode is a mode that affects a function to a key. For example, when you use the ENTER key, the associated function will create a new line and indent it.
5.1 Customization | ||
5.2 Functions |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Type: boolean
Default value: `t'
Description: If `t'; enable the stuttering. Is indicated in
the modeline by "/s" after the mode name and can be toggled by `smarty-stutter-mode'.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If in comment, indent the comment and add new line if necessary. In other case, add a space.
If the previous character is a `(', the `((' will be replaced by `['.
If the previous character is a `[', the `[(' will be replaced by `{'.
In other case, insert a `('.
If the previous character is a `)', the `))' will be replaced by `]'.
If the previous character is a `]', the `])' will be replaced by `}'.
In other case, insert a `)'.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In the Smarty Mode, the Smarty functions (like if, while, for, fopen, fclose) are predefined in functions called "Templates".
Each template can be invoked by the function name or by using the SPACE key after the Smarty function name in the buffer (Note, using M-SPACE disable the template).
A template can be aborted by using the C-g or by lefting empty the tempate prompt (in the minibuffer).
6.1 Customization | ||
6.2 Functions |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Type: boolean
Default value: `t'
Description: If `t'; enable automatic generation of template.
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'.
For a complete description of the template customizable variables, see Templates
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.2.1 Built-in Functions | ||
6.2.2 Custom Functions | ||
6.2.3 Variable Modifiers | ||
6.2.4 Non-Smarty Functions |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Menu: Smarty -> Templates -> Build-in Functions -> capture
Keybinding: none
Description:
Menu: Smarty -> Templates -> Build-in Functions -> config_load
Keybinding: none
Description:
Menu: Smarty -> Templates -> Build-in Functions -> else
Keybinding: none
Description:
Menu: Smarty -> Templates -> Build-in Functions -> elseif
Keybinding: none
Description:
Menu: Smarty -> Templates -> Build-in Functions -> foreach
Keybinding: none
Description:
Menu: Smarty -> Templates -> Build-in Functions -> foreachelse
Keybinding: none
Description:
Menu: Smarty -> Templates -> Build-in Functions -> if
Keybinding: none
Description:
Menu: Smarty -> Templates -> Build-in Functions -> include
Keybinding: none
Description:
Menu: Smarty -> Templates -> Build-in Functions -> include_php
Keybinding: none
Description:
Menu: Smarty -> Templates -> Build-in Functions -> insert
Keybinding: none
Description:
Menu: Smarty -> Templates -> Build-in Functions -> ldelim
Keybinding: none
Description:
Menu: Smarty -> Templates -> Build-in Functions -> literal
Keybinding: none
Description:
Menu: Smarty -> Templates -> Build-in Functions -> php
Keybinding: none
Description:
Menu: Smarty -> Templates -> Build-in Functions -> rdelim
Keybinding: none
Description:
Menu: Smarty -> Templates -> Build-in Functions -> section
Keybinding: none
Description:
Menu: Smarty -> Templates -> Build-in Functions -> sectionelse
Keybinding: none
Description:
Menu: Smarty -> Templates -> Build-in Functions -> strip
Keybinding: none
Description:
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Menu: Smarty -> Templates -> Custom Functions -> assign
Keybinding: none
Description:
Menu: Smarty -> Templates -> Custom Functions -> counter
Keybinding: none
Description:
Menu: Smarty -> Templates -> Custom Functions -> cycle
Keybinding: none
Description:
Menu: Smarty -> Templates -> Custom Functions -> debug
Keybinding: none
Description:
Menu: Smarty -> Templates -> Custom Functions -> eval
Keybinding: none
Description:
Menu: Smarty -> Templates -> Custom Functions -> fetch
Keybinding: none
Description:
Menu: Smarty -> Templates -> Custom Functions -> html_checkboxes
Keybinding: none
Description:
Menu: Smarty -> Templates -> Custom Functions -> html_image
Keybinding: none
Description:
Menu: Smarty -> Templates -> Custom Functions -> html_options
Keybinding: none
Description:
Menu: Smarty -> Templates -> Custom Functions -> html_radios
Keybinding: none
Description:
Menu: Smarty -> Templates -> Custom Functions -> html_select_date
Keybinding: none
Description:
Menu: Smarty -> Templates -> Custom Functions -> html_select_time
Keybinding: none
Description:
Menu: Smarty -> Templates -> Custom Functions -> html_table
Keybinding: none
Description:
Menu: Smarty -> Templates -> Custom Functions -> mailto
Keybinding: none
Description:
Menu: Smarty -> Templates -> Custom Functions -> math
Keybinding: none
Description:
Menu: Smarty -> Templates -> Custom Functions -> popup
Keybinding: none
Description:
Menu: Smarty -> Templates -> Custom Functions -> popup_init
Keybinding: none
Description:
Menu: Smarty -> Templates -> Custom Functions -> textformat
Keybinding: none
Description:
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Menu: Smarty -> Templates -> Variable Modifiers -> capitalize
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> cat
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> count_characters
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> count_paragraphs
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> count_sentences
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> count_words
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> date_format
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> default
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> escape
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> indent
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> lower
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> nl2br
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> regex_replace
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> replace
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> spacify
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> string_format
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> strip
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> strip_tags
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> truncate
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> upper
Keybinding: none
Description:
Menu: Smarty -> Templates -> Variable Modifiers -> wordwrap
Keybinding: none
Description:
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Menu: Smarty -> Templates -> Insert Header
Keybinding: none
Description: This function is used to insert a header in the current buffer.
Menu: Smarty -> Templates -> Insert Footer
Keybinding: none
Description: This function is used to insert a footer in the current buffer.
Menu: Smarty -> Templates -> Insert Date
Keybinding: none
Description: This function is used to insert the date in the current buffer.
Menu: Smarty -> Templates -> Modify Date
Keybinding: none
Description: This function is used to modify the last modification date in the current buffer.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Jump to: | B C F H M N P S T V |
---|
Jump to: | B C F H M N P S T V |
---|
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Jump to: | S |
---|
Jump to: | S |
---|
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Jump to: | S |
---|
Jump to: | S |
---|
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Jump to: | (
)
S |
---|
Index Entry | Section | |
---|---|---|
| ||
( | ||
( | 5.2 Functions | |
| ||
) | ||
) | 5.2 Functions | |
| ||
S | ||
SPACE | 5.2 Functions | |
|
Jump to: | (
)
S |
---|
[Top] | [Contents] | [Index] | [ ? ] |
[Top] | [Contents] | [Index] | [ ? ] |
[Top] | [Contents] | [Index] | [ ? ] |
This document was generated by Vincent DEBOUT on November, 12 2006 using texi2html 1.76.
The buttons in the navigation panels have the following meaning:
Button | Name | Go to | From 1.2.3 go to |
---|---|---|---|
[ < ] | Back | previous section in reading order | 1.2.2 |
[ > ] | Forward | next section in reading order | 1.2.4 |
[ << ] | FastBack | beginning of this chapter or previous chapter | 1 |
[ Up ] | Up | up section | 1.2 |
[ >> ] | FastForward | next chapter | 2 |
[Top] | Top | cover (top) of document | |
[Contents] | Contents | table of contents | |
[Index] | Index | index | |
[ ? ] | About | about (help) |
where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:
This document was generated by Vincent DEBOUT on November, 12 2006 using texi2html 1.76.