Emacs elisp snippet: jlh-join-lines

| | Comments (0) | TrackBacks (0)
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))))

0 TrackBacks

Listed below are links to blogs that reference this entry: Emacs elisp snippet: jlh-join-lines.

TrackBack URL for this entry: http://blog.jdhuntington.com/mt-tb.cgi/16

Leave a comment

About this Entry

This page contains a single entry by JD Huntington published on January 28, 2011 4:22 PM.

Wallpapr - Yet Another Android Wallpaper Application was the previous entry in this blog.

Emacs Major Mode: LESS CSS is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.1