summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
18ee87e)
In principle this should work, but at least in some pre-release
versions of emacs26, this causes problems inside lexical let [1].
[1]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26406
(next-single-property-change (or pos (point)) 'notmuch-search-result
nil (point-max))))
(next-single-property-change (or pos (point)) 'notmuch-search-result
nil (point-max))))
-(defun notmuch-search-foreach-result (beg end function)
- "Invoke FUNCTION for each result between BEG and END.
+(defun notmuch-search-foreach-result (beg end fn)
+ "Invoke FN for each result between BEG and END.
-FUNCTION should take one argument. It will be applied to the
+FN should take one argument. It will be applied to the
character position of the beginning of each result that overlaps
the region between points BEG and END. As a special case, if (=
character position of the beginning of each result that overlaps
the region between points BEG and END. As a special case, if (=
-BEG END), FUNCTION will be applied to the result containing point
+BEG END), FN will be applied to the result containing point
BEG."
(lexical-let ((pos (notmuch-search-result-beginning beg))
BEG."
(lexical-let ((pos (notmuch-search-result-beginning beg))
- ;; End must be a marker in case function changes the
+ ;; End must be a marker in case fn changes the
;; text.
(end (copy-marker end))
;; Make sure we examine at least one result, even if
;; text.
(end (copy-marker end))
;; Make sure we examine at least one result, even if
;; pos.
(while (and pos (or (< pos end) first))
(when (notmuch-search-get-result pos)
;; pos.
(while (and pos (or (< pos end) first))
(when (notmuch-search-get-result pos)
- (funcall function pos))
(setq pos (notmuch-search-result-end pos)
first nil))))
;; Unindent the function argument of notmuch-search-foreach-result so
(setq pos (notmuch-search-result-end pos)
first nil))))
;; Unindent the function argument of notmuch-search-foreach-result so