Changes between Version 1 and Version 2 of HemlockProgrammer/Modes
- Timestamp:
- 01/14/08 19:16:05 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
HemlockProgrammer/Modes
v1 v2 1 [HemlockProgrammer Back to Table of Contents] 1 2 [[PageOutline]] 2 3 … … 5 6 A mode is a collection of Hemlock values which may be present in the 6 7 current environment (page 21) depending on the editing task at hand. 7 Examples of typical modes are Lisp, for editing Lisp code, and Echo 8 Area, for prompting in the echo area. 8 An example of a typical mode is Lisp, for editing Lisp code. 9 9 10 == 8.1. Mode Hooks == 10 == 8.1. Mode Hooks ==#ModeHooks 11 11 12 12 When a mode is added to or removed from a buffer, its mode hook is … … 14 14 and t if the mode is being added or nil if it is being removed. Mode 15 15 hooks are typically used to make a mode do something additional to 16 what it usually does. One might, for example, make a text mode hook16 what it usually does. One might, for example, make a Text mode hook 17 17 that turned on auto-fill mode when you entered. 18 18 19 == 8.2. Major and Minor Modes == 19 == 8.2. Major and Minor Modes ==#MajorAndMinorModes 20 20 21 21 There are two kinds of modes, major modes and minor modes. A buffer … … 31 31 are in effect. 32 32 33 Default Modes(initial value("Fundamental" "Save")) [Hemlock Variable]33 `Default Modes` (initial value `'("Fundamental" "Save")`) [Hemlock Variable] 34 34 35 35 This variable contains a list of mode names which are instantiated in 36 36 a buffer when no other information is available. 37 37 38 *mode-names*[Variable]38 `*mode-names*` [Variable] 39 39 40 40 Holds a string-table of the names of all the modes. 41 41 42 Illegal[Command]42 `Illegal` [Command] 43 43 44 44 This is a useful command to bind in modes that wish to shadow global … … 47 47 command calls editor-error. 48 48 49 == 8.3. Mode Functions == 50 defmode name &key :setup-function :cleanup-function :major-p [Function] 51 :precedence :transparent-p :documentation 49 == 8.3. Mode Functions ==#ModeFunctions 50 51 `defmode` name &key :setup-function :cleanup-function :major-p :precedence :transparent-p :documentation [Function] 52 52 53 53 This function defines a new mode named name, and enters it in … … 67 67 determines which value is found when there are several definitions. 68 68 69 Transparent-p determines whether key bindings local to the defined mode69 Transparent-p determines whether key bindings local to the defined mode 70 70 are transparent. Transparent key bindings are invoked in addition to 71 71 the first normal key binding found rather than shadowing less local 72 72 key bindings. 73 73 74 Documentation is some introductory text about the mode. Commands such74 Documentation is some introductory text about the mode. Commands such 75 75 as Describe Mode use this. 76 76 77 mode-documentationname [Function]77 `mode-documentation` name [Function] 78 78 79 79 This function returns the documentation for the mode named name. 80 80 81 buffer-major-mode buffer [Function] 82 83 Buffer Major Mode Hook [Hemlock Variable] 81 `buffer-major-mode` buffer [Function][[BR]] 82 `Buffer Major Mode Hook` [Hemlock Variable] 84 83 85 84 buffer-major-mode returns the name of buffer's major mode. The major … … 87 86 with buffer and the new mode. 88 87 89 buffer-minor-mode buffer name [Function] 90 91 Buffer Minor Mode Hook [Hemlock Variable] 88 `buffer-minor-mode` buffer name [Function][[BR]] 89 `Buffer Minor Mode Hook` [Hemlock Variable][[BR]] 92 90 93 91 buffer-minor-mode returns t if the minor mode name is active in … … 96 94 new value. 97 95 98 mode-variablesname [Function]96 `mode-variables` name [Function] 99 97 100 98 Returns the string-table of mode local variables. 101 99 102 mode-major-pname [Function]100 `mode-major-p` name [Function] 103 101 104 102 Returns t if name is the name of a major mode, or nil if it is the … … 106 104 mode. 107 105 106 [HemlockProgrammer Back to Table of Contents]
