[template-menu-checkins] CVS: template-menu README,1.1.1.1,1.2
Brought to you by:
xmldoc
From: Michael S. <xm...@us...> - 2003-12-08 03:57:48
|
Update of /cvsroot/template-menu/template-menu In directory sc8-pr-cvs1:/tmp/cvs-serv20056 Modified Files: README Log Message: updated for v0.92 Index: README =================================================================== RCS file: /cvsroot/template-menu/template-menu/README,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -U2 -r1.1.1.1 -r1.2 --- README 6 Dec 2003 03:07:46 -0000 1.1.1.1 +++ README 8 Dec 2003 03:57:45 -0000 1.2 @@ -1,10 +1,9 @@ -------------------------------------------------------------------- Commentary ------------------------------------------------------------------- This package adds an "Insert Template" submenu to your File - menu. It relies on Christoph Wedler's `template' package. + menu. It relies on Christoph Wedler's `template' package. The way it works is this: Given the name of a directory, - `template-menu': + `template-menu-mode' 1. Searches through that directory and all its subdirectories for @@ -24,10 +23,10 @@ 0. First download and install the Christoph Wedler's `template' - package. You can get it from: + package. You can get it from: http://emacs-template.sourceforge.net/ - `template-menu' will not work at all unless you already have - `template' installed. + `template-menu-mode' will not work at all unless you already + have `template' installed. In particular, make sure you have the following `template' @@ -39,10 +38,9 @@ 1. Either put this file into a directory that's already in your load path, or add whatever directory it's already in to your - load path. For example, + load path. For example, (add-to-list 'load-path "c:/my-xml-stuff/elisp/") -2. Add the following to the end of your .emacs file exactly as - shown: +2. Add the following to your .emacs file exactly as shown: (require 'templ-menu) @@ -52,45 +50,63 @@ the directory you plan to use as your base templates directory. -4. Set a value for the `template-menu-template-dir' option, so that - `template-menu' where you find your template files. See the - Customization section for details. +4. Add the following to your .emacs file, replacing "c:/FOO" with + whatever the path to your base templates directory is. + + (template-menu-build-menu-from-dir "c:/FOO") -Convention for Naming Template Files ------------------------------------- +File-naming Conventions for Controlling Formatting of Menu Names +---------------------------------------------------------------- The names of the menu items are generated based on the file names -found. To generate the menu names `template-menu': +found. Use underscores and dots in your files to control formatting +of menu names. - - removes the ".tpl" extension - - replaces any underscores in the name with spaces - - puts the word in the result into uppercase - -So, if you have a template file for which you want the associated -menu-item name to be "Log Event", give the template file the name -log_event.tpl. +For example, suppose that you give a file the following name: -------------------------------------------------------------------- -Customization -------------------------------------------------------------------- + formal_article.journal.risx.tpl + +Based on that filename, `template-menu-mode' does the following +in order to generate a corresponding menu name for that file. + + 1. Removes the ".tpl" extension: + => formal_article.journal.risx + + 2. Replaces any underscores in the name with spaces: + => formal article.journal.risx -Currently, the only option you can (and must) customize is the -`template-menu-template-dir'option, which specifies the path to -the directory where you have template files stored. + 3. Surrounds the part of the name after the first dot with parens: + => formal article (journal.risx) -To customize that option, either: + 4. Replaces any remaining dots in the filename with commas: + => formal article (journal, risx) - - type \M-x customize-group<return>template-menu<return>, set - the value there, then restart your Emacs + 5. Uppercases the initial letter of each word in the result: + => Formal Article (Journal, Risx) - or +------------------------------------------------------------------- +Customization +------------------------------------------------------------------- + There are currently no user-customizable options. + +------------------------------------------------------------------- +History +------------------------------------------------------------------- + 2003-12-03 v0.92 + Updated `template-menu-make-submenu-name' do some smarter + formatting (based on suggestions and examples from Bruce D'Arcus). - - Adding something similar to the following to your .emacs file: + 2003-11-28 v0.91 + Added `template-menu-get-file-list' function for discovering + template files and dynamically generating the menu based on what + it finds (based on suggestion from Bruce D'Arcus). - (setq template-menu-template-dir "c:/my-emacs-stuff/templates") + 2003-11-19 v0.90 + initial version - IMPORTANT: Make sure to place the line above so that appears in - your .emacs file somewhere before the - (require 'templ-menu) line you added when you - installed `template-menu'. If it appears after the - (require 'templ-menu) line, it won't work. +------------------------------------------------------------------- +Acknowledgements +------------------------------------------------------------------- +Thanks to Bruce D'Arcus for patiently testing and providing many +suggestions, including the idea of having contents of the menu +created automatically based on discovery of template files. ------------------------------------------------------------------- |