Add the æ-kill-or-copy-whole-line function
I’m not sure yet if this will be useful in the future, though…
This commit is contained in:
		| @@ -114,3 +114,16 @@ Version 2016-02-16" | ||||
|                     (looking-back eshell-prompt-regexp)) | ||||
|                (kill-buffer) | ||||
|              (signal (car err) (cdr err)))))) | ||||
|  | ||||
| (defun æ-kill-or-copy-whole-line (kill) | ||||
|   "Kill or copy the whole line point is on. | ||||
|  | ||||
| If KILL is non-nil, the line gets killed. Otherwise, it gets just | ||||
| copied to the kill-ring." | ||||
|   (interactive "P") | ||||
|  | ||||
|   (if kill | ||||
|       (kill-whole-line) | ||||
|     (let ((beginning (progn (beginning-of-line) (point))) | ||||
|           (end (progn (end-of-line) (point)))) | ||||
|       (copy-region-as-kill beginning end)))) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user