combobulate icon indicating copy to clipboard operation
combobulate copied to clipboard

Unwrap envelope

Open phuhl opened this issue 2 years ago • 1 comments

I found the envelope functions very nice to use. But I did not find a way to unwrap something.

I.e. when using M-( to wrap <div/> in parenthesis it would be great to also have M-) to remove the parenthesis again. Similar for the other envelope types.

phuhl avatar Apr 27 '23 09:04 phuhl

Good idea! I stole this snippet from emacwiki 20 years ago that does something like that if you hit C-backspace next to an open brace. Might tide you over until I can find the time to add this :)

(defadvice backward-kill-word (around delete-pair activate)
  (if (eq (char-syntax (char-before)) ?\()
      (progn
	(backward-char 1)
	(save-excursion
	  (forward-sexp 1)
	  (delete-char -1))
	(forward-char 1)
	(append-next-kill)
	(kill-backward-chars 1))
    ad-do-it))

mickeynp avatar Apr 27 '23 09:04 mickeynp