I didn't find any easy way to do what you want, but make a my-rectangle-forward-search
command myself, I am not sure what can I do when find a matching rectangle, so I just use message-box
to indicate start/end poing and content of the found rectangle.
(require 'subr-x) ; Require Emacs 24.4+
(defun my-rectangle-equal (start1 end1 start2 end2)
"Return t if two rectangle have identical contents."
(when-let ((r1-lines (extract-rectangle start1 end1))
(r2-lines (extract-rectangle start2 end2))
(r1-line-number (length r1-lines) )
(r2-line-number (length r2-lines) ))
(when (and (= r1-line-number r2-line-number)
(> r1-line-number 0))
(setq counter 0)
(catch 'my--break
(while (< counter r1-line-number)
(unless (string-equal (elt r1-lines counter)
(elt r2-lines counter))
(throw 'my--break nil))
(setq counter (1+ counter)))
t))))
(defun my-rectangle-dialog (start end)
(interactive "r")
(message-box (format
"The content in [%d, %d] rectangle is: \n%s"
start end
(mapconcat #'identity (extract-rectangle start end) "\n"))))
(defun my-rectangle-forward-search (start end)
"Search forward from point for the region-rectangle."
(interactive "r")
(when-let ((lines (extract-rectangle start end))
(line-number (length lines))
(first-line (car lines)))
(save-excursion
(deactivate-mark)
(let (-start -end)
;; (goto-char end)
(while (re-search-forward first-line nil 'noerror)
(setq -start (- (point) (length first-line)))
(line-move-visual (1- line-number))
(setq -end (point))
;; Do something on rectangle just find
(my-rectangle-dialog -start -end))))))