From 6f6a80089724d9f2d69e0677c1ab61e7b70304ad Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Thu, 31 Jul 2025 10:51:21 +0200 Subject: [PATCH] Add editor command COM-KILL-LINE Works as close as I care to get it to its Emacs counterpart --- editor/editor.lisp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/editor/editor.lisp b/editor/editor.lisp index 1b8aed1..a44fed0 100644 --- a/editor/editor.lisp +++ b/editor/editor.lisp @@ -640,6 +640,17 @@ Additionally ensures correct line numbers on the way, as a bonus." (decf column) (redisplay-line line))))) +(defun com-kill-line () + (with-editor-accessors *editor* (:current-column column + :current-line line) + (cond ((and (= column (line-length line)) (null (next-line line))) + (feep)) + ((= column (line-length line)) + (com-forward-delete)) + (t + (setf (fill-pointer (line-content line)) column) + (redisplay-line line :start column))))) + (defun com-newline () (with-editor-accessors *editor* (:current-column column :current-line line) @@ -888,6 +899,7 @@ Additionally ensures correct line numbers on the way, as a bonus." (:left com-backward-char) (#\Del com-backward-delete) ((:c . #\d) com-forward-delete) + ((:c . #\k) com-kill-line) ((:c . #\j) com-newline) ((:c . #\n) com-new-buffer) ((:c . #\l) com-refresh-screen)