I frequently find myself using join-lines in emacs (usually bound to C-x ^), which is a handy function that will merge a line with the line before it. A few times this week, I've found myself needing to join more than one line in this manner. Hitting C-x ^ multiple times is pretty tedious, so I wrote this quick bit of elisp to make this process faster. It's not complicated, but it does serve my goal of reminding myself that I should be writing elisp more often to make my life easier.
(defun jlh-join-lines (arg)
"Join this line to the line above n times
Running this command with an argument of 1 is equivalent
to running 'delete-indentation (aka 'join-line)."
(interactive "NHow many lines to join?: ")
(while (> arg 0)
(join-line)
(setq arg (- arg 1))))
