As or rev 5348, patterns of the form !<command-name>! get translated
to the key binding for command-name, or the string <Alt-x>command-
name<Return> if there is no key binding.
Example 1: docstring for isearch-forward::
'''Begin a forward incremental search.
- Plain characters extend the search.
- !<isearch-forward>! repeats the search.
- Esc or !<keyboard-quit>! abort the search and restore the
original cursor.
'''
help-for-command renders this (roughly) as::
isearch-forward (Alt+S) [A bold title]
Begin a forward incremental search.
- Plain characters extend the search.
- Alt+S repeats the search.
- Esc or Ctrl+G abort the search and restore the original cursor.
Example 2: docstring for isearch-forward-regex
'''Begin a forward incremental regexp search.
- Plain characters extend the search.
- !<isearch-forward-regexp>! repeats the search.
- Esc or !<keyboard-quit>! aborts the search and restore the
original cursor.
'''
help-for-command renders this roughly as::
isearch-forward-regexp [ A bold title]
Begin a forward incremental regexp search.
- Plain characters extend the search.
- <Alt-X>isearch-forward-regexp<Return> repeats the search.
- Esc or Ctrl+G aborts the search and restore the original cursor.
The differences between theses two examples:
1. The shortcut (Alt-S) for isearch-forward is shown in the bold
title.
2. Because isearch-forward-regex has no shortcut, !<isearch-forward-
regex>! gets
translated into <Alt-X>isearch-forward-regexp<Return>
This is just a bit kludgy, but it does what is intended with a minimum
of fuss, without using a more "official" templating system. Indeed, a
templating system wouldn't know about Leo bindings, so all the "real"
work done by the new code would still have to be done even with a
templating system.
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.