From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: skeleton.el _ versus @, a new patch Date: Tue, 22 Apr 2003 09:31:35 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200304221331.h3MDVZbX007869@rum.cs.yale.edu> References: <200303242005.h2OK57gr013285@rum.cs.yale.edu> <1048554010.20622.66.camel@zircon> <200303311740.h2VHeZNG017518@rum.cs.yale.edu> <1049242082.66437.15.camel@zircon> <200304020020.h320K4de023432@rum.cs.yale.edu> <1049245381.66437.33.camel@zircon> <20030403084549.2a5aca76.occitan@esperanto.org> <200304091626.h39GQlwc000430@rum.cs.yale.edu> <1050020736.419.11.camel@zircon> <200304112359.h3BNxpw5012335@rum.cs.yale.edu> <1050879051.74664.17.camel@zircon> <200304211311.h3LDBFLp028593@rum.cs.yale.edu> <1050971563.74664.20.camel@zircon> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1051018587 12968 80.91.224.249 (22 Apr 2003 13:36:27 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 22 Apr 2003 13:36:27 +0000 (UTC) Cc: Stefan Monnier Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Apr 22 15:36:20 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 197xwa-0003MY-00 for ; Tue, 22 Apr 2003 15:36:20 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 197y1r-0002Dj-00 for ; Tue, 22 Apr 2003 15:41:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 197xww-0005zz-07 for emacs-devel@quimby.gnus.org; Tue, 22 Apr 2003 09:36:42 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 197xwf-0005zh-00 for emacs-devel@gnu.org; Tue, 22 Apr 2003 09:36:25 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 197xs6-0003hw-00 for emacs-devel@gnu.org; Tue, 22 Apr 2003 09:31:42 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 197xs0-0003gz-00; Tue, 22 Apr 2003 09:31:36 -0400 Original-Received: from rum.cs.yale.edu (localhost [127.0.0.1]) by rum.cs.yale.edu (8.12.8/8.12.8) with ESMTP id h3MDVZx6007871; Tue, 22 Apr 2003 09:31:35 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.12.8/8.12.8/Submit) id h3MDVZbX007869; Tue, 22 Apr 2003 09:31:35 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Joe Kelsey Original-cc: rms@gnu.org Original-cc: dapfy@t-online.de Original-cc: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:13351 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:13351 > > > Here is a patch to add - as an alternate skeleton character. - operates > > > exactly as _ in setting skeleton-point, but does not interact with the > > > region wrapping effects. This means that @ is completely unaffected and > > > remains as just the method of setting the skeleton-positions. > > > > > > --- skeleton.el.orig Sat Jul 14 04:21:08 2001 > > > +++ skeleton.el Sun Apr 20 15:44:44 2003 > > > @@ -453,7 +453,8 @@ > > > ((eq element '|) > > > (unless skeleton-modified (pop skeleton))) > > > ((eq element '@) > > > - (push (point) skeleton-positions) > > > + (push (point) skeleton-positions)) > > > + ((eq element '-) > > > (unless skeleton-point (setq skeleton-point (point)))) > > > ((eq 'quote (car-safe element)) > > > (eval (nth 1 element))) > > > > I think in that case, we should set skeleton-point unconditionally. > > You *really* only want to set it on the first occurrence of the > appropriate character, not the last! I don't see why anyone would want to put more than 1 such operator in a skeleton anyway. So reason why I want to make it unconditional is so that you can do (nil "do {" \n _ \n "} while (" - ")") and be sure that point will always end up between the parens (I wouldn't want this behavior, personally, but given such a skeleton why would the author have put the `-' if it's not to specify where to place point). Stefan