branch: externals/wrap-search commit d4f73decdf1c624bb2bb3e0bf2292bae4b660fde Author: Emanuel Berg <in...@dataswamp.org> Commit: Emanuel Berg <in...@dataswamp.org>
Fri May 17 11:44:04 PM CEST 2024 --- wrap-search.el | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/wrap-search.el b/wrap-search.el index 4b89f314d8..d919a39723 100644 --- a/wrap-search.el +++ b/wrap-search.el @@ -7,7 +7,7 @@ ;; Keywords: matching ;; License: GPL3+ ;; URL: https://dataswamp.org/~incal/emacs-init/wrap-search.el -;; Version: 4.15.11 +;; Version: 4.16.13 ;; ;; This file is part of GNU Emacs. ;; @@ -69,6 +69,11 @@ ;; ;;; Code: +(defcustom wrap-search-echo-point nil + "Whether to echo point after a search hit." + :group 'wrap-search + :type 'boolean) + (let ((prev-str "dummy search string") (prev-case) (prev-rev) @@ -134,12 +139,15 @@ Do \\[wrap-search-again] to repeat, with `wrap-search-again'." (list #'search-backward end beg) (list #'search-forward beg end) ))) (if (funcall search-f str search-end t) - (message "hit: %s" (point)) + (when wrap-search-echo-point + (message "hit: %s" (point)) ) (goto-char search-beg) (if (funcall search-f str (+ pos (if rev 0 (length str))) t) (if (= pos (point)) - (message "this is the one occurrence") - (message "hit: %s (wrap)" (point)) ) + (message "this is the only occurrence") + (message "wrap%s" (if wrap-search-echo-point + (format ": %s" (point)) + "") )) (goto-char pos) (message "no hit") ))) ))) (declare-function wrap-search nil) )