2

Based on How do you comment out all or part of a Lisp s-exp using Paredit? I did C-M-space then M-; and got, as expected, a commented-out S-exp:

;; (when window-system
;;     (sr-speedbar-open))

Now how do I delete those semicolons? When I try the obvious (backspace or delete), only one semicolon disappears. I also can't just undo, since I've done other stuff between adding the semicolons and wanting to delete them. I could also turn off paredit for this task, but I'm certain there's a more elegant way.

Community
  • 1
  • 1
Sonicsmooth
  • 2,673
  • 2
  • 22
  • 35

1 Answers1

0

One thing you could do is re-select the region and then do M-; again, which will un-comment the given region if it's already commented. You could also try this function that I've put together which deletes backwards on a given line, while still preserving delimiters (it's basically a backwards paredit-kill). You'd just navigate to the spot after the comment semicolons and then invoke paredit-backward-delete-line, preferably with whatever key binding that you bound it to (which was <C-backspace> in my above answer).

Community
  • 1
  • 1
GDP2
  • 1,948
  • 2
  • 22
  • 38