help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with keybinding to delete between {}


From: William Xu
Subject: Re: Help with keybinding to delete between {}
Date: Wed, 05 Dec 2007 21:55:13 +0900
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (darwin)

lampshade <address@hidden> writes:

> Anyone have any improvements or help they could give me?

How does this feel?

,----
| (defun delete-between ()
|   (interactive)
|   (save-excursion
|     (let ((beg (re-search-backward "{\\|(" nil t 1))
|           (end (re-search-forward "}\\|)" nil t 1)))
|       (when (and beg end)
|         (kill-region (1+ beg) (1- end))))))
`----

-- 
William

http://williamxu.net9.org





reply via email to

[Prev in Thread] Current Thread [Next in Thread]