aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/lispintro/emacs-lisp-intro.texi31
1 files changed, 15 insertions, 16 deletions
diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi
index 36e60c23005..6c4f305d86d 100644
--- a/doc/lispintro/emacs-lisp-intro.texi
+++ b/doc/lispintro/emacs-lisp-intro.texi
@@ -8681,10 +8681,9 @@ The critical lines are these:
8681@end group 8681@end group
8682@group 8682@group
8683 ;; @r{else} 8683 ;; @r{else}
8684 (push string kill-ring) 8684 (push string kill-ring)
8685@end group 8685@end group
8686@group 8686@group
8687 (setq kill-ring (cons string kill-ring))
8688 (if (> (length kill-ring) kill-ring-max) 8687 (if (> (length kill-ring) kill-ring-max)
8689 ;; @r{avoid overly long kill ring} 8688 ;; @r{avoid overly long kill ring}
8690 (setcdr (nthcdr (1- kill-ring-max) kill-ring) nil))) 8689 (setcdr (nthcdr (1- kill-ring-max) kill-ring) nil)))
@@ -9075,7 +9074,7 @@ arguments.
9075@item 9074@item
9076The sixth part is nearly like the argument that follows the 9075The sixth part is nearly like the argument that follows the
9077@code{interactive} declaration in a function written in Lisp: a letter 9076@code{interactive} declaration in a function written in Lisp: a letter
9078followed, perhaps, by a prompt. The only difference from the Lisp is 9077followed, perhaps, by a prompt. The only difference from Lisp is
9079when the macro is called with no arguments. Then you write a @code{0} 9078when the macro is called with no arguments. Then you write a @code{0}
9080(which is a null string), as in this macro. 9079(which is a null string), as in this macro.
9081 9080
@@ -9115,7 +9114,7 @@ then return an empty string.
9115The @code{del_range_1} function actually deletes the text. It is a 9114The @code{del_range_1} function actually deletes the text. It is a
9116complex function we will not look into. It updates the buffer and 9115complex function we will not look into. It updates the buffer and
9117does other things. However, it is worth looking at the two arguments 9116does other things. However, it is worth looking at the two arguments
9118passed to @code{del_range}. These are @w{@code{XINT (start)}} and 9117passed to @code{del_range_1}. These are @w{@code{XINT (start)}} and
9119@w{@code{XINT (end)}}. 9118@w{@code{XINT (end)}}.
9120 9119
9121As far as the C language is concerned, @code{start} and @code{end} are 9120As far as the C language is concerned, @code{start} and @code{end} are
@@ -11644,7 +11643,7 @@ Else, act on the beginning of the list (the @sc{car} of the list)
11644@end itemize 11643@end itemize
11645 11644
11646@need 1500 11645@need 1500
11647Here is example: 11646Here is an example:
11648 11647
11649@smallexample 11648@smallexample
11650@group 11649@group
@@ -12538,7 +12537,7 @@ value of @code{arg} to 1, in the case when @code{arg} is bound to
12538@code{nil}. 12537@code{nil}.
12539 12538
12540Next is a @code{let}. That specifies the values of two local 12539Next is a @code{let}. That specifies the values of two local
12541variables, @code{point} and @code{sentence-end}. The local value of 12540variables, @code{opoint} and @code{sentence-end}. The local value of
12542point, from before the search, is used in the 12541point, from before the search, is used in the
12543@code{constrain-to-field} function which handles forms and 12542@code{constrain-to-field} function which handles forms and
12544equivalents. The @code{sentence-end} variable is set by the 12543equivalents. The @code{sentence-end} variable is set by the
@@ -14184,7 +14183,7 @@ the expression that moves point forward, word by word.
14184 14183
14185The third part of a recursive function is the recursive call. 14184The third part of a recursive function is the recursive call.
14186 14185
14187Somewhere, also, we also need a part that does the work of the 14186Somewhere, we also need a part that does the work of the
14188function, a part that does the counting. A vital part! 14187function, a part that does the counting. A vital part!
14189 14188
14190@need 1250 14189@need 1250
@@ -14482,12 +14481,12 @@ First, write a function to count the words in one definition. This
14482includes the problem of handling symbols as well as words. 14481includes the problem of handling symbols as well as words.
14483 14482
14484@item 14483@item
14485Second, write a function to list the numbers of words in each function 14484Second, write a function to list the number of words in each function
14486in a file. This function can use the @code{count-words-in-defun} 14485in a file. This function can use the @code{count-words-in-defun}
14487function. 14486function.
14488 14487
14489@item 14488@item
14490Third, write a function to list the numbers of words in each function 14489Third, write a function to list the number of words in each function
14491in each of several files. This entails automatically finding the 14490in each of several files. This entails automatically finding the
14492various files, switching to them, and counting the words in the 14491various files, switching to them, and counting the words in the
14493definitions within them. 14492definitions within them.
@@ -14952,7 +14951,7 @@ contains two functions, @code{find-file-noselect} and
14952According to its documentation as shown by @kbd{C-h f} (the 14951According to its documentation as shown by @kbd{C-h f} (the
14953@code{describe-function} command), the @code{find-file-noselect} 14952@code{describe-function} command), the @code{find-file-noselect}
14954function reads the named file into a buffer and returns the buffer. 14953function reads the named file into a buffer and returns the buffer.
14955(Its most recent version includes an optional wildcards argument, 14954(Its most recent version includes an optional @var{wildcards} argument,
14956too, as well as another to read a file literally and an other you 14955too, as well as another to read a file literally and an other you
14957suppress warning messages. These optional arguments are irrelevant.) 14956suppress warning messages. These optional arguments are irrelevant.)
14958 14957
@@ -15139,7 +15138,7 @@ either a @code{while} loop or recursion.
15139@end ifnottex 15138@end ifnottex
15140 15139
15141The design using a @code{while} loop is routine. The argument passed 15140The design using a @code{while} loop is routine. The argument passed
15142the function is a list of files. As we saw earlier (@pxref{Loop 15141to the function is a list of files. As we saw earlier (@pxref{Loop
15143Example}), you can write a @code{while} loop so that the body of the 15142Example}), you can write a @code{while} loop so that the body of the
15144loop is evaluated if such a list contains elements, but to exit the 15143loop is evaluated if such a list contains elements, but to exit the
15145loop if the list is empty. For this design to work, the body of the 15144loop if the list is empty. For this design to work, the body of the
@@ -16106,7 +16105,7 @@ columns. Very likely, the name of the function will contain either
16106the word ``print'' or the word ``insert'' or the word ``column''. 16105the word ``print'' or the word ``insert'' or the word ``column''.
16107Therefore, we can simply type @kbd{M-x apropos RET 16106Therefore, we can simply type @kbd{M-x apropos RET
16108print\|insert\|column RET} and look at the result. On my system, this 16107print\|insert\|column RET} and look at the result. On my system, this
16109command once too takes quite some time, and then produced a list of 79 16108command once took quite some time, and then produced a list of 79
16110functions and variables. Now it does not take much time at all and 16109functions and variables. Now it does not take much time at all and
16111produces a list of 211 functions and variables. Scanning down the 16110produces a list of 211 functions and variables. Scanning down the
16112list, the only function that looks as if it might do the job is 16111list, the only function that looks as if it might do the job is
@@ -16183,7 +16182,7 @@ The number of asterisks in the column is the number specified by the
16183current element of the @code{numbers-list}. We need to construct a 16182current element of the @code{numbers-list}. We need to construct a
16184list of asterisks of the right length for each call to 16183list of asterisks of the right length for each call to
16185@code{insert-rectangle}. If this list consists solely of the requisite 16184@code{insert-rectangle}. If this list consists solely of the requisite
16186number of asterisks, then we will have position point the right number 16185number of asterisks, then we will have to position point the right number
16187of lines above the base for the graph to print correctly. This could 16186of lines above the base for the graph to print correctly. This could
16188be difficult. 16187be difficult.
16189 16188
@@ -16348,7 +16347,7 @@ As written, @code{column-of-graph} contains a major flaw: the symbols
16348used for the blank and for the marked entries in the column are 16347used for the blank and for the marked entries in the column are
16349hard-coded as a space and asterisk. This is fine for a prototype, 16348hard-coded as a space and asterisk. This is fine for a prototype,
16350but you, or another user, may wish to use other symbols. For example, 16349but you, or another user, may wish to use other symbols. For example,
16351in testing the graph function, you many want to use a period in place 16350in testing the graph function, you may want to use a period in place
16352of the space, to make sure the point is being repositioned properly 16351of the space, to make sure the point is being repositioned properly
16353each time the @code{insert-rectangle} function is called; or you might 16352each time the @code{insert-rectangle} function is called; or you might
16354want to substitute a @samp{+} sign or other symbol for the asterisk. 16353want to substitute a @samp{+} sign or other symbol for the asterisk.
@@ -16711,7 +16710,7 @@ Write a line graph version of the graph printing functions.
16711 16710
16712``You don't have to like Emacs to like it''---this seemingly 16711``You don't have to like Emacs to like it''---this seemingly
16713paradoxical statement is the secret of GNU Emacs. The plain, out-of-the-box 16712paradoxical statement is the secret of GNU Emacs. The plain, out-of-the-box
16714Emacs is a generic tool. Most people who use it, customize 16713Emacs is a generic tool. Most people who use it customize
16715it to suit themselves. 16714it to suit themselves.
16716 16715
16717GNU Emacs is mostly written in Emacs Lisp; this means that by writing 16716GNU Emacs is mostly written in Emacs Lisp; this means that by writing
@@ -16907,7 +16906,7 @@ M-x customize
16907@end smallexample 16906@end smallexample
16908 16907
16909@noindent 16908@noindent
16910and find that the group for editing files of data is called ``data''. 16909and find that the group for editing files of text is called ``Text''.
16911Enter that group. Text Mode Hook is the first member. You can click 16910Enter that group. Text Mode Hook is the first member. You can click
16912on its various options, such as @code{turn-on-auto-fill}, to set the 16911on its various options, such as @code{turn-on-auto-fill}, to set the
16913values. After you click on the button to 16912values. After you click on the button to