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: make-field suggestion Date: Tue, 31 Aug 2004 09:45:10 -0500 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1093966265 7585 80.91.224.253 (31 Aug 2004 15:31:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 31 Aug 2004 15:31:05 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 31 17:30:36 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 1C29ur-00051h-00 for ; Tue, 31 Aug 2004 16:47:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C29zj-0004mg-MK for ged-emacs-devel@m.gmane.org; Tue, 31 Aug 2004 10:52:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C29zW-0004kx-El for emacs-devel@gnu.org; Tue, 31 Aug 2004 10:52:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C29zS-0004iA-KS for emacs-devel@gnu.org; Tue, 31 Aug 2004 10:52:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C29zR-0004hy-Cu for emacs-devel@gnu.org; Tue, 31 Aug 2004 10:52:05 -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 1C29uM-0007yE-2N for emacs-devel@gnu.org; Tue, 31 Aug 2004 10:46:50 -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 i7VEjACn007187 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 31 Aug 2004 09:45:10 -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 i7VEjAri001216 for ; Tue, 31 Aug 2004 09:45:10 -0500 Original-Received: (from james@localhost) by diannao.ittc.ku.edu (8.12.11/8.12.11/Submit) id i7VEjAZe001215; Tue, 31 Aug 2004 09:45:10 -0500 X-Authentication-Warning: diannao.ittc.ku.edu: james set sender to james@eecs.ku.edu using -f Original-To: emacs-devel@gnu.org X-Face: +5(Pfr,; N>q#6NT,Qi5^TQh-MaUnz#kGN~OW[CQj~RS+sIor( '_8K^f9u^Y#.N`>9oKN$\JpI 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:26651 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:26651 I have been porting the Emacs field interface to XEmacs. I ran into a small hassle when I discovered that the default front/back-stickiness of XEmacs extents is reversed from that of Emacs overlays. In order to hide the differences, I wrote a make-field function that makes an extent, then reverses the stickiness (open/closedness, in XEmacs terminology) to match Emacs. I would like to suggest the make-field interface for Emacs. The Emacs version would look something like this, if defaulting to text properties is okay: (defun make-field (from to value &optional buffer) "Make a field with value VALUE over the range [FROM, TO) in BUFFER. BUFFER defaults to the current buffer." (with-current-buffer (or buffer (current-buffer)) (put-text-property from to 'field value))) If you would rather default to overlays, then perhaps something along these lines would be suitable: (defun make-field (from to value &optional buffer) "Make a field with value VALUE over the range [FROM, TO) in BUFFER. BUFFER defaults to the current buffer." (overlay-put (make-overlay from to buffer) 'field value)) Regards, -- Jerry James http://www.ittc.ku.edu/~james/