changeset 10226:1817c5332316

(next-line, previous-line): If interactive and not in kbd macro, catch the error and beep instead.
author Richard M. Stallman <rms@gnu.org>
date Fri, 23 Dec 1994 17:25:50 +0000
parents 2e5dcd5f3090
children 31d062ac1d2f
files lisp/simple.el
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Fri Dec 23 15:11:57 1994 +0000
+++ b/lisp/simple.el	Fri Dec 23 17:25:50 1994 +0000
@@ -1535,9 +1535,9 @@
 the cursor is positioned after the character in that line which spans this
 column, or at the end of the line if it is not long enough.
 If there is no line in the buffer after this one, behavior depends on the
-value of next-line-add-newlines.  If non-nil, a newline character is inserted
-to create a line and the cursor moves to that line, otherwise the cursor is
-moved to the end of the buffer (if already at the end of the buffer, an error
+value of `next-line-add-newlines'.  If non-nil, it inserts a newline character
+to create a line, and moves the cursor to that line.  Otherwise it moves the
+cursor to the end of the buffer (if already at the end of the buffer, an error
 is signaled).
 
 The command \\[set-goal-column] can be used to create
@@ -1556,7 +1556,11 @@
 	    (insert ?\n)
 	  (goto-char opoint)
 	  (line-move arg)))
-    (line-move arg))
+    (if (interactive-p)
+	(condition-case nil
+	    (line-move arg)
+	  ((beginning-of-buffer end-of-buffer) (ding)))
+      (line-move arg)))
   nil)
 
 (defun previous-line (arg)
@@ -1573,7 +1577,11 @@
 `forward-line' with a negative argument instead.  It is usually easier
 to use and more reliable (no dependence on goal column, etc.)."
   (interactive "p")
-  (line-move (- arg))
+  (if (interactive-p)
+      (condition-case nil
+	  (line-move (- arg))
+	((beginning-of-buffer end-of-buffer) (ding)))
+    (line-move (- arg)))
   nil)
 
 (defconst track-eol nil