From c4403522df754627d698f0806d3920764e3d1291 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Wed, 5 Oct 2022 11:28:34 +1100 Subject: Adding ability to navigate within help buffer --- hcel-utils.el | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'hcel-utils.el') 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. -- cgit v1.2.3