Emacs : Information and code concerning Emacs
Updated: 7/28/2003; 6:30:49 PM.

 

Subscribe to "Emacs" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

Wednesday, June 04, 2003

I've hacked together an Emacs function that I find pretty useful.  I often find myself formatting lines of data and trying to put them into a comma separated list.  I usually do some kind of regex search and replace which leaves me with lines of data with a comma at the end.  Then, I have to collapse all that data onto one line.  Usually I do this by going to the end of the list and then removing the line boundaries by holding down M-^.  This gets old, and tries my patience on long lists.  So, I hacked together the following function that would remove all the line boundaries in a region:

(defun remove-line-boundary-in-region (beginning end)
  (interactive "r")
  (save-excursion
    (goto-char end)
    (while (not (eq (point) beginning))
      (delete-indentation))))


10:37:01 AM    comment []

© Copyright 2003 Tom Pierce.



Click here to visit the Radio UserLand website.

 


June 2003
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30          
May   Jul

Search

 
How this works

Emacs Sources
wedgetsql-indent.el
wedgeuser-add-sql-folding-marks
wedgeremove-line-boundary-in-region

My Subscriptions