From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: Help with keybinding to delete between {} Date: Thu, 6 Dec 2007 09:14:12 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <598472b5-c766-483a-93e5-15b31bfd880f@b40g2000prf.googlegroups.com> <922740c0-88f0-42c0-a373-d7a28c354c4a@s12g2000prg.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1196962849 3919 80.91.229.12 (6 Dec 2007 17:40:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Dec 2007 17:40:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 06 18:40:57 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J0KiK-0007WE-K3 for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Dec 2007 18:40:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J0Ki3-0005JF-QQ for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Dec 2007 12:40:27 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!e6g2000prf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 25 Original-NNTP-Posting-Host: 64.9.239.250 Original-X-Trace: posting.google.com 1196961252 2123 127.0.0.1 (6 Dec 2007 17:14:12 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 6 Dec 2007 17:14:12 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e6g2000prf.googlegroups.com; posting-host=64.9.239.250; posting-account=qPxGtQkAAADb6PWdLGiWVucht1ZDR6fn User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/523.12 (KHTML, like Gecko) Version/3.0.4 Safari/523.12, gzip(gfe), gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:154459 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49889 Archived-At: for some reason my code in the previous post is completely non- functional. (i swear i used it for few months. Perhaps when i put on the website i got smart and edited it "for the better" without testing) Here's the correct version: (defun delete-enclosed-text () "Delete texts between any pair of delimiters. Note: if you have nested matching pairs, the cursor should be inside the inner most one. Else it gets confused. This code should to be fixed in the future." (interactive) (save-excursion (let (p1 p2) (skip-chars-backward "^(<["<<") (setq p1 (point)) (skip-chars-forward "^)>]">>") (setq p2 (point)) (delete-region p1 p2) ) ) ) Xah xah@xahlee.org $B-t(B http://xahlee.org/