aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/simple.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 1662127fe57..3731fbebb13 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1387,6 +1387,11 @@ The goal column is stored in the variable `goal-column'."
1387 goal-column)) 1387 goal-column))
1388 nil) 1388 nil)
1389 1389
1390;;; Make arrow keys do the right thing for improved terminal support
1391;;; When we implement true horizontal autoscrolling, right-arrow and
1392;;; left-arrow can lose the (if truncate-lines ...) clause and become
1393;;; aliases.
1394
1390(defun right-arrow (arg) 1395(defun right-arrow (arg)
1391 "Move right one character on the screen (with prefix ARG, that many chars). 1396 "Move right one character on the screen (with prefix ARG, that many chars).
1392Scroll right if needed to keep point horizontally onscreen." 1397Scroll right if needed to keep point horizontally onscreen."
@@ -1404,6 +1409,15 @@ Scroll left if needed to keep point horizontally onscreen."
1404 (if truncate-lines 1409 (if truncate-lines
1405 (let ((x (current-column)) (w (- (window-width) 2))) 1410 (let ((x (current-column)) (w (- (window-width) 2)))
1406 (set-window-hscroll (selected-window) (- x (% x w)) )))) 1411 (set-window-hscroll (selected-window) (- x (% x w)) ))))
1412
1413(defun down-arrow (arg)
1414 "Move down one line on the screen (with prefix ARG, that many lines).
1415If doing so would add lines to the end of the buffer, raise an error."
1416 (interactive "P")
1417 (let ((next-line-add-newlines nil))
1418 (next-line 1)))
1419
1420(defalias 'up-arrow 'previous-line)
1407 1421
1408(defun transpose-chars (arg) 1422(defun transpose-chars (arg)
1409 "Interchange characters around point, moving forward one character. 1423 "Interchange characters around point, moving forward one character.