From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: lampshade Newsgroups: gmane.emacs.help Subject: Re: Help with keybinding to delete between {} Date: Wed, 12 Dec 2007 01:20:27 -0800 (PST) Organization: http://groups.google.com Message-ID: <0376a958-2d0c-43cf-bbad-ee4954602a48@q3g2000hsg.googlegroups.com> 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 1197452520 7774 80.91.229.12 (12 Dec 2007 09:42:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Dec 2007 09:42:00 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 12 10:42:12 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 1J2O6V-0004it-2W for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Dec 2007 10:42:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2O6D-00051X-3M for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Dec 2007 04:41:53 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!q3g2000hsg.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 34 Original-NNTP-Posting-Host: 76.85.192.52 Original-X-Trace: posting.google.com 1197451228 24737 127.0.0.1 (12 Dec 2007 09:20:28 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 12 Dec 2007 09:20:28 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: q3g2000hsg.googlegroups.com; posting-host=76.85.192.52; posting-account=djMGgQoAAAAG8TIKtb_BitRJthuSPo1H User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.11) Gecko/20071204 Ubuntu/7.10 (gutsy) Firefox/2.0.0.11, gzip(gfe), gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:154610 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:50034 Archived-At: On Dec 6, 11:14 am, Xah Lee wrote: > 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 > x...@xahlee.org > $B-t(Bhttp://xahlee.org/ I'm glad to see you in this thread! I actually came across your code and tried that first. Unfortunately, that version wasn't working so I moved on to trying to write one myself. Your implementation was pretty well exactly what I was looking for. Thank you for the updated version! Thank you!