aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-04-29 13:57:52 +0000
committerRichard M. Stallman1993-04-29 13:57:52 +0000
commitdff7d67f2623e60434b5fe22161d2dc1c0255187 (patch)
tree66ca51061d520e8f083111228bd6ee3d86c1950b
parenteabf01d460f4c55fa323e3f4db50490d67f98bfb (diff)
downloademacs-dff7d67f2623e60434b5fe22161d2dc1c0255187.tar.gz
emacs-dff7d67f2623e60434b5fe22161d2dc1c0255187.zip
(up-arrow, down-arrow, left-arrow, right-arrow): Deleted.
(kill-line, next-line-add-newlines): Doc fix. (kill-whole-line): Doc fix. (kill-forward-chars, kill-forward-chars): Reinsert as before. Change defalias to define-function.
-rw-r--r--lisp/simple.el84
1 files changed, 46 insertions, 38 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 3196eee32b3..eca0b9817ac 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -201,6 +201,18 @@ column specified by the variable `left-margin'."
201 (newline) 201 (newline)
202 (indent-according-to-mode)) 202 (indent-according-to-mode))
203 203
204;; Internal subroutine of delete-char
205(defun kill-forward-chars (arg)
206 (if (listp arg) (setq arg (car arg)))
207 (if (eq arg '-) (setq arg -1))
208 (kill-region (point) (+ (point) arg)))
209
210;; Internal subroutine of backward-delete-char
211(defun kill-backward-chars (arg)
212 (if (listp arg) (setq arg (car arg)))
213 (if (eq arg '-) (setq arg -1))
214 (kill-region (point) (- (point) arg)))
215
204(defun backward-delete-char-untabify (arg &optional killp) 216(defun backward-delete-char-untabify (arg &optional killp)
205 "Delete characters backward, changing tabs into spaces. 217 "Delete characters backward, changing tabs into spaces.
206Delete ARG chars, and kill (save in kill ring) if KILLP is non-nil. 218Delete ARG chars, and kill (save in kill ring) if KILLP is non-nil.
@@ -568,7 +580,7 @@ Get previous element of history which is a completion of minibuffer contents."
568 (forward-line (1- arg))))) 580 (forward-line (1- arg)))))
569 581
570;Put this on C-x u, so we can force that rather than C-_ into startup msg 582;Put this on C-x u, so we can force that rather than C-_ into startup msg
571(defalias 'advertised-undo 'undo) 583(define-function 'advertised-undo 'undo)
572 584
573(defun undo (&optional arg) 585(defun undo (&optional arg)
574 "Undo some previous changes. 586 "Undo some previous changes.
@@ -838,17 +850,18 @@ Repeating \\[universal-argument] without digits or minus sign
838 (skip-chars-forward " \t")) 850 (skip-chars-forward " \t"))
839 851
840(defvar kill-whole-line nil 852(defvar kill-whole-line nil
841 "*If non-nil, kill-line kills the whole line (including the newline) 853 "*If non-nil, `kill-line' with no arg at beg of line kills the whole line.")
842 if point is positioned at the beginning of a line.")
843 854
844(defun kill-line (&optional arg) 855(defun kill-line (&optional arg)
845 "Kill the rest of the current line; if the line is blank, or if point is at 856 "Kill the rest of the current line; if no nonblanks there, kill thru newline.
846the beginning of the line and kill-whole-line is non-nil, kill thru newline.
847With prefix argument, kill that many lines from point. 857With prefix argument, kill that many lines from point.
848Negative arguments kill lines backward. 858Negative arguments kill lines backward.
849 859
850When calling from a program, nil means \"no arg\", 860When calling from a program, nil means \"no arg\",
851a number counts as a prefix arg." 861a number counts as a prefix arg.
862
863If `kill-whole-line' is non-nil, then kill the whole line
864when given no argument at the beginning of a line."
852 (interactive "P") 865 (interactive "P")
853 (kill-region (point) 866 (kill-region (point)
854 ;; Don't shift point before doing the delete; that way, 867 ;; Don't shift point before doing the delete; that way,
@@ -1254,7 +1267,7 @@ Does not set point. Does nothing if mark ring is empty."
1254 (if (null (mark)) (ding)) 1267 (if (null (mark)) (ding))
1255 (setq mark-ring (cdr mark-ring))))) 1268 (setq mark-ring (cdr mark-ring)))))
1256 1269
1257(defalias 'exchange-dot-and-mark 'exchange-point-and-mark) 1270(define-function 'exchange-dot-and-mark 'exchange-point-and-mark)
1258(defun exchange-point-and-mark () 1271(defun exchange-point-and-mark ()
1259 "Put the mark where point is now, and point where the mark is now. 1272 "Put the mark where point is now, and point where the mark is now.
1260This command works even when the mark is not active, 1273This command works even when the mark is not active,
@@ -1268,9 +1281,7 @@ and it reactivates the mark."
1268 nil)) 1281 nil))
1269 1282
1270(defvar next-line-add-newlines t 1283(defvar next-line-add-newlines t
1271 "*If non-nil, next-line will insert a newline into the buffer 1284 "*If non-nil, `next-line' inserts newline to avoid `end of buffer' error.")
1272 when invoked with no newline character between the point and the end
1273 of the buffer.")
1274 1285
1275(defun next-line (arg) 1286(defun next-line (arg)
1276 "Move cursor vertically down ARG lines. 1287 "Move cursor vertically down ARG lines.
@@ -1409,34 +1420,31 @@ If this is zero, point is always centered after it moves off frame.")
1409 (scroll-left (- (- here min) delta)) 1420 (scroll-left (- (- here min) delta))
1410 )))) 1421 ))))
1411 1422
1412;;; Make arrow keys do the right thing for improved terminal support 1423;; rms: (1) The definitions of arrow keys should not simply restate
1413;;; When we implement true horizontal autoscrolling, right-arrow and 1424;; what keys they are. The arrow keys should run the ordinary commands.
1414;;; left-arrow can lose the (if truncate-lines ...) clause and become 1425;; (2) The arrow keys are just one of many common ways of moving point
1415;;; aliases. These functions are bound to the corresponding keyboard 1426;; within a line. Real horizontal autoscrolling would be a good feature,
1416;;; events in loaddefs.el. 1427;; but supporting it only for arrow keys is too incomplete to be desirable.
1417 1428
1418(defun right-arrow (arg) 1429;;;;; Make arrow keys do the right thing for improved terminal support
1419 "Move right one character on the screen (with prefix ARG, that many chars). 1430;;;;; When we implement true horizontal autoscrolling, right-arrow and
1420Scroll right if needed to keep point horizontally onscreen." 1431;;;;; left-arrow can lose the (if truncate-lines ...) clause and become
1421 (interactive "P") 1432;;;;; aliases. These functions are bound to the corresponding keyboard
1422 (forward-char arg) 1433;;;;; events in loaddefs.el.
1423 (hscroll-point-visible)) 1434
1424 1435;;(defun right-arrow (arg)
1425(defun left-arrow (arg) 1436;; "Move right one character on the screen (with prefix ARG, that many chars).
1426 "Move left one character on the screen (with prefix ARG, that many chars). 1437;;Scroll right if needed to keep point horizontally onscreen."
1427Scroll left if needed to keep point horizontally onscreen." 1438;; (interactive "P")
1428 (interactive "P") 1439;; (forward-char arg)
1429 (backward-char arg) 1440;; (hscroll-point-visible))
1430 (hscroll-point-visible)) 1441
1431 1442;;(defun left-arrow (arg)
1432(defun down-arrow (arg) 1443;; "Move left one character on the screen (with prefix ARG, that many chars).
1433 "Move down one line on the screen (with prefix ARG, that many lines). 1444;;Scroll left if needed to keep point horizontally onscreen."
1434If doing so would add lines to the end of the buffer, raise an error." 1445;; (interactive "P")
1435 (interactive "P") 1446;; (backward-char arg)
1436 (let ((next-line-add-newlines nil)) 1447;; (hscroll-point-visible))
1437 (next-line 1)))
1438
1439(defalias 'up-arrow 'previous-line)
1440 1448
1441(defun transpose-chars (arg) 1449(defun transpose-chars (arg)
1442 "Interchange characters around point, moving forward one character. 1450 "Interchange characters around point, moving forward one character.