| [Top] | [Contents] | [Index] | [Search] [Page Top / Page Bottom] [?] |
@insertcopying
This master menu first lists each chapter and index; then it lists every node in every chapter.
Preface What to look for. 1. List Processing What is Lisp? 2. Practicing Evaluation Running several programs. 3. How To Write Function Definitions How to write function definitions. 4. A Few Buffer--Related Functions Exploring a few buffer-related functions. 5. A Few More Complex Functions A few, even more complex functions. 6. Narrowing and Widening Restricting your and Emacs attention to a region. 7. car,cdr,cons: Fundamental FunctionsFundamental functions in Lisp. 8. Cutting and Storing Text Removing text and saving it. 9. How Lists are Implemented How lists are implemented in the computer. 10. Yanking Text Back Pasting stored text. 11. Loops and Recursion How to repeat a process. 12. Regular Expression Searches Regular expression searches. 13. Counting: Repetition and Regexps A review of repetition and regexps. 14. Counting Words in a defunCounting words in a defun.15. Readying a Graph A prototype graph printing function. 16. Your `.emacs' File How to write a `.emacs' file. 17. Debugging How to run the Emacs Lisp debuggers. 18. Conclusion Now you have the basics. A. The the-theFunctionAn appendix: how to find reduplicated words. B. Handling the Kill Ring An appendix: how the kill ring works. C. A Graph with Labelled Axes How to create a graph with labelled axes. D. Free Software and Free Manuals E. GNU Free Documentation License Index About the Author
-- The Detailed Node Listing ---
Preface
Why Study Emacs Lisp? Why learn Emacs Lisp? On Reading this Text Read, gain familiarity, pick up habits.... For Whom This is Written For whom this is written. Lisp History A Note for Novices You can read this as a novice. Thank You
List Processing
1.1 Lisp Lists What are lists? 1.2 Run a Program Any list in Lisp is a program ready to run. 1.3 Generate an Error Message Generating an error message. 1.4 Symbol Names and Function Definitions Names of symbols and function definitions. 1.5 The Lisp Interpreter What the Lisp interpreter does. 1.6 Evaluation Running a program. 1.7 Variables Returning a value from a variable. 1.8 Arguments Passing information to a function. 1.9 Setting the Value of a Variable Setting the value of a variable. 1.10 Summary The major points. 1.11 Exercises
Lisp Lists
Numbers, Lists inside of Lists List have numbers, other lists, in them. 1.1.1 Lisp Atoms Elemental entities. 1.1.2 Whitespace in Lists Formatting lists to be readable. 1.1.3 GNU Emacs Helps You Type Lists How GNU Emacs helps you type lists.
The Lisp Interpreter
Complications Variables, Special forms, Lists within. 1.5.1 Byte Compiling Specially processing code for speed.
Evaluation
How the Lisp Interpreter Acts Returns and Side Effects... 1.6.1 Evaluating Inner Lists Lists within lists...
Variables
fill-column, an Example Variable1.7.1 Error Message for a Symbol Without a Function The error message for a symbol without a function. 1.7.2 Error Message for a Symbol Without a Value The error message for a symbol without a value.
Arguments
1.8.1 Arguments' Data Types Types of data passed to a function. 1.8.2 An Argument as the Value of a Variable or List An argument can be the value of a variable or list. 1.8.3 Variable Number of Arguments Some functions may take a variable number of arguments. 1.8.4 Using the Wrong Type Object as an Argument Passing an argument of the wrong type to a function. 1.8.5 The messageFunctionA useful function for sending messages.
Setting the Value of a Variable
1.9.1 Using setSetting values. 1.9.2 Using setqSetting a quoted value. 1.9.3 Counting Using setqto count.
Practicing Evaluation
How to Evaluate Typing editing commands or C-x C-e causes evaluation. 2.1 Buffer Names Buffers and files are different. 2.2 Getting Buffers Getting a buffer itself, not merely its name. 2.3 Switching Buffers How to change to another buffer. 2.4 Buffer Size and the Location of Point Where point is located and the size of the buffer. 2.5 Exercise
How To Write Function Definitions
An Aside about Primitive Functions 3.1 The defunSpecial FormThe defunspecial form.3.2 Install a Function Definition Install a function definition. 3.3 Make a Function Interactive Making a function interactive. 3.4 Different Options for interactiveDifferent options for interactive.3.5 Install Code Permanently Installing code permanently. 3.6 letCreating and initializing local variables. 3.7 The ifSpecial FormWhat if? 3.8 If--then--else Expressions If--then--else expressions. 3.9 Truth and Falsehood in Emacs Lisp What Lisp considers false and true. 3.10 save-excursionKeeping track of point, mark, and buffer. 3.11 Review 3.12 Exercises
Install a Function Definition
The effect of installation 3.2.1 Change a Function Definition How to change a function definition.
Make a Function Interactive
An Interactive multiply-by-seven, An OverviewAn overview. 3.3.1 An Interactive multiply-by-sevenThe interactive version.
let
letPrevents Confusion3.6.1 The Parts of a letExpression3.6.2 Sample letExpression3.6.3 Uninitialized Variables in a letStatement
TheifSpecial Form
ifin more detail3.7.1 The type-of-animalFunction in DetailAn example of an ifexpression.
Truth and Falsehood in Emacs Lisp
An explanation of nilnilhas two meanings.
save-excursion
Point and Mark A review of various locations. 3.10.1 Template for a save-excursionExpression
A Few Buffer--Related Functions
4.1 Finding More Information How to find more information. 4.2 A Simplified beginning-of-bufferDefinitionShows goto-char,point-min, andpush-mark.
4.3 The Definition of mark-whole-bufferAlmost the same as beginning-of-buffer.4.4 The Definition of append-to-bufferUses save-excursionandinsert-buffer-substring.
4.5 Review 4.6 Exercises
The Definition ofmark-whole-buffer
An overview of mark-whole-buffer4.3.1 Body of mark-whole-bufferOnly three lines of code.
The Definition ofappend-to-buffer
An Overview of append-to-buffer4.4.1 The append-to-bufferInteractive ExpressionA two part interactive expression. 4.4.2 The Body of append-to-bufferIncorporates a letexpression.4.4.3 save-excursioninappend-to-bufferHow the save-excursionworks.
A Few More Complex Functions
5.1 The Definition of copy-to-bufferWith set-buffer,get-buffer-create.5.2 The Definition of insert-bufferRead-only, and with or.5.3 Complete Definition of beginning-of-bufferShows goto-char,point-min, andpush-mark.
5.4 Review 5.5 optionalArgument Exercise
The Definition ofinsert-buffer
The Code for insert-buffer5.2.1 The Interactive Expression in insert-bufferWhen you can read, but not write. 5.2.2 The Body of the insert-bufferFunctionThe body has an orand alet.5.2.3 insert-bufferWith anifInstead of anorUsing an ifinstead of anor.5.2.4 The orin the BodyHow the orexpression works.5.2.5 The letExpression ininsert-bufferTwo save-excursionexpressions.5.2.6 New Body for insert-buffer
The Interactive Expression ininsert-buffer
A Read-only Buffer When a buffer cannot be modified. `b' in an Interactive Expression An existing buffer or else its name.
Complete Definition ofbeginning-of-buffer
5.3.1 Optional Arguments 5.3.2 beginning-of-bufferwith an ArgumentExample with optional argument. 5.3.3 The Complete beginning-of-buffer
beginning-of-bufferwith an Argument
Disentangle beginning-of-bufferWhat happens in a large buffer What happens in a small buffer
Narrowing and Widening
The Advantages of Narrowing The advantages of narrowing 6.1 The save-restrictionSpecial FormThe save-restrictionspecial form.6.2 what-lineThe number of the line that point is on. 6.3 Exercise with Narrowing
car,cdr,cons: Fundamental Functions
Strange Names An historical aside: why the strange names? 7.1 carandcdrFunctions for extracting part of a list. 7.2 consConstructing a list. 7.3 nthcdrCalling cdrrepeatedly.7.4 nth7.5 setcarChanging the first element of a list. 7.6 setcdrChanging the rest of a list. 7.7 Exercise
cons
Build a list 7.2.1 Find the Length of a List: lengthHow to find the length of a list.
Cutting and Storing Text
Storing Text in a List Text is stored in a list. 8.1 zap-to-charCutting out text up to a character. 8.2 kill-regionCutting text out of a region. 8.3 copy-region-as-killA definition for copying text. 8.4 Digression into C Minor note on C programming language macros. 8.5 Initializing a Variable with defvarHow to give a variable an initial value. 8.6 Review 8.7 Searching Exercises
zap-to-char
The Complete zap-to-charImplementationThe complete implementation. 8.1.1 The interactiveExpressionA three part interactive expression. 8.1.2 The Body of zap-to-charA short overview. 8.1.3 The search-forwardFunctionHow to search for a string. 8.1.4 The prognSpecial FormThe prognspecial form.8.1.5 Summing up zap-to-charUsing pointandsearch-forward.
kill-region
The Complete kill-regionDefinitionThe function definition. 8.2.1 condition-caseDealing with a problem. 8.2.2 Lisp macro
copy-region-as-kill
The complete copy-region-as-killfunction definitionThe complete function definition. 8.3.1 The Body of copy-region-as-killThe body of copy-region-as-kill.
The Body ofcopy-region-as-kill
last-commandandthis-commandThe kill-appendfunctionThe kill-newfunction
Initializing a Variable withdefvar
Seeing the Current Value of a Variable 8.5.1 defvarand an asterisk
How Lists are Implemented
Lists diagrammed 9.1 Symbols as a Chest of Drawers Exploring a powerful metaphor. 9.2 Exercise
Yanking Text Back
10.1 Kill Ring Overview 10.2 The kill-ring-yank-pointerVariableThe kill ring is a list. 10.3 Exercises with yankandnthcdrThe kill-ring-yank-pointervariable.
Loops and Recursion
11.1 whileCausing a stretch of code to repeat. 11.2 Save your time: dolistanddotimes11.3 Recursion Causing a function to call itself. 11.4 Looping Exercise
while
Looping with whileRepeat so long as test returns true. 11.1.1 A whileLoop and a ListA whileloop that uses a list.11.1.2 An Example: print-elements-of-listUses while,car,cdr.11.1.3 A Loop with an Incrementing Counter A loop with an incrementing counter. Details of an Incrementing Loop 11.1.4 Loop with a Decrementing Counter A loop with a decrementing counter.
Details of an Incrementing Loop
Example with incrementing counter Counting pebbles in a triangle. The parts of the function definition Putting the function definition together
Loop with a Decrementing Counter
Example with decrementing counter More pebbles on the beach. The parts of the function definition Putting the function definition together
Save your time:dolistanddotimes
The dolistMacroThe dotimesMacro
Recursion
11.3.1 Building Robots: Extending the Metaphor Same model, different serial number ... 11.3.2 The Parts of a Recursive Definition Walk until you stop ... 11.3.3 Recursion with a List Using a list as the test whether to recurse. 11.3.4 Recursion in Place of a Counter 11.3.5 Recursion Example Using cond11.3.6 Recursive Patterns Often used templates. 11.3.7 Recursion without Deferments Don't store up work ... 11.3.8 No Deferment Solution
Recursion in Place of a Counter
An argument of 1 or 2 An argument of 3 or 4
Recursive Patterns
Recursive Pattern: every Recursive Pattern: accumulate Recursive Pattern: keep
Regular Expression Searches
12.1 The Regular Expression for sentence-endThe regular expression for sentence-end.12.2 The re-search-forwardFunctionVery similar to search-forward.12.3 forward-sentenceA straightforward example of regexp search. 12.4 forward-paragraph: a Goldmine of FunctionsA somewhat complex example. 12.5 Create Your Own `TAGS' File How to create your own `TAGS' table. 12.6 Review 12.7 Exercises with re-search-forward
forward-sentence
Complete forward-sentencefunction definitionThe whileloopsTwo whileloops.The regular expression search A regular expression search.
forward-paragraph: a Goldmine of Functions
Shortened forward-paragraphfunction definitionKey parts of the function definition. The let*expressionThe forward motion whileloop
Counting: Repetition and Regexps
Counting words 13.1 The count-words-regionFunctionUse a regexp, but find a problem. 13.2 Count Words Recursively Start with case of no words in region. 13.3 Exercise: Counting Punctuation
Thecount-words-regionFunction
Designing count-words-regionThe definition using a whileloop.13.1.1 The Whitespace Bug in count-words-region
Counting Words in adefun
Divide and Conquer 14.1 What to Count? What to count? 14.2 What Constitutes a Word or Symbol? What constitutes a word or symbol? 14.3 The count-words-in-defunFunctionVery like count-words.14.4 Count Several defunsWithin a FileCounting several defuns in a file. 14.5 Find a File Do you want to look at a file? 14.6 lengths-list-filein DetailA list of the lengths of many definitions. 14.7 Count Words in defunsin Different FilesCounting in definitions in different files. 14.8 Recursively Count Words in Different Files Recursively counting in different files. 14.9 Prepare the Data for Display in a Graph Prepare the data for display in a graph.
Count Words indefunsin Different Files
Determine the lengths of defunsReturn a list of the lengths of defuns. 14.7.1 The appendFunctionAttach one list to another.
Prepare the Data for Display in a Graph
The Data for Display in Detail 14.9.1 Sorting Lists Sorting lists. 14.9.2 Making a List of Files Making a list of files. 14.9.3 Counting function definitions
Readying a Graph
Printing the Columns of a Graph 15.1 The graph-body-printFunctionHow to print the body of a graph. 15.2 The recursive-graph-body-printFunction15.3 Need for Printed Axes 15.4 Exercise
Your `.emacs' File
Emacs' Default Configuration 16.1 Site-wide Initialization Files You can write site-wide init files. 16.2 Specifying Variables using defcustomEmacs will write code for you. 16.3 Beginning a `.emacs' File How to write a .emacs file.16.4 Text and Auto Fill Mode Automatically wrap lines. 16.5 Mail Aliases Use abbreviations for email addresses. 16.6 Indent Tabs Mode Don't use tabs with TeX 16.7 Some Keybindings Create some personal keybindings. 16.8 Keymaps More about key binding. 16.9 Loading Files Load (i.e., evaluate) files automatically. 16.10 Autoloading Make functions available. 16.11 A Simple Extension: line-to-top-of-windowDefine a function; bind it to a key. 16.12 X11 Colors Colors in X. 16.13 Miscellaneous Settings for a `.emacs' File 16.14 A Modified Mode Line How to customize your mode line.
Debugging
17.1 debugHow to use the built-in debugger. 17.2 debug-on-entryStart debugging when you call a function. 17.3 debug-on-quitand(debug)Start debugging when you quit with C-g. 17.4 The edebugSource Level DebuggerHow to use Edebug, a source level debugger. 17.5 Debugging Exercises
Handling the Kill Ring
What the Kill Ring Does B.1 The current-killFunctionB.2 yankPaste a copy of a clipped element. B.3 yank-popInsert element pointed to. B.4 The `ring.el' File
Thecurrent-killFunction
current-killin Outline
current-killin Outline
The Body of current-killDigression about the word `error' How to mislead humans, but not computers. Determining the Element
A Graph with Labelled Axes
Labelled Example Graph C.1 The print-graphVarlistletexpression inprint-graph.C.2 The print-Y-axisFunctionPrint a label for the vertical axis. C.3 The print-X-axisFunctionPrint a horizontal label. C.4 Printing the Whole Graph The function to print a complete graph.
Theprint-Y-axisFunction
The print-Y-axisFunction in DetailWhat height should the label be? What height for the Y axis? C.2.1 Side Trip: Compute a Remainder How to compute the remainder of a division. C.2.2 Construct a Y Axis Element Construct a line for the Y axis. C.2.3 Create a Y Axis Column Generate a list of Y axis labels. C.2.4 The Not Quite Final Version of print-Y-axisA not quite final version.
Theprint-X-axisFunction
Similarities and differences Much like print-Y-axis, but not exactly.C.3.1 X Axis Tic Marks Create tic marks for the horizontal axis.
Printing the Whole Graph
Changes for the Final Version A few changes. C.4.1 Testing print-graphRun a short test. C.4.2 Graphing Numbers of Words and Symbols Executing the final code. C.4.3 A lambdaExpression: Useful AnonymityHow to write an anonymous function. C.4.4 The mapcarFunctionApply a function to elements of a list. C.4.5 Another Bug ... Most Insidious Yet another bug ... most insidious. C.4.6 The Printed Graph The graph itself!