aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoseph Arceneaux1992-06-02 04:15:32 +0000
committerJoseph Arceneaux1992-06-02 04:15:32 +0000
commit228d4b1c2ca4af62f74ba0a2edc03f962e20f544 (patch)
treeeafb177374cb74f16322c3be8efc4c48315a60e2 /src
parent6370a710ed28794d17cb27262bf995e175473cb0 (diff)
downloademacs-228d4b1c2ca4af62f74ba0a2edc03f962e20f544.tar.gz
emacs-228d4b1c2ca4af62f74ba0a2edc03f962e20f544.zip
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/buffer.h2
-rw-r--r--src/lread.c37
2 files changed, 38 insertions, 1 deletions
diff --git a/src/buffer.h b/src/buffer.h
index a1d838c037d..a75d81bfd4a 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -71,6 +71,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
71/* Now similar macros for a specified buffer. 71/* Now similar macros for a specified buffer.
72 Note that many of these evaluate the buffer argument more than once. */ 72 Note that many of these evaluate the buffer argument more than once. */
73 73
74#define BUF_SET_PT(buffer, position) (buffer->text.pt = (position))
75
74/* Character position of beginning of buffer. */ 76/* Character position of beginning of buffer. */
75#define BUF_BEG(buf) (1) 77#define BUF_BEG(buf) (1)
76 78
diff --git a/src/lread.c b/src/lread.c
index 5ffa1ea5183..930a9e56839 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -500,6 +500,40 @@ readevalloop (readcharfun, stream, evalfun, printflag)
500 500
501#ifndef standalone 501#ifndef standalone
502 502
503DEFUN ("eval-buffer", Feval_buffer, Seval_buffer, 0, 2, "bBuffer: ",
504 "Execute BUFFER as Lisp code. If BUFFER is nil, use the current buffer.\n\
505Programs can pass argument PRINTFLAG which controls printing of output:\n\
506nil means discard it; anything else is stream for print.\n\
507\n\
508If there is no error, point does not move. If there is an error,\n\
509point remains at the end of the last character read from the buffer.")
510 (bufname, printflag)
511 Lisp_Object bufname, printflag;
512{
513 int count = specpdl_ptr - specpdl;
514 Lisp_Object tem, buf;
515
516 if (NIL_P (bufname))
517 buf = Fcurrent_buffer ();
518 else
519 buf = Fget_buffer (bufname);
520 if (NIL_P (buf))
521 error ("No such buffer.");
522
523 if (NIL_P (printflag))
524 tem = Qsymbolp;
525 else
526 tem = printflag;
527 specbind (Qstandard_output, tem);
528 record_unwind_protect (save_excursion_restore, save_excursion_save ());
529 BUF_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf)));
530 readevalloop (buf, 0, Feval, !NIL_P (printflag));
531 unbind_to (count);
532
533 return Qnil;
534}
535
536#if 0
503DEFUN ("eval-current-buffer", Feval_current_buffer, Seval_current_buffer, 0, 1, "", 537DEFUN ("eval-current-buffer", Feval_current_buffer, Seval_current_buffer, 0, 1, "",
504 "Execute the current buffer as Lisp code.\n\ 538 "Execute the current buffer as Lisp code.\n\
505Programs can pass argument PRINTFLAG which controls printing of output:\n\ 539Programs can pass argument PRINTFLAG which controls printing of output:\n\
@@ -523,6 +557,7 @@ point remains at the end of the last character read from the buffer.")
523 readevalloop (Fcurrent_buffer (), 0, Feval, !NILP (printflag)); 557 readevalloop (Fcurrent_buffer (), 0, Feval, !NILP (printflag));
524 return unbind_to (count, Qnil); 558 return unbind_to (count, Qnil);
525} 559}
560#endif
526 561
527DEFUN ("eval-region", Feval_region, Seval_region, 2, 3, "r", 562DEFUN ("eval-region", Feval_region, Seval_region, 2, 3, "r",
528 "Execute the region as Lisp code.\n\ 563 "Execute the region as Lisp code.\n\
@@ -1499,7 +1534,7 @@ syms_of_lread ()
1499 defsubr (&Sintern); 1534 defsubr (&Sintern);
1500 defsubr (&Sintern_soft); 1535 defsubr (&Sintern_soft);
1501 defsubr (&Sload); 1536 defsubr (&Sload);
1502 defsubr (&Seval_current_buffer); 1537 defsubr (&Seval_buffer);
1503 defsubr (&Seval_region); 1538 defsubr (&Seval_region);
1504 defsubr (&Sread_char); 1539 defsubr (&Sread_char);
1505 defsubr (&Sread_char_exclusive); 1540 defsubr (&Sread_char_exclusive);