kill-whole-line
is quite useful as it completely deletes both content and whitespace unlike kill-line
which only deletes contents in line. But in lisp-mode
, it is necessary to keep parens in tact and kill-whole-line
fails there.
Update:
If point is in a buffer like this
|(setq foo "bar")
(setq foo1 "bar1")
if i kill line, it should become
|(setq foo1 "bar1")
but not
|
(setq foo1 "bar1")
On the other hand, if point is in a buffer like this
(defun foo ()
|(message "foo"))
if i kill line, it should become
(defun foo ()
|)
How can i kill whole line and keep parens intact?
C-M-k
thenM-SPC
orM-/
depending on a situation.M-\
-delete-horizontal-space
.