emacs-diffs
[Top][All Lists]

## [Emacs-diffs] Changes to emacs/lispintro/emacs-lisp-intro.texi,v

 From: Robert J. Chassell Subject: [Emacs-diffs] Changes to emacs/lispintro/emacs-lisp-intro.texi,v Date: Sat, 04 Nov 2006 19:08:36 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Robert J. Chassell <bob>        06/11/04 19:08:35

Index: emacs-lisp-intro.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/lispintro/emacs-lisp-intro.texi,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- emacs-lisp-intro.texi       4 Nov 2006 14:48:39 -0000       1.50
+++ emacs-lisp-intro.texi       4 Nov 2006 19:08:35 -0000       1.51
@@ -183,7 +183,11 @@
@c in the Texinfo version 4.6 of the 2003 Jun 13 distribution.

@tex
-\global\def\xrefprintnodename#1{\unskip, #1''}
+\if \xrefprintnodename
+ \global\def\xrefprintnodename#1{\unskip, #1''}
+ \else
+ \global\def\xrefprintnodename#1{ #1''}
+\fi
% \global\def\xrefprintnodename#1{, #1''}
@end tex

@@ -5123,12 +5127,14 @@
Function Interactive}.)  The expression reads as follows:

@smallexample
(interactive
"Append to buffer: "
(other-buffer (current-buffer) t))
(region-beginning)
(region-end)))
@end smallexample

@noindent
@@ -5640,7 +5646,7 @@
Here is a discussion based on the original code.  The code was
simplified in 2003 and is harder to understand.

address@hidden insert-buffer, , New Body for @code{insert-buffer}}, to see
+(@xref{New insert-buffer, , New Body for @code{insert-buffer}}, to see
a discussion of the new body.)

In addition, this code illustrates the use of @code{interactive} with a
@@ -6078,17 +6084,17 @@

As previously described, when invoked without an argument,
@code{beginning-of-buffer} moves the cursor to the beginning of the
-buffer (in truth, the accessible portion of the buffer), leaving the
-mark at the previous position.  However, when the command is invoked
-with a number between one and ten, the function considers that number
-to be a fraction of the length of the buffer, measured in tenths, and
-Emacs moves the cursor that fraction of the way from the beginning of
-the buffer.  Thus, you can either call this function with the key
-command @kbd{M-<}, which will move the cursor to the beginning of the
-buffer, or with a key command such as @kbd{C-u 7 M-<} which will move
-the cursor to a point 70% of the way through the buffer.  If a number
-bigger than ten is used for the argument, it moves to the end of the
-buffer.
+buffer (in truth, the beginning of the accessible portion of the
+buffer), leaving the mark at the previous position.  However, when the
+command is invoked with a number between one and ten, the function
+considers that number to be a fraction of the length of the buffer,
+measured in tenths, and Emacs moves the cursor that fraction of the
+way from the beginning of the buffer.  Thus, you can either call this
+function with the key command @kbd{M-<}, which will move the cursor to
+the beginning of the buffer, or with a key command such as @kbd{C-u 7
+M-<} which will move the cursor to a point 70% of the way through the
+buffer.  If a number bigger than ten is used for the argument, it
+moves to the end of the buffer.

The @code{beginning-of-buffer} function can be called with or without an
argument.  The use of the argument is optional.
@@ -6887,10 +6893,10 @@
@code{filter-buffer-substring} @dots{}, yet other functions.  Text
properties are a feature otherwise not discussed here.  @xref{Text
Properties, , Text Properties, elisp, The GNU Emacs Lisp Reference
-Manual}.
+Manual}.)

Additionally, do you really need @code{goto-char} or @code{point-min}?
-Or can you write the function without them?)
+Or can you write the function without them?

@node car cdr & cons, Cutting & Storing Text, Narrowing & Widening, Top
@comment  node-name,  next,  previous,  up
@@ -7658,7 +7664,7 @@
@section @code{zap-to-char}
@findex zap-to-char

-The @code{zap-to-char} function changed a little between GNU Emacs
+The @code{zap-to-char} function changed little between GNU Emacs
version 19 and GNU Emacs version 22.  However, @code{zap-to-char}
calls another function, @code{kill-region}, which enjoyed a major
rewrite.
@@ -7686,18 +7692,16 @@
@unnumberedsubsec The Complete @code{zap-to-char} Implementation
@end ifnottex

-The GNU Emacs version 19 and version 21 implementations of the
address@hidden function are nearly identical in form, and they
-work alike.  The function removes the text in the region between the
-location of the cursor (i.e., of point) up to and including the next
-occurrence of a specified character.  The text that @code{zap-to-char}
-removes is put in the kill ring; and it can be retrieved from the kill
-ring by typing @kbd{C-y} (@code{yank}).  If the command is given an
-argument, it removes text through that number of occurrences.  Thus,
-if the cursor were at the beginning of this sentence and the character
-were @samp{s}, @samp{Thus} would be removed.  If the argument were
-two, @samp{Thus, if the curs} would be removed, up to and including
-the @samp{s} in @samp{cursor}.
+The @code{zap-to-char} function removes the text in the region between
+the location of the cursor (i.e., of point) up to and including the
+next occurrence of a specified character.  The text that
address@hidden removes is put in the kill ring; and it can be
+the command is given an argument, it removes text through that number
+of occurrences.  Thus, if the cursor were at the beginning of this
+sentence and the character were @samp{s}, @samp{Thus} would be
+removed.  If the argument were two, @samp{Thus, if the curs} would be
+removed, up to and including the @samp{s} in @samp{cursor}.

