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: Wed, 08 Sep 2004 17:26:22 -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 1094682427 24274 80.91.224.253 (8 Sep 2004 22:27:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Sep 2004 22:27:07 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 09 00:26:59 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 1C5Au3-0000ZH-00 for ; Thu, 09 Sep 2004 00:26:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C5AzL-00077C-Db for ged-emacs-devel@m.gmane.org; Wed, 08 Sep 2004 18:32:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C5AzD-00076T-RY for emacs-devel@gnu.org; Wed, 08 Sep 2004 18:32:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C5AzC-00073z-1W for emacs-devel@gnu.org; Wed, 08 Sep 2004 18:32:19 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C5AzB-00073s-Uj for emacs-devel@gnu.org; Wed, 08 Sep 2004 18:32:17 -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 1C5Atb-0006O7-0N; Wed, 08 Sep 2004 18:26:31 -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 i88MQMVp019540 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 8 Sep 2004 17:26:22 -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 i88MQMp9020883; Wed, 8 Sep 2004 17:26:22 -0500 Original-Received: (from james@localhost) by diannao.ittc.ku.edu (8.12.11/8.12.11/Submit) id i88MQM74020882; Wed, 8 Sep 2004 17:26:22 -0500 X-Authentication-Warning: diannao.ittc.ku.edu: james set sender to james@eecs.ku.edu using -f Original-To: Miles Bader X-Face: +5(Pfr,; N>q#6NT,Qi5^TQh-MaUnz#kGN~OW[CQj~RS+sIor( '_8K^f9u^Y#.N`>9oKN$\JpI In-Reply-To: (Miles Bader's message of "Wed, 08 Sep 2004 10:25:26 +0900") 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:26902 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:26902 Miles Bader wrote: > I think some attention should be paid to the issue of creating > text-property fields vs. overlay fields -- both are useful in different > circumstances, so any `make-field' function should allow creating both > (or there should be multiple `make...field' functions). That makes sense. How about something like this? (defun make-field (from to value &optional buffer front-advance rear-advance use-text-props) "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. If USE-TEXT-PROPS is non-nil, then the field is created using text properties. Otherwise, it is created using an overlay." (if use-text-props (add-text-properties from to (list 'field value 'front-sticky (not front-advance) 'rear-nonsticky (not rear-advance)) buffer) (overlay-put (make-overlay from to buffer front-advance rear-advance) 'field value)) value) I'm not sure what this function could usefully return. It ought to return a reference to a field object, but there is no such thing. Regards, -- Jerry James http://www.ittc.ku.edu/~james/