# HG changeset patch # User Eric S. Raymond # Date 735718453 0 # Node ID b28675709d4168a2b00aaa920002c6b17b47a51b # Parent 48318133e7a68fe4b2fade817c934e05843ad2bd (down-arrow): New function. Uses next-line-add-newlines to suppress addition of new lines at end of buffer. (up-arrow): Alias of previous-line, added for consistency. These changes complete terminal-type-independent support for arrow keys. diff -r 48318133e7a6 -r b28675709d41 lisp/simple.el --- a/lisp/simple.el Sun Apr 25 06:14:10 1993 +0000 +++ b/lisp/simple.el Sun Apr 25 06:14:13 1993 +0000 @@ -1387,6 +1387,11 @@ goal-column)) nil) +;;; Make arrow keys do the right thing for improved terminal support +;;; When we implement true horizontal autoscrolling, right-arrow and +;;; left-arrow can lose the (if truncate-lines ...) clause and become +;;; aliases. + (defun right-arrow (arg) "Move right one character on the screen (with prefix ARG, that many chars). Scroll right if needed to keep point horizontally onscreen." @@ -1404,6 +1409,15 @@ (if truncate-lines (let ((x (current-column)) (w (- (window-width) 2))) (set-window-hscroll (selected-window) (- x (% x w)) )))) + +(defun down-arrow (arg) + "Move down one line on the screen (with prefix ARG, that many lines). +If doing so would add lines to the end of the buffer, raise an error." + (interactive "P") + (let ((next-line-add-newlines nil)) + (next-line 1))) + +(defalias 'up-arrow 'previous-line) (defun transpose-chars (arg) "Interchange characters around point, moving forward one character.