Search failed'', tell you the character you typed, and not remove
@@ -7740,6 +7744,9 @@
@end group
@end smallexample

+The documentation is thorough.  You do need to know the jargon meaning
+of the word kill'.
+
@node zap-to-char interactive, zap-to-char body, Complete zap-to-char,
zap-to-char
@comment  node-name,  next,  previous,  up
@subsection The @code{interactive} Expression
@@ -7776,8 +7783,6 @@
message saying that the buffer is read-only.  Also, the terminal may

-Let us continue with the interactive specification.
-
@node zap-to-char body, search-forward, zap-to-char interactive, zap-to-char
@comment  node-name,  next,  previous,  up
@subsection The Body of @code{zap-to-char}
@@ -7786,9 +7791,6 @@
kills (that is, removes) the text in the region from the current
position of the cursor up to and including the specified character.

-The documentation is thorough.  You do need to know the jargon meaning
-of the word kill'.
-
The first part of the code looks like this:

@smallexample
@@ -8067,6 +8069,7 @@
;; @bullet{} Since order matters, pass point first.
(interactive (list (point) (mark)))
;; @bullet{} And tell us if we cannot cut the text.
+  ;; unless' is an if' without a then-part.
(unless (and beg end)
(error "The mark is not set now, so there is no region"))
@end group
@@ -8338,10 +8341,15 @@
enables you to define new control constructs and other language
features.  It tells the interpreter how to compute another Lisp
expression which will in turn compute the value.  In this case, the
-other expression' is an @code{if} expression.  For more about Lisp
-macros, see @ref{Macros, , Macros, elisp, The GNU Emacs Lisp Reference
-Manual}.  The C programming language also provides macros.  These are
-different, but also useful.
+other expression' is an @code{if} expression.
+
+The @code{kill-region} function definition also has an @code{unless}
+macro; it is the converse of @code{when}.  The @code{unless} macro is
+an @code{if} without a then clause
+
+For more about Lisp macros, see @ref{Macros, , Macros, elisp, The GNU
+Emacs Lisp Reference Manual}.  The C programming language also
+provides macros.  These are different, but also useful.

@ignore
We will briefly look at C macros in
@@ -8349,8 +8357,10 @@
@end ignore

@need 1200
-If the string has content, then another conditional expression is
-executed.  This is an @code{if} with both a then-part and an else-part.
+Regarding the @code{when} macro, in the @code{condition-case}
+expression, when the string has content, then another conditional
+expression is executed.  This is an @code{if} with both a then-part
+and an else-part.

@smallexample
@group
@@ -8531,8 +8541,7 @@
function.

@need 1250
-The @code{if} expression reads as follows; it uses @code{eq}, which is
-a function we have not yet seen:
+The @code{if} expression reads as follows; it uses @code{eq}:

@smallexample
@group
@@ -8582,7 +8591,8 @@
(let* ((cur (car kill-ring)))
(kill-new (if before-p (concat string cur) (concat cur string))
(or (= (length cur) 0)
-                 (equal yank-handler (get-text-property 0 'yank-handler cur)))
+                  (equal yank-handler
+                         (get-text-property 0 'yank-handler cur)))
yank-handler)))
@end group
@end smallexample
@@ -8772,7 +8782,6 @@
(funcall interprogram-cut-function string (not replace))))
@end ignore

(Notice that the function is not interactive.)

As usual, we can look at this function in parts.
@@ -8848,8 +8857,8 @@

@noindent
@need 1250
address@hidden puts its first argument onto the second.  It is the same
-as the older
address@hidden puts its first argument onto the second.  It is similar to
+the older

@smallexample
(setq kill-ring (cons string kill-ring))
@@ -8957,7 +8966,7 @@
@findex setcdr, @r{example}
Thus, if we had a four element list that was supposed to be three
elements long, we could set the @sc{cdr} of the next to last element
-to @code{nil}, and thereby shorten the list.  (If you sent the last
+to @code{nil}, and thereby shorten the list.  (If you set the last
element to some other value than @code{nil}, which you could do, then
you would not have shortened the list.  @xref{setcdr, ,
@code{setcdr}}.)
@@ -9005,8 +9014,6 @@
Even though the @code{kill-ring-yank-pointer} is called a
@samp{pointer}, it is a variable just like the kill ring.  However, the
name has been chosen to help humans understand how the variable is used.
-The variable is used in functions such as @code{yank} and
address@hidden (@pxref{Yanking, , Yanking Text Back}).

@need 1200
Now, to return to an early expression in the body of the function:
@@ -9087,7 +9094,8 @@
bringing back text that has been cut out of the buffer---the yank
commands.  However, before discussing the yank commands, it is better
to learn how lists are implemented in a computer.  This will make
-clear such mysteries as the use of the term pointer'.
+clear such mysteries as the use of the term pointer'.  But before
+that, we will digress into C.

@ignore
@c is this true in Emacs 22?   Does not seems to be