aboutsummaryrefslogtreecommitdiff
path: root/hcel-utils.el
diff options
context:
space:
mode:
Diffstat (limited to 'hcel-utils.el')
-rw-r--r--hcel-utils.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/hcel-utils.el b/hcel-utils.el
index d5b75cf..be152f5 100644
--- a/hcel-utils.el
+++ b/hcel-utils.el
@@ -191,5 +191,15 @@ Example of an idSrcSpan:
(or (get-text-property (point) prop)
(get-text-property (max (point-min) (1- (point))) prop)))
+(defun hcel-string-with-text-property-at-point (prop)
+ "Find the string with property PROP at point.
+
+Does not check whether point does indeed has property PROP."
+ (save-excursion
+ (let ((beg) (end))
+ (setq end (next-single-char-property-change (point) prop))
+ (setq beg (previous-single-char-property-change end prop))
+ (buffer-substring-no-properties beg end))))
+
(provide 'hcel-utils)
;;; hcel-utils.el ends here.