diff options
| author | Richard M. Stallman | 1997-09-07 18:32:49 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-09-07 18:32:49 +0000 |
| commit | 13febd855d89ec4d59c5e64fa6710189877b3024 (patch) | |
| tree | 2821c61af1290f796b413f054d1cf543673b82b8 /src/lread.c | |
| parent | 0b79b2ace8aae013282ef814b1f4dcd75057edf7 (diff) | |
| download | emacs-13febd855d89ec4d59c5e64fa6710189877b3024.tar.gz emacs-13febd855d89ec4d59c5e64fa6710189877b3024.zip | |
(Feval_buffer): New arg FILENAME.
Diffstat (limited to 'src/lread.c')
| -rw-r--r-- | src/lread.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/lread.c b/src/lread.c index 458992cfaa8..a2c90e7f2b1 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -941,16 +941,19 @@ readevalloop (readcharfun, stream, sourcename, evalfun, printflag) | |||
| 941 | 941 | ||
| 942 | #ifndef standalone | 942 | #ifndef standalone |
| 943 | 943 | ||
| 944 | DEFUN ("eval-buffer", Feval_buffer, Seval_buffer, 0, 2, "", | 944 | DEFUN ("eval-buffer", Feval_buffer, Seval_buffer, 0, 3, "", |
| 945 | "Execute the current buffer as Lisp code.\n\ | 945 | "Execute the current buffer as Lisp code.\n\ |
| 946 | Programs can pass two arguments, BUFFER and PRINTFLAG.\n\ | 946 | Programs can pass two arguments, BUFFER and PRINTFLAG.\n\ |
| 947 | BUFFER is the buffer to evaluate (nil means use current buffer).\n\ | 947 | BUFFER is the buffer to evaluate (nil means use current buffer).\n\ |
| 948 | PRINTFLAG controls printing of output:\n\ | 948 | PRINTFLAG controls printing of output:\n\ |
| 949 | nil means discard it; anything else is stream for print.\n\ | 949 | nil means discard it; anything else is stream for print.\n\ |
| 950 | \n\ | 950 | \n\ |
| 951 | If the optional third argument FILENAME is non-nil,\n\ | ||
| 952 | it specifies the file name to use for `load-history'.\n\ | ||
| 953 | \n\ | ||
| 951 | This function preserves the position of point.") | 954 | This function preserves the position of point.") |
| 952 | (buffer, printflag) | 955 | (buffer, printflag, filename) |
| 953 | Lisp_Object buffer, printflag; | 956 | Lisp_Object buffer, printflag, filename; |
| 954 | { | 957 | { |
| 955 | int count = specpdl_ptr - specpdl; | 958 | int count = specpdl_ptr - specpdl; |
| 956 | Lisp_Object tem, buf; | 959 | Lisp_Object tem, buf; |
| @@ -960,16 +963,20 @@ This function preserves the position of point.") | |||
| 960 | else | 963 | else |
| 961 | buf = Fget_buffer (buffer); | 964 | buf = Fget_buffer (buffer); |
| 962 | if (NILP (buf)) | 965 | if (NILP (buf)) |
| 963 | error ("No such buffer."); | 966 | error ("No such buffer"); |
| 964 | 967 | ||
| 965 | if (NILP (printflag)) | 968 | if (NILP (printflag)) |
| 966 | tem = Qsymbolp; | 969 | tem = Qsymbolp; |
| 967 | else | 970 | else |
| 968 | tem = printflag; | 971 | tem = printflag; |
| 972 | |||
| 973 | if (NILP (filename)) | ||
| 974 | filename = XBUFFER (buf)->filename; | ||
| 975 | |||
| 969 | specbind (Qstandard_output, tem); | 976 | specbind (Qstandard_output, tem); |
| 970 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); | 977 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); |
| 971 | BUF_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf))); | 978 | BUF_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf))); |
| 972 | readevalloop (buf, 0, XBUFFER (buf)->filename, Feval, !NILP (printflag)); | 979 | readevalloop (buf, 0, filename, Feval, !NILP (printflag)); |
| 973 | unbind_to (count, Qnil); | 980 | unbind_to (count, Qnil); |
| 974 | 981 | ||
| 975 | return Qnil; | 982 | return Qnil; |