summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2022-04-12 13:15:36 -0500
committerCase Duckworth2022-04-12 13:15:36 -0500
commit9b23b33921a2d6eddf09f52dfb429bc053fdbba0 (patch)
treeab71a0e5a0b351af306e68a17c7b35e549e54403 /lisp
parentStart the server if not already (diff)
downloademacs-9b23b33921a2d6eddf09f52dfb429bc053fdbba0.tar.gz
emacs-9b23b33921a2d6eddf09f52dfb429bc053fdbba0.zip
Add +crux-kill-and-join-forward
This one is visual-line-mode aware
Diffstat (limited to 'lisp')
-rw-r--r--lisp/+crux.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/+crux.el b/lisp/+crux.el index 45b4dee..c55a0b9 100644 --- a/lisp/+crux.el +++ b/lisp/+crux.el
@@ -44,5 +44,15 @@ prompt for the time format."
44 (format-time-string +crux-alternate-date-format time)) 44 (format-time-string +crux-alternate-date-format time))
45 (t (format-time-string (read-string "Time Format: ") time)))))) 45 (t (format-time-string (read-string "Time Format: ") time))))))
46 46
47(defun +crux-kill-and-join-forward (&optional arg)
48 "If at end of line, join with following; else (visual)-kill line.
49In `visual-line-mode', runs command `kill-visual-line'; in other
50modes, runs command `kill-line'. Passes ARG to command when
51provided. Deletes whitespace at join."
52 (interactive "P")
53 (if (and (eolp) (not (bolp)))
54 (delete-indentation 1)
55 (funcall (if visual-line-mode #'kill-visual-line #'kill-line) arg)))
56
47(provide '+crux) 57(provide '+crux)
48;;; +crux.el ends here 58;;; +crux.el ends here