diff options
| author | Glenn Morris | 2013-03-02 18:34:48 -0800 |
|---|---|---|
| committer | Glenn Morris | 2013-03-02 18:34:48 -0800 |
| commit | 2d7d23256f4bbf716ab81f49ce7cef5196da7092 (patch) | |
| tree | b4c2f585fd6e2d4fea8b577f2ba3e78dfe2e9a06 | |
| parent | 9bed73f34308231324c976e68f9bf413ba6d94cd (diff) | |
| download | emacs-2d7d23256f4bbf716ab81f49ce7cef5196da7092.tar.gz emacs-2d7d23256f4bbf716ab81f49ce7cef5196da7092.zip | |
* emacs-lisp-intro.texi (Digression into C): Update example.
| -rw-r--r-- | doc/lispintro/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/lispintro/emacs-lisp-intro.texi | 48 |
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 @@ | |||
| 1 | 2013-03-03 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp-intro.texi (Digression into C): Update example. | ||
| 4 | |||
| 1 | 2012-12-22 Glenn Morris <rgm@gnu.org> | 5 | 2012-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 | |||
| 9116 | system. Since it is very simple, I will digress briefly from Lisp and | 9116 | system. Since it is very simple, I will digress briefly from Lisp and |
| 9117 | describe it here. | 9117 | describe 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 |
| 9123 | Like many of the other Emacs primitives, | 9123 | Like many of the other Emacs primitives, |
| @@ -9127,22 +9127,15 @@ like this: | |||
| 9127 | 9127 | ||
| 9128 | @smallexample | 9128 | @smallexample |
| 9129 | @group | 9129 | @group |
| 9130 | DEFUN ("buffer-substring-no-properties", Fbuffer_substring_no_properties, | 9130 | DEFUN ("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. */) |
| 9133 | without the text properties. | 9133 | (Lisp_Object start, Lisp_Object end) |
| 9134 | The two arguments START and END are character positions; | ||
| 9135 | they 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 |
| 9194 | The seventh part is a documentation string, just like the one for a | 9187 | The seventh part is a documentation string, just like the one for a |
| 9195 | function written in Emacs Lisp, except that every newline must be | 9188 | function written in Emacs Lisp. This is written as a C comment. (When |
| 9196 | written explicitly as @samp{\n} followed by a backslash and carriage | 9189 | you build Emacs, the program @command{lib-src/make-docfile} extracts |
| 9197 | return. | 9190 | these comments and uses them to make the ``real'' documentation.) |
| 9198 | |||
| 9199 | @need 1000 | ||
| 9200 | Thus, the first two lines of documentation for @code{goto-char} are | ||
| 9201 | written like this: | ||
| 9202 | |||
| 9203 | @smallexample | ||
| 9204 | @group | ||
| 9205 | "Set point to POSITION, a number or marker.\n\ | ||
| 9206 | Beginning 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 |
| 9219 | validate_region (&start, &end); | 9201 | validate_region (&start, &end); |
| 9220 | if (XINT (start) == XINT (end)) | 9202 | if (XINT (start) == XINT (end)) |
| 9221 | return build_string (""); | 9203 | return empty_unibyte_string; |
| 9222 | return del_range_1 (XINT (start), XINT (end), 1, 1); | 9204 | return del_range_1 (XINT (start), XINT (end), 1, 1); |
| 9223 | @end group | 9205 | @end group |
| 9224 | @end smallexample | 9206 | @end smallexample |
| 9225 | 9207 | ||
| 9226 | The @code{validate_region} function checks whether the values | 9208 | The @code{validate_region} function checks whether the values |
| 9227 | passed as the beginning and end of the region are the proper type and | 9209 | passed as the beginning and end of the region are the proper type and |
| 9228 | are within range. If the beginning and end positions are the same, | 9210 | are within range. If the beginning and end positions are the same, |
| 9229 | then return and empty string. | 9211 | then return an empty string. |
| 9230 | 9212 | ||
| 9231 | The @code{del_range_1} function actually deletes the text. It is a | 9213 | The @code{del_range_1} function actually deletes the text. It is a |
| 9232 | complex function we will not look into. It updates the buffer and | 9214 | complex function we will not look into. It updates the buffer and |