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, 13 Dec 2007 02:39:13 -0800 (PST) Organization: http://groups.google.com Message-ID: <8f720f53-129e-4d17-b6c3-96ebbaea4724@i29g2000prf.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=EUC-KR Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1197543049 31406 80.91.229.12 (13 Dec 2007 10:50:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Dec 2007 10:50: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 13 11:51:00 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 1J2leb-0005ao-SF for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Dec 2007 11:50:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2leI-0006FH-PX for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Dec 2007 05:50:38 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!i29g2000prf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 70 Original-NNTP-Posting-Host: 64.9.239.250 Original-X-Trace: posting.google.com 1197542353 6118 127.0.0.1 (13 Dec 2007 10:39:13 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 13 Dec 2007 10:39:13 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i29g2000prf.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:154631 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:50060 Archived-At: Google Groups diddles with my unicode chars. The unadulterated code can be found here: http://xahlee.org/emacs/elisp_examples.html -------------- am not sure what's the prob with google. Don't know if they are still experimenting with unicode chars in posts or what. I often use U+00AB and U+00BB (french double angle quotes, here: <<>>). But starting about 2007-09, google groups either deletes them, or replace them with << and >>, or botched the replacement lopsided. (and this transformation apparantly took place before it is posted, so it's distributed to all other places, not just a displaying issue on goople groups) This week i also noticed that they replace my bullet char "*" by a asterisk "*". i'll be using one of the chinese quotations "=A1=B8=A1=B9=A1=BA=A1=BB=A1=B4= =A1=B5=A1=B6=A1=B7" for posting i think. For the bullet i might use a start "=A1=DA" or heart "=A2=BE". Xah xah@xahlee.org =A2=B2 http://xahlee.org/ On Dec 12, 7:59 pm, Mike Mattie wrote: > On Thu, 6 Dec 2007 09:14:12 -0800 (PST) > > > > 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) > > ) > > ) > > ) > > I don't this this can be right. on a single line it has three string quota= tion characters. > > (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) > (skip-chars-forward "^)>>") > (delete-backward-char (skip-chars-backward "^(<<"))) > > this version doesn't change the mark so I dropped the save-excursion. It i= s not quite right because > it does not handle nested sexp at all. I don't understand the elisp flavor= of regex yet, so it's > probably an easy fix.