@PythonNut provided a good answer. Another answer is that if you use library Isearch+ (e.g., for other, more important reasons) then you have a user option and commands that let you select the last target occurrence (set the region around it):
Option isearchp-set-region-flag
-– Non-nil
means automatically set the region around the last search target.
Command isearchp-toggle-set-region
, bound to C-SPC
during Isearch -– toggle isearchp-set-region-flag
.
Command set-region-around-search-target
-– manually set the region around the last search target.
So if you set the option to non-nil
then Isearch selects the last search hit automatically, by default.
Whether the option is nil
or non-nil
, you can cause Isearch to select that search hit by using C-SPC
before exiting Isearch, if needed.
And if you do not, in one of these ways, cause Isearch to automatically select the last search hit, you can nevertheless select it after exiting Isearch, by using command set-region-around-search-target
.
hi-lock-mode
), correct? If so, I believe the question and the tag need to be updated.