# HG changeset patch # User Nick Roberts # Date 1147221154 0 # Node ID e184fae4f7dd9d632c748b07dcda906b57653345 # Parent 264aa3b97540941296669824ca52d69f3a63c05a (field-at-point): New function. diff -r 264aa3b97540 -r e184fae4f7dd lisp/subr.el --- a/lisp/subr.el Wed May 10 00:29:24 2006 +0000 +++ b/lisp/subr.el Wed May 10 00:32:34 2006 +0000 @@ -1956,6 +1956,13 @@ "Return non-nil if OBJECT is one of the two canonical boolean values: t or nil." (memq object '(nil t))) +(defun field-at-point (pos) + "Return the field at position POS, taking stickiness etc into account" + (let ((raw-field (get-char-property (field-beginning pos) 'field))) + (if (eq raw-field 'boundary) + (get-char-property (1- (field-end pos)) 'field) + raw-field))) + ;;;; Support for yanking and text properties.