From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jerry James Newsgroups: gmane.emacs.devel Subject: Re: make-field suggestion Date: Tue, 31 Aug 2004 21:42:39 -0500 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1094006607 13807 80.91.224.253 (1 Sep 2004 02:43:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 1 Sep 2004 02:43:27 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 01 04:43:19 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C2L5j-0000D6-00 for ; Wed, 01 Sep 2004 04:43:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C2LAd-0005yL-5I for ged-emacs-devel@m.gmane.org; Tue, 31 Aug 2004 22:48:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C2LAW-0005yC-9T for emacs-devel@gnu.org; Tue, 31 Aug 2004 22:48:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C2LAT-0005xs-9B for emacs-devel@gnu.org; Tue, 31 Aug 2004 22:48:16 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C2LAT-0005xi-5T for emacs-devel@gnu.org; Tue, 31 Aug 2004 22:48:13 -0400 Original-Received: from [129.237.125.220] (helo=stephens.ittc.ku.edu) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1C2L5A-0002eS-08 for emacs-devel@gnu.org; Tue, 31 Aug 2004 22:42:44 -0400 Original-Received: from diannao.ittc.ku.edu (diannao.ittc.ku.edu [129.237.126.112]) by stephens.ittc.ku.edu (8.12.11/8.12.10/ITTC-ANTISPAM-ANTIVIRUS-3.1) with ESMTP id i812gdaW004881 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 31 Aug 2004 21:42:40 -0500 Original-Received: from diannao.ittc.ku.edu (localhost [127.0.0.1]) by diannao.ittc.ku.edu (8.12.11/8.12.11) with ESMTP id i812gdQs004052; Tue, 31 Aug 2004 21:42:39 -0500 Original-Received: (from james@localhost) by diannao.ittc.ku.edu (8.12.11/8.12.11/Submit) id i812gdKw004051; Tue, 31 Aug 2004 21:42:39 -0500 X-Authentication-Warning: diannao.ittc.ku.edu: james set sender to james@eecs.ku.edu using -f Original-To: Stefan X-Face: +5(Pfr,; N>q#6NT,Qi5^TQh-MaUnz#kGN~OW[CQj~RS+sIor( '_8K^f9u^Y#.N`>9oKN$\JpI In-Reply-To: (Stefan's message of "31 Aug 2004 11:39:48 -0400") User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.5 (chayote, linux) X-VirusScan: Clean X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:26672 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:26672 Stefan wrote: > The only place where I've use fields is for minibuffer-like entry things > with completion (where I reuse the minibuffer completion code, suitably > fixed not to assume it's in a minibuffer). In such cases, it's often > important that if the user reduces the size of the field to 0 it can still > grow it back later on by inserting text into it, i.e. I've had to use an > overlay and it had to be created as: > > (make-overlay from to nil nil t) > > so I suggest to at least make it possible to pass the front/rear stickiness > as an argument. Okay, that makes sense. It looks like I can rip off much of the make-overlay docstring in that case. Hmmmm.... so is it true that overlays are neither front- nor rear-sticky by default? But the text property API creates regions that are front-sticky but not rear-sticky by default, doesn't it? I want to make sure I get this right, because the whole point of make-field is to hide the different Emacs and XEmacs defaults. Here's my latest attempt, which I think is wrong because the created field has no stickiness at all. I think. (defun make-field (from to value &optional buffer front-advance rear-advance) "Make a field with value VALUE over the range [FROM, TO) in BUFFER. If omitted, BUFFER defaults to the current buffer. FROM and TO may be integers or markers. The fifth argument, FRONT-ADVANCE, if non-nil, makes the front delimiter advance when text is inserted there. The sixth argument, REAR-ADVANCE, if non-nil, makes the rear delimiter advance when text is inserted there." (overlay-put (make-overlay from to buffer front-advance rear-advance) 'field value)) Regards, -- Jerry James http://www.ittc.ku.edu/~james/