aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2013-03-02 18:34:48 -0800
committerGlenn Morris2013-03-02 18:34:48 -0800
commit2d7d23256f4bbf716ab81f49ce7cef5196da7092 (patch)
treeb4c2f585fd6e2d4fea8b577f2ba3e78dfe2e9a06
parent9bed73f34308231324c976e68f9bf413ba6d94cd (diff)
downloademacs-2d7d23256f4bbf716ab81f49ce7cef5196da7092.tar.gz
emacs-2d7d23256f4bbf716ab81f49ce7cef5196da7092.zip
* emacs-lisp-intro.texi (Digression into C): Update example.
-rw-r--r--doc/lispintro/ChangeLog4
-rw-r--r--doc/lispintro/emacs-lisp-intro.texi48
2 files changed, 19 insertions, 33 deletions
diff --git a/doc/lispintro/ChangeLog b/doc/lispintro/ChangeLog
index 23a7d3d8e0c..09be1b86c7e 100644
--- a/doc/lispintro/ChangeLog
+++ b/doc/lispintro/ChangeLog
@@ -1,3 +1,7 @@
12013-03-03 Glenn Morris <rgm@gnu.org>
2
3 * emacs-lisp-intro.texi (Digression into C): Update example.
4
12012-12-22 Glenn Morris <rgm@gnu.org> 52012-12-22 Glenn Morris <rgm@gnu.org>
2 6
3 * Makefile.in (srcs): New variable, adding doclicense.texi. 7 * Makefile.in (srcs): New variable, adding doclicense.texi.
diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi
index d00f36cda58..61e3154baa4 100644
--- a/doc/lispintro/emacs-lisp-intro.texi
+++ b/doc/lispintro/emacs-lisp-intro.texi
@@ -9116,8 +9116,8 @@ Lisp; it is written in C and is one of the primitives of the GNU Emacs
9116system. Since it is very simple, I will digress briefly from Lisp and 9116system. Since it is very simple, I will digress briefly from Lisp and
9117describe it here. 9117describe it here.
9118 9118
9119@c GNU Emacs 22 in /usr/local/src/emacs/src/editfns.c 9119@c GNU Emacs 24 in src/editfns.c
9120@c the DEFUN for buffer-substring-no-properties 9120@c the DEFUN for delete-and-extract-region
9121 9121
9122@need 1500 9122@need 1500
9123Like many of the other Emacs primitives, 9123Like many of the other Emacs primitives,
@@ -9127,22 +9127,15 @@ like this:
9127 9127
9128@smallexample 9128@smallexample
9129@group 9129@group
9130DEFUN ("buffer-substring-no-properties", Fbuffer_substring_no_properties, 9130DEFUN ("delete-and-extract-region", Fdelete_and_extract_region,
9131 Sbuffer_substring_no_properties, 2, 2, 0, 9131 Sdelete_and_extract_region, 2, 2, 0,
9132 doc: /* Return the characters of part of the buffer, 9132 doc: /* Delete the text between START and END and return it. */)
9133without the text properties. 9133 (Lisp_Object start, Lisp_Object end)
9134The two arguments START and END are character positions;
9135they can be in either order. */)
9136 (start, end)
9137 Lisp_Object start, end;
9138@{ 9134@{
9139 register int b, e;
9140
9141 validate_region (&start, &end); 9135 validate_region (&start, &end);
9142 b = XINT (start); 9136 if (XINT (start) == XINT (end))
9143 e = XINT (end); 9137 return empty_unibyte_string;
9144 9138 return del_range_1 (XINT (start), XINT (end), 1, 1);
9145 return make_buffer_string (b, e, 0);
9146@} 9139@}
9147@end group 9140@end group
9148@end smallexample 9141@end smallexample
@@ -9192,20 +9185,9 @@ and provides a prompt.
9192 9185
9193@item 9186@item
9194The seventh part is a documentation string, just like the one for a 9187The seventh part is a documentation string, just like the one for a
9195function written in Emacs Lisp, except that every newline must be 9188function written in Emacs Lisp. This is written as a C comment. (When
9196written explicitly as @samp{\n} followed by a backslash and carriage 9189you build Emacs, the program @command{lib-src/make-docfile} extracts
9197return. 9190these comments and uses them to make the ``real'' documentation.)
9198
9199@need 1000
9200Thus, the first two lines of documentation for @code{goto-char} are
9201written like this:
9202
9203@smallexample
9204@group
9205 "Set point to POSITION, a number or marker.\n\
9206Beginning of buffer is position (point-min), end is (point-max)."
9207@end group
9208@end smallexample
9209@end itemize 9191@end itemize
9210 9192
9211@need 1200 9193@need 1200
@@ -9218,15 +9200,15 @@ consists of the following four lines:
9218@group 9200@group
9219validate_region (&start, &end); 9201validate_region (&start, &end);
9220if (XINT (start) == XINT (end)) 9202if (XINT (start) == XINT (end))
9221 return build_string (""); 9203 return empty_unibyte_string;
9222return del_range_1 (XINT (start), XINT (end), 1, 1); 9204return del_range_1 (XINT (start), XINT (end), 1, 1);
9223@end group 9205@end group
9224@end smallexample 9206@end smallexample
9225 9207
9226The @code{validate_region} function checks whether the values 9208The @code{validate_region} function checks whether the values
9227passed as the beginning and end of the region are the proper type and 9209passed as the beginning and end of the region are the proper type and
9228are within range. If the beginning and end positions are the same, 9210are within range. If the beginning and end positions are the same,
9229then return and empty string. 9211then return an empty string.
9230 9212
9231The @code{del_range_1} function actually deletes the text. It is a 9213The @code{del_range_1} function actually deletes the text. It is a
9232complex function we will not look into. It updates the buffer and 9214complex function we will not look into. It updates the buffer and