branch: elpa/fedi
commit 971a363fba28097f9f6940ace4235b1b8a38d8c1
Author: marty hiatt <martianhiatus [a t] riseup [d o t] net>
Commit: marty hiatt <martianhiatus [a t] riseup [d o t] net>
generalize fedi--goto-pos
---
fedi.el | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/fedi.el b/fedi.el
index 24d0e732ee6..d32c021a266 100644
--- a/fedi.el
+++ b/fedi.el
@@ -184,19 +184,21 @@ than `switch-to-buffer'."
;;; NAV
-(defun fedi--goto-pos (fun &optional refresh pos)
+(defun fedi--goto-pos (fun prop &optional refresh pos)
"Search for item with FUN.
If search returns nil, execute REFRESH function.
Optionally start from POS."
(let* ((npos (funcall fun
(or pos (point))
- 'byline-top
+ prop
(current-buffer))))
(if npos
- (if (not (get-text-property npos 'byline-top))
- (fedi--goto-pos fun refresh npos)
+ (if (not (get-text-property npos prop))
+ (fedi--goto-pos fun prop refresh npos)
(goto-char npos))
- (funcall refresh))))
+ (if refresh
+ (funcall refresh)
+ (message "Nothing further")))))
(defun fedi-next-item ()
"Move to next item."