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
|