emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

make-field suggestion


From: Jerry James
Subject: make-field suggestion
Date: Tue, 31 Aug 2004 09:45:10 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.5 (chayote, linux)

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/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]