branch: elpa/fedi
commit 5ad0d7cf9bbf289c0d7ae492dd1137b3635eaa90
Author: marty hiatt <[email protected]>
Commit: marty hiatt <[email protected]>
propertize-items: no buffer handling, save-excur, point-min
---
fedi.el | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/fedi.el b/fedi.el
index 67999d5076f..2e351d2a18f 100644
--- a/fedi.el
+++ b/fedi.el
@@ -746,9 +746,9 @@ the whole likes count in order to propertize it fully."
;;; PROPERTIZING SPECIAL ITEMS
-(defun fedi-propertize-items (str regex type json keymap subexp
- &optional item-subexp domain-subexp link
- extra-props face)
+(defun fedi-propertize-items (regex type json keymap subexp
+ &optional item-subexp domain-subexp link
+ extra-props face)
"Propertize items of TYPE matching REGEX in STR as links using JSON.
KEYMAP and LINK are properties to add to the match.
EXTRA-PROPS is a property list of any extra properties to add.
@@ -761,11 +761,9 @@ used in a link function. For an example of regexes'
subgroups, see
`fedi-post-handle-regex'."
;; FIXME: ideally we'd not do this in a sep buffer (gc)
;; this runs on every item for every regex type!
- (with-temp-buffer
- (switch-to-buffer (current-buffer))
- (insert str)
- (goto-char (point-min))
+ (save-excursion
(save-match-data
+ (goto-char (point-min))
;; ideally we'd work errors out, but we don't want to ruin
;; our caller, which might make a page load fail:
(ignore-errors
@@ -792,8 +790,7 @@ used in a link function. For an example of regexes'
subgroups, see
end
(fedi-link-props face link item type item-str
keymap))
(add-text-properties beg end
- extra-props)))))
- (buffer-string)))
+ extra-props)))))))
(defun fedi-link-props (&optional face link item type help-echo keymap)
"Return a plist for a link."