diff options
| author | Eli Zaretskii | 2015-11-27 12:07:08 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-11-27 12:07:08 +0200 |
| commit | 3f42061bb631361465a7693035f220760a74133b (patch) | |
| tree | 28af9170bc8fc91535d9e335643a02c06160651e /src | |
| parent | 33460000f92fbfd054937aa3555f6cf27567716d (diff) | |
| download | emacs-3f42061bb631361465a7693035f220760a74133b.tar.gz emacs-3f42061bb631361465a7693035f220760a74133b.zip | |
Improve documentation of 'eval-buffer' and 'eval-region'
* src/lread.c (Feval_buffer, Feval_region): Doc fixes. (Bug#22023)
* doc/lispref/eval.texi (Eval): Mention narrowing to clarify
"accessible portion of buffer".
Diffstat (limited to 'src')
| -rw-r--r-- | src/lread.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/lread.c b/src/lread.c index 2239bfc452a..94f373c3539 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -1941,17 +1941,22 @@ readevalloop (Lisp_Object readcharfun, | |||
| 1941 | } | 1941 | } |
| 1942 | 1942 | ||
| 1943 | DEFUN ("eval-buffer", Feval_buffer, Seval_buffer, 0, 5, "", | 1943 | DEFUN ("eval-buffer", Feval_buffer, Seval_buffer, 0, 5, "", |
| 1944 | doc: /* Execute the current buffer as Lisp code. | 1944 | doc: /* Execute the accessible portion of current buffer as Lisp code. |
| 1945 | You can use \\[narrow-to-region] to limit the part of buffer to be evaluated. | ||
| 1945 | When called from a Lisp program (i.e., not interactively), this | 1946 | When called from a Lisp program (i.e., not interactively), this |
| 1946 | function accepts up to five optional arguments: | 1947 | function accepts up to five optional arguments: |
| 1947 | BUFFER is the buffer to evaluate (nil means use current buffer). | 1948 | BUFFER is the buffer to evaluate (nil means use current buffer), |
| 1948 | PRINTFLAG controls printing of output: | 1949 | or a name of a buffer (a string). |
| 1949 | A value of nil means discard it; anything else is stream for print. | 1950 | PRINTFLAG controls printing of output by any output functions in the |
| 1951 | evaluated code, such as `print', `princ', and `prin1': | ||
| 1952 | a value of nil means discard it; anything else is the stream to print to. | ||
| 1953 | See Info node `(elisp)Output Streams' for details on streams. | ||
| 1950 | FILENAME specifies the file name to use for `load-history'. | 1954 | FILENAME specifies the file name to use for `load-history'. |
| 1951 | UNIBYTE, if non-nil, specifies `load-convert-to-unibyte' for this | 1955 | UNIBYTE, if non-nil, specifies `load-convert-to-unibyte' for this |
| 1952 | invocation. | 1956 | invocation. |
| 1953 | DO-ALLOW-PRINT, if non-nil, specifies that `print' and related | 1957 | DO-ALLOW-PRINT, if non-nil, specifies that output functions in the |
| 1954 | functions should work normally even if PRINTFLAG is nil. | 1958 | evaluated code should work normally even if PRINTFLAG is nil, in |
| 1959 | which case the output is displayed in the echo area. | ||
| 1955 | 1960 | ||
| 1956 | This function preserves the position of point. */) | 1961 | This function preserves the position of point. */) |
| 1957 | (Lisp_Object buffer, Lisp_Object printflag, Lisp_Object filename, Lisp_Object unibyte, Lisp_Object do_allow_print) | 1962 | (Lisp_Object buffer, Lisp_Object printflag, Lisp_Object filename, Lisp_Object unibyte, Lisp_Object do_allow_print) |
| @@ -1992,7 +1997,8 @@ When called from programs, expects two arguments, | |||
| 1992 | giving starting and ending indices in the current buffer | 1997 | giving starting and ending indices in the current buffer |
| 1993 | of the text to be executed. | 1998 | of the text to be executed. |
| 1994 | Programs can pass third argument PRINTFLAG which controls output: | 1999 | Programs can pass third argument PRINTFLAG which controls output: |
| 1995 | A value of nil means discard it; anything else is stream for printing it. | 2000 | a value of nil means discard it; anything else is stream for printing it. |
| 2001 | See Info node `(elisp)Output Streams' for details on streams. | ||
| 1996 | Also the fourth argument READ-FUNCTION, if non-nil, is used | 2002 | Also the fourth argument READ-FUNCTION, if non-nil, is used |
| 1997 | instead of `read' to read each expression. It gets one argument | 2003 | instead of `read' to read each expression. It gets one argument |
| 1998 | which is the input stream for reading characters. | 2004 | which is the input stream for reading characters. |