all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* make-field suggestion
@ 2004-08-31 14:45 Jerry James
  2004-08-31 15:39 ` Stefan
  2004-09-01  4:57 ` Richard Stallman
  0 siblings, 2 replies; 13+ messages in thread
From: Jerry James @ 2004-08-31 14:45 UTC (permalink / raw)


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/

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-09-08 22:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-31 14:45 make-field suggestion Jerry James
2004-08-31 15:39 ` Stefan
2004-09-01  2:42   ` Jerry James
2004-09-01  2:48     ` Stefan
2004-09-07 15:28       ` Jerry James
2004-09-07 15:56         ` Stefan
2004-09-07 19:46           ` Jerry James
2004-09-01  4:57 ` Richard Stallman
2004-09-07 15:32   ` Jerry James
2004-09-08  1:25     ` Miles Bader
2004-09-08 22:26       ` Jerry James
2004-09-08 22:41         ` Stefan
2004-09-08 22:44         ` Miles Bader

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.