From 1ecaae6cc946143d9a03db5e73d96210e301e876 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Wed, 10 May 2006 00:32:34 +0000 Subject: [PATCH] (field-at-point): New function. --- lisp/subr.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/subr.el b/lisp/subr.el index d4167724ca0..1c7e23cfcd1 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1956,6 +1956,13 @@ Otherwise, return nil." "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. -- 2.39.5