Changes between Version 2 and Version 3 of HemlockProgrammer/HemlockVariables
- Timestamp:
- Jan 15, 2008, 12:02:16 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
HemlockProgrammer/HemlockVariables
v2 v3 1 [HemlockProgrammer Back to Table of Contents] 1 2 [[PageOutline]] 2 3 … … 10 11 3. There is a database of variable names and documentation which makes it easier to find out what variables exist and what their values mean. 11 12 12 == 6.1. Variable Names == 13 == 6.1. Variable Names ==#VariableNames 13 14 14 15 To the user, a variable name is a case insensitive string. This … … 18 19 In Lisp code a variable name is a symbol. The name of this symbol is 19 20 created by replacing any spaces in the string name with hyphens. This 20 symbol name is always interned in the Hemlock package and referring to 21 a symbol with the same name in the wrong package is an error. 21 symbol name is always interned in the Hemlock package. 22 22 23 *global-variable-names*[Variable]23 `*global-variable-names*` [Variable] 24 24 25 25 This variable holds a string-table of the names of all the global … … 27 27 variable. 28 28 29 current-variable-tables[Function]29 `current-variable-tables` [Function] 30 30 31 31 This function returns a list of variable tables currently established, 32 globally, in the current -buffer, and by the modes of the32 globally, in the current buffer, and by the modes of the 33 33 current-buffer. This list is suitable for use with 34 34 prompt-for-variable. 35 35 36 == 6.2. Variable Functions == 36 == 6.2. Variable Functions ==#VariableFunctions 37 37 In the following descriptions name is the symbol name of the variable. 38 38 39 defhvarstring-name documentation &key :mode :buffer :hooks :value [Function]39 `defhvar` string-name documentation &key :mode :buffer :hooks :value [Function] 40 40 41 41 This function defines a Hemlock variable. Functions that take a … … 49 49 50 50 :mode, :buffer:: 51 If buffer is supplied, the variable is local to that buffer. If mode 52 is supplied, it is local to that mode. If neither is supplied, it is 53 global. 51 If buffer is supplied, the variable is local to that buffer. If mode is supplied, it is local to that mode. If neither is supplied, it is global. 54 52 55 53 :value:: 56 This is the initial value for the variable, which defaults to nil.54 This is the initial value for the variable, which defaults to nil. 57 55 58 56 :hooks:: 59 This is the initial list of functions to call when someone sets the 60 variable's value. These functions execute before Hemlock establishes 61 the new value. See variable-valuefor the arguments passed to the 62 hook functions. 57 This is the initial list of functions to call when someone sets the variable's value. These functions execute before Hemlock establishes the new value. See variable-value for the arguments passed to the hook functions. 63 58 64 59 If a variable with the same name already exists in the same place, … … 66 61 supplies these keywords. 67 62 68 variable-valuename &optional kind where [Function]63 `variable-value` name &optional kind where [Function] 69 64 70 65 This function returns the value of a Hemlock variable in some place. The following values for kind are defined: 71 66 72 67 :current:: 73 Return the value present in the current environment, taking into 74 consideration anymode or buffer local variables. This is the 75 default. 68 Return the value present in the current environment, taking into consideration any mode or buffer local variables. This is the default. 76 69 77 70 :global:: 78 71 Return the global value. 72 79 73 :mode:: 80 Return the value in the mode named where.74 Return the value in the mode named where. 81 75 82 76 :buffer … … 87 81 the new value. 88 82 89 variable-documentationname &optional kind where [Function]83 `variable-documentation` name &optional kind where [Function] 90 84 91 variable-hooksname &optional kind where [Function]85 `variable-hooks` name &optional kind where [Function] 92 86 93 variable-namename &optional kind where [Function]87 `variable-name` name &optional kind where [Function] 94 88 95 89 These function return the documentation, hooks and string name of a … … 97 91 variable-value. The documentation and hook list may be set using setf. 98 92 99 string-to-variablestring [Function]93 `string-to-variable` string [Function] 100 94 101 95 This function converts a string into the corresponding variable symbol 102 name. String need not be the name of an actual Hemlock variable.96 name. String need not be the name of an actual Hemlock variable. 103 97 104 value name [Macro] 105 106 setv name new-value [Macro] 98 `value` name [Macro][[BR]] 99 `setv` name new-value [Macro][[BR]] 107 100 108 101 These macros get and set the current value of the Hemlock variable 109 name. Name is not evaluated. There is a setf form for value.102 name. Name is not evaluated. There is a setf form for `value`. 110 103 111 hlet({(var value)}*){form}* [Macro]104 `hlet` ({(var value)}*){form}* [Macro] 112 105 113 106 This macro is very similar to let in effect; within its scope each of … … 117 110 returned. 118 111 119 hemlock-bound-pname &optional kind where [Function]112 `hemlock-bound-p` name &optional kind where [Function] 120 113 121 114 Returns t if name is defined as a Hemlock variable in the place 122 115 specified by kind and where, or nil otherwise. 123 116 124 delete-variable name &optional kind where [Function] 125 126 Delete Variable Hook [Hemlock Variable] 117 `delete-variable` name &optional kind where [Function][[BR]] 118 `Delete Variable Hook` [Hemlock Variable] 127 119 128 120 delete-variable makes the Hemlock variable name no longer defined in … … 135 127 variable is deleted. 136 128 137 == 6.3. Hooks == 129 == 6.3. Hooks ==#Hooks 138 130 139 131 Hemlock actions such as setting variables, changing buffers, changing … … 153 145 interpretation of the hook place argument. 154 146 155 add-hook place hook-fun [Macro] 156 157 remove-hook place hook-fun [Macro] 147 `add-hook` place hook-fun [Macro][[BR]] 148 `remove-hook` place hook-fun [Macro][[BR]] 158 149 159 150 These macros add or remove a hook function in some place. If hook-fun … … 168 159 }}} 169 160 170 invoke-hook place &restargs [Macro]161 `invoke-hook` place &rest args [Macro] 171 162 172 163 This macro calls all the functions in place. If place is a symbol, … … 174 165 variable. 175 166 167 168 [HemlockProgrammer Back to Table of Contents]