Any existing package that can do incremental search inside a function definition instead of the whole buffer?
Now the best I can do is to turn on semantic-mode along with semantic-stickyfunc-mode and carefully search within its scope.
As @xuchunyang said in a comment to your question, you can first narrow the buffer to the function definition.
Or you can use library Isearch+, which lets you search just the active region, without narrowing.
Non-nil option isearchp-restrict-to-region-flag does this. You can use C-x n (command isearchp-toggle-region-restriction) during search to toggle this option value.
Also, deactivation of the active region when you search is controlled by option isearchp-deactivate-region-flag.
(NOTE: For search to be limited to the active region in Info, you must also use library Info+.)
C-x n d(orM-x narrow-to-defun) then search? – xuchunyang Mar 13 '17 at 09:17