Author(s): Robert J Chassell; Free Software Foundation (Cambridge, Mass.)
Edition: Ed. 1.05
Publisher: Free Software Foundation
Year: 1997
Language: English
Pages: 262
City: Boston, MA
Programming in Emacs Lisp......Page 3
Short Contents......Page 5
Table of Contents......Page 7
Preface......Page 13
For Whom This is Written......Page 14
Thank You......Page 15
Lisp Atoms......Page 17
Whitespace in Lists......Page 18
Run a Program......Page 19
Generate an Error Message......Page 20
The Lisp Interpreter......Page 21
Evaluation......Page 22
Evaluating Inner Lists......Page 23
Variables......Page 24
Arguments......Page 25
Arguments' Data Types......Page 26
Using the Wrong Type Object as an Argument......Page 27
The message Function......Page 28
Using set......Page 30
Counting......Page 31
Summary......Page 32
Exercises......Page 33
Buffer Names......Page 35
Getting Buffers......Page 37
Switching Buffers......Page 38
Exercise......Page 39
The defun Special Form......Page 41
Install a Function Definition......Page 43
Make a Function Interactive......Page 44
An Interactive multiply-by-seven.......Page 45
Different Options for interactive......Page 46
Install Code Permanently......Page 47
The Parts of a let Expression......Page 48
Sample let Expression......Page 49
The if Special Form......Page 50
The type-of-animal Function in Detail......Page 51
If--then--else Expressions......Page 52
Truth and Falsehood in Lisp......Page 53
save-excursion......Page 54
Template for a save-excursion Expression......Page 55
Review......Page 56
Exercises......Page 59
A Simplified beginning-of-buffer Definition......Page 61
The Definition of mark-whole-buffer......Page 63
The Definition of append-to-buffer......Page 64
The append-to-buffer Interactive Expression......Page 65
save-excursion in append-to-buffer......Page 66
Review......Page 68
Exercises......Page 69
The Definition of copy-to-buffer......Page 71
A Read-only Buffer......Page 72
insert-buffer With an if Instead of an or......Page 73
The or in the Body......Page 74
The let Expression in insert-buffer......Page 75
Complete Definition of beginning-of-buffer......Page 76
Optional Arguments......Page 77
What happens in a large buffer......Page 78
What happens in a small buffer......Page 79
The Complete beginning-of-buffer......Page 80
&optional Argument Exercise......Page 81
The save-restriction Special Form......Page 83
what-line......Page 84
Exercise with Narrowing......Page 85
car and cdr......Page 87
cons......Page 88
Find the Length of a List: length......Page 89
nthcdr......Page 90
setcdr......Page 92
Exercise......Page 93
Cutting and Storing Text......Page 95
The interactive Expression......Page 96
The search-forward Function......Page 97
The progn Function......Page 98
The Version 18 Implementation......Page 99
The body of the progn expression......Page 100
delete-region: A Digression into C......Page 102
Initializing a Variable with defvar......Page 104
copy-region-as-kill......Page 105
The Body of copy-region-as-kill......Page 106
The kill-append function......Page 107
The else-part of copy-region-as-kill......Page 108
Review......Page 110
Searching Exercises......Page 112
How Lists are Implemented......Page 113
Exercise......Page 116
The kill-ring-yank-pointer Variable......Page 117
Exercises with yank and nthcdr......Page 119
while......Page 121
A while Loop and a List......Page 122
An Example: print-elements-of-list......Page 123
Example with incrementing counter......Page 124
The parts of the function definition......Page 125
Putting the function definition together......Page 126
Example with decrementing counter......Page 128
Putting the function definition together......Page 129
Recursion......Page 130
Recursion with a List......Page 131
Recursion in Place of a Counter......Page 132
An argument of 3......Page 133
Recursion Example Using cond......Page 134
Looping Exercise......Page 135
The Regular Expression for sentence-end......Page 137
The re-search-forward Function......Page 138
forward-sentence......Page 139
The while loops......Page 140
forward-paragraph: a Goldmine of Functions......Page 142
The let* expression......Page 143
The forward motion while loop......Page 145
Between paragraphs......Page 146
No fill prefix......Page 147
Summary......Page 148
Review......Page 150
Exercises with re-search-forward......Page 152
The count-words-region Function......Page 153
The Whitespace Bug in count-words-region......Page 156
Count Words Recursively......Page 158
Exercise: Counting Punctuation......Page 163
What to Count?......Page 165
What Constitutes a Word or Symbol?......Page 166
The count-words-in-defun Function......Page 167
Find a File......Page 170
lengths-list-file in Detail......Page 171
Count Words in defuns in Different Files......Page 173
The append Function......Page 174
Recursively Count Words in Different Files......Page 175
Sorting Lists......Page 176
Making a List of Files......Page 177
Readying a Graph......Page 183
The graph-body-print Function......Page 188
The recursive-graph-body-print Function......Page 189
Exercise......Page 191
Site-wide Initialization Files......Page 193
Beginning a .emacs File......Page 194
Text and Auto Fill Mode......Page 195
Some Keybindings......Page 197
Loading Files......Page 199
A Simple Extension: line-to-top-of-window......Page 200
Keymaps......Page 202
X11 Colors......Page 203
V19 Miscellaneous......Page 204
A Modified Mode Line......Page 205
debug......Page 207
debug-on-entry......Page 208
The edebug Source Level Debugger......Page 210
Debugging Exercises......Page 212
Conclusion......Page 213
The the-the Function......Page 215
The rotate-yank-pointer Function......Page 217
The Body of rotate-yank-pointer......Page 218
The else-part of the if expression......Page 219
Using % in rotate-yank-pointer......Page 221
Pointing to the last element......Page 222
Passing the argument......Page 223
Passing a negative argument......Page 224
yank-pop......Page 225
A Graph with Labelled Axes......Page 227
The print-Y-axis Function......Page 228
Side Trip: Compute a Remainder......Page 230
Construct a Y Axis Element......Page 231
Final Version of print-Y-axis......Page 233
The print-X-axis Function......Page 234
X Axis Tic Marks......Page 235
Printing the Whole Graph......Page 238
Testing print-graph......Page 241
Graphing Numbers of Words and Symbols......Page 242
A lambda Expression......Page 243
The mapcar Function......Page 244
Another Bug ...{} Most Insidious......Page 245
The Printed Graph......Page 247
Index......Page 249