diff options
| author | Kai Großjohann | 2003-05-19 15:47:14 +0000 |
|---|---|---|
| committer | Kai Großjohann | 2003-05-19 15:47:14 +0000 |
| commit | 348de80b31f6de0a286d83d2808beb47954d74f5 (patch) | |
| tree | 73384e9359c5e11bd53146305d526da28fc2532a | |
| parent | af253914f217ccfbc2fcae37d96e8adbd7163bc0 (diff) | |
| download | emacs-348de80b31f6de0a286d83d2808beb47954d74f5.tar.gz emacs-348de80b31f6de0a286d83d2808beb47954d74f5.zip | |
* simple.el (kill-whole-line): New function.
* bindings.el (global-map): Bind it.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/bindings.el | 1 | ||||
| -rw-r--r-- | lisp/simple.el | 19 |
3 files changed, 25 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e90f4445ce0..11eab58f2fe 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2003-05-19 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net> | ||
| 2 | |||
| 3 | * simple.el (kill-whole-line): New function. | ||
| 4 | * bindings.el (global-map): Bind it. | ||
| 5 | |||
| 1 | 2003-05-19 Richard M. Stallman <rms@gnu.org> | 6 | 2003-05-19 Richard M. Stallman <rms@gnu.org> |
| 2 | 7 | ||
| 3 | * net/goto-addr.el (goto-address-fontify-maximum-size): | 8 | * net/goto-addr.el (goto-address-fontify-maximum-size): |
diff --git a/lisp/bindings.el b/lisp/bindings.el index f95a3f588c2..7568c89c858 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el | |||
| @@ -743,6 +743,7 @@ language you are using." | |||
| 743 | ;(define-key global-map [delete] 'backward-delete-char) | 743 | ;(define-key global-map [delete] 'backward-delete-char) |
| 744 | 744 | ||
| 745 | ;; natural bindings for terminal keycaps --- defined in X keysym order | 745 | ;; natural bindings for terminal keycaps --- defined in X keysym order |
| 746 | (define-key global-map [S-backspace] 'kill-whole-line) | ||
| 746 | (define-key global-map [home] 'beginning-of-line) | 747 | (define-key global-map [home] 'beginning-of-line) |
| 747 | (define-key global-map [C-home] 'beginning-of-buffer) | 748 | (define-key global-map [C-home] 'beginning-of-buffer) |
| 748 | (define-key global-map [M-home] 'beginning-of-buffer-other-window) | 749 | (define-key global-map [M-home] 'beginning-of-buffer-other-window) |
diff --git a/lisp/simple.el b/lisp/simple.el index c726bf745bc..64b56d5dfbb 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -2205,6 +2205,25 @@ even beep.)" | |||
| 2205 | (goto-char end)))) | 2205 | (goto-char end)))) |
| 2206 | (point)))) | 2206 | (point)))) |
| 2207 | 2207 | ||
| 2208 | (defun kill-whole-line (&optional arg) | ||
| 2209 | "Kill current line. | ||
| 2210 | With prefix arg, kill that many lines from point. | ||
| 2211 | If arg is negative, kill backwards. | ||
| 2212 | If arg is zero, kill current line but exclude the trailing newline." | ||
| 2213 | (interactive "P") | ||
| 2214 | (setq arg (prefix-numeric-value arg)) | ||
| 2215 | (cond ((zerop arg) | ||
| 2216 | (kill-region (point) (progn (forward-visible-line 0) (point))) | ||
| 2217 | (kill-region (point) (progn (end-of-visible-line) (point)))) | ||
| 2218 | ((< arg 0) | ||
| 2219 | (kill-line 1) | ||
| 2220 | (kill-line (1+ arg)) | ||
| 2221 | (unless (bobp) (forward-visible-line -1))) | ||
| 2222 | (t | ||
| 2223 | (kill-line 0) | ||
| 2224 | (if (eobp) | ||
| 2225 | (signal 'end-of-buffer nil) | ||
| 2226 | (kill-line arg))))) | ||
| 2208 | 2227 | ||
| 2209 | (defun forward-visible-line (arg) | 2228 | (defun forward-visible-line (arg) |
| 2210 | "Move forward by ARG lines, ignoring currently invisible newlines only. | 2229 | "Move forward by ARG lines, ignoring currently invisible newlines only. |