diff src/window.c @ 98:0d2f883870bc r20-1b1

Import from CVS: tag r20-1b1
author cvs
date Mon, 13 Aug 2007 09:13:56 +0200
parents 131b0175ea99
children a145efe76779
line wrap: on
line diff
--- a/src/window.c	Mon Aug 13 09:12:43 2007 +0200
+++ b/src/window.c	Mon Aug 13 09:13:56 2007 +0200
@@ -4041,15 +4041,23 @@
 
 }
 
+extern int signal_error_on_buffer_boundary;
+
 DEFUN ("scroll-up", Fscroll_up, 0, 1, "_P", /*
 Scroll text of current window upward ARG lines; or near full screen if no ARG.
 A near full screen is `next-screen-context-lines' less than a full screen.
 Negative ARG means scroll downward.
 When calling from a program, supply a number as argument or nil.
+
+If `signal-error-on-buffer-boundary' is nil, the usual error and
+loss of zmacs region is suppressed when moving past end of buffer.
 */
        (n))
 {
-  window_scroll (Fselected_window (Qnil), n, 1, ERROR_ME);
+  Error_behavior errb =
+    signal_error_on_buffer_boundary ? ERROR_ME : ERROR_ME_NOT;
+
+  window_scroll (Fselected_window (Qnil), n, 1, errb);
   return Qnil;
 }
 
@@ -4058,10 +4066,16 @@
 A near full screen is `next-screen-context-lines' less than a full screen.
 Negative ARG means scroll upward.
 When calling from a program, supply a number as argument or nil.
+
+If `signal-error-on-buffer-boundary' is nil, the usual error and
+loss of zmacs region is suppressed when moving past end of buffer.
 */
        (n))
 {
-  window_scroll (Fselected_window (Qnil), n, -1, ERROR_ME);
+  Error_behavior errb =
+    signal_error_on_buffer_boundary ? ERROR_ME : ERROR_ME_NOT;
+
+  window_scroll (Fselected_window (Qnil), n, -1, errb);
   return Qnil;
 }